MK3S-E3DREVO_HF_60W_lang_base: file format elf32-avr Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 5c 57 jmp 0xaeb8 ; 0xaeb8 <__dtors_end> 4: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 8: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> c: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 10: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 14: 0d 94 58 bc jmp 0x378b0 ; 0x378b0 <__vector_5> 18: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 1c: 0c 94 d0 75 jmp 0xeba0 ; 0xeba0 <__vector_7> 20: 0c 94 ed 75 jmp 0xebda ; 0xebda <__vector_8> 24: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 28: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 2c: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 30: 0c 94 28 68 jmp 0xd050 ; 0xd050 <__vector_12> 34: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 38: 0d 94 1a 49 jmp 0x29234 ; 0x29234 <__vector_14> 3c: 0d 94 a2 42 jmp 0x28544 ; 0x28544 <__vector_15> 40: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 44: 0d 94 e6 59 jmp 0x2b3cc ; 0x2b3cc <__vector_17> 48: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 4c: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 50: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 54: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 58: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 5c: 0c 94 d7 74 jmp 0xe9ae ; 0xe9ae <__vector_23> 60: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 64: 0d 94 fa d6 jmp 0x3adf4 ; 0x3adf4 <__vector_25> 68: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 6c: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 70: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 74: 0c 94 e2 8e jmp 0x11dc4 ; 0x11dc4 <__vector_29> 78: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 7c: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 80: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 84: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 88: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 8c: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 90: 0d 94 b6 d6 jmp 0x3ad6c ; 0x3ad6c <__vector_36> 94: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 98: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 9c: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> a0: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> a4: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> a8: 0d 94 38 38 jmp 0x27070 ; 0x27070 <__vector_42> ac: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> b0: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> b4: 0d 94 1a 38 jmp 0x27034 ; 0x27034 <__vector_45> b8: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> bc: 0d 94 64 4e jmp 0x29cc8 ; 0x29cc8 <__vector_47> c0: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> c4: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> c8: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> cc: 0d 94 da 37 jmp 0x26fb4 ; 0x26fb4 <__vector_51> d0: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> d4: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> d8: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> dc: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> e0: 0c 94 8d 57 jmp 0xaf1a ; 0xaf1a <__bad_interrupt> 000000e4 <__loc_sec_start>: ... 00000100 <_SEC_LANG>: 100: 5f 53 45 43 5f 4c 41 4e 47 00 00 00 00 00 00 00 _SEC_LANG....... ... 00003600 <__loc_pri_start>: 3600: ff ff .word 0xffff ; ???? 3602: 43 72 andi r20, 0x23 ; 35 3604: 61 73 andi r22, 0x31 ; 49 3606: 68 20 and r6, r8 3608: 64 65 ori r22, 0x54 ; 84 360a: 74 65 ori r23, 0x54 ; 84 360c: 63 74 andi r22, 0x43 ; 67 360e: 65 64 ori r22, 0x45 ; 69 3610: 2e 00 .word 0x002e ; ???? 00003612 : 3612: ff ff 53 6f 6d 65 20 70 72 6f 62 6c 65 6d 20 65 ..Some problem e 3622: 6e 63 6f 75 6e 74 65 72 65 64 2c 20 5a 2d 6c 65 ncountered, Z-le 3632: 76 65 6c 69 6e 67 20 65 6e 66 6f 72 63 65 64 20 veling enforced 3642: 2e 2e 2e 00 .... 00003646 : 3646: ff ff 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c ..Mesh bed level 3656: 69 6e 67 20 66 61 69 6c 65 64 2e 20 50 72 69 6e ing failed. Prin 3666: 74 20 63 61 6e 63 65 6c 65 64 2e 00 t canceled.. 00003672 : 3672: ff ff 48 65 61 74 69 6e 67 20 64 69 73 61 62 6c ..Heating disabl 3682: 65 64 20 62 79 20 73 61 66 65 74 79 20 74 69 6d ed by safety tim 3692: 65 72 2e 00 er.. 00003696 : 3696: ff ff 53 54 4f 50 50 45 44 2e 00 ..STOPPED.. 000036a1 : 36a1: ff ff 50 41 55 53 45 44 20 54 48 45 52 4d 41 4c ..PAUSED THERMAL 36b1: 20 45 52 52 4f 52 00 ERROR. 000036b8 : 36b8: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36c8: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36d8: 6c 65 76 65 6c 2e 00 level.. 000036df : 36df: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 36ef: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 36ff: 6c 65 76 65 6c 2e 20 50 6c 65 61 73 65 20 72 65 level. Please re 370f: 2d 73 6c 69 63 65 20 74 68 65 20 6d 6f 64 65 6c -slice the model 371f: 20 61 67 61 69 6e 2e 00 again.. 00003727 : 3727: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 3737: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 3747: 77 61 72 65 2e 00 ware.. 0000374d : 374d: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 375d: 66 6f 72 20 61 20 6e 65 77 65 72 20 66 69 72 6d for a newer firm 376d: 77 61 72 65 2e 20 50 6c 65 61 73 65 20 75 70 64 ware. Please upd 377d: 61 74 65 20 74 68 65 20 66 69 72 6d 77 61 72 65 ate the firmware 378d: 2e 00 .. 0000378f : 378f: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 379f: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37af: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 00 printer type.. 000037bd : 37bd: ff ff 47 2d 63 6f 64 65 20 73 6c 69 63 65 64 20 ..G-code sliced 37cd: 66 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 for a different 37dd: 70 72 69 6e 74 65 72 20 74 79 70 65 2e 20 50 6c printer type. Pl 37ed: 65 61 73 65 20 72 65 2d 73 6c 69 63 65 20 74 68 ease re-slice th 37fd: 65 20 6d 6f 64 65 6c 20 61 67 61 69 6e 2e 00 e model again.. 0000380c : 380c: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob 381c: 20 74 6f 20 70 72 65 68 65 61 74 20 6e 6f 7a 7a to preheat nozz 382c: 6c 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 2e le and continue. ... 0000383d : 383d: ff ff 50 6c 65 61 73 65 20 70 72 65 73 73 20 74 ..Please press t 384d: 68 65 20 6b 6e 6f 62 20 74 6f 20 75 6e 6c 6f 61 he knob to unloa 385d: 64 20 66 69 6c 61 6d 65 6e 74 00 d filament. 00003868 : 3868: ff ff 61 6e 64 20 70 72 65 73 73 20 74 68 65 20 ..and press the 3878: 6b 6e 6f 62 00 knob. 0000387d : 387d: ff ff 49 6e 73 65 72 74 20 66 69 6c 61 6d 65 6e ..Insert filamen 388d: 74 00 t. 0000388f : 388f: ff ff 43 6f 6c 6f 72 20 6e 6f 74 20 63 6f 72 72 ..Color not corr 389f: 65 63 74 00 ect. 000038a3 : 38a3: ff ff 46 69 6c 61 6d 65 6e 74 20 6e 6f 74 20 6c ..Filament not l 38b3: 6f 61 64 65 64 00 oaded. 000038b9 : 38b9: ff ff 43 68 61 6e 67 65 64 20 63 6f 72 72 65 63 ..Changed correc 38c9: 74 6c 79 00 tly. 000038cd : 38cd: ff ff 4c 6f 61 64 69 6e 67 20 63 6f 6c 6f 72 00 ..Loading color. 000038dd : 38dd: ff ff 43 68 61 6e 67 65 20 73 75 63 63 65 73 73 ..Change success 38ed: 21 00 !. 000038ef : 38ef: ff ff 50 6c 65 61 73 65 20 6f 70 65 6e 20 69 64 ..Please open id 38ff: 6c 65 72 20 61 6e 64 20 72 65 6d 6f 76 65 20 66 ler and remove f 390f: 69 6c 61 6d 65 6e 74 20 6d 61 6e 75 61 6c 6c 79 ilament manually 391f: 2e 00 .. 00003921 : 3921: ff ff 57 61 73 20 66 69 6c 61 6d 65 6e 74 20 75 ..Was filament u 3931: 6e 6c 6f 61 64 20 73 75 63 63 65 73 73 66 75 6c nload successful 3941: 3f 00 ?. 00003943 : 3943: ff ff 50 6c 65 61 73 65 20 75 70 67 72 61 64 65 ..Please upgrade 3953: 2e 00 .. 00003955 : 3955: ff ff 4e 65 77 20 66 69 72 6d 77 61 72 65 20 76 ..New firmware v 3965: 65 72 73 69 6f 6e 20 61 76 61 69 6c 61 62 6c 65 ersion available 3975: 3a 00 :. 00003977 : 3977: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 50 49 ..Waiting for PI 3987: 4e 44 41 20 70 72 6f 62 65 20 63 6f 6f 6c 69 6e NDA probe coolin 3997: 67 00 g. 00003999 : 3999: ff ff 50 6c 65 61 73 65 20 77 61 69 74 00 ..Please wait. 000039a7 : 39a7: ff ff 4e 6f 20 6d 6f 76 65 2e 00 ..No move.. 000039b2 : 39b2: ff ff 57 61 69 74 20 66 6f 72 20 75 73 65 72 2e ..Wait for user. 39c2: 2e 2e 00 ... 000039c5 : 39c5: ff ff 53 74 61 62 6c 65 20 61 6d 62 69 65 6e 74 ..Stable ambient 39d5: 20 74 65 6d 70 65 72 61 74 75 72 65 20 32 31 2d temperature 21- 39e5: 32 36 43 20 69 73 20 6e 65 65 64 65 64 20 61 20 26C is needed a 39f5: 72 69 67 69 64 20 73 74 61 6e 64 20 69 73 20 72 rigid stand is r 3a05: 65 71 75 69 72 65 64 2e 00 equired.. 00003a0e : 3a0e: ff ff 50 6c 65 61 73 65 20 72 75 6e 20 58 59 5a ..Please run XYZ 3a1e: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 69 72 calibration fir 3a2e: 73 74 2e 00 st.. 00003a32 : 3a32: ff ff 50 49 4e 44 41 20 63 61 6c 2e 00 ..PINDA cal.. 00003a3f : 3a3f: ff ff 52 65 73 65 74 20 58 59 5a 20 63 61 6c 69 ..Reset XYZ cali 3a4f: 62 72 2e 00 br.. 00003a53 : 3a53: ff ff 50 49 44 20 63 61 6c 69 62 72 61 74 69 6f ..PID calibratio 3a63: 6e 00 n. 00003a65 : 3a65: ff ff 42 65 64 20 6c 65 76 65 6c 20 63 6f 72 72 ..Bed level corr 3a75: 65 63 74 00 ect. 00003a79 : 3a79: ff ff 4d 65 73 68 20 42 65 64 20 4c 65 76 65 6c ..Mesh Bed Level 3a89: 69 6e 67 00 ing. 00003a8d : 3a8d: ff ff 43 61 6c 69 62 72 61 74 65 20 5a 00 ..Calibrate Z. 00003a9b : 3a9b: ff ff 43 61 6c 69 62 72 61 74 65 20 58 59 5a 00 ..Calibrate XYZ. 00003aab : 3aab: ff ff 53 65 6c 66 74 65 73 74 00 ..Selftest. 00003ab6 : 3ab6: ff ff 42 65 6c 74 20 74 65 73 74 00 ..Belt test. 00003ac2 : 3ac2: ff ff 57 69 7a 61 72 64 00 ..Wizard. 00003acb : 3acb: ff ff 54 65 73 74 69 6e 67 20 66 69 6c 61 6d 65 ..Testing filame 3adb: 6e 74 00 nt. 00003ade : 3ade: ff ff 4c 6f 61 64 20 41 6c 6c 00 ..Load All. 00003ae9 : 3ae9: ff ff 50 6c 65 61 73 65 20 70 75 6c 6c 20 6f 75 ..Please pull ou 3af9: 74 20 66 69 6c 61 6d 65 6e 74 20 69 6d 6d 65 64 t filament immed 3b09: 69 61 74 65 6c 79 00 iately. 00003b10 : 3b10: ff ff 52 65 73 65 74 00 ..Reset. 00003b18 : 3b18: ff ff 52 65 6e 61 6d 65 00 ..Rename. 00003b21 : 3b21: ff ff 46 69 72 73 74 20 6c 61 79 65 72 20 63 61 ..First layer ca 3b31: 6c 2e 00 l.. 00003b34 : 3b34: ff ff 53 65 6c 65 63 74 00 ..Select. 00003b3d : 3b3d: ff ff 53 74 65 65 6c 20 73 68 65 65 74 73 00 ..Steel sheets. 00003b4c : 3b4c: ff ff 53 75 70 70 6f 72 74 00 ..Support. 00003b56 : 3b56: ff ff 46 61 69 6c 20 73 74 61 74 73 20 4d 4d 55 ..Fail stats MMU ... 00003b67 : 3b67: ff ff 46 61 69 6c 20 73 74 61 74 73 00 ..Fail stats. 00003b74 : 3b74: ff ff 53 74 61 74 69 73 74 69 63 73 00 ..Statistics. 00003b81 : 3b81: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 00 ..Calibration. 00003b8f : 3b8f: ff ff 41 75 74 6f 4c 6f 61 64 20 66 69 6c 61 6d ..AutoLoad filam 3b9f: 65 6e 74 00 ent. 00003ba3 : 3ba3: ff ff 4c 6f 61 64 20 66 69 6c 61 6d 65 6e 74 00 ..Load filament. 00003bb3 : 3bb3: ff ff 55 6e 6c 6f 61 64 20 66 69 6c 61 6d 65 6e ..Unload filamen 3bc3: 74 00 t. 00003bc5 : 3bc5: ff ff 4c 6f 61 64 20 74 6f 20 6e 6f 7a 7a 6c 65 ..Load to nozzle ... 00003bd6 : 3bd6: ff ff 50 72 65 6c 6f 61 64 20 74 6f 20 4d 4d 55 ..Preload to MMU ... 00003be7 : 3be7: ff ff 4e 6f 7a 7a 6c 65 20 64 2e 00 ..Nozzle d.. 00003bf3 : 3bf3: ff ff 4e 6f 20 53 44 20 63 61 72 64 00 ..No SD card. 00003c00 : 3c00: ff ff 50 72 69 6e 74 20 66 72 6f 6d 20 53 44 00 ..Print from SD. 00003c10 : 3c10: ff ff 43 6c 65 61 72 20 54 4d 20 65 72 72 6f 72 ..Clear TM error ... 00003c21 : 3c21: ff ff 52 65 73 75 6d 65 20 70 72 69 6e 74 00 ..Resume print. 00003c30 : 3c30: ff ff 50 61 75 73 65 20 70 72 69 6e 74 00 ..Pause print. 00003c3e : 3c3e: ff ff 53 65 74 20 52 65 61 64 79 00 ..Set Ready. 00003c4a : 3c4a: ff ff 53 65 74 20 6e 6f 74 20 52 65 61 64 79 00 ..Set not Ready. 00003c5a : 3c5a: ff ff 50 72 65 68 65 61 74 00 ..Preheat. 00003c64 : 3c64: ff ff 54 75 6e 65 00 ..Tune. 00003c6b : 3c6b: ff ff 4c 69 76 65 20 61 64 6a 75 73 74 20 5a 00 ..Live adjust Z. 00003c7b : 3c7b: ff ff 52 65 70 72 69 6e 74 00 ..Reprint. 00003c85 : 3c85: ff ff 49 6e 66 6f 20 73 63 72 65 65 6e 00 ..Info screen. 00003c93 : 3c93: ff ff 42 72 69 67 68 74 6e 65 73 73 00 ..Brightness. 00003ca0 : 3ca0: ff ff 41 73 73 69 73 74 00 ..Assist. 00003ca9 : 3ca9: ff ff 53 69 6c 65 6e 74 00 ..Silent. 00003cb2 : 3cb2: ff ff 4f 6e 63 65 00 ..Once. 00003cb9 : 3cb9: ff ff 53 6f 75 6e 64 00 ..Sound. 00003cc1 : 3cc1: ff ff 4c 6f 75 64 00 ..Loud. 00003cc8 : 3cc8: ff ff 46 69 6c 2e 20 73 65 6e 73 6f 72 00 ..Fil. sensor. 00003cd6 : 3cd6: ff ff 43 68 61 6e 67 65 20 66 69 6c 61 6d 65 6e ..Change filamen 3ce6: 74 00 t. 00003ce8 : 3ce8: ff ff 46 6c 6f 77 00 ..Flow. 00003cef : 3cef: ff ff 53 70 65 65 64 00 ..Speed. 00003cf7 : 3cf7: ff ff 4d 61 67 6e 65 74 73 20 63 6f 6d 70 2e 00 ..Magnets comp.. 00003d07 : 3d07: ff ff 4e 2f 41 00 ..N/A. 00003d0d : 3d0d: ff ff 5a 2d 70 72 6f 62 65 20 6e 72 2e 00 ..Z-probe nr.. 00003d1b : 3d1b: ff ff 4d 65 73 68 00 ..Mesh. 00003d22 : 3d22: ff ff 54 69 6d 65 6f 75 74 00 ..Timeout. 00003d2c : 3d2c: ff ff 4d 6f 64 65 00 ..Mode. 00003d33 : 3d33: ff ff 41 75 74 6f 00 ..Auto. 00003d3a : 3d3a: ff ff 44 69 6d 00 ..Dim. 00003d40 : 3d40: ff ff 42 72 69 67 68 74 00 ..Bright. 00003d49 : 3d49: ff ff 4c 65 76 65 6c 20 44 69 6d 6d 65 64 00 ..Level Dimmed. 00003d58 : 3d58: ff ff 4c 65 76 65 6c 20 42 72 69 67 68 74 00 ..Level Bright. 00003d67 : 3d67: ff ff 53 65 74 74 69 6e 67 73 00 ..Settings. 00003d72 : 3d72: ff ff 59 65 73 00 ..Yes. 00003d78 : 3d78: ff ff 4e 6f 00 ..No. 00003d7d : 3d7d: ff ff 53 74 6f 70 20 70 72 69 6e 74 00 ..Stop print. 00003d8a : 3d8a: ff ff 43 68 65 63 6b 69 6e 67 20 66 69 6c 65 00 ..Checking file. 00003d9a : 3d9a: ff ff 46 69 6c 65 20 69 6e 63 6f 6d 70 6c 65 74 ..File incomplet 3daa: 65 2e 00 e.. 00003dad : 3dad: ff ff 84 52 65 66 72 65 73 68 00 ...Refresh. 00003db8 : 3db8: ff ff 4d 61 69 6e 00 ..Main. 00003dbf : 3dbf: ff ff 49 6e 73 65 72 74 20 74 68 65 20 66 69 6c ..Insert the fil 3dcf: 61 6d 65 6e 74 20 28 64 6f 20 6e 6f 74 20 6c 6f ament (do not lo 3ddf: 61 64 20 69 74 29 20 69 6e 74 6f 20 74 68 65 20 ad it) into the 3def: 65 78 74 72 75 64 65 72 20 61 6e 64 20 74 68 65 extruder and the 3dff: 6e 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 n press the knob 3e0f: 2e 00 .. 00003e11 : 3e11: ff ff 53 65 6e 73 6f 72 20 76 65 72 69 66 69 65 ..Sensor verifie 3e21: 64 2c 20 72 65 6d 6f 76 65 20 74 68 65 20 66 69 d, remove the fi 3e31: 6c 61 6d 65 6e 74 20 6e 6f 77 2e 00 lament now.. 00003e3d : 3e3d: ff ff 56 65 72 69 66 69 63 61 74 69 6f 6e 20 66 ..Verification f 3e4d: 61 69 6c 65 64 2c 20 72 65 6d 6f 76 65 20 74 68 ailed, remove th 3e5d: 65 20 66 69 6c 61 6d 65 6e 74 20 61 6e 64 20 74 e filament and t 3e6d: 72 79 20 61 67 61 69 6e 2e 00 ry again.. 00003e77 : 3e77: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 74 ..Please check t 3e87: 68 65 20 49 52 20 73 65 6e 73 6f 72 20 63 6f 6e he IR sensor con 3e97: 6e 65 63 74 69 6f 6e 2c 20 75 6e 6c 6f 61 64 20 nection, unload 3ea7: 66 69 6c 61 6d 65 6e 74 20 69 66 20 70 72 65 73 filament if pres 3eb7: 65 6e 74 2e 00 ent.. 00003ebc : 3ebc: ff ff 50 6c 65 61 73 65 20 75 6e 6c 6f 61 64 20 ..Please unload 3ecc: 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 66 69 72 the filament fir 3edc: 73 74 2c 20 74 68 65 6e 20 72 65 70 65 61 74 20 st, then repeat 3eec: 74 68 69 73 20 61 63 74 69 6f 6e 2e 00 this action.. 00003ef9 : 3ef9: ff ff 57 61 69 74 69 6e 67 20 66 6f 72 20 6e 6f ..Waiting for no 3f09: 7a 7a 6c 65 20 61 6e 64 20 62 65 64 20 63 6f 6f zzle and bed coo 3f19: 6c 69 6e 67 00 ling. 00003f1e : 3f1e: ff ff 53 65 6c 65 63 74 20 66 69 6c 61 6d 65 6e ..Select filamen 3f2e: 74 3a 00 t:. 00003f31 : 3f31: ff ff 53 65 6c 66 74 65 73 74 20 4f 4b 00 ..Selftest OK. 00003f3f : 3f3f: ff ff 53 65 6c 66 74 65 73 74 20 73 74 61 72 74 ..Selftest start ... 00003f50 : 3f50: ff ff 50 72 69 6e 74 20 66 61 6e 3a 00 ..Print fan:. 00003f5d : 3f5d: ff ff 48 6f 74 65 6e 64 20 66 61 6e 3a 00 ..Hotend fan:. 00003f6b : 3f6b: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 68 6f ..Calibrating ho 3f7b: 6d 65 00 me. 00003f7e : 3f7e: ff ff 41 6c 6c 20 63 6f 72 72 65 63 74 00 ..All correct. 00003f8c : 3f8c: ff ff 43 68 65 63 6b 69 6e 67 20 73 65 6e 73 6f ..Checking senso 3f9c: 72 73 00 rs. 00003f9f : 3f9f: ff ff 43 68 65 63 6b 69 6e 67 20 68 6f 74 65 6e ..Checking hoten 3faf: 64 00 d. 00003fb1 : 3fb1: ff ff 43 68 65 63 6b 69 6e 67 20 62 65 64 00 ..Checking bed. 00003fc0 : 3fc0: ff ff 43 68 65 63 6b 69 6e 67 20 5a 20 61 78 69 ..Checking Z axi 3fd0: 73 00 s. 00003fd2 : 3fd2: ff ff 43 68 65 63 6b 69 6e 67 20 59 20 61 78 69 ..Checking Y axi 3fe2: 73 00 s. 00003fe4 : 3fe4: ff ff 43 68 65 63 6b 69 6e 67 20 58 20 61 78 69 ..Checking X axi 3ff4: 73 00 s. 00003ff6 : 3ff6: ff ff 43 68 65 63 6b 69 6e 67 20 65 6e 64 73 74 ..Checking endst 4006: 6f 70 73 00 ops. 0000400a : 400a: ff ff 43 61 72 64 20 72 65 6d 6f 76 65 64 00 ..Card removed. 00004019 : 4019: ff ff 42 61 63 6b 00 ..Back. 00004020 : 4020: ff ff 53 74 72 69 63 74 00 ..Strict. 00004029 : 4029: ff ff 57 61 72 6e 00 ..Warn. 00004030 : 4030: ff ff 4e 6f 6e 65 00 ..None. 00004037 : 4037: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 64 ..Nozzle changed 4047: 3f 00 ?. 00004049 : 4049: ff ff 4e 6f 7a 7a 6c 65 20 69 73 20 68 6f 74 21 ..Nozzle is hot! 4059: 20 57 61 69 74 20 66 6f 72 20 63 6f 6f 6c 64 6f Wait for cooldo 4069: 77 6e 2e 00 wn.. 0000406d : 406d: ff ff 50 49 44 20 63 61 6c 2e 20 66 69 6e 69 73 ..PID cal. finis 407d: 68 65 64 00 hed. 00004081 : 4081: ff ff 50 49 44 20 63 61 6c 2e 00 ..PID cal.. 0000408c : 408c: ff ff 50 72 69 6e 74 20 70 61 75 73 65 64 00 ..Print paused. 0000409b : 409b: ff ff 50 72 69 6e 74 20 61 62 6f 72 74 65 64 00 ..Print aborted. 000040ab : 40ab: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 40bb: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 40cb: 68 65 20 47 2d 63 6f 64 65 2e 00 he G-code.. 000040d6 : 40d6: ff ff 4e 6f 7a 7a 6c 65 20 64 69 61 6d 65 74 65 ..Nozzle diamete 40e6: 72 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 74 r differs from t 40f6: 68 65 20 47 2d 63 6f 64 65 2e 20 50 6c 65 61 73 he G-code. Pleas 4106: 65 20 63 68 65 63 6b 20 74 68 65 20 76 61 6c 75 e check the valu 4116: 65 20 69 6e 20 73 65 74 74 69 6e 67 73 2e 00 e in settings.. 00004125 : 4125: ff ff 54 68 65 72 65 20 69 73 20 6e 6f 20 66 69 ..There is no fi 4135: 6c 61 6d 65 6e 74 20 6c 6f 61 64 65 64 2e 00 lament loaded.. 00004144 : 4144: ff ff 4d 4b 33 53 20 66 69 72 6d 77 61 72 65 20 ..MK3S firmware 4154: 64 65 74 65 63 74 65 64 20 6f 6e 20 4d 4b 33 20 detected on MK3 4164: 70 72 69 6e 74 65 72 00 printer. 0000416c : 416c: ff ff 42 6c 61 63 6b 6f 75 74 20 6f 63 63 75 72 ..Blackout occur 417c: 72 65 64 2e 20 52 65 63 6f 76 65 72 20 70 72 69 red. Recover pri 418c: 6e 74 3f 00 nt?. 00004190 : 4190: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 41a0: 6e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 20 79 not calibrated y 41b0: 65 74 2e 00 et.. 000041b4 : 41b4: ff ff 54 68 65 72 65 20 69 73 20 73 74 69 6c 6c ..There is still 41c4: 20 61 20 6e 65 65 64 20 74 6f 20 6d 61 6b 65 20 a need to make 41d4: 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 20 50 Z calibration. P 41e4: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 41f4: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 4204: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 4214: 63 74 69 6f 6e 20 43 61 6c 69 62 72 61 74 69 6f ction Calibratio 4224: 6e 20 66 6c 6f 77 2e 00 n flow.. 0000422c : 422c: ff ff 50 72 69 6e 74 65 72 20 68 61 73 20 6e 6f ..Printer has no 423c: 74 20 62 65 65 6e 20 63 61 6c 69 62 72 61 74 65 t been calibrate 424c: 64 20 79 65 74 2e 20 50 6c 65 61 73 65 20 66 6f d yet. Please fo 425c: 6c 6c 6f 77 20 74 68 65 20 6d 61 6e 75 61 6c 2c llow the manual, 426c: 20 63 68 61 70 74 65 72 20 46 69 72 73 74 20 73 chapter First s 427c: 74 65 70 73 2c 20 73 65 63 74 69 6f 6e 20 43 61 teps, section Ca 428c: 6c 69 62 72 61 74 69 6f 6e 20 66 6c 6f 77 2e 00 libration flow.. 0000429c : 429c: ff ff 53 65 6c 66 74 65 73 74 20 77 69 6c 6c 20 ..Selftest will 42ac: 62 65 20 72 75 6e 20 74 6f 20 63 61 6c 69 62 72 be run to calibr 42bc: 61 74 65 20 61 63 63 75 72 61 74 65 20 73 65 6e ate accurate sen 42cc: 73 6f 72 6c 65 73 73 20 72 65 68 6f 6d 69 6e 67 sorless rehoming 42dc: 2e 00 .. 000042de : 42de: ff ff 4f 6c 64 20 73 65 74 74 69 6e 67 73 20 66 ..Old settings f 42ee: 6f 75 6e 64 2e 20 44 65 66 61 75 6c 74 20 50 49 ound. Default PI 42fe: 44 2c 20 45 73 74 65 70 73 20 65 74 63 2e 20 77 D, Esteps etc. w 430e: 69 6c 6c 20 62 65 20 73 65 74 2e 00 ill be set.. 0000431a : 431a: ff ff 57 61 72 6e 69 6e 67 3a 20 62 6f 74 68 20 ..Warning: both 432a: 70 72 69 6e 74 65 72 20 74 79 70 65 20 61 6e 64 printer type and 433a: 20 6d 6f 74 68 65 72 62 6f 61 72 64 20 74 79 70 motherboard typ 434a: 65 20 63 68 61 6e 67 65 64 2e 00 e changed.. 00004355 : 4355: ff ff 57 61 72 6e 69 6e 67 3a 20 70 72 69 6e 74 ..Warning: print 4365: 65 72 20 74 79 70 65 20 63 68 61 6e 67 65 64 2e er type changed. ... 00004376 : 4376: ff ff 57 61 72 6e 69 6e 67 3a 20 6d 6f 74 68 65 ..Warning: mothe 4386: 72 62 6f 61 72 64 20 74 79 70 65 20 63 68 61 6e rboard type chan 4396: 67 65 64 2e 00 ged.. 0000439b : 439b: ff ff 53 68 65 65 74 00 ..Sheet. 000043a3 : 43a3: ff ff 4e 6f 74 20 73 70 69 6e 6e 69 6e 67 00 ..Not spinning. 000043b2 : 43b2: ff ff 53 70 69 6e 6e 69 6e 67 00 ..Spinning. 000043bd : 43bd: ff ff 46 61 6e 20 74 65 73 74 00 ..Fan test. 000043c8 : 43c8: ff ff 53 65 6c 66 74 65 73 74 20 66 61 69 6c 65 ..Selftest faile 43d8: 64 00 d. 000043da : 43da: ff ff 25 73 20 6c 65 76 65 6c 20 65 78 70 65 63 ..%s level expec 43ea: 74 65 64 00 ted. 000043ee : 43ee: ff ff 46 61 6c 73 65 20 74 72 69 67 67 65 72 69 ..False triggeri 43fe: 6e 67 00 ng. 00004401 : 4401: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 4411: 72 00 r. 00004413 : 4413: ff ff 53 77 61 70 70 65 64 00 ..Swapped. 0000441d : 441d: ff ff 46 72 6f 6e 74 2f 6c 65 66 74 20 66 61 6e ..Front/left fan 442d: 73 00 s. 0000442f : 442f: ff ff 41 78 69 73 00 ..Axis. 00004436 : 4436: ff ff 41 78 69 73 20 6c 65 6e 67 74 68 00 ..Axis length. 00004444 : 4444: ff ff 4c 6f 6f 73 65 20 70 75 6c 6c 65 79 00 ..Loose pulley. 00004453 : 4453: ff ff 4c 65 66 74 20 68 6f 74 65 6e 64 20 66 61 ..Left hotend fa 4463: 6e 3f 00 n?. 00004466 : 4466: ff ff 46 72 6f 6e 74 20 70 72 69 6e 74 20 66 61 ..Front print fa 4476: 6e 3f 00 n?. 00004479 : 4479: ff ff 45 6e 64 73 74 6f 70 20 6e 6f 74 20 68 69 ..Endstop not hi 4489: 74 00 t. 0000448b : 448b: ff ff 45 6e 64 73 74 6f 70 00 ..Endstop. 00004495 : 4495: ff ff 4d 6f 74 6f 72 00 ..Motor. 0000449d : 449d: ff ff 45 6e 64 73 74 6f 70 73 00 ..Endstops. 000044a8 : 44a8: ff ff 57 69 72 69 6e 67 20 65 72 72 6f 72 00 ..Wiring error. 000044b7 : 44b7: ff ff 42 65 64 2f 48 65 61 74 65 72 00 ..Bed/Heater. 000044c4 : 44c4: ff ff 4e 6f 74 20 63 6f 6e 6e 65 63 74 65 64 00 ..Not connected. 000044d4 : 44d4: ff ff 48 65 61 74 65 72 2f 54 68 65 72 6d 69 73 ..Heater/Thermis 44e4: 74 6f 72 00 tor. 000044e8 : 44e8: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 3a 00 ..Please check:. 000044f8 : 44f8: ff ff 53 65 6c 66 74 65 73 74 20 65 72 72 6f 72 ..Selftest error 4508: 21 00 !. 0000450a : 450a: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 451a: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 53 6b 65 n all right. Ske 452a: 77 20 77 69 6c 6c 20 62 65 20 63 6f 72 72 65 63 w will be correc 453a: 74 65 64 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c ted automaticall 454a: 79 2e 00 y.. 0000454d : 454d: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 455d: 6e 20 61 6c 6c 20 72 69 67 68 74 2e 20 58 2f 59 n all right. X/Y 456d: 20 61 78 65 73 20 61 72 65 20 73 6c 69 67 68 74 axes are slight 457d: 6c 79 20 73 6b 65 77 65 64 2e 20 47 6f 6f 64 20 ly skewed. Good 458d: 6a 6f 62 21 00 job!. 00004592 : 4592: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45a2: 6e 20 6f 6b 2e 20 58 2f 59 20 61 78 65 73 20 61 n ok. X/Y axes a 45b2: 72 65 20 70 65 72 70 65 6e 64 69 63 75 6c 61 72 re perpendicular 45c2: 2e 20 43 6f 6e 67 72 61 74 75 6c 61 74 69 6f 6e . Congratulation 45d2: 73 21 00 s!. 000045d5 : 45d5: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 45e5: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 52 n compromised. R 45f5: 69 67 68 74 20 66 72 6f 6e 74 20 63 61 6c 69 62 ight front calib 4605: 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 6e 6f 74 ration point not 4615: 20 72 65 61 63 68 61 62 6c 65 2e 00 reachable.. 00004621 : 4621: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4631: 6e 20 63 6f 6d 70 72 6f 6d 69 73 65 64 2e 20 46 n compromised. F 4641: 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e ront calibration 4651: 20 70 6f 69 6e 74 73 20 6e 6f 74 20 72 65 61 63 points not reac 4661: 68 61 62 6c 65 2e 00 hable.. 00004668 : 4668: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4678: 6e 20 66 61 69 6c 65 64 2e 20 52 69 67 68 74 20 n failed. Right 4688: 66 72 6f 6e 74 20 63 61 6c 69 62 72 61 74 69 6f front calibratio 4698: 6e 20 70 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 n point not reac 46a8: 68 61 62 6c 65 2e 00 hable.. 000046af : 46af: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 46bf: 6e 20 66 61 69 6c 65 64 2e 20 46 72 6f 6e 74 20 n failed. Front 46cf: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 46df: 74 73 20 6e 6f 74 20 72 65 61 63 68 61 62 6c 65 ts not reachable 46ef: 2e 00 .. 000046f1 : 46f1: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4701: 6e 20 66 61 69 6c 65 64 2e 20 50 6c 65 61 73 65 n failed. Please 4711: 20 63 6f 6e 73 75 6c 74 20 74 68 65 20 6d 61 6e consult the man 4721: 75 61 6c 2e 00 ual.. 00004726 : 4726: ff ff 58 59 5a 20 63 61 6c 69 62 72 61 74 69 6f ..XYZ calibratio 4736: 6e 20 66 61 69 6c 65 64 2e 20 42 65 64 20 63 61 n failed. Bed ca 4746: 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e 74 20 libration point 4756: 77 61 73 20 6e 6f 74 20 66 6f 75 6e 64 2e 00 was not found.. 00004765 : 4765: ff ff 50 6c 65 61 73 65 20 70 6c 61 63 65 20 73 ..Please place s 4775: 74 65 65 6c 20 73 68 65 65 74 20 6f 6e 20 68 65 teel sheet on he 4785: 61 74 62 65 64 2e 00 atbed.. 0000478c : 478c: ff ff 44 69 73 74 61 6e 63 65 20 62 65 74 77 65 ..Distance betwe 479c: 65 6e 20 74 69 70 20 6f 66 20 74 68 65 20 6e 6f en tip of the no 47ac: 7a 7a 6c 65 20 61 6e 64 20 74 68 65 20 62 65 64 zzle and the bed 47bc: 20 73 75 72 66 61 63 65 20 68 61 73 20 6e 6f 74 surface has not 47cc: 20 62 65 65 6e 20 73 65 74 20 79 65 74 2e 20 50 been set yet. P 47dc: 6c 65 61 73 65 20 66 6f 6c 6c 6f 77 20 74 68 65 lease follow the 47ec: 20 6d 61 6e 75 61 6c 2c 20 63 68 61 70 74 65 72 manual, chapter 47fc: 20 46 69 72 73 74 20 73 74 65 70 73 2c 20 73 65 First steps, se 480c: 63 74 69 6f 6e 20 46 69 72 73 74 20 6c 61 79 65 ction First laye 481c: 72 20 63 61 6c 69 62 72 61 74 69 6f 6e 2e 00 r calibration.. 0000482b : 482b: ff ff 50 6c 61 63 65 20 61 20 73 68 65 65 74 20 ..Place a sheet 483b: 6f 66 20 70 61 70 65 72 20 75 6e 64 65 72 20 74 of paper under t 484b: 68 65 20 6e 6f 7a 7a 6c 65 20 64 75 72 69 6e 67 he nozzle during 485b: 20 74 68 65 20 63 61 6c 69 62 72 61 74 69 6f 6e the calibration 486b: 20 6f 66 20 66 69 72 73 74 20 34 20 70 6f 69 6e of first 4 poin 487b: 74 73 2e 20 49 66 20 74 68 65 20 6e 6f 7a 7a 6c ts. If the nozzl 488b: 65 20 63 61 74 63 68 65 73 20 74 68 65 20 70 61 e catches the pa 489b: 70 65 72 2c 20 70 6f 77 65 72 20 6f 66 66 20 74 per, power off t 48ab: 68 65 20 70 72 69 6e 74 65 72 20 69 6d 6d 65 64 he printer immed 48bb: 69 61 74 65 6c 79 2e 00 iately.. 000048c3 : 48c3: ff ff 53 65 61 72 63 68 69 6e 67 20 62 65 64 20 ..Searching bed 48d3: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 48e3: 74 00 t. 000048e5 : 48e5: ff ff 4d 65 61 73 75 72 69 6e 67 20 72 65 66 65 ..Measuring refe 48f5: 72 65 6e 63 65 20 68 65 69 67 68 74 20 6f 66 20 rence height of 4905: 63 61 6c 69 62 72 61 74 69 6f 6e 20 70 6f 69 6e calibration poin 4915: 74 00 t. 00004917 : 4917: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 74 ..Please clean t 4927: 68 65 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 63 61 he nozzle for ca 4937: 6c 69 62 72 61 74 69 6f 6e 2e 20 43 6c 69 63 6b libration. Click 4947: 20 77 68 65 6e 20 64 6f 6e 65 2e 00 when done.. 00004953 : 4953: ff ff 41 75 74 6f 20 68 6f 6d 65 00 ..Auto home. 0000495f : 495f: ff ff 54 48 45 52 4d 41 4c 20 41 4e 4f 4d 41 4c ..THERMAL ANOMAL 496f: 59 00 Y. 00004971 : 4971: ff ff 52 65 73 75 6d 69 6e 67 20 70 72 69 6e 74 ..Resuming print ... 00004982 : 4982: ff ff 50 49 4e 44 41 20 48 65 61 74 69 6e 67 00 ..PINDA Heating. 00004992 : 4992: ff ff 43 61 6c 69 62 72 61 74 69 6f 6e 20 64 6f ..Calibration do 49a2: 6e 65 00 ne. 000049a5 : 49a5: ff ff 43 61 6c 69 62 72 61 74 69 6e 67 20 5a 00 ..Calibrating Z. 000049b5 : 49b5: ff ff 42 65 64 20 64 6f 6e 65 00 ..Bed done. 000049c0 : 49c0: ff ff 42 65 64 20 48 65 61 74 69 6e 67 00 ..Bed Heating. 000049ce : 49ce: ff ff 48 65 61 74 69 6e 67 20 64 6f 6e 65 2e 00 ..Heating done.. 000049de : 49de: ff ff 48 65 61 74 69 6e 67 00 ..Heating. 000049e8 : 49e8: ff ff 4d 4d 55 20 66 61 69 6c 73 00 ..MMU fails. 000049f4 : 49f4: ff ff 4d 4d 55 20 6c 6f 61 64 20 66 61 69 6c 73 ..MMU load fails ... 00004a05 : 4a05: ff ff 4d 4d 55 20 70 6f 77 65 72 20 66 61 69 6c ..MMU power fail 4a15: 73 00 s. 00004a17 : 4a17: ff ff 4d 61 74 65 72 69 61 6c 20 63 68 61 6e 67 ..Material chang 4a27: 65 73 00 es. 00004a2a : 4a2a: ff ff 54 6f 74 61 6c 20 66 61 69 6c 75 72 65 73 ..Total failures ... 00004a3b : 4a3b: ff ff 4c 61 73 74 20 70 72 69 6e 74 20 66 61 69 ..Last print fai 4a4b: 6c 75 72 65 73 00 lures. 00004a51 : 4a51: ff ff 50 6f 77 65 72 20 66 61 69 6c 75 72 65 73 ..Power failures ... 00004a62 : 4a62: ff ff 46 69 6c 2e 20 72 75 6e 6f 75 74 73 00 ..Fil. runouts. 00004a71 : 4a71: ff ff 43 72 61 73 68 00 ..Crash. 00004a79 : 4a79: ff ff 54 6f 74 61 6c 00 ..Total. 00004a81 : 4a81: ff ff 4c 61 73 74 20 70 72 69 6e 74 00 ..Last print. 00004a8e : 4a8e: ff ff 41 6d 62 69 65 6e 74 00 ..Ambient. 00004a98 : 4a98: ff ff 56 6f 6c 74 61 67 65 73 00 ..Voltages. 00004aa3 : 4aa3: ff ff 54 65 6d 70 65 72 61 74 75 72 65 73 00 ..Temperatures. 00004ab2 : 4ab2: ff ff 42 65 6c 74 20 73 74 61 74 75 73 00 ..Belt status. 00004ac0 : 4ac0: ff ff 53 65 6e 73 6f 72 20 69 6e 66 6f 00 ..Sensor info. 00004ace : 4ace: ff ff 45 78 74 72 75 64 65 72 20 69 6e 66 6f 00 ..Extruder info. 00004ade : 4ade: ff ff 58 59 5a 20 63 61 6c 2e 20 64 65 74 61 69 ..XYZ cal. detai 4aee: 6c 73 00 ls. 00004af1 : 4af1: ff ff 50 72 69 6e 74 65 72 20 49 50 20 41 64 64 ..Printer IP Add 4b01: 72 3a 00 r:. 00004b04 : 4b04: ff ff 75 6e 6b 6e 6f 77 6e 00 ..unknown. 00004b0e : 4b0e: ff ff 4d 4d 55 20 63 6f 6e 6e 65 63 74 65 64 00 ..MMU connected. 00004b1e : 4b1e: ff ff 44 61 74 65 3a 00 ..Date:. 00004b26 : 4b26: ff ff 74 6f 20 75 6e 6c 6f 61 64 20 66 69 6c 61 ..to unload fila 4b36: 6d 65 6e 74 00 ment. 00004b3b : 4b3b: ff ff 74 6f 20 6c 6f 61 64 20 66 69 6c 61 6d 65 ..to load filame 4b4b: 6e 74 00 nt. 00004b4e : 4b4e: ff ff 50 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 ..Press the knob ... 00004b5f : 4b5f: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b6f: 63 75 74 00 cut. 00004b73 : 4b73: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b83: 65 6a 65 63 74 00 eject. 00004b89 : 4b89: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4b99: 75 6e 6c 6f 61 64 00 unload. 00004ba0 : 4ba0: ff ff 50 72 65 68 65 61 74 69 6e 67 20 74 6f 20 ..Preheating to 4bb0: 6c 6f 61 64 00 load. 00004bb5 : 4bb5: ff ff 43 6f 6f 6c 64 6f 77 6e 00 ..Cooldown. 00004bc0 : 4bc0: ff ff 46 69 6c 61 6d 65 6e 74 20 65 78 74 72 75 ..Filament extru 4bd0: 64 69 6e 67 20 26 20 77 69 74 68 20 63 6f 72 72 ding & with corr 4be0: 65 63 74 20 63 6f 6c 6f 72 3f 00 ect color?. 00004beb : 4beb: ff ff 45 6a 65 63 74 00 ..Eject. 00004bf3 : 4bf3: ff ff 41 75 74 6f 6c 6f 61 64 69 6e 67 20 66 69 ..Autoloading fi 4c03: 6c 61 6d 65 6e 74 20 69 73 20 61 63 74 69 76 65 lament is active 4c13: 2c 20 6a 75 73 74 20 70 72 65 73 73 20 74 68 65 , just press the 4c23: 20 6b 6e 6f 62 20 61 6e 64 20 69 6e 73 65 72 74 knob and insert 4c33: 20 66 69 6c 61 6d 65 6e 74 2e 2e 2e 00 filament.... 00004c40 : 4c40: ff ff 54 6f 74 61 6c 20 66 69 6c 61 6d 65 6e 74 ..Total filament ... 00004c51 : 4c51: ff ff 54 6f 74 61 6c 20 70 72 69 6e 74 20 74 69 ..Total print ti 4c61: 6d 65 00 me. 00004c64 : 4c64: ff ff 46 69 6c 61 6d 65 6e 74 20 75 73 65 64 00 ..Filament used. 00004c74 : 4c74: ff ff 50 72 69 6e 74 20 74 69 6d 65 00 ..Print time. 00004c81 : 4c81: ff ff 50 72 65 68 65 61 74 20 74 68 65 20 6e 6f ..Preheat the no 4c91: 7a 7a 6c 65 21 00 zzle!. 00004c97 : 4c97: ff ff 45 52 52 4f 52 3a 00 ..ERROR:. 00004ca0 : 4ca0: ff ff 59 20 64 69 73 74 61 6e 63 65 20 66 72 6f ..Y distance fro 4cb0: 6d 20 6d 69 6e 00 m min. 00004cb6 : 4cb6: ff ff 4c 65 66 74 00 ..Left. 00004cbd : 4cbd: ff ff 52 69 67 68 74 00 ..Right. 00004cc5 : 4cc5: ff ff 4d 65 61 73 75 72 65 64 20 73 6b 65 77 00 ..Measured skew. 00004cd5 : 4cd5: ff ff 53 6c 69 67 68 74 20 73 6b 65 77 00 ..Slight skew. 00004ce3 : 4ce3: ff ff 53 65 76 65 72 65 20 73 6b 65 77 00 ..Severe skew. 00004cf1 : 4cf1: ff ff 5b 30 3b 30 5d 20 70 6f 69 6e 74 20 6f 66 ..[0;0] point of 4d01: 66 73 65 74 00 fset. 00004d06 : 4d06: ff ff 41 64 6a 75 73 74 69 6e 67 20 5a 00 ..Adjusting Z. 00004d14 : 4d14: ff ff 52 65 61 72 20 73 69 64 65 20 5b e4 6d 5d ..Rear side [.m] ... 00004d25 : 4d25: ff ff 46 72 6f 6e 74 20 73 69 64 65 5b e4 6d 5d ..Front side[.m] ... 00004d36 : 4d36: ff ff 52 69 67 68 74 20 73 69 64 65 5b e4 6d 5d ..Right side[.m] ... 00004d47 : 4d47: ff ff 4c 65 66 74 20 73 69 64 65 20 5b e4 6d 5d ..Left side [.m] ... 00004d58 : 4d58: ff ff 53 65 74 20 74 65 6d 70 65 72 61 74 75 72 ..Set temperatur 4d68: 65 3a 00 e:. 00004d6b : 4d6b: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4d7b: 69 6f 6e 20 66 61 69 6c 65 64 00 ion failed. 00004d86 : 4d86: ff ff 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 ..PINDA calibrat 4d96: 69 6f 6e 20 69 73 20 66 69 6e 69 73 68 65 64 20 ion is finished 4da6: 61 6e 64 20 61 63 74 69 76 65 2e 20 49 74 20 63 and active. It c 4db6: 61 6e 20 62 65 20 64 69 73 61 62 6c 65 64 20 69 an be disabled i 4dc6: 6e 20 6d 65 6e 75 20 53 65 74 74 69 6e 67 73 2d n menu Settings- 4dd6: 3e 50 49 4e 44 41 20 63 61 6c 2e 00 >PINDA cal.. 00004de2 : 4de2: ff ff 45 78 74 72 75 64 65 72 00 ..Extruder. 00004ded : 4ded: ff ff 4d 6f 76 65 20 5a 00 ..Move Z. 00004df6 : 4df6: ff ff 4d 6f 76 65 20 59 00 ..Move Y. 00004dff : 4dff: ff ff 4d 6f 76 65 20 58 00 ..Move X. 00004e08 : 4e08: ff ff 43 72 61 73 68 20 64 65 74 65 63 74 69 6f ..Crash detectio 4e18: 6e 20 63 61 6e 0a 62 65 20 74 75 72 6e 65 64 20 n can.be turned 4e28: 6f 6e 20 6f 6e 6c 79 20 69 6e 0a 4e 6f 72 6d 61 on only in.Norma 4e38: 6c 20 6d 6f 64 65 00 l mode. 00004e3f : 4e3f: ff ff 57 41 52 4e 49 4e 47 3a 0a 43 72 61 73 68 ..WARNING:.Crash 4e4f: 20 64 65 74 65 63 74 69 6f 6e 0a 64 69 73 61 62 detection.disab 4e5f: 6c 65 64 20 69 6e 0a 53 74 65 61 6c 74 68 20 6d led in.Stealth m 4e6f: 6f 64 65 00 ode. 00004e73 : 4e73: ff ff 4d 6f 64 65 20 63 68 61 6e 67 65 20 69 6e ..Mode change in 4e83: 20 70 72 6f 67 72 65 73 73 2e 2e 2e 00 progress.... 00004e90 : 4e90: ff ff 43 6f 70 79 20 73 65 6c 65 63 74 65 64 20 ..Copy selected 4ea0: 6c 61 6e 67 75 61 67 65 3f 00 language?. 00004eaa : 4eaa: ff ff 43 6f 6d 6d 75 6e 69 74 79 20 6d 61 64 65 ..Community made ... 00004ebb : 4ebb: ff ff 53 68 65 65 74 20 25 2e 37 73 0a 5a 20 6f ..Sheet %.7s.Z o 4ecb: 66 66 73 65 74 3a 20 25 2b 31 2e 33 66 6d 6d 0a ffset: %+1.3fmm. 4edb: 25 63 43 6f 6e 74 69 6e 75 65 0a 25 63 52 65 73 %cContinue.%cRes 4eeb: 65 74 00 et. 00004eee : 4eee: ff ff 50 6c 65 61 73 65 20 6c 6f 61 64 20 66 69 ..Please load fi 4efe: 6c 61 6d 65 6e 74 20 66 69 72 73 74 2e 00 lament first.. 00004f0c : 4f0c: ff ff 43 61 6e 63 65 6c 00 ..Cancel. 00004f15 : 4f15: ff ff 52 75 6e 6e 69 6e 67 20 57 69 7a 61 72 64 ..Running Wizard 4f25: 20 77 69 6c 6c 20 64 65 6c 65 74 65 20 63 75 72 will delete cur 4f35: 72 65 6e 74 20 63 61 6c 69 62 72 61 74 69 6f 6e rent calibration 4f45: 20 72 65 73 75 6c 74 73 20 61 6e 64 20 73 74 61 results and sta 4f55: 72 74 20 66 72 6f 6d 20 74 68 65 20 62 65 67 69 rt from the begi 4f65: 6e 6e 69 6e 67 2e 00 nning.. 00004f6c : 4f6c: ff ff 50 72 65 68 65 61 74 69 6e 67 20 6e 6f 7a ..Preheating noz 4f7c: 7a 6c 65 2e 20 50 6c 65 61 73 65 20 77 61 69 74 zle. Please wait 4f8c: 2e 00 .. 00004f8e : 4f8e: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4f9e: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4fae: 65 20 65 78 74 72 75 64 65 72 2c 20 74 68 65 6e e extruder, then 4fbe: 20 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 press the knob 4fce: 74 6f 20 6c 6f 61 64 20 69 74 2e 00 to load it.. 00004fda : 4fda: ff ff 50 6c 65 61 73 65 20 69 6e 73 65 72 74 20 ..Please insert 4fea: 66 69 6c 61 6d 65 6e 74 20 69 6e 74 6f 20 74 68 filament into th 4ffa: 65 20 66 69 72 73 74 20 74 75 62 65 20 6f 66 20 e first tube of 500a: 74 68 65 20 4d 4d 55 2c 20 74 68 65 6e 20 70 72 the MMU, then pr 501a: 65 73 73 20 74 68 65 20 6b 6e 6f 62 20 74 6f 20 ess the knob to 502a: 6c 6f 61 64 20 69 74 2e 00 load it.. 00005033 : 5033: ff ff 54 68 65 20 70 72 69 6e 74 65 72 20 77 69 ..The printer wi 5043: 6c 6c 20 73 74 61 72 74 20 70 72 69 6e 74 69 6e ll start printin 5053: 67 20 61 20 7a 69 67 2d 7a 61 67 20 6c 69 6e 65 g a zig-zag line 5063: 2e 20 52 6f 74 61 74 65 20 74 68 65 20 6b 6e 6f . Rotate the kno 5073: 62 20 75 6e 74 69 6c 20 79 6f 75 20 72 65 61 63 b until you reac 5083: 68 20 74 68 65 20 6f 70 74 69 6d 61 6c 20 68 65 h the optimal he 5093: 69 67 68 74 2e 20 43 68 65 63 6b 20 74 68 65 20 ight. Check the 50a3: 70 69 63 74 75 72 65 73 20 69 6e 20 74 68 65 20 pictures in the 50b3: 68 61 6e 64 62 6f 6f 6b 20 28 43 61 6c 69 62 72 handbook (Calibr 50c3: 61 74 69 6f 6e 20 63 68 61 70 74 65 72 29 2e 00 ation chapter).. 000050d3 : 50d3: ff ff 53 65 6c 65 63 74 20 74 65 6d 70 65 72 61 ..Select tempera 50e3: 74 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 ture which match 50f3: 65 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c es your material 5103: 2e 00 .. 00005105 : 5105: ff ff 53 65 6c 65 63 74 20 61 20 66 69 6c 61 6d ..Select a filam 5115: 65 6e 74 20 66 6f 72 20 74 68 65 20 46 69 72 73 ent for the Firs 5125: 74 20 4c 61 79 65 72 20 43 61 6c 69 62 72 61 74 t Layer Calibrat 5135: 69 6f 6e 20 61 6e 64 20 73 65 6c 65 63 74 20 69 ion and select i 5145: 74 20 69 6e 20 74 68 65 20 6f 6e 2d 73 63 72 65 t in the on-scre 5155: 65 6e 20 6d 65 6e 75 2e 00 en menu.. 0000515e : 515e: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 63 61 6c ..Now I will cal 516e: 69 62 72 61 74 65 20 64 69 73 74 61 6e 63 65 20 ibrate distance 517e: 62 65 74 77 65 65 6e 20 74 69 70 20 6f 66 20 74 between tip of t 518e: 68 65 20 6e 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 he nozzle and he 519e: 61 74 62 65 64 20 73 75 72 66 61 63 65 2e 00 atbed surface.. 000051ad : 51ad: ff ff 5a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 ..Z calibration 51bd: 72 65 63 6f 6d 6d 65 6e 64 65 64 2e 20 52 75 6e recommended. Run 51cd: 20 69 74 20 6e 6f 77 3f 00 it now?. 000051d6 : 51d6: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 51e6: 73 74 65 65 6c 20 73 68 65 65 74 20 66 72 6f 6d steel sheet from 51f6: 20 68 65 61 74 62 65 64 2e 00 heatbed.. 00005200 : 5200: ff ff 49 73 20 73 74 65 65 6c 20 73 68 65 65 74 ..Is steel sheet 5210: 20 6f 6e 20 68 65 61 74 62 65 64 3f 00 on heatbed?. 0000521d : 521d: ff ff 50 6c 65 61 73 65 20 63 68 65 63 6b 20 6f ..Please check o 522d: 75 72 20 68 61 6e 64 62 6f 6f 6b 20 61 6e 64 20 ur handbook and 523d: 66 69 78 20 74 68 65 20 70 72 6f 62 6c 65 6d 2e fix the problem. 524d: 20 54 68 65 6e 20 72 65 73 75 6d 65 20 74 68 65 Then resume the 525d: 20 57 69 7a 61 72 64 20 62 79 20 72 65 62 6f 6f Wizard by reboo 526d: 74 69 6e 67 20 74 68 65 20 70 72 69 6e 74 65 72 ting the printer 527d: 2e 00 .. 0000527f : 527f: ff ff 41 6c 6c 20 69 73 20 64 6f 6e 65 2e 20 48 ..All is done. H 528f: 61 70 70 79 20 70 72 69 6e 74 69 6e 67 21 00 appy printing!. 0000529e : 529e: ff ff 59 6f 75 20 63 61 6e 20 61 6c 77 61 79 73 ..You can always 52ae: 20 72 65 73 75 6d 65 20 74 68 65 20 57 69 7a 61 resume the Wiza 52be: 72 64 20 66 72 6f 6d 20 43 61 6c 69 62 72 61 74 rd from Calibrat 52ce: 69 6f 6e 20 2d 3e 20 57 69 7a 61 72 64 2e 00 ion -> Wizard.. 000052dd : 52dd: ff ff 49 66 20 79 6f 75 20 68 61 76 65 20 61 64 ..If you have ad 52ed: 64 69 74 69 6f 6e 61 6c 20 73 74 65 65 6c 20 73 ditional steel s 52fd: 68 65 65 74 73 2c 20 63 61 6c 69 62 72 61 74 65 heets, calibrate 530d: 20 74 68 65 69 72 20 70 72 65 73 65 74 73 20 69 their presets i 531d: 6e 20 53 65 74 74 69 6e 67 73 20 2d 20 48 57 20 n Settings - HW 532d: 53 65 74 75 70 20 2d 20 53 74 65 65 6c 20 73 68 Setup - Steel sh 533d: 65 65 74 73 2e 00 eets.. 00005343 : 5343: ff ff 50 6c 65 61 73 65 20 63 6c 65 61 6e 20 68 ..Please clean h 5353: 65 61 74 62 65 64 20 61 6e 64 20 74 68 65 6e 20 eatbed and then 5363: 70 72 65 73 73 20 74 68 65 20 6b 6e 6f 62 2e 00 press the knob.. 00005373 : 5373: ff ff 44 6f 20 79 6f 75 20 77 61 6e 74 20 74 6f ..Do you want to 5383: 20 72 65 70 65 61 74 20 6c 61 73 74 20 73 74 65 repeat last ste 5393: 70 20 74 6f 20 72 65 61 64 6a 75 73 74 20 64 69 p to readjust di 53a3: 73 74 61 6e 63 65 20 62 65 74 77 65 65 6e 20 6e stance between n 53b3: 6f 7a 7a 6c 65 20 61 6e 64 20 68 65 61 74 62 65 ozzle and heatbe 53c3: 64 3f 00 d?. 000053c6 : 53c6: ff ff 53 65 6c 65 63 74 20 6e 6f 7a 7a 6c 65 20 ..Select nozzle 53d6: 70 72 65 68 65 61 74 20 74 65 6d 70 65 72 61 74 preheat temperat 53e6: 75 72 65 20 77 68 69 63 68 20 6d 61 74 63 68 65 ure which matche 53f6: 73 20 79 6f 75 72 20 6d 61 74 65 72 69 61 6c 2e s your material. ... 00005407 : 5407: ff ff 49 73 20 66 69 6c 61 6d 65 6e 74 20 6c 6f ..Is filament lo 5417: 61 64 65 64 3f 00 aded?. 0000541d : 541d: ff ff 54 68 65 72 6d 61 6c 20 6d 6f 64 65 6c 20 ..Thermal model 542d: 63 61 6c 2e 20 74 61 6b 65 73 20 61 70 70 72 6f cal. takes appro 543d: 78 2e 20 31 32 20 6d 69 6e 73 2e 20 53 65 65 0a x. 12 mins. See. 544d: 70 72 75 73 61 2e 69 6f 2f 74 6d 2d 63 61 6c 00 prusa.io/tm-cal. 0000545d : 545d: ff ff 4e 6f 77 20 49 20 77 69 6c 6c 20 70 72 65 ..Now I will pre 546d: 68 65 61 74 20 6e 6f 7a 7a 6c 65 20 66 6f 72 20 heat nozzle for 547d: 50 4c 41 2e 00 PLA.. 00005482 : 5482: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 7a 20 63 ..I will run z c 5492: 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 2e 00 alibration now.. 000054a2 : 54a2: ff ff 4e 6f 77 20 72 65 6d 6f 76 65 20 74 68 65 ..Now remove the 54b2: 20 74 65 73 74 20 70 72 69 6e 74 20 66 72 6f 6d test print from 54c2: 20 73 74 65 65 6c 20 73 68 65 65 74 2e 00 steel sheet.. 000054d0 : 54d0: ff ff 50 6c 65 61 73 65 20 72 65 6d 6f 76 65 20 ..Please remove 54e0: 73 68 69 70 70 69 6e 67 20 68 65 6c 70 65 72 73 shipping helpers 54f0: 20 66 69 72 73 74 2e 00 first.. 000054f8 : 54f8: ff ff 49 20 77 69 6c 6c 20 72 75 6e 20 78 79 7a ..I will run xyz 5508: 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 6e 6f 77 calibration now 5518: 2e 20 49 74 20 77 69 6c 6c 20 74 61 6b 65 20 75 . It will take u 5528: 70 20 74 6f 20 32 34 20 6d 69 6e 73 2e 00 p to 24 mins.. 00005536 : 5536: ff ff 46 69 72 73 74 2c 20 49 20 77 69 6c 6c 20 ..First, I will 5546: 72 75 6e 20 74 68 65 20 73 65 6c 66 74 65 73 74 run the selftest 5556: 20 74 6f 20 63 68 65 63 6b 20 6d 6f 73 74 20 63 to check most c 5566: 6f 6d 6d 6f 6e 20 61 73 73 65 6d 62 6c 79 20 70 ommon assembly p 5576: 72 6f 62 6c 65 6d 73 2e 00 roblems.. 0000557f : 557f: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 558f: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 559f: 33 20 70 72 69 6e 74 65 72 2e 20 57 6f 75 6c 64 3 printer. Would 55af: 20 79 6f 75 20 6c 69 6b 65 20 6d 65 20 74 6f 20 you like me to 55bf: 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f 75 67 guide you throug 55cf: 68 20 74 68 65 20 73 65 74 75 70 20 70 72 6f 63 h the setup proc 55df: 65 73 73 3f 00 ess?. 000055e4 : 55e4: ff ff 48 69 2c 20 49 20 61 6d 20 79 6f 75 72 20 ..Hi, I am your 55f4: 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 20 69 Original Prusa i 5604: 33 20 70 72 69 6e 74 65 72 2e 20 49 20 77 69 6c 3 printer. I wil 5614: 6c 20 67 75 69 64 65 20 79 6f 75 20 74 68 72 6f l guide you thro 5624: 75 67 68 20 61 20 73 68 6f 72 74 20 73 65 74 75 ugh a short setu 5634: 70 20 70 72 6f 63 65 73 73 2c 20 69 6e 20 77 68 p process, in wh 5644: 69 63 68 20 74 68 65 20 5a 2d 61 78 69 73 20 77 ich the Z-axis w 5654: 69 6c 6c 20 62 65 20 63 61 6c 69 62 72 61 74 65 ill be calibrate 5664: 64 2e 20 54 68 65 6e 2c 20 79 6f 75 20 77 69 6c d. Then, you wil 5674: 6c 20 62 65 20 72 65 61 64 79 20 74 6f 20 70 72 l be ready to pr 5684: 69 6e 74 2e 00 int.. 00005689 : 5689: ff ff 45 2d 63 6f 72 72 65 63 74 00 ..E-correct. 00005695 : 5695: ff ff 5a 2d 63 6f 72 72 65 63 74 00 ..Z-correct. 000056a1 : 56a1: ff ff 59 2d 63 6f 72 72 65 63 74 00 ..Y-correct. 000056ad : 56ad: ff ff 58 2d 63 6f 72 72 65 63 74 00 ..X-correct. 000056b9 : 56b9: ff ff 50 61 75 73 65 00 ..Pause. 000056c1 : 56c1: ff ff 46 53 20 41 63 74 69 6f 6e 00 ..FS Action. 000056cd : 56cd: ff ff 43 6f 6e 74 2e 00 ..Cont.. 000056d5 : 56d5: ff ff 46 2e 20 61 75 74 6f 6c 6f 61 64 00 ..F. autoload. 000056e3 : 56e3: ff ff 46 2e 20 72 75 6e 6f 75 74 00 ..F. runout. 000056ef : 56ef: ff ff 4d 4d 55 20 4d 6f 64 65 00 ..MMU Mode. 000056fa : 56fa: ff ff 43 75 74 74 65 72 00 ..Cutter. 00005703 : 5703: ff ff 53 74 65 61 6c 74 68 00 ..Stealth. 0000570d : 570d: ff ff 43 72 61 73 68 20 64 65 74 2e 00 ..Crash det.. 0000571a : 571a: ff ff 46 61 6e 20 73 70 65 65 64 00 ..Fan speed. 00005726 : 5726: ff ff 42 65 64 00 ..Bed. 0000572c : 572c: ff ff 46 61 6e 73 20 63 68 65 63 6b 00 ..Fans check. 00005739 : 5739: ff ff 4d 6f 64 65 6c 00 ..Model. 00005741 : 5741: ff ff 4e 6f 7a 7a 6c 65 00 ..Nozzle. 0000574a : 574a: ff ff 43 68 65 63 6b 73 00 ..Checks. 00005753 : 5753: ff ff 4e 6f 7a 7a 6c 65 20 63 68 61 6e 67 65 00 ..Nozzle change. 00005763 : 5763: ff ff 41 6c 70 68 61 62 65 74 00 ..Alphabet. 0000576e : 576e: ff ff 53 6f 72 74 00 ..Sort. 00005775 : 5775: ff ff 54 69 6d 65 00 ..Time. 0000577c : 577c: ff ff 4e 6f 72 6d 61 6c 00 ..Normal. 00005785 : 5785: ff ff 53 44 20 63 61 72 64 00 ..SD card. 0000578f : 578f: ff ff 53 65 6c 65 63 74 20 6c 61 6e 67 75 61 67 ..Select languag 579f: 65 00 e. 000057a1 : 57a1: ff ff 52 50 69 20 70 6f 72 74 00 ..RPi port. 000057ac : 57ac: ff ff 4c 69 6e 2e 20 63 6f 72 72 65 63 74 69 6f ..Lin. correctio 57bc: 6e 00 n. 000057be : 57be: ff ff 48 57 20 53 65 74 75 70 00 ..HW Setup. 000057c9 : 57c9: ff ff 4c 6f 61 64 69 6e 67 20 54 65 73 74 00 ..Loading Test. 000057d8 : 57d8: ff ff 44 69 73 61 62 6c 65 20 73 74 65 70 70 65 ..Disable steppe 57e8: 72 73 00 rs. 000057eb : 57eb: ff ff 4d 6f 76 65 20 61 78 69 73 00 ..Move axis. 000057f7 : 57f7: ff ff 54 65 6d 70 65 72 61 74 75 72 65 00 ..Temperature. 00005805 : 5805: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 53 65 ..Feeding to FSe 5815: 6e 73 6f 72 00 nsor. 0000581a : 581a: ff ff 4d 6f 76 69 6e 67 20 73 65 6c 65 63 74 6f ..Moving selecto 582a: 72 00 r. 0000582c : 582c: ff ff 48 6f 6d 69 6e 67 00 ..Homing. 00005835 : 5835: ff ff 52 65 74 72 61 63 74 20 66 72 6f 6d 20 46 ..Retract from F 5845: 49 4e 44 41 00 INDA. 0000584a : 584a: ff ff 45 6a 65 63 74 69 6e 67 20 66 69 6c 61 6d ..Ejecting filam 585a: 65 6e 74 00 ent. 0000585e : 585e: ff ff 50 61 72 6b 69 6e 67 20 73 65 6c 65 63 74 ..Parking select 586e: 6f 72 00 or. 00005871 : 5871: ff ff 52 65 74 75 72 6e 69 6e 67 20 73 65 6c 65 ..Returning sele 5881: 63 74 6f 72 00 ctor. 00005886 : 5886: ff ff 50 65 72 66 6f 72 6d 69 6e 67 20 63 75 74 ..Performing cut ... 00005897 : 5897: ff ff 50 75 73 68 69 6e 67 20 66 69 6c 61 6d 65 ..Pushing filame 58a7: 6e 74 00 nt. 000058aa : 58aa: ff ff 50 72 65 70 61 72 69 6e 67 20 62 6c 61 64 ..Preparing blad 58ba: 65 00 e. 000058bc : 58bc: ff ff 53 65 6c 65 63 74 69 6e 67 20 66 69 6c 2e ..Selecting fil. 58cc: 20 73 6c 6f 74 00 slot. 000058d2 : 58d2: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 ..Unloading fila 58e2: 6d 65 6e 74 00 ment. 000058e7 : 58e7: ff ff 45 52 52 20 54 4d 43 20 66 61 69 6c 65 64 ..ERR TMC failed ... 000058f8 : 58f8: ff ff 45 52 52 20 48 65 6c 70 20 66 69 6c 61 6d ..ERR Help filam 5908: 65 6e 74 00 ent. 0000590c : 590c: ff ff 45 52 52 20 49 6e 74 65 72 6e 61 6c 00 ..ERR Internal. 0000591b : 591b: ff ff 45 52 52 20 57 61 69 74 20 66 6f 72 20 55 ..ERR Wait for U 592b: 73 65 72 00 ser. 0000592f : 592f: ff ff 46 69 6e 69 73 68 69 6e 67 20 6d 6f 76 65 ..Finishing move 593f: 6d 65 6e 74 73 00 ments. 00005945 : 5945: ff ff 41 76 6f 69 64 69 6e 67 20 67 72 69 6e 64 ..Avoiding grind ... 00005956 : 5956: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 6e 6f 7a ..Feeding to noz 5966: 7a 6c 65 00 zle. 0000596a : 596a: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 65 78 74 ..Feeding to ext 597a: 72 75 64 65 72 00 ruder. 00005980 : 5980: ff ff 46 65 65 64 69 6e 67 20 74 6f 20 46 49 4e ..Feeding to FIN 5990: 44 41 00 DA. 00005993 : 5993: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 70 ..Unloading to p 59a3: 75 6c 6c 65 79 00 ulley. 000059a9 : 59a9: ff ff 55 6e 6c 6f 61 64 69 6e 67 20 74 6f 20 46 ..Unloading to F 59b9: 49 4e 44 41 00 INDA. 000059be : 59be: ff ff 44 69 73 65 6e 67 61 67 69 6e 67 20 69 64 ..Disengaging id 59ce: 6c 65 72 00 ler. 000059d2 : 59d2: ff ff 45 6e 67 61 67 69 6e 67 20 69 64 6c 65 72 ..Engaging idler ... 000059e3 : 59e3: ff ff 4f 4b 00 ..OK. 000059e8 <_ZN4MMU2L23MSG_TITLE_UNKNOWN_ERRORE.lto_priv.547>: 59e8: ff ff 55 4e 4b 4e 4f 57 4e 20 45 52 52 4f 52 00 ..UNKNOWN ERROR. 000059f8 <_ZN4MMU2L25MSG_TITLE_FILAMENT_CHANGEE.lto_priv.546>: 59f8: ff ff 46 49 4c 41 4d 45 4e 54 20 43 48 41 4e 47 ..FILAMENT CHANG 5a08: 45 00 E. 00005a0a <_ZN4MMU2L26MSG_TITLE_FILAMENT_EJECTEDE.lto_priv.545>: 5a0a: ff ff 46 49 4c 41 4d 45 4e 54 20 45 4a 45 43 54 ..FILAMENT EJECT 5a1a: 45 44 00 ED. 00005a1d <_ZN4MMU2L25MSG_TITLE_UNLOAD_MANUALLYE.lto_priv.544>: 5a1d: ff ff 55 4e 4c 4f 41 44 20 4d 41 4e 55 41 4c 4c ..UNLOAD MANUALL 5a2d: 59 00 Y. 00005a2f <_ZN4MMU2L26MSG_TITLE_FW_RUNTIME_ERRORE.lto_priv.543>: 5a2f: ff ff 46 57 20 52 55 4e 54 49 4d 45 20 45 52 52 ..FW RUNTIME ERR 5a3f: 4f 52 00 OR. 00005a42 <_ZN4MMU2L26MSG_TITLE_FW_UPDATE_NEEDEDE.lto_priv.542>: 5a42: ff ff 4d 4d 55 20 46 57 20 55 50 44 41 54 45 20 ..MMU FW UPDATE 5a52: 4e 45 45 44 45 44 00 NEEDED. 00005a59 <_ZN4MMU2L20MSG_TITLE_QUEUE_FULLE.lto_priv.541>: 5a59: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005a66 <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.540>: 5a66: ff ff 49 4e 56 41 4c 49 44 20 54 4f 4f 4c 00 ..INVALID TOOL. 00005a75 <_ZN4MMU2L33MSG_TITLE_FILAMENT_ALREADY_LOADEDE.lto_priv.539>: 5a75: ff ff 46 49 4c 2e 20 41 4c 52 45 41 44 59 20 4c ..FIL. ALREADY L 5a85: 4f 41 44 45 44 00 OADED. 00005a8b <_ZN4MMU2L29MSG_TITLE_COMMUNICATION_ERRORE.lto_priv.538>: 5a8b: ff ff 43 4f 4d 4d 55 4e 49 43 41 54 49 4f 4e 20 ..COMMUNICATION 5a9b: 45 52 52 4f 52 00 ERROR. 00005aa1 <_ZN4MMU2L28MSG_TITLE_MMU_NOT_RESPONDINGE.lto_priv.537>: 5aa1: ff ff 4d 4d 55 20 4e 4f 54 20 52 45 53 50 4f 4e ..MMU NOT RESPON 5ab1: 44 49 4e 47 00 DING. 00005ab6 <_ZN4MMU2L23MSG_TITLE_MMU_MCU_ERRORE.lto_priv.536>: 5ab6: ff ff 4d 4d 55 20 4d 43 55 20 45 52 52 4f 52 00 ..MMU MCU ERROR. 00005ac6 <_ZN4MMU2L25MSG_TITLE_SELFTEST_FAILEDE.lto_priv.535>: 5ac6: ff ff 4d 4d 55 20 53 45 4c 46 54 45 53 54 20 46 ..MMU SELFTEST F 5ad6: 41 49 4c 45 44 00 AILED. 00005adc <_ZN4MMU2L28MSG_TITLE_TMC_DRIVER_SHORTEDE.lto_priv.534>: 5adc: ff ff 54 4d 43 20 44 52 49 56 45 52 20 53 48 4f ..TMC DRIVER SHO 5aec: 52 54 45 44 00 RTED. 00005af1 <_ZN4MMU2L32MSG_TITLE_TMC_UNDERVOLTAGE_ERRORE.lto_priv.533>: 5af1: ff ff 54 4d 43 20 55 4e 44 45 52 56 4f 4c 54 41 ..TMC UNDERVOLTA 5b01: 47 45 20 45 52 52 00 GE ERR. 00005b08 <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_RESETE.lto_priv.532>: 5b08: ff ff 54 4d 43 20 44 52 49 56 45 52 20 52 45 53 ..TMC DRIVER RES 5b18: 45 54 00 ET. 00005b1b <_ZN4MMU2L26MSG_TITLE_TMC_DRIVER_ERRORE.lto_priv.531>: 5b1b: ff ff 54 4d 43 20 44 52 49 56 45 52 20 45 52 52 ..TMC DRIVER ERR 5b2b: 4f 52 00 OR. 00005b2e <_ZN4MMU2L28MSG_TITLE_TMC_OVERHEAT_ERRORE.lto_priv.530>: 5b2e: ff ff 54 4d 43 20 4f 56 45 52 48 45 41 54 20 45 ..TMC OVERHEAT E 5b3e: 52 52 4f 52 00 RROR. 00005b43 <_ZN4MMU2L33MSG_TITLE_TMC_WARNING_TMC_TOO_HOTE.lto_priv.529>: 5b43: ff ff 57 41 52 4e 49 4e 47 20 54 4d 43 20 54 4f ..WARNING TMC TO 5b53: 4f 20 48 4f 54 00 O HOT. 00005b59 <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_MOVEE.lto_priv.528>: 5b59: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 4d ..IDLER CANNOT M 5b69: 4f 56 45 00 OVE. 00005b6d <_ZN4MMU2L27MSG_TITLE_IDLER_CANNOT_HOMEE.lto_priv.527>: 5b6d: ff ff 49 44 4c 45 52 20 43 41 4e 4e 4f 54 20 48 ..IDLER CANNOT H 5b7d: 4f 4d 45 00 OME. 00005b81 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_MOVEE.lto_priv.526>: 5b81: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5b91: 54 20 4d 4f 56 45 00 T MOVE. 00005b98 <_ZN4MMU2L30MSG_TITLE_SELECTOR_CANNOT_HOMEE.lto_priv.525>: 5b98: ff ff 53 45 4c 45 43 54 4f 52 20 43 41 4e 4e 4f ..SELECTOR CANNO 5ba8: 54 20 48 4f 4d 45 00 T HOME. 00005baf <_ZN4MMU2L33MSG_TITLE_LOAD_TO_EXTRUDER_FAILEDE.lto_priv.524>: 5baf: ff ff 4c 4f 41 44 20 54 4f 20 45 58 54 52 2e 20 ..LOAD TO EXTR. 5bbf: 46 41 49 4c 45 44 00 FAILED. 00005bc6 <_ZN4MMU2L23MSG_TITLE_INSPECT_FINDAE.lto_priv.523>: 5bc6: ff ff 49 4e 53 50 45 43 54 20 46 49 4e 44 41 00 ..INSPECT FINDA. 00005bd6 <_ZN4MMU2L27MSG_TITLE_FSENSOR_TOO_EARLYE.lto_priv.522>: 5bd6: ff ff 46 53 45 4e 53 4f 52 20 54 4f 4f 20 45 41 ..FSENSOR TOO EA 5be6: 52 4c 59 00 RLY. 00005bea <_ZN4MMU2L28MSG_TITLE_PULLEY_CANNOT_MOVEE.lto_priv.521>: 5bea: ff ff 50 55 4c 4c 45 59 20 43 41 4e 4e 4f 54 20 ..PULLEY CANNOT 5bfa: 4d 4f 56 45 00 MOVE. 00005bff <_ZN4MMU2L32MSG_TITLE_FSENSOR_FILAMENT_STUCKE.lto_priv.520>: 5bff: ff ff 46 53 45 4e 53 4f 52 20 46 49 4c 2e 20 53 ..FSENSOR FIL. S 5c0f: 54 55 43 4b 00 TUCK. 00005c14 <_ZN4MMU2L31MSG_TITLE_FSENSOR_DIDNT_TRIGGERE.lto_priv.519>: 5c14: ff ff 46 53 45 4e 53 4f 52 20 44 49 44 4e 54 20 ..FSENSOR DIDNT 5c24: 54 52 49 47 47 2e 00 TRIGG.. 00005c2b <_ZN4MMU2L30MSG_TITLE_FINDA_FILAMENT_STUCKE.lto_priv.518>: 5c2b: ff ff 46 49 4e 44 41 20 46 49 4c 41 4d 2e 20 53 ..FINDA FILAM. S 5c3b: 54 55 43 4b 00 TUCK. 00005c40 <_ZN4MMU2L29MSG_TITLE_FINDA_DIDNT_TRIGGERE.lto_priv.517>: 5c40: ff ff 46 49 4e 44 41 20 44 49 44 4e 54 20 54 52 ..FINDA DIDNT TR 5c50: 49 47 47 45 52 00 IGGER. 00005c56 : 5c56: ff ff 43 75 74 20 66 69 6c 61 6d 65 6e 74 00 ..Cut filament. 00005c65 : 5c65: ff ff 45 6a 65 63 74 20 66 72 6f 6d 20 4d 4d 55 ..Eject from MMU ... 00005c76 : 5c76: ff ff 4c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 ..Loading filame 5c86: 6e 74 00 nt. 00005c89 : 5c89: ff ff 4d 4d 55 20 52 65 74 72 79 3a 20 52 65 73 ..MMU Retry: Res 5c99: 74 6f 72 69 6e 67 20 74 65 6d 70 65 72 61 74 75 toring temperatu 5ca9: 72 65 2e 2e 2e 00 re.... 00005caf : 5caf: ff ff 53 6f 72 74 69 6e 67 20 66 69 6c 65 73 00 ..Sorting files. 00005cbf : 5cbf: ff ff 53 6f 6d 65 20 66 69 6c 65 73 20 77 69 6c ..Some files wil 5ccf: 6c 20 6e 6f 74 20 62 65 20 73 6f 72 74 65 64 2e l not be sorted. 5cdf: 20 4d 61 78 2e 20 4e 6f 2e 20 6f 66 20 66 69 6c Max. No. of fil 5cef: 65 73 20 69 6e 20 31 20 66 6f 6c 64 65 72 20 66 es in 1 folder f 5cff: 6f 72 20 73 6f 72 74 69 6e 67 20 69 73 20 31 30 or sorting is 10 5d0f: 30 2e 00 0.. 00005d12 : 5d12: ff ff 75 6e 6b 6e 6f 77 6e 20 73 74 61 74 65 00 ..unknown state. 00005d22 : 5d22: ff ff 20 30 2e 34 20 6f 72 20 6e 65 77 65 72 00 .. 0.4 or newer. 00005d32 : 5d32: ff ff 20 30 2e 33 20 6f 72 20 6f 6c 64 65 72 00 .. 0.3 or older. 00005d42 : 5d42: ff ff 4f 66 66 00 ..Off. 00005d48 : 5d48: ff ff 4f 6e 00 ..On. 00005d4d : 5d4d: ff ff 55 6e 65 78 70 65 63 74 65 64 20 65 72 72 ..Unexpected err 5d5d: 6f 72 20 6f 63 63 75 72 72 65 64 2e 00 or occurred.. 00005d6a : 5d6a: ff ff 4d 36 30 30 20 46 69 6c 61 6d 65 6e 74 20 ..M600 Filament 5d7a: 43 68 61 6e 67 65 2e 20 4c 6f 61 64 20 61 20 6e Change. Load a n 5d8a: 65 77 20 66 69 6c 61 6d 65 6e 74 20 6f 72 20 65 ew filament or e 5d9a: 6a 65 63 74 20 74 68 65 20 6f 6c 64 20 6f 6e 65 ject the old one 5daa: 2e 00 .. 00005dac : 5dac: ff ff 52 65 6d 6f 76 65 20 74 68 65 20 65 6a 65 ..Remove the eje 5dbc: 63 74 65 64 20 66 69 6c 61 6d 65 6e 74 20 66 72 cted filament fr 5dcc: 6f 6d 20 74 68 65 20 66 72 6f 6e 74 20 6f 66 20 om the front of 5ddc: 74 68 65 20 4d 4d 55 2e 00 the MMU.. 00005de5 : 5de5: ff ff 46 69 6c 61 6d 65 6e 74 20 64 65 74 65 63 ..Filament detec 5df5: 74 65 64 20 75 6e 65 78 70 65 63 74 65 64 6c 79 ted unexpectedly 5e05: 2e 20 45 6e 73 75 72 65 20 6e 6f 20 66 69 6c 61 . Ensure no fila 5e15: 6d 65 6e 74 20 69 73 20 6c 6f 61 64 65 64 2e 20 ment is loaded. 5e25: 43 68 65 63 6b 20 74 68 65 20 73 65 6e 73 6f 72 Check the sensor 5e35: 73 20 61 6e 64 20 77 69 72 69 6e 67 2e 00 s and wiring.. 00005e43 : 5e43: ff ff 49 6e 74 65 72 6e 61 6c 20 72 75 6e 74 69 ..Internal runti 5e53: 6d 65 20 65 72 72 6f 72 2e 20 54 72 79 20 72 65 me error. Try re 5e63: 73 65 74 74 69 6e 67 20 74 68 65 20 4d 4d 55 20 setting the MMU 5e73: 6f 72 20 75 70 64 61 74 69 6e 67 20 74 68 65 20 or updating the 5e83: 66 69 72 6d 77 61 72 65 2e 00 firmware.. 00005e8d : 5e8d: ff ff 4d 4d 55 20 46 57 20 76 65 72 73 69 6f 6e ..MMU FW version 5e9d: 20 69 73 20 69 6e 63 6f 6d 70 61 74 69 62 6c 65 is incompatible 5ead: 20 77 69 74 68 20 70 72 69 6e 74 65 72 20 46 57 with printer FW 5ebd: 2e 55 70 64 61 74 65 20 74 6f 20 76 65 72 73 69 .Update to versi 5ecd: 6f 6e 20 33 2e 30 2e 33 2e 00 on 3.0.3.. 00005ed7 : 5ed7: ff ff 4d 4d 55 20 46 69 72 6d 77 61 72 65 20 69 ..MMU Firmware i 5ee7: 6e 74 65 72 6e 61 6c 20 65 72 72 6f 72 2c 20 70 nternal error, p 5ef7: 6c 65 61 73 65 20 72 65 73 65 74 20 74 68 65 20 lease reset the 5f07: 4d 4d 55 2e 00 MMU.. 00005f0c : 5f0c: ff ff 52 65 71 75 65 73 74 65 64 20 66 69 6c 61 ..Requested fila 5f1c: 6d 65 6e 74 20 74 6f 6f 6c 20 69 73 20 6e 6f 74 ment tool is not 5f2c: 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20 74 68 available on th 5f3c: 69 73 20 68 61 72 64 77 61 72 65 2e 20 43 68 65 is hardware. Che 5f4c: 63 6b 20 74 68 65 20 47 2d 63 6f 64 65 20 66 6f ck the G-code fo 5f5c: 72 20 74 6f 6f 6c 20 69 6e 64 65 78 20 6f 75 74 r tool index out 5f6c: 20 6f 66 20 72 61 6e 67 65 20 28 54 30 2d 54 34 of range (T0-T4 5f7c: 29 2e 00 ).. 00005f7f : 5f7f: ff ff 43 61 6e 6e 6f 74 20 70 65 72 66 6f 72 6d ..Cannot perform 5f8f: 20 74 68 65 20 61 63 74 69 6f 6e 2c 20 66 69 6c the action, fil 5f9f: 61 6d 65 6e 74 20 69 73 20 61 6c 72 65 61 64 79 ament is already 5faf: 20 6c 6f 61 64 65 64 2e 20 55 6e 6c 6f 61 64 20 loaded. Unload 5fbf: 69 74 20 66 69 72 73 74 2e 00 it first.. 00005fc9 : 5fc9: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 5fd9: 64 69 6e 67 20 63 6f 72 72 65 63 74 6c 79 2e 20 ding correctly. 5fe9: 43 68 65 63 6b 20 74 68 65 20 77 69 72 69 6e 67 Check the wiring 5ff9: 20 61 6e 64 20 63 6f 6e 6e 65 63 74 6f 72 73 2e and connectors. ... 0000600a : 600a: ff ff 4d 4d 55 20 6e 6f 74 20 72 65 73 70 6f 6e ..MMU not respon 601a: 64 69 6e 67 2e 20 43 68 65 63 6b 20 74 68 65 20 ding. Check the 602a: 77 69 72 69 6e 67 20 61 6e 64 20 63 6f 6e 6e 65 wiring and conne 603a: 63 74 6f 72 73 2e 00 ctors.. 00006041 : 6041: ff ff 4d 6f 72 65 20 64 65 74 61 69 6c 73 20 6f ..More details o 6051: 6e 6c 69 6e 65 2e 00 nline.. 00006058 : 6058: ff ff 54 68 65 20 49 64 6c 65 72 20 63 61 6e 6e ..The Idler cann 6068: 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 72 6c 79 ot home properly 6078: 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 6e 79 74 . Check for anyt 6088: 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 20 69 74 hing blocking it 6098: 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 s movement.. 000060a4 : 60a4: ff ff 43 61 6e 27 74 20 6d 6f 76 65 20 53 65 6c ..Can't move Sel 60b4: 65 63 74 6f 72 20 6f 72 20 49 64 6c 65 72 2e 00 ector or Idler.. 000060c4 : 60c4: ff ff 54 68 65 20 53 65 6c 65 63 74 6f 72 20 63 ..The Selector c 60d4: 61 6e 6e 6f 74 20 68 6f 6d 65 20 70 72 6f 70 65 annot home prope 60e4: 72 6c 79 2e 20 43 68 65 63 6b 20 66 6f 72 20 61 rly. Check for a 60f4: 6e 79 74 68 69 6e 67 20 62 6c 6f 63 6b 69 6e 67 nything blocking 6104: 20 69 74 73 20 6d 6f 76 65 6d 65 6e 74 2e 00 its movement.. 00006113 : 6113: ff ff 4c 6f 61 64 69 6e 67 20 74 6f 20 65 78 74 ..Loading to ext 6123: 72 75 64 65 72 20 66 61 69 6c 65 64 2e 20 49 6e ruder failed. In 6133: 73 70 65 63 74 20 74 68 65 20 66 69 6c 61 6d 65 spect the filame 6143: 6e 74 20 74 69 70 20 73 68 61 70 65 2e 20 52 65 nt tip shape. Re 6153: 66 69 6e 65 20 74 68 65 20 73 65 6e 73 6f 72 20 fine the sensor 6163: 63 61 6c 69 62 72 61 74 69 6f 6e 2c 20 69 66 20 calibration, if 6173: 6e 65 65 64 65 64 2e 00 needed.. 0000617b : 617b: ff ff 53 65 6c 65 63 74 6f 72 20 63 61 6e 27 74 ..Selector can't 618b: 20 6d 6f 76 65 20 64 75 65 20 74 6f 20 46 49 4e move due to FIN 619b: 44 41 20 64 65 74 65 63 74 69 6e 67 20 61 20 66 DA detecting a f 61ab: 69 6c 61 6d 65 6e 74 2e 20 4d 61 6b 65 20 73 75 ilament. Make su 61bb: 72 65 20 6e 6f 20 66 69 6c 61 6d 65 6e 74 20 69 re no filament i 61cb: 73 20 69 6e 20 53 65 6c 65 63 74 6f 72 20 61 6e s in Selector an 61db: 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 20 70 72 d FINDA works pr 61eb: 6f 70 65 72 6c 79 2e 00 operly.. 000061f3 : 61f3: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 6203: 72 20 74 72 69 67 67 65 72 65 64 20 74 6f 6f 20 r triggered too 6213: 65 61 72 6c 79 20 77 68 69 6c 65 20 6c 6f 61 64 early while load 6223: 69 6e 67 20 74 6f 20 65 78 74 72 75 64 65 72 2e ing to extruder. 6233: 20 43 68 65 63 6b 20 74 68 65 72 65 20 69 73 6e Check there isn 6243: 27 74 20 61 6e 79 74 68 69 6e 67 20 73 74 75 63 't anything stuc 6253: 6b 20 69 6e 20 50 54 46 45 20 74 75 62 65 2e 20 k in PTFE tube. 6263: 43 68 65 63 6b 20 74 68 61 74 20 73 65 6e 73 6f Check that senso 6273: 72 20 72 65 61 64 73 20 70 72 6f 70 65 72 6c 79 r reads properly 6283: 2e 00 .. 00006285 : 6285: ff ff 50 75 6c 6c 65 79 20 6d 6f 74 6f 72 20 73 ..Pulley motor s 6295: 74 61 6c 6c 65 64 2e 20 45 6e 73 75 72 65 20 74 talled. Ensure t 62a5: 68 65 20 70 75 6c 6c 65 79 20 63 61 6e 20 6d 6f he pulley can mo 62b5: 76 65 20 61 6e 64 20 63 68 65 63 6b 20 74 68 65 ve and check the 62c5: 20 77 69 72 69 6e 67 2e 00 wiring.. 000062ce : 62ce: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 62de: 72 20 64 69 64 6e 27 74 20 73 77 69 74 63 68 20 r didn't switch 62ee: 6f 66 66 20 77 68 69 6c 65 20 75 6e 6c 6f 61 64 off while unload 62fe: 69 6e 67 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e ing filament. En 630e: 73 75 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 sure filament ca 631e: 6e 20 6d 6f 76 65 20 61 6e 64 20 74 68 65 20 73 n move and the s 632e: 65 6e 73 6f 72 20 77 6f 72 6b 73 2e 00 ensor works.. 0000633b : 633b: ff ff 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f ..Filament senso 634b: 72 20 64 69 64 6e 27 74 20 74 72 69 67 67 65 72 r didn't trigger 635b: 20 77 68 69 6c 65 20 6c 6f 61 64 69 6e 67 20 74 while loading t 636b: 68 65 20 66 69 6c 61 6d 65 6e 74 2e 20 45 6e 73 he filament. Ens 637b: 75 72 65 20 74 68 65 20 73 65 6e 73 6f 72 20 69 ure the sensor i 638b: 73 20 63 61 6c 69 62 72 61 74 65 64 20 61 6e 64 s calibrated and 639b: 20 74 68 65 20 66 69 6c 61 6d 65 6e 74 20 72 65 the filament re 63ab: 61 63 68 65 64 20 69 74 2e 00 ached it.. 000063b5 : 63b5: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 73 ..FINDA didn't s 63c5: 77 69 74 63 68 20 6f 66 66 20 77 68 69 6c 65 20 witch off while 63d5: 75 6e 6c 6f 61 64 69 6e 67 20 66 69 6c 61 6d 65 unloading filame 63e5: 6e 74 2e 20 54 72 79 20 75 6e 6c 6f 61 64 69 6e nt. Try unloadin 63f5: 67 20 6d 61 6e 75 61 6c 6c 79 2e 20 45 6e 73 75 g manually. Ensu 6405: 72 65 20 66 69 6c 61 6d 65 6e 74 20 63 61 6e 20 re filament can 6415: 6d 6f 76 65 20 61 6e 64 20 46 49 4e 44 41 20 77 move and FINDA w 6425: 6f 72 6b 73 2e 00 orks.. 0000642b : 642b: ff ff 46 49 4e 44 41 20 64 69 64 6e 27 74 20 74 ..FINDA didn't t 643b: 72 69 67 67 65 72 20 77 68 69 6c 65 20 6c 6f 61 rigger while loa 644b: 64 69 6e 67 20 74 68 65 20 66 69 6c 61 6d 65 6e ding the filamen 645b: 74 2e 20 45 6e 73 75 72 65 20 74 68 65 20 66 69 t. Ensure the fi 646b: 6c 61 6d 65 6e 74 20 63 61 6e 20 6d 6f 76 65 20 lament can move 647b: 61 6e 64 20 46 49 4e 44 41 20 77 6f 72 6b 73 2e and FINDA works. ... 0000648c : 648c: ff ff 44 69 73 61 62 6c 65 00 ..Disable. 00006496 : 6496: ff ff 53 74 6f 70 00 ..Stop. 0000649d : 649d: ff ff 4c 6f 61 64 00 ..Load. 000064a4 : 64a4: ff ff 55 6e 6c 6f 61 64 00 ..Unload. 000064ad : 64ad: ff ff 52 65 73 65 74 4d 4d 55 00 ..ResetMMU. 000064b8 : 64b8: ff ff 52 65 74 72 79 00 ..Retry. 000064c0 : 64c0: ff ff 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 ..Bed leveling f 64d0: 61 69 6c 65 64 2e 20 53 65 6e 73 6f 72 20 64 69 ailed. Sensor di 64e0: 64 6e 27 74 20 74 72 69 67 67 65 72 2e 20 44 65 dn't trigger. De 64f0: 62 72 69 73 20 6f 6e 20 6e 6f 7a 7a 6c 65 3f 20 bris on nozzle? 6500: 57 61 69 74 69 6e 67 20 66 6f 72 20 72 65 73 65 Waiting for rese 6510: 74 2e 00 t.. 00006513 : 6513: ff ff 53 65 6e 73 69 74 69 76 69 74 79 00 ..Sensitivity. 00006521 : 6521: ff ff 44 6f 6e 65 00 ..Done. 00006528 : 6528: ff ff 52 65 63 6f 76 65 72 69 6e 67 20 70 72 69 ..Recovering pri 6538: 6e 74 00 nt. 0000653b <__loc_pri_end>: 653b: 65 6e ori r22, 0xE5 ; 229 653d: 71 75 andi r23, 0x51 ; 81 653f: 65 69 ori r22, 0x95 ; 149 6541: 6e 67 ori r22, 0x7E ; 126 6543: 20 22 and r2, r16 ... 00006546 : 6546: 44 6f 6e 65 20 70 72 69 6e 74 69 6e 67 20 66 69 Done printing fi 6556: 6c 65 00 le. 00006559 : 6559: 4e 6f 20 4c 69 6e 65 20 4e 75 6d 62 65 72 20 77 No Line Number w 6569: 69 74 68 20 63 68 65 63 6b 73 75 6d 2c 20 4c 61 ith checksum, La 6579: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 00006583 : 6583: 4e 6f 20 43 68 65 63 6b 73 75 6d 20 77 69 74 68 No Checksum with 6593: 20 6c 69 6e 65 20 6e 75 6d 62 65 72 2c 20 4c 61 line number, La 65a3: 73 74 20 4c 69 6e 65 3a 20 00 st Line: . 000065ad : 65ad: 63 68 65 63 6b 73 75 6d 20 6d 69 73 6d 61 74 63 checksum mismatc 65bd: 68 2c 20 4c 61 73 74 20 4c 69 6e 65 3a 20 00 h, Last Line: . 000065cc : 65cc: 4c 69 6e 65 20 4e 75 6d 62 65 72 20 69 73 20 6e Line Number is n 65dc: 6f 74 20 4c 61 73 74 20 4c 69 6e 65 20 4e 75 6d ot Last Line Num 65ec: 62 65 72 2b 31 2c 20 4c 61 73 74 20 4c 69 6e 65 ber+1, Last Line 65fc: 3a 20 00 : . 000065ff : 65ff: 25 6c 75 20 62 79 74 65 73 20 77 72 69 74 74 65 %lu bytes writte 660f: 6e 20 74 6f 20 25 53 20 61 74 20 61 64 64 72 65 n to %S at addre 661f: 73 73 20 30 78 25 30 34 6c 78 0a 00 ss 0x%04lx.. 0000662b : 662b: 44 25 64 20 2d 20 52 65 61 64 2f 57 72 69 74 65 D%d - Read/Write 663b: 20 25 53 0a 00 %S.. 00006640 <__c.2368>: 6640: 3f 3f 00 ??. 00006643 <__c.2366>: 6643: 52 6f 6d 61 6e 61 00 Romana. 0000664a <__c.2363>: 664a: 48 72 76 61 74 73 6b 69 00 Hrvatski. 00006653 <__c.2360>: 6653: 4d 61 67 79 61 72 00 Magyar. 0000665a <__c.2357>: 665a: 53 6c 6f 76 65 6e 63 69 6e 61 00 Slovencina. 00006665 <__c.2354>: 6665: 4e 6f 72 73 6b 00 Norsk. 0000666b <__c.2351>: 666b: 53 76 65 6e 73 6b 61 00 Svenska. 00006673 <__c.2348>: 6673: 4e 65 64 65 72 6c 61 6e 64 73 00 Nederlands. 0000667e <__c.2345>: 667e: 50 6f 6c 73 6b 69 00 Polski. 00006685 <__c.2342>: 6685: 49 74 61 6c 69 61 6e 6f 00 Italiano. 0000668e <__c.2339>: 668e: 46 72 61 6e 63 61 69 73 00 Francais. 00006697 <__c.2336>: 6697: 45 73 70 61 6e 6f 6c 00 Espanol. 0000669f <__c.2333>: 669f: 44 65 75 74 73 63 68 00 Deutsch. 000066a7 <__c.2330>: 66a7: 43 65 73 74 69 6e 61 00 Cestina. 000066af <__c.2327>: 66af: 45 6e 67 6c 69 73 68 00 English. 000066b7 : 66b7: 20 43 6f 75 6e 74 20 58 3a 20 00 Count X: . 000066c2 : 66c2: 45 30 3a 25 64 20 52 50 4d 20 50 52 4e 31 3a 25 E0:%d RPM PRN1:% 66d2: 64 20 52 50 4d 20 45 30 40 3a 25 75 20 50 52 4e d RPM E0@:%u PRN 66e2: 31 40 3a 25 75 0a 00 1@:%u.. 000066e9 : 66e9: 52 65 73 65 6e 64 00 Resend. 000066f0 : 66f0: 25 53 3a 20 25 6c 64 0a 25 53 0a 00 %S: %ld.%S.. 000066fc : 66fc: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 69 66 69 63 //action:notific 670c: 61 74 69 6f 6e 20 25 53 0a 00 ation %S.. 00006716 : 6716: 46 69 6c 61 6d 65 6e 74 20 72 75 6e 6f 75 74 20 Filament runout 6726: 64 65 74 65 63 74 65 64 21 00 detected!. 00006730 : 6730: 50 72 69 6e 74 65 72 20 73 74 6f 70 70 65 64 20 Printer stopped 6740: 64 75 65 20 74 6f 20 65 72 72 6f 72 73 2e 20 53 due to errors. S 6750: 75 70 65 72 76 69 73 69 6f 6e 20 72 65 71 75 69 upervision requi 6760: 72 65 64 2e 00 red.. 00006765 : 6765: 64 75 6d 70 20 63 6c 65 61 72 65 64 0a 00 dump cleared.. 00006773 : 6773: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 6783: 65 0a 00 e.. 00006786 : 6786: 44 32 31 20 2d 20 72 65 61 64 20 63 72 61 73 68 D21 - read crash 6796: 20 64 75 6d 70 0a 00 dump.. 0000679d : 679d: 6e 6f 20 64 75 6d 70 20 61 76 61 69 6c 61 62 6c no dump availabl 67ad: 65 0a 00 e.. 000067b0 : 67b0: 64 75 6d 70 20 63 6f 6d 70 6c 65 74 65 64 20 69 dump completed i 67c0: 6e 20 25 6c 75 6d 73 0a 00 n %lums.. 000067c9 : 67c9: 58 46 4c 41 53 48 00 XFLASH. 000067d0 : 67d0: 45 45 50 52 4f 4d 00 EEPROM. 000067d7 : 67d7: 53 52 41 4d 00 SRAM. 000067dc : 67dc: 44 2d 31 20 2d 20 45 6e 64 6c 65 73 73 20 6c 6f D-1 - Endless lo 67ec: 6f 70 0a 00 op.. 000067f0 : 67f0: 41 63 74 69 76 65 20 45 78 74 72 75 64 65 72 3a Active Extruder: 6800: 20 30 00 0. 00006803 : 6803: 49 6e 76 61 6c 69 64 20 65 78 74 72 75 64 65 72 Invalid extruder ... 00006814 : 6814: 74 6d 63 32 31 33 30 5f 70 72 69 6e 74 5f 63 75 tmc2130_print_cu 6824: 72 72 65 6e 74 73 28 29 0a 09 48 09 52 0a 58 09 rrents()..H.R.X. 6834: 25 64 09 25 64 0a 59 09 25 64 09 25 64 0a 5a 09 %d.%d.Y.%d.%d.Z. 6844: 25 64 09 25 64 0a 45 09 25 64 09 25 64 0a 00 %d.%d.E.%d.%d.. 00006853 : 6853: 53 44 20 70 72 69 6e 74 69 6e 67 20 62 79 74 65 SD printing byte 6863: 20 00 . 00006865 : 6865: 55 6e 6b 6e 6f 77 6e 20 63 6f 6d 6d 61 6e 64 3a Unknown command: 6875: 20 22 00 ". 00006878 <_ZZ16process_commandsvE3__c__65_>: 6878: 4d 32 30 30 20 49 6e 76 61 6c 69 64 20 65 78 74 M200 Invalid ext 6888: 72 75 64 65 72 20 00 ruder . 0000688f : 688f: 7a 5f 6d 61 78 3a 20 00 z_max: . 00006897 : 6897: 7a 5f 6d 69 6e 3a 20 00 z_min: . 0000689f <_ZZ16process_commandsvE3__c__64_>: 689f: 79 5f 6d 61 78 3a 20 00 y_max: . 000068a7 <_ZZ16process_commandsvE3__c__63_>: 68a7: 79 5f 6d 69 6e 3a 20 00 y_min: . 000068af <_ZZ16process_commandsvE3__c__62_>: 68af: 78 5f 6d 61 78 3a 20 00 x_max: . 000068b7 : 68b7: 54 52 49 47 47 45 52 45 44 00 TRIGGERED. 000068c1 : 68c1: 6f 70 65 6e 00 open. 000068c6 <_ZZ16process_commandsvE3__c__61_>: 68c6: 78 5f 6d 69 6e 3a 20 00 x_min: . 000068ce <_ZZ16process_commandsvE3__c__60_>: 68ce: 52 65 70 6f 72 74 69 6e 67 20 65 6e 64 73 74 6f Reporting endsto 68de: 70 20 73 74 61 74 75 73 00 p status. 000068e7 : 68e7: 4d 31 31 32 20 63 61 6c 6c 65 64 2e 20 45 6d 65 M112 called. Eme 68f7: 72 67 65 6e 63 79 20 53 74 6f 70 2e 00 rgency Stop.. 00006904 : 6904: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 72 65 //action:uvlo_re 6914: 63 6f 76 65 72 79 5f 72 65 61 64 79 00 covery_ready. 00006921 : 6921: 2f 2f 61 63 74 69 6f 6e 3a 75 76 6c 6f 5f 61 75 //action:uvlo_au 6931: 74 6f 5f 72 65 63 6f 76 65 72 79 5f 72 65 61 64 to_recovery_read 6941: 79 00 y. 00006943 <_ZZ16process_commandsvE3__c__46_>: 6943: 25 53 3a 25 6c 75 20 63 6d 0a 25 53 3a 25 6c 75 %S:%lu cm.%S:%lu 6953: 20 6d 69 6e 0a 00 min.. 00006959 <_ZZ16process_commandsvE3__c__45_>: 6959: 53 49 4c 45 4e 54 00 SILENT. 00006960 <_ZZ16process_commandsvE3__c__44_>: 6960: 4e 4f 52 4d 41 4c 00 NORMAL. 00006967 <_ZZ16process_commandsvE3__c__43_>: 6967: 25 53 20 4d 4f 44 45 3a 20 50 65 72 63 65 6e 74 %S MODE: Percent 6977: 20 64 6f 6e 65 3a 20 25 68 68 64 3b 20 70 72 69 done: %hhd; pri 6987: 6e 74 20 74 69 6d 65 20 72 65 6d 61 69 6e 69 6e nt time remainin 6997: 67 20 69 6e 20 6d 69 6e 73 3a 20 25 64 3b 20 43 g in mins: %d; C 69a7: 68 61 6e 67 65 20 69 6e 20 6d 69 6e 73 3a 20 25 hange in mins: % 69b7: 64 0a 00 d.. 000069ba <_ZZ16process_commandsvE3__c__42_>: 69ba: 50 72 69 6e 74 65 72 53 74 61 74 65 3a 20 25 64 PrinterState: %d 69ca: 0a 00 .. 000069cc <_ZZ16process_commandsvE3__c__38_>: 69cc: 45 6e 64 20 66 69 6c 65 20 6c 69 73 74 00 End file list. 000069da <_ZZ16process_commandsvE3__c__37_>: 69da: 42 65 67 69 6e 20 66 69 6c 65 20 6c 69 73 74 00 Begin file list. 000069ea : 69ea: 55 6e 6b 6e 6f 77 6e 20 25 63 20 63 6f 64 65 3a Unknown %c code: 69fa: 20 25 73 0a 00 %s.. 000069ff <_ZZ16process_commandsvE3__c__35_>: 69ff: 0a 50 49 4e 44 41 20 74 65 6d 70 65 72 61 74 75 .PINDA temperatu 6a0f: 72 65 3a 20 25 2e 31 66 20 5a 20 73 68 69 66 74 re: %.1f Z shift 6a1f: 20 28 6d 6d 29 3a 20 25 2e 33 66 00 (mm): %.3f. 00006a2b <_ZZ16process_commandsvE3__c__34_>: 6a2b: 0a 53 74 65 70 3a 20 25 64 2f 36 0a 00 .Step: %d/6.. 00006a38 <_ZZ16process_commandsvE3__c__33_>: 6a38: 0a 53 74 65 70 3a 20 25 64 2f 36 20 28 73 6b 69 .Step: %d/6 (ski 6a48: 70 70 65 64 29 0a 50 49 4e 44 41 20 74 65 6d 70 pped).PINDA temp 6a58: 65 72 61 74 75 72 65 3a 20 25 64 20 5a 20 73 68 erature: %d Z sh 6a68: 69 66 74 20 28 6d 6d 29 3a 30 0a 00 ift (mm):0.. 00006a74 <_ZZ16process_commandsvE3__c__32_>: 6a74: 0a 5a 45 52 4f 3a 20 25 2e 33 66 0a 00 .ZERO: %.3f.. 00006a81 <_ZZ16process_commandsvE3__c__31_>: 6a81: 73 74 61 72 74 20 74 65 6d 70 65 72 61 74 75 72 start temperatur 6a91: 65 3a 20 25 2e 31 66 0a 00 e: %.1f.. 00006a9a <_ZZ16process_commandsvE3__c__28_>: 6a9a: 25 64 20 20 25 2e 32 66 00 %d %.2f. 00006aa3 <_ZZ16process_commandsvE3__c__27_>: 6aa3: 25 53 20 58 3a 20 25 2e 35 66 20 59 3a 20 25 2e %S X: %.5f Y: %. 6ab3: 35 66 20 5a 3a 20 25 2e 35 66 0a 00 5f Z: %.5f.. 00006abf <_ZZ16process_commandsvE3__c__26_>: 6abf: 53 6c 65 65 70 2e 2e 2e 00 Sleep.... 00006ac8 <_ZZ16process_commandsvE3__c__10_>: 6ac8: 45 30 3a 25 64 20 52 50 4d 0a 50 52 4e 30 3a 25 E0:%d RPM.PRN0:% 6ad8: 64 20 52 50 4d 0a 00 d RPM.. 00006adf : 6adf: 47 39 30 00 G90. 00006ae3 : 6ae3: 4d 31 30 37 00 M107. 00006ae8 : 6ae8: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 63 61 Thermal Model ca 6af8: 6c 2e 00 l.. 00006afb : 6afb: 45 72 72 3a 50 52 49 4e 54 20 46 41 4e 20 45 52 Err:PRINT FAN ER 6b0b: 52 4f 52 00 ROR. 00006b0f : 6b0f: 45 72 72 3a 48 4f 54 45 4e 44 20 46 41 4e 20 45 Err:HOTEND FAN E 6b1f: 52 52 4f 52 00 RROR. 00006b24 : 6b24: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 64 //action:resumed ... 00006b35 : 6b35: 2f 2f 61 63 74 69 6f 6e 3a 72 65 73 75 6d 65 00 //action:resume. 00006b45 : 6b45: 2f 2f 61 63 74 69 6f 6e 3a 72 65 61 64 79 00 //action:ready. 00006b54 : 6b54: 2f 2f 61 63 74 69 6f 6e 3a 6e 6f 74 5f 72 65 61 //action:not_rea 6b64: 64 79 00 dy. 00006b67 : 6b67: 2f 2f 61 63 74 69 6f 6e 3a 63 61 6e 63 65 6c 00 //action:cancel. 00006b77 : 6b77: 4d 38 34 00 M84. 00006b7b : 6b7b: 41 78 69 73 20 6c 65 6e 67 74 68 20 64 69 66 66 Axis length diff 6b8b: 65 72 65 6e 63 65 3a 25 2e 33 66 0a 00 erence:%.3f.. 00006b98 : 6b98: 4d 65 61 73 75 72 65 64 20 61 78 69 73 20 6c 65 Measured axis le 6ba8: 6e 67 74 68 3a 25 2e 33 66 0a 00 ngth:%.3f.. 00006bb3 : 6bb3: 4f 4b 00 OK. 00006bb6 : 6bb6: 4c 43 44 20 73 74 61 74 75 73 20 63 68 61 6e 67 LCD status chang 6bc6: 65 64 00 ed. 00006bc9 <_ZZN10CardReader7releaseEvE3__c.lto_priv.555>: 6bc9: 53 44 20 63 61 72 64 20 72 65 6c 65 61 73 65 64 SD card released ... 00006bda : 6bda: 46 61 6b 65 20 73 65 72 69 61 6c 20 6e 75 6d 62 Fake serial numb 6bea: 65 72 00 er. 00006bed : 6bed: 45 2d 63 6f 6f 6c 20 6d 6f 64 65 00 E-cool mode. 00006bf9 : 6bf9: 41 4c 54 46 41 4e 20 64 65 74 2e 00 ALTFAN det.. 00006c05 : 6c05: 2f 2f 61 63 74 69 6f 6e 3a 73 74 61 72 74 00 //action:start. 00006c14 : 6c14: 47 39 31 00 G91. 00006c18 : 6c18: 4d 37 30 32 00 M702. 00006c1d : 6c1d: 4d 38 33 00 M83. 00006c21 : 6c21: 47 32 38 20 57 00 G28 W. 00006c27 : 6c27: 4d 35 30 30 00 M500. 00006c2c : 6c2c: 45 78 74 65 72 6e 61 6c 20 53 50 49 20 66 6c 61 External SPI fla 6c3c: 73 68 0a 58 46 4c 41 53 48 20 69 73 20 6e 6f 74 sh.XFLASH is not 6c4c: 20 72 65 73 2d 0a 70 6f 6e 64 69 6e 67 2e 20 4c res-.ponding. L 6c5c: 61 6e 67 75 61 67 65 0a 73 77 69 74 63 68 20 75 anguage.switch u 6c6c: 6e 61 76 61 69 6c 61 62 6c 65 2e 00 navailable.. 00006c78 : 6c78: 58 46 4c 41 53 48 20 6e 6f 74 20 72 65 73 70 6f XFLASH not respo 6c88: 6e 64 69 6e 67 2e 00 nding.. 00006c8f : 6c8f: 46 57 20 63 72 61 73 68 20 64 65 74 65 63 74 65 FW crash detecte 6c9f: 64 21 20 59 6f 75 20 63 61 6e 20 63 6f 6e 74 69 d! You can conti 6caf: 6e 75 65 20 70 72 69 6e 74 69 6e 67 2e 20 44 65 nue printing. De 6cbf: 62 75 67 20 64 61 74 61 20 61 76 61 69 6c 61 62 bug data availab 6ccf: 6c 65 20 66 6f 72 20 61 6e 61 6c 79 73 69 73 2e le for analysis. 6cdf: 20 43 6f 6e 74 61 63 74 20 73 75 70 70 6f 72 74 Contact support 6cef: 20 74 6f 20 73 75 62 6d 69 74 20 64 65 74 61 69 to submit detai 6cff: 6c 73 2e 00 ls.. 00006d03 : 6d03: 2f 2f 61 63 74 69 6f 6e 3a 64 75 6d 70 5f 61 76 //action:dump_av 6d13: 61 69 6c 61 62 6c 65 00 ailable. 00006d1b <_ZZ5setupE3__c__14_>: 6d1b: 43 72 61 73 68 44 65 74 65 63 74 20 44 49 53 41 CrashDetect DISA 6d2b: 42 4c 45 44 00 BLED. 00006d30 <_ZZ5setupE3__c__13_>: 6d30: 43 72 61 73 68 44 65 74 65 63 74 20 45 4e 41 42 CrashDetect ENAB 6d40: 4c 45 44 21 00 LED!. 00006d45 <_ZZ5setupE3__c__10_>: 6d45: 48 6f 74 65 6e 64 20 66 61 6e 20 74 79 70 65 3a Hotend fan type: 6d55: 20 00 . 00006d57 : 6d57: 20 20 50 6c 61 6e 6e 65 72 42 75 66 66 65 72 42 PlannerBufferB 6d67: 79 74 65 73 3a 20 00 ytes: . 00006d6e : 6d6e: 20 46 72 65 65 20 4d 65 6d 6f 72 79 3a 20 00 Free Memory: . 00006d7d : 6d7d: 20 7c 20 41 75 74 68 6f 72 3a 20 00 | Author: . 00006d89 : 6d89: 20 4c 61 73 74 20 55 70 64 61 74 65 64 3a 20 00 Last Updated: . 00006d99 : 6d99: 20 53 6f 66 74 77 61 72 65 20 52 65 73 65 74 00 Software Reset. 00006da9 : 6da9: 20 57 61 74 63 68 64 6f 67 20 52 65 73 65 74 00 Watchdog Reset. 00006db9 : 6db9: 20 42 72 6f 77 6e 20 6f 75 74 20 52 65 73 65 74 Brown out Reset ... 00006dca : 6dca: 20 45 78 74 65 72 6e 61 6c 20 52 65 73 65 74 00 External Reset. 00006dda : 6dda: 50 6f 77 65 72 55 70 00 PowerUp. 00006de2 : 6de2: 65 72 72 6f 72 20 77 72 69 74 69 6e 67 20 74 6f error writing to 6df2: 20 66 69 6c 65 00 file. 00006df8 : 6df8: 44 6f 6e 65 20 73 61 76 69 6e 67 20 66 69 6c 65 Done saving file 6e08: 2e 00 .. 00006e0a : 6e0a: 6f 6b 00 ok. 00006e0d : 6e0d: 46 69 6c 61 6d 65 6e 74 00 Filament. 00006e16 : 6e16: 4d 65 61 73 75 72 65 64 20 73 6b 65 77 73 3a 20 Measured skews: 6e26: 25 66 20 25 66 0a 00 %f %f.. 00006e2d : 6e2d: 46 69 74 74 69 6e 67 20 66 61 69 6c 65 64 20 3d Fitting failed = 6e3d: 3e 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 > calibration fa 6e4d: 69 6c 65 64 2e 0a 00 iled... 00006e54 : 6e54: 43 61 6c 69 62 72 61 74 69 6f 6e 20 73 75 63 63 Calibration succ 6e64: 65 73 73 2e 0a 00 ess... 00006e6a : 6e6a: 41 6c 6c 20 34 20 63 61 6c 69 62 72 61 74 69 6f All 4 calibratio 6e7a: 6e 20 70 6f 69 6e 74 73 20 66 6f 75 6e 64 2e 0a n points found.. ... 00006e8b : 6e8b: 31 2f 34 00 1/4. 00006e8f : 6e8f: 31 2f 34 00 1/4. 00006e93 : 6e93: 31 2f 39 00 1/9. 00006e97 : 6e97: 54 4d 43 20 44 52 49 56 45 52 20 4f 56 45 52 54 TMC DRIVER OVERT 6ea7: 45 4d 50 00 EMP. 00006eab : 6eab: 48 6f 6c 64 20 63 75 72 72 65 6e 74 20 74 72 75 Hold current tru 6ebb: 6e 63 61 74 65 64 20 74 6f 20 52 75 6e 20 63 75 ncated to Run cu 6ecb: 72 72 65 6e 74 00 rrent. 00006ed1 : 6ed1: 25 63 25 33 64 2f 25 64 81 00 %c%3d/%d.. 00006edb : 6edb: 5a 25 36 2e 32 66 25 63 00 Z%6.2f%c. 00006ee4 : 6ee4: 5a 20 20 20 2d 2d 2d 20 00 Z --- . 00006eed : 6eed: 86 25 33 64 25 25 00 .%3d%%. 00006ef4 : 6ef4: 2d 2d 2d 25 25 00 ---%%. 00006efa : 6efa: 25 33 64 25 25 00 %3d%%. 00006f00 : 6f00: 20 53 44 00 SD. 00006f04 : 6f04: 20 20 20 00 . 00006f08 : 6f08: 20 48 4f 00 HO. 00006f0c : 6f0c: 87 25 33 75 68 20 25 63 25 63 00 .%3uh %c%c. 00006f17 : 6f17: 87 25 30 32 75 3a 25 30 32 75 25 63 25 63 00 .%02u:%02u%c%c. 00006f26 : 6f26: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 64 00 //action:paused. 00006f36 : 6f36: 2f 2f 61 63 74 69 6f 6e 3a 70 61 75 73 65 00 //action:pause. 00006f45 <_ZZL16lcd_support_menuvE3__c__17_>: 6f45: 44 75 6d 70 20 6d 65 6d 6f 72 79 00 Dump memory. 00006f51 : 6f51: 68 65 6c 70 2e 70 72 75 73 61 33 64 2e 63 6f 6d help.prusa3d.com ... 00006f62 : 6f62: 66 6f 72 75 6d 2e 70 72 75 73 61 33 64 2e 63 6f forum.prusa3d.co 6f72: 6d 00 m. 00006f74 : 6f74: 70 72 75 73 61 33 64 2e 63 6f 6d 00 prusa3d.com. 00006f80 : 6f80: 4d 37 30 31 00 M701. 00006f85 : 6f85: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6f95: 0a 25 31 30 6c 64 64 20 25 30 32 64 68 20 25 30 .%10ldd %02dh %0 6fa5: 32 64 6d 00 2dm. 00006fa9 : 6fa9: 25 53 3a 0a 25 31 38 2e 32 66 6d 20 0a 25 53 3a %S:.%18.2fm .%S: 6fb9: 0a 25 31 30 6c 64 68 20 25 30 32 64 6d 20 25 30 .%10ldh %02dm %0 6fc9: 32 64 73 00 2ds. 00006fcd : 6fcd: 25 36 2e 32 66 6d 6d 00 %6.2fmm. 00006fd5 : 6fd5: 25 53 0a 25 53 0a 25 53 3a 0a 25 53 3a 00 %S.%S.%S:.%S:. 00006fe3 : 6fe3: 25 33 2e 32 66 81 00 %3.2f.. 00006fea : 6fea: 25 2d 31 34 2e 31 34 53 3a 0a 25 53 0a 25 2d 31 %-14.14S:.%S.%-1 6ffa: 34 2e 31 34 53 3a 25 33 2e 32 66 81 0a 25 2d 31 4.14S:%3.2f..%-1 700a: 34 2e 31 34 53 3a 25 33 2e 32 66 81 00 4.14S:%3.2f.. 00007017 : 7017: 20 20 30 00 0. 0000701b : 701b: 20 20 31 00 1. 0000701f : 701f: 46 49 4e 44 41 00 FINDA. 00007025 : 7025: 50 49 4e 44 41 00 PINDA. 0000702b : 702b: 57 69 7a 61 72 64 20 65 6e 64 20 73 74 61 74 65 Wizard end state 703b: 3a 20 25 64 0a 00 : %d.. 00007041 : 7041: 53 70 6f 6f 6c 4a 6f 69 6e 00 SpoolJoin. 0000704b : 704b: 46 69 72 6d 77 61 72 65 00 Firmware. 00007054 : 7054: 48 42 65 64 20 6f 6e 20 6c 6f 61 64 00 HBed on load. 00007061 : 7061: 46 6c 61 73 68 41 69 72 00 FlashAir. 0000706a : 706a: 50 72 75 73 61 20 4d 4b 33 53 2b 52 48 46 36 30 Prusa MK3S+RHF60 707a: 20 4f 4b 2e 00 OK.. 0000707f : 707f: 4d 36 30 30 00 M600. 00007084 : 7084: 53 44 20 63 61 72 64 20 6f 6b 00 SD card ok. 0000708f : 708f: 6f 70 65 6e 52 6f 6f 74 20 66 61 69 6c 65 64 00 openRoot failed. 0000709f : 709f: 76 6f 6c 75 6d 65 2e 69 6e 69 74 20 66 61 69 6c volume.init fail 70af: 65 64 00 ed. 000070b2 : 70b2: 53 44 20 69 6e 69 74 20 66 61 69 6c 00 SD init fail. 000070bf : 70bf: 6f 70 65 6e 20 66 61 69 6c 65 64 2c 20 46 69 6c open failed, Fil 70cf: 65 3a 20 00 e: . 000070d3 : 70d3: 43 61 6e 6e 6f 74 20 65 6e 74 65 72 20 73 75 62 Cannot enter sub 70e3: 64 69 72 3a 20 00 dir: . 000070e9 : 70e9: 4d 32 34 00 M24. 000070ed : 70ed: 4d 32 33 20 25 73 00 M23 %s. 000070f4 : 70f4: 31 2f 39 00 1/9. 000070f8 : 70f8: 88 00 .. 000070fa : 70fa: 20 74 6f 6f 20 6c 6f 6e 67 20 65 78 74 72 75 73 too long extrus 710a: 69 6f 6e 20 70 72 65 76 65 6e 74 65 64 00 ion prevented. 00007118 : 7118: 20 63 6f 6c 64 20 65 78 74 72 75 73 69 6f 6e 20 cold extrusion 7128: 70 72 65 76 65 6e 74 65 64 00 prevented. 00007132 : 7132: 4d 6f 76 65 20 61 62 6f 72 74 65 64 00 Move aborted. 0000713f : 713f: 50 4f 57 45 52 20 50 41 4e 49 43 20 44 45 54 45 POWER PANIC DETE 714f: 43 54 45 44 00 CTED. 00007154 : 7154: 55 56 4c 4f 20 2d 20 65 6e 64 20 25 64 0a 00 UVLO - end %d.. 00007163 : 7163: 55 56 4c 4f 5f 54 49 4e 59 20 2d 20 65 6e 64 20 UVLO_TINY - end 7173: 25 64 0a 00 %d.. 00007177 : 7177: 77 6f 72 6c 64 20 63 6f 6f 72 64 69 6e 61 74 65 world coordinate 7187: 73 3a 20 28 25 2e 33 66 2c 20 25 2e 33 66 2c 20 s: (%.3f, %.3f, 7197: 25 2e 33 66 29 0a 00 %.3f).. 0000719e : 719e: 4d 32 32 30 20 53 25 64 00 M220 S%d. 000071a7 : 71a7: 44 6f 6e 65 20 72 65 61 64 69 6e 67 20 45 45 50 Done reading EEP 71b7: 52 4f 4d 0a 00 ROM.. 000071bc : 71bc: 54 65 6d 70 65 72 61 74 75 72 65 20 52 65 73 74 Temperature Rest 71cc: 6f 72 65 64 0a 00 ored.. 000071d2 : 71d2: 47 31 20 45 25 2d 2e 33 66 20 46 32 37 30 30 00 G1 E%-.3f F2700. 000071e2 <__noloc_end>: 71e2: 08 4a sbci r16, 0xA8 ; 168 71e4: d7 3b cpi r29, 0xB7 ; 183 71e6: 3b ce rjmp .-906 ; 0x6e5e 71e8: 01 6e ori r16, 0xE1 ; 225 71ea: 84 bc out 0x24, r8 ; 36 71ec: bf fd .word 0xfdbf ; ???? 71ee: c1 2f mov r28, r17 71f0: 3d 6c ori r19, 0xCD ; 205 71f2: 74 31 cpi r23, 0x14 ; 20 71f4: 9a bd out 0x2a, r25 ; 42 71f6: 56 83 std Z+6, r21 ; 0x06 71f8: 3d da rcall .-2950 ; 0x6674 <__c.2348+0x1> 71fa: 3d 00 .word 0x003d ; ???? 71fc: c7 7f andi r28, 0xF7 ; 247 71fe: 11 be out 0x31, r1 ; 49 7200: d9 e4 ldi r29, 0x49 ; 73 7202: bb 4c sbci r27, 0xCB ; 203 7204: 3e 91 ld r19, -X 7206: 6b aa std Y+51, r6 ; 0x33 7208: aa be out 0x3a, r10 ; 58 720a: 00 00 nop 720c: 00 80 ld r0, Z 720e: 3f 05 cpc r19, r15 7210: a8 4c sbci r26, 0xC8 ; 200 7212: cd b2 in r12, 0x1d ; 29 7214: d4 4e sbci r29, 0xE4 ; 228 7216: b9 38 cpi r27, 0x89 ; 137 7218: 36 a9 ldd r19, Z+54 ; 0x36 721a: 02 0c add r0, r2 721c: 50 b9 out 0x00, r21 ; 0 721e: 91 86 std Z+9, r9 ; 0x09 7220: 88 08 sbc r8, r8 7222: 3c a6 std Y+44, r3 ; 0x2c 7224: aa aa std Y+50, r10 ; 0x32 7226: 2a be out 0x3a, r2 ; 58 7228: 00 00 nop 722a: 00 80 ld r0, Z 722c: 3f 07 cpc r19, r31 722e: 63 42 sbci r22, 0x23 ; 35 7230: 36 b7 in r19, 0x36 ; 54 7232: 9b d8 rcall .-3786 ; 0x636a 7234: a7 1a sub r10, r23 7236: 39 68 ori r19, 0x89 ; 137 7238: 56 18 sub r5, r6 723a: ae ba out 0x1e, r10 ; 30 723c: ab 55 subi r26, 0x5B ; 91 723e: 8c 1d adc r24, r12 7240: 3c b7 in r19, 0x3c ; 60 7242: cc 57 subi r28, 0x7C ; 124 7244: 63 bd out 0x23, r22 ; 35 7246: 6d ed ldi r22, 0xDD ; 221 7248: fd 75 andi r31, 0x5D ; 93 724a: 3e f6 brtc .-114 ; 0x71da 724c: 17 72 andi r17, 0x27 ; 39 724e: 31 bf out 0x31, r19 ; 49 7250: 00 00 nop 7252: 00 80 ld r0, Z 7254: 3f 08 sbc r3, r15 7256: 00 00 nop 7258: 00 be out 0x30, r0 ; 48 725a: 92 24 eor r9, r2 725c: 49 12 cpse r4, r25 725e: 3e ab std Y+54, r19 ; 0x36 7260: aa aa std Y+50, r10 ; 0x32 7262: 2a be out 0x3a, r2 ; 58 7264: cd cc rjmp .-1638 ; 0x6c00 7266: cc 4c sbci r28, 0xCC ; 204 7268: 3e 00 .word 0x003e ; ???? 726a: 00 00 nop 726c: 80 be out 0x30, r8 ; 48 726e: ab aa std Y+51, r10 ; 0x33 7270: aa aa std Y+50, r10 ; 0x32 7272: 3e 00 .word 0x003e ; ???? 7274: 00 00 nop 7276: 00 bf out 0x30, r16 ; 48 7278: 00 00 nop 727a: 00 80 ld r0, Z 727c: 3f 00 .word 0x003f ; ???? 727e: 00 00 nop 7280: 00 00 nop 7282: 08 41 sbci r16, 0x18 ; 24 7284: 78 d3 rcall .+1776 ; 0x7976 7286: bb 43 sbci r27, 0x3B ; 59 7288: 87 d1 rcall .+782 ; 0x7598 <__trampolines_start+0x2e8> 728a: 13 3d cpi r17, 0xD3 ; 211 728c: 19 0e add r1, r25 728e: 3c c3 rjmp .+1656 ; 0x7908 7290: bd 42 sbci r27, 0x2D ; 45 7292: 82 ad ldd r24, Z+58 ; 0x3a 7294: 2b 3e cpi r18, 0xEB ; 235 7296: 68 ec ldi r22, 0xC8 ; 200 7298: 82 76 andi r24, 0x62 ; 98 729a: be d9 rcall .-3204 ; 0x6618 729c: 8f e1 ldi r24, 0x1F ; 31 729e: a9 3e cpi r26, 0xE9 ; 233 72a0: 4c 80 ldd r4, Y+4 ; 0x04 72a2: ef ff .word 0xffef ; ???? 72a4: be 01 movw r22, r28 72a6: c4 ff sbrs r28, 4 72a8: 7f 3f cpi r23, 0xFF ; 255 72aa: 00 00 nop 72ac: 00 00 nop ... 000072b0 <__trampolines_start>: 72b0: 0c 94 b0 cf jmp 0x19f60 ; 0x19f60 72b4: 0c 94 e7 cf jmp 0x19fce ; 0x19fce 72b8: 0d 94 00 d2 jmp 0x3a400 ; 0x3a400 72bc: 0d 94 07 2f jmp 0x25e0e ; 0x25e0e 72c0: 0d 94 7c 1e jmp 0x23cf8 ; 0x23cf8 72c4: 0d 94 82 6a jmp 0x2d504 ; 0x2d504 72c8: 0c 94 bd cf jmp 0x19f7a ; 0x19f7a 72cc: 0d 94 f3 25 jmp 0x24be6 ; 0x24be6 72d0: 0d 94 fd 99 jmp 0x333fa ; 0x333fa 72d4: 0c 94 fb d8 jmp 0x1b1f6 ; 0x1b1f6 72d8: 0d 94 0f 12 jmp 0x2241e ; 0x2241e 72dc: 0d 94 ab 28 jmp 0x25156 ; 0x25156 72e0: 0d 94 f1 07 jmp 0x20fe2 ; 0x20fe2 72e4: 0d 94 2a 15 jmp 0x22a54 ; 0x22a54 72e8: 0d 94 6f 41 jmp 0x282de ; 0x282de 72ec: 0d 94 4c 07 jmp 0x20e98 ; 0x20e98 72f0: 0d 94 97 3f jmp 0x27f2e ; 0x27f2e 72f4: 0d 94 53 67 jmp 0x2cea6 ; 0x2cea6 72f8: 0d 94 76 69 jmp 0x2d2ec ; 0x2d2ec 72fc: 0c 94 80 d2 jmp 0x1a500 ; 0x1a500 7300: 0d 94 10 2f jmp 0x25e20 ; 0x25e20 7304: 0c 94 8b d0 jmp 0x1a116 ; 0x1a116 7308: 0d 94 c2 66 jmp 0x2cd84 ; 0x2cd84 730c: 0d 94 12 67 jmp 0x2ce24 ; 0x2ce24 7310: 0c 94 2e d4 jmp 0x1a85c ; 0x1a85c () [clone .lto_priv.447]> 7314: 0d 94 fe 24 jmp 0x249fc ; 0x249fc 7318: 0d 94 f9 cf jmp 0x39ff2 ; 0x39ff2 <_menu_edit_P()> 731c: 0d 94 50 30 jmp 0x260a0 ; 0x260a0 7320: 0d 94 c1 07 jmp 0x20f82 ; 0x20f82 7324: 0c 94 24 d8 jmp 0x1b048 ; 0x1b048 7328: 0d 94 a2 59 jmp 0x2b344 ; 0x2b344 732c: 0c 94 be d6 jmp 0x1ad7c ; 0x1ad7c 7330: 0c 94 53 e0 jmp 0x1c0a6 ; 0x1c0a6 7334: 0d 94 c4 07 jmp 0x20f88 ; 0x20f88 7338: 0d 94 59 6f jmp 0x2deb2 ; 0x2deb2 733c: 0c 94 61 d2 jmp 0x1a4c2 ; 0x1a4c2 7340: 0d 94 30 23 jmp 0x24660 ; 0x24660 7344: 0c 94 26 e0 jmp 0x1c04c ; 0x1c04c 7348: 0d 94 20 9a jmp 0x33440 ; 0x33440 734c: 0d 94 c1 33 jmp 0x26782 ; 0x26782 7350: 0d 94 f4 24 jmp 0x249e8 ; 0x249e8 7354: 0d 94 9c 66 jmp 0x2cd38 ; 0x2cd38 7358: 0d 94 72 6a jmp 0x2d4e4 ; 0x2d4e4 735c: 0d 94 f2 22 jmp 0x245e4 ; 0x245e4 7360: 0c 94 85 d0 jmp 0x1a10a ; 0x1a10a 7364: 0d 94 a8 69 jmp 0x2d350 ; 0x2d350 7368: 0c 94 1a d4 jmp 0x1a834 ; 0x1a834 () [clone .lto_priv.451]> 736c: 0d 94 47 6a jmp 0x2d48e ; 0x2d48e 7370: 0d 94 fe 41 jmp 0x283fc ; 0x283fc 7374: 0c 94 70 d7 jmp 0x1aee0 ; 0x1aee0 7378: 0c 94 fd d2 jmp 0x1a5fa ; 0x1a5fa 737c: 0d 94 51 27 jmp 0x24ea2 ; 0x24ea2 7380: 0d 94 8a 6a jmp 0x2d514 ; 0x2d514 7384: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 7388: 0d 94 e2 07 jmp 0x20fc4 ; 0x20fc4 738c: 0d 94 89 2a jmp 0x25512 ; 0x25512 7390: 0d 94 ce 66 jmp 0x2cd9c ; 0x2cd9c 7394: 0d 94 07 10 jmp 0x2200e ; 0x2200e 7398: 0c 94 e4 df jmp 0x1bfc8 ; 0x1bfc8 739c: 0d 94 1f 2d jmp 0x25a3e ; 0x25a3e 73a0: 0d 94 9f 67 jmp 0x2cf3e ; 0x2cf3e 73a4: 0c 94 d5 df jmp 0x1bfaa ; 0x1bfaa 73a8: 0d 94 c7 07 jmp 0x20f8e ; 0x20f8e 73ac: 0d 94 8e 27 jmp 0x24f1c ; 0x24f1c 73b0: 0c 94 b5 d8 jmp 0x1b16a ; 0x1b16a 73b4: 0d 94 1f 0f jmp 0x21e3e ; 0x21e3e 73b8: 0d 94 16 15 jmp 0x22a2c ; 0x22a2c 73bc: 0d 94 e8 25 jmp 0x24bd0 ; 0x24bd0 73c0: 0d 94 4d 24 jmp 0x2489a ; 0x2489a 73c4: 0c 94 67 e0 jmp 0x1c0ce ; 0x1c0ce 73c8: 0d 94 c5 3d jmp 0x27b8a ; 0x27b8a 73cc: 0d 94 fd 28 jmp 0x251fa ; 0x251fa 73d0: 0c 94 c1 cf jmp 0x19f82 ; 0x19f82 73d4: 0d 94 4f 67 jmp 0x2ce9e ; 0x2ce9e 73d8: 0d 94 cb 41 jmp 0x28396 ; 0x28396 73dc: 0d 94 70 07 jmp 0x20ee0 ; 0x20ee0 73e0: 0d 94 20 a0 jmp 0x34040 ; 0x34040 73e4: 0c 94 29 75 jmp 0xea52 ; 0xea52 <__vector_23+0xa4> 73e8: 0d 94 61 67 jmp 0x2cec2 ; 0x2cec2 73ec: 0d 94 69 2d jmp 0x25ad2 ; 0x25ad2 73f0: 0c 94 e2 cf jmp 0x19fc4 ; 0x19fc4 73f4: 0c 94 15 d4 jmp 0x1a82a ; 0x1a82a () [clone .lto_priv.452]> 73f8: 0c 94 ee 77 jmp 0xefdc ; 0xefdc 73fc: 0d 94 a3 27 jmp 0x24f46 ; 0x24f46 7400: 0d 94 b4 6f jmp 0x2df68 ; 0x2df68 7404: 0d 94 3a 28 jmp 0x25074 ; 0x25074 7408: 0d 94 d8 66 jmp 0x2cdb0 ; 0x2cdb0 740c: 0c 94 cf cf jmp 0x19f9e ; 0x19f9e 7410: 0d 94 64 27 jmp 0x24ec8 ; 0x24ec8 7414: 0c 94 0b d4 jmp 0x1a816 ; 0x1a816 () [clone .lto_priv.454]> 7418: 0d 94 a4 37 jmp 0x26f48 ; 0x26f48 741c: 0d 94 58 07 jmp 0x20eb0 ; 0x20eb0 7420: 0c 94 a8 71 jmp 0xe350 ; 0xe350 7424: 0d 94 94 23 jmp 0x24728 ; 0x24728 7428: 0d 94 4a 6a jmp 0x2d494 ; 0x2d494 742c: 0d 94 a2 99 jmp 0x33344 ; 0x33344 7430: 0d 94 08 25 jmp 0x24a10 ; 0x24a10 7434: 0c 94 a9 d9 jmp 0x1b352 ; 0x1b352 7438: 0c 94 f4 d2 jmp 0x1a5e8 ; 0x1a5e8 743c: 0d 94 5a 6a jmp 0x2d4b4 ; 0x2d4b4 7440: 0c 94 32 d4 jmp 0x1a864 ; 0x1a864 7444: 0d 94 b0 0f jmp 0x21f60 ; 0x21f60 7448: 0d 94 1a 9a jmp 0x33434 ; 0x33434 744c: 0c 94 24 d4 jmp 0x1a848 ; 0x1a848 () [clone .lto_priv.449]> 7450: 0d 94 76 15 jmp 0x22aec ; 0x22aec 7454: 0c 94 3f e0 jmp 0x1c07e ; 0x1c07e 7458: 0c 94 1c e0 jmp 0x1c038 ; 0x1c038 745c: 0c 94 f8 df jmp 0x1bff0 ; 0x1bff0 7460: 0c 94 66 d7 jmp 0x1aecc ; 0x1aecc 7464: 0d 94 bb 99 jmp 0x33376 ; 0x33376 7468: 0d 94 b8 25 jmp 0x24b70 ; 0x24b70 746c: 0d 94 d0 0b jmp 0x217a0 ; 0x217a0 7470: 0c 94 92 d9 jmp 0x1b324 ; 0x1b324 7474: 0d 94 41 6a jmp 0x2d482 ; 0x2d482 7478: 0d 94 f9 55 jmp 0x2abf2 ; 0x2abf2 747c: 0d 94 39 06 jmp 0x20c72 ; 0x20c72 7480: 0c 94 1f d4 jmp 0x1a83e ; 0x1a83e () [clone .lto_priv.450]> 7484: 0c 94 8a d9 jmp 0x1b314 ; 0x1b314 7488: 0d 94 d6 07 jmp 0x20fac ; 0x20fac 748c: 0c 94 29 d4 jmp 0x1a852 ; 0x1a852 () [clone .lto_priv.448]> 7490: 0d 94 e0 24 jmp 0x249c0 ; 0x249c0 7494: 0d 94 f4 27 jmp 0x24fe8 ; 0x24fe8 7498: 0c 94 ec d8 jmp 0x1b1d8 ; 0x1b1d8 749c: 0c 94 d9 cf jmp 0x19fb2 ; 0x19fb2 74a0: 0d 94 98 23 jmp 0x24730 ; 0x24730 74a4: 0d 94 1d 9a jmp 0x3343a ; 0x3343a 74a8: 0d 94 6a 6a jmp 0x2d4d4 ; 0x2d4d4 74ac: 0d 94 5e 69 jmp 0x2d2bc ; 0x2d2bc 74b0: 0d 94 5e 23 jmp 0x246bc ; 0x246bc 74b4: 0d 94 1c a0 jmp 0x34038 ; 0x34038 74b8: 0d 94 aa 27 jmp 0x24f54 ; 0x24f54 74bc: 0d 94 13 6a jmp 0x2d426 ; 0x2d426 74c0: 0d 94 2e a0 jmp 0x3405c ; 0x3405c 74c4: 0c 94 80 d0 jmp 0x1a100 ; 0x1a100 74c8: 0d 94 37 27 jmp 0x24e6e ; 0x24e6e 74cc: 0c 94 7f cf jmp 0x19efe ; 0x19efe 74d0: 0c 94 ef d8 jmp 0x1b1de ; 0x1b1de 74d4: 0c 94 d5 cf jmp 0x19faa ; 0x19faa 74d8: 0d 94 2d 27 jmp 0x24e5a ; 0x24e5a 74dc: 0d 94 49 67 jmp 0x2ce92 ; 0x2ce92 74e0: 0d 94 95 27 jmp 0x24f2a ; 0x24f2a 74e4: 0d 94 38 67 jmp 0x2ce70 ; 0x2ce70 74e8: 0c 94 f2 d8 jmp 0x1b1e4 ; 0x1b1e4 74ec: 0d 94 4c 66 jmp 0x2cc98 ; 0x2cc98 74f0: 0d 94 4a 24 jmp 0x24894 ; 0x24894 74f4: 0c 94 12 e0 jmp 0x1c024 ; 0x1c024 74f8: 0d 94 cc 25 jmp 0x24b98 ; 0x24b98 74fc: 0c 94 e3 cf jmp 0x19fc6 ; 0x19fc6 7500: 0c 94 eb d4 jmp 0x1a9d6 ; 0x1a9d6 7504: 0c 94 cb d4 jmp 0x1a996 ; 0x1a996 7508: 0d 94 ea 24 jmp 0x249d4 ; 0x249d4 750c: 0c 94 c7 cf jmp 0x19f8e ; 0x19f8e 7510: 0c 94 00 e0 jmp 0x1c000 ; 0x1c000 7514: 0d 94 94 1e jmp 0x23d28 ; 0x23d28 7518: 0c 94 ef cf jmp 0x19fde ; 0x19fde 751c: 0d 94 7e 67 jmp 0x2cefc ; 0x2cefc 7520: 0d 94 82 41 jmp 0x28304 ; 0x28304 7524: 0d 94 24 2d jmp 0x25a48 ; 0x25a48 7528: 0d 94 e2 26 jmp 0x24dc4 ; 0x24dc4 752c: 0d 94 f7 36 jmp 0x26dee ; 0x26dee 7530: 0d 94 9a 6a jmp 0x2d534 ; 0x2d534 7534: 0c 94 2a 65 jmp 0xca54 ; 0xca54 <_GLOBAL__sub_D_card> 7538: 0d 94 a5 69 jmp 0x2d34a ; 0x2d34a 753c: 0d 94 3a 2a jmp 0x25474 ; 0x25474 7540: 0d 94 9c 27 jmp 0x24f38 ; 0x24f38 7544: 0d 94 84 06 jmp 0x20d08 ; 0x20d08 7548: 0c 94 3a d3 jmp 0x1a674 ; 0x1a674 754c: 0d 94 09 1d jmp 0x23a12 ; 0x23a12 7550: 0d 94 6a 16 jmp 0x22cd4 ; 0x22cd4 7554: 0d 94 92 6a jmp 0x2d524 ; 0x2d524 7558: 0c 94 9e d9 jmp 0x1b33c ; 0x1b33c 755c: 0c 94 1f e7 jmp 0x1ce3e ; 0x1ce3e 7560: 0c 94 ac cf jmp 0x19f58 ; 0x19f58 7564: 0c 94 6b 75 jmp 0xead6 ; 0xead6 <__vector_23+0x128> 7568: 0d 94 19 a0 jmp 0x34032 ; 0x34032 756c: 0d 94 e1 69 jmp 0x2d3c2 ; 0x2d3c2 7570: 0d 94 b5 07 jmp 0x20f6a ; 0x20f6a 7574: 0c 94 10 75 jmp 0xea20 ; 0xea20 <__vector_23+0x72> 7578: 0d 94 6c 45 jmp 0x28ad8 ; 0x28ad8 757c: 0c 94 08 e0 jmp 0x1c010 ; 0x1c010 7580: 0d 94 20 1d jmp 0x23a40 ; 0x23a40 7584: 0d 94 2a 11 jmp 0x22254 ; 0x22254 7588: 0c 94 b4 cf jmp 0x19f68 ; 0x19f68 758c: 0d 94 ca 07 jmp 0x20f94 ; 0x20f94 7590: 0c 94 1b 75 jmp 0xea36 ; 0xea36 <__vector_23+0x88> 7594: 0d 94 d3 29 jmp 0x253a6 ; 0x253a6 7598: 0d 94 46 2b jmp 0x2568c ; 0x2568c 759c: 0d 94 f6 3e jmp 0x27dec ; 0x27dec 75a0: 0c 94 14 d8 jmp 0x1b028 ; 0x1b028 75a4: 0c 94 b8 d9 jmp 0x1b370 ; 0x1b370 75a8: 0c 94 f6 74 jmp 0xe9ec ; 0xe9ec <__vector_23+0x3e> 75ac: 0d 94 f3 26 jmp 0x24de6 ; 0x24de6 75b0: 0d 94 fe 2e jmp 0x25dfc ; 0x25dfc 75b4: 0d 94 14 25 jmp 0x24a28 ; 0x24a28 75b8: 0d 94 71 10 jmp 0x220e2 ; 0x220e2 75bc: 0c 94 eb cf jmp 0x19fd6 ; 0x19fd6 75c0: 0d 94 0d 6a jmp 0x2d41a ; 0x2d41a 75c4: 0d 94 10 6a jmp 0x2d420 ; 0x2d420 75c8: 0c 94 b7 cf jmp 0x19f6e ; 0x19f6e 75cc: 0d 94 75 10 jmp 0x220ea ; 0x220ea 75d0: 0d 94 19 55 jmp 0x2aa32 ; 0x2aa32 75d4: 0d 94 1b 3c jmp 0x27836 ; 0x27836 75d8: 0c 94 f8 d8 jmp 0x1b1f0 ; 0x1b1f0 75dc: 0d 94 7f 68 jmp 0x2d0fe ; 0x2d0fe 75e0: 0d 94 06 0b jmp 0x2160c ; 0x2160c 75e4: 0d 94 2b 42 jmp 0x28456 ; 0x28456 75e8: 0d 94 e5 07 jmp 0x20fca ; 0x20fca 75ec: 0c 94 ee df jmp 0x1bfdc ; 0x1bfdc 75f0: 0c 94 dd cf jmp 0x19fba ; 0x19fba 75f4: 0d 94 1b 0f jmp 0x21e36 ; 0x21e36 75f8: 0d 94 d7 3c jmp 0x279ae ; 0x279ae 75fc: 0c 94 10 d4 jmp 0x1a820 ; 0x1a820 () [clone .lto_priv.453]> 7600: 0d 94 9b 69 jmp 0x2d336 ; 0x2d336 7604: 0c 94 04 d9 jmp 0x1b208 ; 0x1b208 7608: 0d 94 29 a0 jmp 0x34052 ; 0x34052 760c: 0d 94 88 2c jmp 0x25910 ; 0x25910 7610: 0c 94 82 d9 jmp 0x1b304 ; 0x1b304 7614: 0d 94 5e 29 jmp 0x252bc ; 0x252bc 7618: 0d 94 ad 23 jmp 0x2475a ; 0x2475a 761c: 0c 94 c1 e4 jmp 0x1c982 ; 0x1c982 7620: 0c 94 48 75 jmp 0xea90 ; 0xea90 <__vector_23+0xe2> 7624: 0c 94 da df jmp 0x1bfb4 ; 0x1bfb4 7628: 0d 94 9e 69 jmp 0x2d33c ; 0x2d33c 762c: 0c 94 a8 cf jmp 0x19f50 ; 0x19f50 7630: 0d 94 d6 26 jmp 0x24dac ; 0x24dac 7634: 0d 94 0b 1d jmp 0x23a16 ; 0x23a16 7638: 0d 94 ae 0e jmp 0x21d5c ; 0x21d5c 763c: 0d 94 d6 25 jmp 0x24bac ; 0x24bac 7640: 0d 94 75 2f jmp 0x25eea ; 0x25eea 7644: 0c 94 d6 78 jmp 0xf1ac ; 0xf1ac 7648: 0d 94 56 0d jmp 0x21aac ; 0x21aac 764c: 0d 94 1d 26 jmp 0x24c3a ; 0x24c3a 7650: 0d 94 29 68 jmp 0x2d052 ; 0x2d052 7654: 0c 94 7a d9 jmp 0x1b2f4 ; 0x1b2f4 7658: 0d 94 52 6a jmp 0x2d4a4 ; 0x2d4a4 765c: 0c 94 6d d2 jmp 0x1a4da ; 0x1a4da 7660: 0d 94 50 75 jmp 0x2eaa0 ; 0x2eaa0 7664: 0d 94 9c 24 jmp 0x24938 ; 0x24938 7668: 0c 94 3f 75 jmp 0xea7e ; 0xea7e <__vector_23+0xd0> 766c: 0d 94 4a 27 jmp 0x24e94 ; 0x24e94 7670: 0d 94 17 2d jmp 0x25a2e ; 0x25a2e 7674: 0d 94 62 6a jmp 0x2d4c4 ; 0x2d4c4 7678: 0c 94 a2 cf jmp 0x19f44 ; 0x19f44 767c: 0c 94 5d e0 jmp 0x1c0ba ; 0x1c0ba 7680: 0c 94 9b d2 jmp 0x1a536 ; 0x1a536 7684: 0c 94 7d 75 jmp 0xeafa ; 0xeafa <__vector_23+0x14c> 7688: 0d 94 0a 26 jmp 0x24c14 ; 0x24c14 768c: 0c 94 9b d7 jmp 0x1af36 ; 0x1af36 7690: 0d 94 45 6f jmp 0x2de8a ; 0x2de8a 7694: 0d 94 fd 9f jmp 0x33ffa ; 0x33ffa 7698: 0d 94 c2 25 jmp 0x24b84 ; 0x24b84 769c: 0c 94 49 e0 jmp 0x1c092 ; 0x1c092 76a0: 0d 94 aa 1d jmp 0x23b54 ; 0x23b54 76a4: 0d 94 b7 9f jmp 0x33f6e ; 0x33f6e 76a8: 0d 94 5c 0d jmp 0x21ab8 ; 0x21ab8 76ac: 0c 94 8f d2 jmp 0x1a51e ; 0x1a51e 76b0: 0c 94 cd df jmp 0x1bf9a ; 0x1bf9a 76b4: 0c 94 cb cf jmp 0x19f96 ; 0x19f96 76b8: 0c 94 e8 5c jmp 0xb9d0 ; 0xb9d0 76bc: 0c 94 35 e0 jmp 0x1c06a ; 0x1c06a 76c0: 0d 94 6a 67 jmp 0x2ced4 ; 0x2ced4 76c4: 0d 94 ff 26 jmp 0x24dfe ; 0x24dfe 76c8: 0d 94 0f 42 jmp 0x2841e ; 0x2841e 76cc: 0c 94 f5 d8 jmp 0x1b1ea ; 0x1b1ea 76d0: 0d 94 7a 6a jmp 0x2d4f4 ; 0x2d4f4 76d4: 0d 94 44 6a jmp 0x2d488 ; 0x2d488 76d8: 0d 94 c8 2f jmp 0x25f90 ; 0x25f90 76dc: 0d 94 1e 67 jmp 0x2ce3c ; 0x2ce3c 76e0: 0c 94 a6 d2 jmp 0x1a54c ; 0x1a54c 76e4: 0d 94 19 32 jmp 0x26432 ; 0x26432 000076e8 <__trampolines_end>: 76e8: 6e 61 ori r22, 0x1E ; 30 76ea: 6e 00 .word 0x006e ; ???? 000076ec <__c.2228>: 76ec: 69 6e 66 00 00 40 7a 10 f3 5a 00 a0 72 4e 18 09 inf..@z..Z..rN.. 76fc: 00 10 a5 d4 e8 00 00 e8 76 48 17 00 00 e4 0b 54 ........vH.....T 770c: 02 00 00 ca 9a 3b 00 00 00 e1 f5 05 00 00 80 96 .....;.......... 771c: 98 00 00 00 40 42 0f 00 00 00 a0 86 01 00 00 00 ....@B.......... 772c: 10 27 00 00 00 00 e8 03 00 00 00 00 64 00 00 00 .'..........d... 773c: 00 00 0a 00 00 00 00 00 01 00 00 00 00 00 2c 76 ..............,v 774c: d8 88 dc 67 4f 08 23 df c1 df ae 59 e1 b1 b7 96 ...gO.#....Y.... 775c: e5 e3 e4 53 c6 3a e6 51 99 76 96 e8 e6 c2 84 26 ...S.:.Q.v.....& 776c: eb 89 8c 9b 62 ed 40 7c 6f fc ef bc 9c 9f 40 f2 ....b.@|o.....@. 777c: ba a5 6f a5 f4 90 05 5a 2a f7 5c 93 6b 6c f9 67 ..o....Z*.\.kl.g 778c: 6d c1 1b fc e0 e4 0d 47 fe f5 20 e6 b5 00 d0 ed m......G.. ..... 779c: 90 2e 03 00 94 35 77 05 00 80 84 1e 08 00 00 20 .....5w........ 77ac: 4e 0a 00 00 00 c8 0c 33 33 33 33 0f 98 6e 12 83 N......3333..n.. 77bc: 11 41 ef 8d 21 14 89 3b e6 55 16 cf fe e6 db 18 .A..!..;.U...... 77cc: d1 84 4b 38 1b f7 7c 1d 90 1d a4 bb e4 24 20 32 ..K8..|......$ 2 77dc: 84 72 5e 22 81 00 c9 f1 24 ec a1 e5 3d 27 .r^"....$...=' 000077ea : 77ea: 22 00 ". 000077ec : ... 000077ed : 77ed: 20 45 53 50 00 ESP. 000077f2 : 77f2: 20 4e 53 50 00 NSP. 000077f7 : 77f7: 20 4f 46 46 00 OFF. 000077fc : 77fc: 20 4f 4e 00 ON. 00007800 : 7800: 50 56 30 31 00 PV01. 00007805 : 7805: 20 5b 4d 50 5d 20 00 [MP] . 0000780c : 780c: 25 69 20 68 6f 75 72 73 20 25 69 20 6d 69 6e 75 %i hours %i minu 781c: 74 65 73 00 tes. 00007820 : 7820: 52 58 20 74 69 6d 65 6f 75 74 00 RX timeout. 0000782b : 782b: 4d 33 31 30 00 M310. 00007830 : 7830: 4d 31 31 32 00 M112. 00007835 : 7835: 4d 31 31 30 00 M110. 0000783a : 783a: 46 75 6c 6c 20 52 58 20 42 75 66 66 65 72 00 Full RX Buffer. 00007849 : 7849: 53 65 74 74 69 6e 67 73 20 53 74 6f 72 65 64 00 Settings Stored. 00007859 : 7859: 54 4d 3a 20 73 74 6f 72 65 64 20 63 61 6c 69 62 TM: stored calib 7869: 72 61 74 69 6f 6e 20 69 6e 76 61 6c 69 64 2c 20 ration invalid, 7879: 72 65 73 65 74 74 69 6e 67 00 resetting. 00007883 : 7883: 53 74 6f 72 65 64 20 73 65 74 74 69 6e 67 73 20 Stored settings 7893: 72 65 74 72 69 65 76 65 64 00 retrieved. 0000789d : 789d: 48 61 72 64 63 6f 64 65 64 20 44 65 66 61 75 6c Hardcoded Defaul 78ad: 74 20 53 65 74 74 69 6e 67 73 20 4c 6f 61 64 65 t Settings Loade 78bd: 64 00 d. 000078bf : 78bf: 56 32 00 00 00 00 c8 42 00 00 c8 42 00 00 c8 43 V2.....B...B...C 78cf: 00 00 8c 43 00 00 48 43 00 00 48 43 00 00 40 41 ...C..HC..HC..@A 78df: 00 00 f0 42 e8 03 00 00 e8 03 00 00 c8 00 00 00 ...B............ 78ef: 88 13 00 00 00 40 9c 44 00 40 9c 44 00 00 00 00 .....@.D.@.D.... 78ff: 00 00 00 00 20 4e 00 00 00 00 20 41 00 00 20 41 .... N.... A.. A 790f: cd cc cc 3e 00 00 90 40 00 00 00 00 00 00 00 00 ...>...@........ 791f: 00 00 00 00 cd cc cc 3e 00 00 70 41 07 45 f3 3e .......>..pA.E.> 792f: 01 60 ea 42 8f 42 fc 42 e6 5a 34 3f 4c 62 b0 45 .`.B.B.B.Z4?Lb.E 793f: 00 00 00 00 00 40 40 00 00 34 42 00 00 00 00 00 .....@@..4B..... 794f: 00 00 00 00 00 00 41 00 00 00 e0 3f 00 00 c8 42 ......A....?...B 795f: 00 00 c8 42 00 00 40 41 00 00 f0 42 c0 03 00 00 ...B..@A...B.... 796f: c0 03 00 00 c8 00 00 00 88 13 00 00 10 10 10 20 ............... 797f: 00 40 9c 44 00 00 80 3f 00 00 00 3f 19 14 00 00 .@.D...?...?.... ... 00007990 : 7990: 43 75 73 74 6f 6d 00 Custom. 00007997 : 7997: 4e 79 6c 6f 6e 50 41 00 NylonPA. 0000799f : 799f: 53 61 74 69 6e 20 20 00 Satin . 000079a7 : 79a7: 54 65 78 74 75 72 00 Textur. 000079ae : 79ae: 53 6d 6f 6f 74 68 00 Smooth. 000079b5 : 79b5: 48 6f 74 65 6e 64 20 66 61 6e 20 73 70 65 65 64 Hotend fan speed 79c5: 20 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 is lower than e 79d5: 78 70 65 63 74 65 64 00 xpected. 000079dd : 79dd: 50 72 69 6e 74 20 66 61 6e 20 73 70 65 65 64 20 Print fan speed 79ed: 69 73 20 6c 6f 77 65 72 20 74 68 61 6e 20 65 78 is lower than ex 79fd: 70 65 63 74 65 64 00 pected. 00007a04 : 7a04: 31 2e 30 00 1.0. 00007a08 : 7a08: 31 2e 35 00 1.5. 00007a0c : 7a0c: 55 4e 4b 4e 4f 57 4e 00 UNKNOWN. 00007a14 : 7a14: 4c 41 31 30 43 3a 20 4c 69 6e 65 61 72 20 41 64 LA10C: Linear Ad 7a24: 76 61 6e 63 65 20 6d 6f 64 65 3a 20 00 vance mode: . 00007a31 : 7a31: 4c 41 31 30 43 3a 20 41 64 6a 75 73 74 65 64 20 LA10C: Adjusted 7a41: 45 2d 4a 65 72 6b 3a 20 00 E-Jerk: . 00007a4a <_PRI_LANG_SIGNATURE>: 7a4a: ff ff ff ff .... 00007a4e : 7a4e: 3e 0f a8 af 00 48 00 69 96 00 00 df 60 25 55 58 >....H.i....`%UX 7a5e: 87 68 04 27 f2 e0 00 5e 34 03 cc 19 60 f3 3c 0e .h.'...^4...`.<. 7a6e: f8 8f 00 db 08 02 94 92 00 3e 1c 07 9a 87 00 e5 .........>...... 7a7e: 24 00 85 28 52 7e 06 00 1b e4 00 7e 78 12 70 78 $..(R~.....~x.px 7a8e: 70 61 f8 12 78 8f 88 41 78 42 70 78 70 61 78 25 pa..x..AxBpxpax% 7a9e: 70 78 70 61 f8 50 78 8f 88 d1 f0 25 27 07 87 61 pxpa.Px....%'..a 7aae: f0 25 27 8f 88 41 2c 0d 27 aa 50 d1 bc 07 07 87 .%'..A,.'.P..... 7abe: 11 61 be 78 8f 88 11 41 78 52 70 78 70 61 f8 52 .a.x...AxRpxpa.R 7ace: 78 8f 88 41 20 12 78 88 70 63 20 52 78 88 70 63 x..A .x.pc Rx.pc 7ade: 48 52 78 88 87 43 03 11 17 99 70 64 18 12 78 f8 HRx..C....pd..x. 7aee: 70 65 44 12 f8 f8 f0 45 18 42 78 f8 70 65 18 25 peD....E.Bx.pe.% 7afe: 78 f8 70 65 18 52 78 f8 70 65 18 50 78 f8 70 65 x.pe.Rx.pe.Px.pe 7b0e: 0c 07 8f 87 23 65 a2 0f 8f 8f 11 45 00 12 06 22 ....#e.....E..." 7b1e: 70 69 00 12 07 22 27 49 00 25 06 22 70 69 00 25 pi..."'I.%."pi.% 7b2e: 07 22 27 49 00 12 06 22 27 6c 02 62 36 a2 70 6c ."'I..."'l.b6.pl 7b3e: 40 45 6c 44 70 4c 03 62 22 22 70 6c 43 88 88 88 @ElDpL.b""plC... 7b4e: f0 4c 78 12 bc 88 80 6e 78 52 bc 88 80 6e 38 12 .Lx....nxR...n8. 7b5e: 78 88 70 6f 78 12 78 88 87 4f 38 42 78 88 70 6f x.pox.x..O8Bx.po 7b6e: 38 25 78 88 70 6f 3a 00 79 ac 78 6f 3d 07 9a ac 8%x.po:.y.xo=... 7b7e: 78 6f 78 50 78 88 87 ef 39 49 78 88 70 6f 08 52 xoxPx...9Ix.po.R 7b8e: bc 88 80 72 98 52 f8 8f 98 52 20 12 78 70 f0 73 ...r.R...R .xp.s 7b9e: 48 12 78 63 87 53 20 52 78 70 f0 73 48 52 78 63 H.xc.S Rxp.sHRxc 7bae: 87 53 10 07 87 0f 24 73 12 78 63 87 24 53 60 69 .S....$s.xc.$S`i 7bbe: 9a 98 8b e2 23 04 e4 44 30 74 10 4e 44 43 24 74 ....#..D0t.NDC$t 7bce: 7c 12 88 89 60 75 3c 50 88 88 70 55 78 25 28 89 |...`u: 7c0a: 00 40 14 54 .@.T 00007c0e : 7c0e: cd cc cc 3d 0a d7 23 3c 17 b7 d1 38 77 cc 2b 32 ...=..#<...8w.+2 7c1e: 95 95 e6 24 1f b1 4f 0a ...$..O. 00007c26 : 7c26: 00 00 20 41 00 00 c8 42 00 40 1c 46 20 bc be 4c .. A...B.@.F ..L 7c36: ca 1b 0e 5a ae c5 9d 74 ...Z...t 00007c3e : 7c3e: 4e 41 4e NAN 00007c41 : 7c41: 49 4e 46 INF 00007c44 : 7c44: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7c54: 20 69 6e 70 75 74 00 input. 00007c5b : 7c5b: 62 75 73 79 3a 20 70 61 75 73 65 64 20 66 6f 72 busy: paused for 7c6b: 20 75 73 65 72 00 user. 00007c71 : 7c71: 62 75 73 79 3a 20 70 72 6f 63 65 73 73 69 6e 67 busy: processing ... 00007c82 : 7c82: 00 00 7f 43 00 80 54 43 00 00 52 43 ...C..TC..RC 00007c8e : 7c8e: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007c9a : 7c9a: 00 00 00 00 00 00 80 c0 9a 99 19 3e ...........> 00007ca6 : 7ca6: 00 00 a0 40 00 00 a0 40 00 00 00 40 ...@...@...@ 00007cb2 : 7cb2: 25 33 64 20 73 74 65 70 3d 25 32 64 20 6d 73 63 %3d step=%2d msc 7cc2: 6e 74 3d 25 34 64 0a 00 nt=%4d.. 00007cca : 7cca: 00 00 7f 43 00 80 58 43 9a d9 51 43 ...C..XC..QC 00007cd6 : 7cd6: ff ff ff ... 00007cd9 : 7cd9: 20 41 3a 00 A:. 00007cdd : 7cdd: 20 50 3a 00 P:. 00007ce1 : 7ce1: 20 42 40 3a 00 B@:. 00007ce6 : 7ce6: 20 40 3a 00 @:. 00007cea : 7cea: 20 2f 00 /. 00007ced : 7ced: 20 54 30 3a 00 T0:. 00007cf2 : 7cf2: 20 2f 00 /. 00007cf5 : 7cf5: 20 42 3a 00 B:. 00007cf9 : 7cf9: 20 2f 00 /. 00007cfc : 7cfc: 54 3a 00 T:. 00007cff : 7cff: 25 53 45 78 63 65 73 73 69 76 65 20 62 65 64 20 %SExcessive bed 7d0f: 6c 65 76 65 6c 69 6e 67 20 63 6f 72 72 65 63 74 leveling correct 7d1f: 69 6f 6e 3a 20 25 69 20 6d 69 63 72 6f 6e 73 0a ion: %i microns. ... 00007d30 : 7d30: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7d40: 6c 65 64 2e 20 54 6f 6f 20 6d 75 63 68 20 76 61 led. Too much va 7d50: 72 69 61 74 69 6f 6e 20 66 72 6f 6d 20 65 65 70 riation from eep 7d60: 72 6f 6d 20 6d 65 73 68 00 rom mesh. 00007d69 : 7d69: 42 65 64 20 6c 65 76 65 6c 69 6e 67 20 66 61 69 Bed leveling fai 7d79: 6c 65 64 2e 20 53 65 6e 73 6f 72 20 74 72 69 67 led. Sensor trig 7d89: 67 65 72 65 64 20 74 6f 6f 20 73 6f 6f 6e 00 gered too soon. 00007d98 : 7d98: 20 20 00 . 00007d9b : 7d9b: 4d 65 61 73 75 72 65 64 20 70 6f 69 6e 74 73 3a Measured points: ... 00007dac : 7dac: 5a 20 73 65 61 72 63 68 20 68 65 69 67 68 74 3a Z search height: 7dbc: 20 35 2e 30 66 00 5.0f. 00007dc2 : 7dc2: 4e 75 6d 20 58 2c 59 3a 20 37 2c 37 00 Num X,Y: 7,7. 00007dcf : 7dcf: 4d 65 73 68 20 62 65 64 20 6c 65 76 65 6c 69 6e Mesh bed levelin 7ddf: 67 20 6e 6f 74 20 61 63 74 69 76 65 2e 00 g not active.. 00007ded : 7ded: 20 45 3a 00 E:. 00007df1 : 7df1: 20 5a 3a 00 Z:. 00007df5 : 7df5: 20 59 3a 00 Y:. 00007df9 : 7df9: 20 45 3a 00 E:. 00007dfd : 7dfd: 20 5a 3a 00 Z:. 00007e01 : 7e01: 20 59 3a 00 Y:. 00007e05 : 7e05: 58 3a 00 X:. 00007e08 : 7e08: 20 2d 3e 20 00 -> . 00007e0d : 7e0d: 53 70 6f 6f 6c 4a 6f 69 6e 3a 20 00 SpoolJoin: . 00007e19 : 7e19: 2c 20 00 , . 00007e1c : 7e1c: 66 73 65 6e 73 6f 72 20 76 30 2e 34 20 69 6e 20 fsensor v0.4 in 7e2c: 66 61 75 6c 74 20 72 61 6e 67 65 20 34 2e 36 2d fault range 4.6- 7e3c: 35 56 20 2d 20 75 6e 63 6f 6e 6e 65 63 74 65 64 5V - unconnected ... 00007e4d : 7e4d: 66 73 65 6e 73 6f 72 20 69 6e 20 66 6f 72 62 69 fsensor in forbi 7e5d: 64 64 65 6e 20 72 61 6e 67 65 20 31 2e 35 2d 33 dden range 1.5-3 7e6d: 56 20 2d 20 63 68 65 63 6b 20 73 65 6e 73 6f 72 V - check sensor ... 00007e7e : 7e7e: 49 6e 61 63 74 69 76 69 74 79 20 53 68 75 74 64 Inactivity Shutd 7e8e: 6f 77 6e 00 own. 00007e92 : 7e92: 4b 49 4c 4c 45 44 2e 00 KILLED.. 00007e9a : 7e9a: 50 72 69 6e 74 65 72 20 68 61 6c 74 65 64 2e 20 Printer halted. 7eaa: 6b 69 6c 6c 28 29 20 63 61 6c 6c 65 64 21 00 kill() called!. 00007eb9 : 7eb9: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7ec9: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7ed9: 69 6e 67 20 74 6f 20 30 2e 20 43 6c 69 63 6b 20 ing to 0. Click 7ee9: 74 6f 20 63 6f 6e 74 69 6e 75 65 2e 00 to continue.. 00007ef6 : 7ef6: 5a 20 6c 69 76 65 20 61 64 6a 75 73 74 20 6f 75 Z live adjust ou 7f06: 74 20 6f 66 20 72 61 6e 67 65 2e 20 53 65 74 74 t of range. Sett 7f16: 69 6e 67 20 74 6f 20 30 00 ing to 0. 00007f1f : 7f1f: 20 45 3a 30 20 42 3a 00 E:0 B:. 00007f27 : 7f27: 54 3a 00 T:. 00007f2a : 7f2a: 47 31 20 5a 25 2d 2e 33 66 20 46 25 2d 2e 33 66 G1 Z%-.3f F%-.3f ... 00007f3b : 7f3b: 49 6e 76 61 6c 69 64 20 54 20 63 6f 64 65 2e 00 Invalid T code.. 00007f4b : 7f4b: 44 75 70 6c 69 63 61 74 65 20 54 2d 63 6f 64 65 Duplicate T-code 7f5b: 20 69 67 6e 6f 72 65 64 2e 00 ignored.. 00007f65 : 7f65: 41 64 76 61 6e 63 65 20 4b 3d 00 Advance K=. 00007f70 : 7f70: 4b 20 6f 75 74 20 6f 66 20 61 6c 6c 6f 77 65 64 K out of allowed 7f80: 20 72 61 6e 67 65 21 00 range!. 00007f88 <_sPrinterName>: 7f88: 4d 4b 33 53 00 MK3S. 00007f8d <_sPrinterMmuName>: 7f8d: 4d 4b 33 53 4d 4d 55 33 00 MK3SMMU3. 00007f96 <_nPrinterMmuType>: 7f96: 5e 76 ^v 00007f98 <_nPrinterType>: 7f98: 2e 01 .. 00007f9a : 7f9a: 25 33 64 2f 25 33 64 00 %3d/%3d. 00007fa2 : 7fa2: 25 33 64 00 %3d. 00007fa6 : 7fa6: 20 0a 20 0a 20 0a 20 00 . . . . 00007fae : 7fae: 25 53 53 74 61 74 69 73 74 69 63 73 3a 0a 25 53 %SStatistics:.%S 7fbe: 20 20 4d 37 38 20 53 25 6c 75 20 54 25 6c 75 0a M78 S%lu T%lu. ... 00007fcf : 7fcf: 25 53 41 72 63 20 53 65 74 74 69 6e 67 73 3a 20 %SArc Settings: 7fdf: 50 3a 4d 61 78 20 6c 65 6e 67 74 68 28 6d 6d 29 P:Max length(mm) 7fef: 20 53 3a 4d 69 6e 20 6c 65 6e 67 74 68 20 28 6d S:Min length (m 7fff: 6d 29 20 4e 3a 43 6f 72 72 65 63 74 69 6f 6e 73 m) N:Corrections 800f: 20 52 3a 4d 69 6e 20 73 65 67 6d 65 6e 74 73 20 R:Min segments 801f: 46 3a 53 65 67 6d 65 6e 74 73 2f 73 65 63 2e 0a F:Segments/sec.. 802f: 25 53 20 20 4d 32 31 34 20 50 25 2e 32 66 20 53 %S M214 P%.2f S 803f: 25 2e 32 66 20 4e 25 64 20 52 25 64 20 46 25 64 %.2f N%d R%d F%d 804f: 0a 00 .. 00008051 : 8051: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 8061: 6e 67 73 3a 20 44 69 73 61 62 6c 65 64 0a 00 ngs: Disabled.. 00008070 : 8070: 25 53 46 69 6c 61 6d 65 6e 74 20 73 65 74 74 69 %SFilament setti 8080: 6e 67 73 3a 0a 25 53 20 20 20 4d 32 30 30 20 44 ngs:.%S M200 D 8090: 25 2e 32 66 0a 00 %.2f.. 00008096 : 8096: 25 53 52 65 74 72 61 63 74 3a 20 53 3d 4c 65 6e %SRetract: S=Len 80a6: 67 74 68 20 28 6d 6d 29 20 46 3a 53 70 65 65 64 gth (mm) F:Speed 80b6: 20 28 6d 6d 2f 6d 29 20 5a 3a 20 5a 4c 69 66 74 (mm/m) Z: ZLift 80c6: 20 28 6d 6d 29 0a 25 53 20 20 20 4d 32 30 37 20 (mm).%S M207 80d6: 53 25 2e 32 66 20 46 25 2e 32 66 20 5a 25 2e 32 S%.2f F%.2f Z%.2 80e6: 66 0a 25 53 52 65 63 6f 76 65 72 3a 20 53 3d 45 f.%SRecover: S=E 80f6: 78 74 72 61 20 6c 65 6e 67 74 68 20 28 6d 6d 29 xtra length (mm) 8106: 20 46 3a 53 70 65 65 64 20 28 6d 6d 2f 6d 29 0a F:Speed (mm/m). 8116: 25 53 20 20 20 4d 32 30 38 20 53 25 2e 32 66 20 %S M208 S%.2f 8126: 46 25 2e 32 66 0a 25 53 41 75 74 6f 2d 52 65 74 F%.2f.%SAuto-Ret 8136: 72 61 63 74 3a 20 53 3d 30 20 74 6f 20 64 69 73 ract: S=0 to dis 8146: 61 62 6c 65 2c 20 31 20 74 6f 20 69 6e 74 65 72 able, 1 to inter 8156: 70 72 65 74 20 65 78 74 72 75 64 65 2d 6f 6e 6c pret extrude-onl 8166: 79 20 6d 6f 76 65 73 20 61 73 20 72 65 74 72 61 y moves as retra 8176: 63 74 73 20 6f 72 20 72 65 63 6f 76 65 72 69 65 cts or recoverie 8186: 73 0a 25 53 20 20 20 4d 32 30 39 20 53 25 64 0a s.%S M209 S%d. ... 00008197 : 8197: 25 53 50 49 44 20 68 65 61 74 62 65 64 20 73 65 %SPID heatbed se 81a7: 74 74 69 6e 67 73 3a 0a 25 53 20 20 20 4d 33 30 ttings:.%S M30 81b7: 34 20 50 25 2e 32 66 20 49 25 2e 32 66 20 44 25 4 P%.2f I%.2f D% 81c7: 2e 32 66 0a 00 .2f.. 000081cc : 81cc: 25 53 50 49 44 20 73 65 74 74 69 6e 67 73 3a 0a %SPID settings:. 81dc: 25 53 20 20 20 4d 33 30 31 20 50 25 2e 32 66 20 %S M301 P%.2f 81ec: 49 25 2e 32 66 20 44 25 2e 32 66 0a 00 I%.2f D%.2f.. 000081f9 : 81f9: 25 53 53 74 65 70 73 20 70 65 72 20 75 6e 69 74 %SSteps per unit 8209: 3a 0a 25 53 20 20 4d 39 32 20 58 25 2e 32 66 20 :.%S M92 X%.2f 8219: 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 25 2e 32 Y%.2f Z%.2f E%.2 8229: 66 0a 25 53 55 53 74 65 70 20 72 65 73 6f 6c 75 f.%SUStep resolu 8239: 74 69 6f 6e 3a 20 0a 25 53 20 4d 33 35 30 20 58 tion: .%S M350 X 8249: 25 64 20 59 25 64 20 5a 25 64 20 45 25 64 0a 25 %d Y%d Z%d E%d.% 8259: 53 4d 61 78 69 6d 75 6d 20 66 65 65 64 72 61 74 SMaximum feedrat 8269: 65 73 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f es - normal (mm/ 8279: 73 29 3a 0a 25 53 20 20 4d 32 30 33 20 58 25 2e s):.%S M203 X%. 8289: 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 66 20 45 2f Y%.2f Z%.2f E 8299: 25 2e 32 66 0a 25 53 4d 61 78 69 6d 75 6d 20 66 %.2f.%SMaximum f 82a9: 65 65 64 72 61 74 65 73 20 2d 20 73 74 65 61 6c eedrates - steal 82b9: 74 68 20 28 6d 6d 2f 73 29 3a 0a 25 53 20 20 4d th (mm/s):.%S M 82c9: 32 30 33 20 58 25 2e 32 66 20 59 25 2e 32 66 20 203 X%.2f Y%.2f 82d9: 5a 25 2e 32 66 20 45 25 2e 32 66 0a 25 53 4d 61 Z%.2f E%.2f.%SMa 82e9: 78 69 6d 75 6d 20 61 63 63 65 6c 65 72 61 74 69 ximum accelerati 82f9: 6f 6e 20 2d 20 6e 6f 72 6d 61 6c 20 28 6d 6d 2f on - normal (mm/ 8309: 73 32 29 3a 0a 25 53 20 20 4d 32 30 31 20 58 25 s2):.%S M201 X% 8319: 6c 75 20 59 25 6c 75 20 5a 25 6c 75 20 45 25 6c lu Y%lu Z%lu E%l 8329: 75 0a 25 53 4d 61 78 69 6d 75 6d 20 61 63 63 65 u.%SMaximum acce 8339: 6c 65 72 61 74 69 6f 6e 20 2d 20 73 74 65 61 6c leration - steal 8349: 74 68 20 28 6d 6d 2f 73 32 29 3a 0a 25 53 20 20 th (mm/s2):.%S 8359: 4d 32 30 31 20 58 25 6c 75 20 59 25 6c 75 20 5a M201 X%lu Y%lu Z 8369: 25 6c 75 20 45 25 6c 75 0a 25 53 41 63 63 65 6c %lu E%lu.%SAccel 8379: 65 72 61 74 69 6f 6e 3a 20 50 3d 70 72 69 6e 74 eration: P=print 8389: 2c 20 52 3d 72 65 74 72 61 63 74 2c 20 54 3d 74 , R=retract, T=t 8399: 72 61 76 65 6c 0a 25 53 20 20 4d 32 30 34 20 50 ravel.%S M204 P 83a9: 25 2e 32 66 20 52 25 2e 32 66 20 54 25 2e 32 66 %.2f R%.2f T%.2f 83b9: 0a 25 53 41 64 76 61 6e 63 65 64 20 76 61 72 69 .%SAdvanced vari 83c9: 61 62 6c 65 73 3a 20 53 3d 4d 69 6e 20 66 65 65 ables: S=Min fee 83d9: 64 72 61 74 65 20 28 6d 6d 2f 73 29 2c 20 54 3d drate (mm/s), T= 83e9: 4d 69 6e 20 74 72 61 76 65 6c 20 66 65 65 64 72 Min travel feedr 83f9: 61 74 65 20 28 6d 6d 2f 73 29 2c 20 42 3d 6d 69 ate (mm/s), B=mi 8409: 6e 69 6d 75 6d 20 73 65 67 6d 65 6e 74 20 74 69 nimum segment ti 8419: 6d 65 20 28 75 73 29 2c 20 58 3d 6d 61 78 69 6d me (us), X=maxim 8429: 75 6d 20 58 59 20 6a 65 72 6b 20 28 6d 6d 2f 73 um XY jerk (mm/s 8439: 29 2c 20 20 5a 3d 6d 61 78 69 6d 75 6d 20 5a 20 ), Z=maximum Z 8449: 6a 65 72 6b 20 28 6d 6d 2f 73 29 2c 20 20 45 3d jerk (mm/s), E= 8459: 6d 61 78 69 6d 75 6d 20 45 20 6a 65 72 6b 20 28 maximum E jerk ( 8469: 6d 6d 2f 73 29 0a 25 53 20 20 4d 32 30 35 20 53 mm/s).%S M205 S 8479: 25 2e 32 66 20 54 25 2e 32 66 20 42 25 6c 75 20 %.2f T%.2f B%lu 8489: 58 25 2e 32 66 20 59 25 2e 32 66 20 5a 25 2e 32 X%.2f Y%.2f Z%.2 8499: 66 20 45 25 2e 32 66 0a 25 53 48 6f 6d 65 20 6f f E%.2f.%SHome o 84a9: 66 66 73 65 74 20 28 6d 6d 29 3a 0a 25 53 20 20 ffset (mm):.%S 84b9: 4d 32 30 36 20 58 25 2e 32 66 20 59 25 2e 32 66 M206 X%.2f Y%.2f 84c9: 20 5a 25 2e 32 66 0a 00 Z%.2f.. 000084d1 : 84d1: 54 4d 3a 20 52 5b 25 75 5d 20 65 73 74 69 6d 61 TM: R[%u] estima 84e1: 74 65 2e 00 te.. 000084e5 : 84e5: 54 4d 3a 20 25 53 20 52 20 25 64 43 00 TM: %S R %dC. 000084f2 : 84f2: 54 4d 3a 20 25 53 20 43 20 65 73 74 2e 00 TM: %S C est.. 00008500 : 8500: 54 4d 3a 20 63 6f 6f 6c 20 64 6f 77 6e 20 3c 25 TM: cool down <% 8510: 64 43 00 dC. 00008513 : 8513: 72 65 66 69 6e 65 00 refine. 0000851a : 851a: 69 6e 69 74 69 61 6c 00 initial. 00008522 : 8522: 54 4d 3a 20 63 61 6c 69 62 72 2e 20 66 61 69 6c TM: calibr. fail 8532: 65 64 21 00 ed!. 00008536 : 8536: 54 4d 3a 20 63 61 6c 69 62 72 61 74 69 6f 6e 20 TM: calibration 8546: 73 74 61 72 74 00 start. 0000854c : 854c: 54 4d 3a 20 43 61 6c 2e 20 4e 4f 54 20 49 44 4c TM: Cal. NOT IDL 855c: 45 00 E. 0000855e : 855e: 43 61 70 3a 25 53 3a 25 63 0a 00 Cap:%S:%c.. 00008569 : 8569: 50 52 55 53 41 5f 4d 4d 55 32 00 PRUSA_MMU2. 00008574 : 8574: 45 58 54 45 4e 44 45 44 5f 4d 32 30 00 EXTENDED_M20. 00008581 : 8581: 41 55 54 4f 52 45 50 4f 52 54 5f 50 4f 53 49 54 AUTOREPORT_POSIT 8591: 49 4f 4e 00 ION. 00008595 : 8595: 41 55 54 4f 52 45 50 4f 52 54 5f 46 41 4e 53 00 AUTOREPORT_FANS. 000085a5 : 85a5: 41 55 54 4f 52 45 50 4f 52 54 5f 54 45 4d 50 00 AUTOREPORT_TEMP. 000085b5 : ... 000085b6 : 85b6: 33 2e 31 34 2e 31 00 3.14.1. 000085bd : 85bd: 44 65 6c 65 74 69 6f 6e 20 66 61 69 6c 65 64 2c Deletion failed, 85cd: 20 46 69 6c 65 3a 20 00 File: . 000085d5 : 85d5: 46 69 6c 65 20 64 65 6c 65 74 65 64 3a 00 File deleted:. 000085e3 : 85e3: 4e 6f 74 20 53 44 20 70 72 69 6e 74 69 6e 67 00 Not SD printing. 000085f3 : 85f3: 50 72 69 6e 74 20 73 61 76 65 64 00 Print saved. 000085ff : 85ff: 53 44 20 70 72 69 6e 74 20 70 61 75 73 65 64 00 SD print paused. 0000860f : 860f: 25 33 64 2f 25 33 64 00 %3d/%3d. 00008617 : 8617: 4f 4b 00 OK. 0000861a : 861a: 42 41 44 00 BAD. 0000861e : 861e: 52 41 4d 42 6f 20 46 41 4e 20 00 RAMBo FAN . 00008629 : 8629: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 00008636 : 8636: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008644 : 8644: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 00008652 <_ZZ16process_commandsvE3__c__97_>: 8652: 22 28 32 29 00 "(2). 00008657 <_ZZ16process_commandsvE3__c__96_>: 8657: 25 53 3a 20 25 53 0a 00 %S: %S.. 0000865f <_ZZ16process_commandsvE3__c__95_>: 865f: 2c 20 4d 39 30 37 20 45 20 69 67 6e 6f 72 65 64 , M907 E ignored ... 00008670 <_ZZ16process_commandsvE3__c__94_>: 8670: 6e 6f 20 76 61 6c 69 64 20 63 6f 6d 6d 61 6e 64 no valid command ... 00008681 <_ZZ16process_commandsvE3__c__93_>: 8681: 7a 65 72 6f 72 69 7a 65 64 00 zerorized. 0000868b <_ZZ16process_commandsvE3__c__92_>: 868b: 66 61 63 74 6f 72 79 20 72 65 73 74 6f 72 65 64 factory restored ... 0000869c <_ZZ16process_commandsvE3__c__90_>: 869c: 69 6e 64 65 78 2c 20 74 65 6d 70 2c 20 75 73 74 index, temp, ust 86ac: 65 70 2c 20 75 6d 00 ep, um. 000086b3 <_ZZ16process_commandsvE3__c__91_>: 86b3: 50 49 4e 44 41 20 63 61 6c 20 73 74 61 74 75 73 PINDA cal status 86c3: 3a 20 00 : . 000086c6 <_ZZ16process_commandsvE3__c__89_>: 86c6: 50 3a 00 P:. 000086c9 <_ZZ16process_commandsvE3__c__88_>: 86c9: 57 61 69 74 20 66 6f 72 20 50 49 4e 44 41 20 74 Wait for PINDA t 86d9: 61 72 67 65 74 20 74 65 6d 70 65 72 61 74 75 72 arget temperatur 86e9: 65 3a 00 e:. 000086ec <_ZZ16process_commandsvE3__c__87_>: 86ec: 20 41 00 A. 000086ef <_ZZ16process_commandsvE3__c__86_>: 86ef: 20 50 00 P. 000086f2 <_ZZ16process_commandsvE3__c__85_>: 86f2: 20 42 00 B. 000086f5 <_ZZ16process_commandsvE3__c__84_>: 86f5: 20 4c 00 L. 000086f8 <_ZZ16process_commandsvE3__c__83_>: 86f8: 20 52 00 R. 000086fb <_ZZ16process_commandsvE3__c__82_>: 86fb: 20 5a 00 Z. 000086fe <_ZZ16process_commandsvE3__c__81_>: 86fe: 20 4e 4f 54 20 49 4e 49 54 49 41 4c 49 5a 45 44 NOT INITIALIZED ... 0000870f <_ZZ16process_commandsvE3__c__80_>: 870f: 53 68 65 65 74 20 00 Sheet . 00008716 <_ZZ16process_commandsvE3__c__79_>: 8716: 20 5a 20 56 41 4c 55 45 20 4f 55 54 20 4f 46 20 Z VALUE OUT OF 8726: 52 41 4e 47 45 00 RANGE. 0000872c <_ZZ16process_commandsvE3__c__78_>: 872c: 49 6e 76 61 6c 69 64 20 73 68 65 65 74 20 49 44 Invalid sheet ID 873c: 2e 20 41 6c 6c 6f 77 65 64 3a 20 30 2e 2e 00 . Allowed: 0... 0000874b <_ZZ16process_commandsvE3__c__77_>: 874b: 41 55 54 4f 00 AUTO. 00008750 <_ZZ16process_commandsvE3__c__76_>: 8750: 4c 41 4e 47 20 53 45 4c 20 46 4f 52 43 45 44 00 LANG SEL FORCED. 00008760 <_ZZ16process_commandsvE3__c__75_>: 8760: 4d 32 35 36 20 42 25 64 20 44 25 64 20 53 25 64 M256 B%d D%d S%d 8770: 20 54 25 75 0a 00 T%u.. 00008776 <_ZZ16process_commandsvE3__c__74_>: 8776: 20 64 3a 00 d:. 0000877a <_ZZ16process_commandsvE3__c__73_>: 877a: 20 69 3a 00 i:. 0000877e <_ZZ16process_commandsvE3__c__72_>: 877e: 20 70 3a 00 p:. 00008782 <_ZZ16process_commandsvE3__c__71_>: 8782: 20 64 3a 00 d:. 00008786 <_ZZ16process_commandsvE3__c__70_>: 8786: 20 69 3a 00 i:. 0000878a <_ZZ16process_commandsvE3__c__69_>: 878a: 20 70 3a 00 p:. 0000878e <_ZZ16process_commandsvE3__c__68_>: 878e: 25 69 25 25 0a 00 %i%%.. 00008794 <_ZZ16process_commandsvE3__c__67_>: 8794: 25 69 25 25 0a 00 %i%%.. 0000879a <_ZZ16process_commandsvE3__c__66_>: 879a: 22 28 31 29 00 "(1). 0000879f <_ZZ16process_commandsvE3__c__59_>: 879f: 2f 2f 00 //. 000087a2 <_ZZ16process_commandsvE3__c__58_>: ... 000087a3 <_ZZ16process_commandsvE3__c__57_>: 87a3: 20 45 58 54 52 55 44 45 52 5f 43 4f 55 4e 54 3a EXTRUDER_COUNT: 87b3: 31 00 1. 000087b5 <_ZZ16process_commandsvE3__c__56_>: 87b5: 20 4d 41 43 48 49 4e 45 5f 54 59 50 45 3a 00 MACHINE_TYPE:. 000087c4 <_ZZ16process_commandsvE3__c__55_>: 87c4: 31 2e 30 00 1.0. 000087c8 <_ZZ16process_commandsvE3__c__54_>: 87c8: 20 62 61 73 65 64 20 6f 6e 20 4d 61 72 6c 69 6e based on Marlin 87d8: 20 46 49 52 4d 57 41 52 45 5f 55 52 4c 3a 68 74 FIRMWARE_URL:ht 87e8: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d tps://github.com 87f8: 2f 70 72 75 73 61 33 64 2f 50 72 75 73 61 2d 46 /prusa3d/Prusa-F 8808: 69 72 6d 77 61 72 65 20 50 52 4f 54 4f 43 4f 4c irmware PROTOCOL 8818: 5f 56 45 52 53 49 4f 4e 3a 00 _VERSION:. 00008822 <_ZZ16process_commandsvE3__c__53_>: 8822: 37 37 33 31 30 32 34 65 64 00 7731024ed. 0000882c <_ZZ16process_commandsvE3__c__52_>: 882c: 5f 00 _. 0000882e <_ZZ16process_commandsvE3__c__51_>: 882e: 38 32 37 39 00 8279. 00008833 <_ZZ16process_commandsvE3__c__50_>: 8833: 2b 00 +. 00008835 <_ZZ16process_commandsvE3__c__49_>: 8835: 46 49 52 4d 57 41 52 45 5f 4e 41 4d 45 3a 50 72 FIRMWARE_NAME:Pr 8845: 75 73 61 2d 46 69 72 6d 77 61 72 65 20 00 usa-Firmware . 00008853 <_ZZ16process_commandsvE3__c__48_>: 8853: 4d 31 31 33 20 53 00 M113 S. 0000885a <_ZZ16process_commandsvE3__c__47_>: 885a: 6f 6b 20 00 ok . 0000885e <_ZZ16process_commandsvE3__c__41_>: 885e: 6e 2f 61 00 n/a. 00008862 <_ZZ16process_commandsvE3__c__40_>: 8862: 3f 54 6f 73 68 69 62 61 20 46 6c 61 73 68 41 69 ?Toshiba FlashAi 8872: 72 20 47 65 74 49 50 20 66 61 69 6c 65 64 0a 00 r GetIP failed.. 00008882 : 8882: 00 01 25 31 1d 0c 40 24 30 1c 0b 45 23 2f 1b 0a ..%1..@$0..E#/.. 8892: 17 ff 04 06 22 2b 1a 03 36 37 35 38 ...."+..6758 0000889e <_ZZ16process_commandsvE3__c__39_>: 889e: 25 69 20 6d 69 6e 2c 20 25 69 20 73 65 63 00 %i min, %i sec. 000088ad <_ZZ16process_commandsvE3__c__36_>: 88ad: 49 6e 76 61 6c 69 64 20 4d 20 63 6f 64 65 3a 20 Invalid M code: 88bd: 25 73 0a 00 %s.. 000088c1 <_ZZ16process_commandsvE3__c__30_>: 88c1: 50 49 4e 44 41 20 70 72 6f 62 65 20 63 61 6c 69 PINDA probe cali 88d1: 62 72 61 74 69 6f 6e 20 73 74 61 72 74 00 bration start. 000088df <_ZZ16process_commandsvE3__c__29_>: 88df: 4e 6f 20 50 49 4e 44 41 20 74 68 65 72 6d 69 73 No PINDA thermis 88ef: 74 6f 72 00 tor. 000088f3 <_ZZ16process_commandsvE3__c__25_>: 88f3: 73 65 74 00 set. 000088f7 <_ZZ16process_commandsvE3__c__24_>: 88f7: 6e 6f 7a 7a 6c 65 00 nozzle. 000088fe <_ZZ16process_commandsvE3__c__23_>: 88fe: 4d 42 4c 00 MBL. 00008902 <_ZZ16process_commandsvE3__c__22_>: 8902: 46 52 00 FR. 00008905 <_ZZ16process_commandsvE3__c__21_>: 8905: 4c 7a 00 Lz. 00008908 <_ZZ16process_commandsvE3__c__20_>: 8908: 4c 61 6e 67 00 Lang. 0000890d <_ZZ16process_commandsvE3__c__19_>: 890d: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 2d 45 49 4e 53 1_75mm_MK3S-EINS 891d: 79 5f 31 30 61 2d 45 33 44 52 45 56 4f 5f 48 46 y_10a-E3DREVO_HF 892d: 5f 36 30 57 00 _60W. 00008932 <_ZZ16process_commandsvE3__c__18_>: 8932: 52 65 76 00 Rev. 00008936 <_ZZ16process_commandsvE3__c__17_>: 8936: 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 00008942 <_ZZ16process_commandsvE3__c__16_>: 8942: 46 69 72 00 Fir. 00008946 <_ZZ16process_commandsvE3__c__15_>: 8946: 53 4e 20 69 6e 76 61 6c 69 64 00 SN invalid. 00008951 <_ZZ16process_commandsvE3__c__14_>: 8951: 53 4e 00 SN. 00008954 <_ZZ16process_commandsvE3__c__13_>: 8954: 52 45 53 45 54 00 RESET. 0000895a <_ZZ16process_commandsvE3__c__12_>: 895a: 4d 4d 55 52 45 53 00 MMURES. 00008961 <_ZZ16process_commandsvE3__c__11_>: 8961: 75 76 6c 6f 00 uvlo. 00008966 : 8966: 46 41 4e 00 FAN. 0000896a : 896a: 46 41 4e 50 49 4e 54 53 54 00 FANPINTST. 00008974 : 8974: 50 52 55 53 41 00 PRUSA. 0000897a : 897a: 53 45 54 5f 43 48 4f 50 5f 00 SET_CHOP_. 00008984 : 8984: 53 45 54 5f 53 54 45 50 5f 00 SET_STEP_. 0000898e : 898e: 53 45 54 5f 57 41 56 45 5f 00 SET_WAVE_. 00008998 : 8998: 54 4d 43 5f 00 TMC_. 0000899d : 899d: 43 52 41 53 48 5f 43 41 4e 43 45 4c 00 CRASH_CANCEL. 000089aa : 89aa: 43 52 41 53 48 5f 52 45 43 4f 56 45 52 00 CRASH_RECOVER. 000089b8 : 89b8: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 00 CRASH_DETECTED. 000089c7 : 89c7: 43 52 41 53 48 5f 00 CRASH_. 000089ce : 89ce: 4d 31 30 34 53 30 00 M104S0. 000089d5 : 89d5: 47 31 58 31 30 59 31 38 30 46 34 30 30 30 00 G1X10Y180F4000. 000089e4 : 89e4: 47 31 5a 31 30 46 31 33 30 30 00 G1Z10F1300. 000089ef : 89ef: 4d 31 34 30 53 30 00 M140S0. 000089f6 : 89f6: 47 31 45 2d 30 2e 30 37 35 46 32 31 30 30 00 G1E-0.075F2100. 00008a05 : 8a05: 4d 32 30 34 53 31 30 30 30 00 M204S1000. 00008a0f : 8a0f: 47 31 5a 35 46 37 32 30 30 00 G1Z5F7200. 00008a19 : 8a19: 47 31 45 2d 31 2e 35 46 32 31 30 30 00 G1E-1.5F2100. 00008a26 : 8a26: 47 31 5a 30 2e 32 00 G1Z0.2. 00008a2d : 8a2d: 47 31 58 32 30 32 2e 35 45 38 46 31 34 30 30 00 G1X202.5E8F1400. 00008a3d : 8a3d: 47 31 59 2d 32 46 31 30 30 30 00 G1Y-2F1000. 00008a48 : 8a48: 47 31 58 32 34 30 45 32 35 46 32 32 30 30 00 G1X240E25F2200. 00008a57 : 8a57: 47 31 5a 30 2e 33 46 31 30 30 30 00 G1Z0.3F1000. 00008a63 : 8a63: 47 31 58 35 35 45 38 46 32 30 30 30 00 G1X55E8F2000. 00008a70 : 8a70: 47 31 58 35 45 32 39 46 31 38 30 30 00 G1X5E29F1800. 00008a7d : 8a7d: 47 31 58 35 35 45 32 39 46 31 30 37 33 00 G1X55E29F1073. 00008a8b : 8a8b: 47 39 32 45 30 00 G92E0. 00008a91 : 8a91: 47 32 38 00 G28. 00008a95 : 8a95: 4d 31 30 39 00 M109. 00008a9a : 8a9a: 4d 31 39 30 00 M190. 00008a9f : 8a9f: 10 00 c9 02 10 01 2c 01 40 01 22 01 70 01 18 01 ......,.@.".p... 8aaf: b0 01 0e 01 f0 01 04 01 50 02 fa 00 b0 02 f0 00 ........P....... 8abf: 30 03 e6 00 d0 03 dc 00 90 04 d2 00 70 05 c8 00 0...........p... 8acf: a0 06 be 00 00 08 b4 00 b0 09 aa 00 d0 0b a0 00 ................ 8adf: 60 0e 96 00 60 11 8c 00 00 15 82 00 20 19 78 00 `...`....... .x. 8aef: c0 1d 6e 00 a0 22 64 00 b0 27 5a 00 90 2c 50 00 ..n.."d..'Z..,P. 8aff: 00 31 46 00 e0 34 3c 00 10 38 32 00 90 3a 28 00 .1F..4<..82..:(. 8b0f: 60 3c 1e 00 a0 3d 14 00 80 3e 0a 00 20 3f 00 00 `<...=...>.. ?.. 00008b1f : 8b1f: 4d 34 34 00 M44. 00008b23 : 8b23: 30 2e 38 30 00 0.80. 00008b28 : 8b28: 30 2e 36 30 00 0.60. 00008b2d : 8b2d: 30 2e 34 30 00 0.40. 00008b32 : 8b32: 30 2e 32 35 00 0.25. 00008b37 : 8b37: 47 32 38 20 58 59 00 G28 XY. 00008b3e : 8b3e: 4d 20 38 34 00 M 84. 00008b43 : 8b43: 85 2e 2e 00 .... 00008b47 : 8b47: 59 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 Y: %u -> .... 00008b54 : 8b54: 58 3a 20 25 75 20 2d 3e 20 2e 2e 2e 00 X: %u -> .... 00008b61 : 8b61: 46 69 6c 61 6d 65 6e 74 20 73 65 6e 73 6f 72 20 Filament sensor 8b71: 62 6f 61 72 64 20 63 68 61 6e 67 65 20 64 65 74 board change det 8b81: 65 63 74 65 64 3a 20 72 65 76 69 73 69 6f 6e 25 ected: revision% 8b91: 53 0a 00 S.. 00008b94 : 8b94: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8ba4: 74 20 73 65 6e 73 6f 72 20 6c 6f 77 20 6c 65 76 t sensor low lev 8bb4: 65 6c 3a 20 25 34 2e 32 66 56 0a 00 el: %4.2fV.. 00008bc0 : 8bc0: 4d 65 61 73 75 72 65 64 20 66 69 6c 61 6d 65 6e Measured filamen 8bd0: 74 20 73 65 6e 73 6f 72 20 68 69 67 68 20 6c 65 t sensor high le 8be0: 76 65 6c 3a 20 25 34 2e 32 66 56 0a 00 vel: %4.2fV.. 00008bed : 8bed: 25 33 64 2f 30 00 %3d/0. 00008bf3 : 8bf3: 25 33 64 2f 30 00 %3d/0. 00008bf9 : 8bf9: 25 63 20 41 58 49 53 20 53 47 31 3d 25 64 0a 00 %c AXIS SG1=%d.. 00008c09 : 8c09: 48 6f 74 65 6e 64 00 Hotend. 00008c10 : 8c10: 42 65 64 00 Bed. 00008c14 : 8c14: 5a 00 Z. 00008c16 : 8c16: 59 00 Y. 00008c18 : 8c18: 58 00 X. 00008c1a <_ZL13STR_SEPARATOR.lto_priv.458>: 8c1a: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ---------------- 8c2a: 2d 2d 2d 2d 00 ----. 00008c2f : 8c2f: 43 5a 50 58 49 6e 76 61 6c 69 64 53 65 72 69 61 CZPXInvalidSeria 8c3f: 6c 4e 72 00 lNr. 00008c43 : 8c43: df 6a e3 6a f6 89 ef 89 e4 89 d5 89 18 6c ce 89 .j.j.........l.. 8c53: 77 6b wk 00008c55 : 8c55: 47 31 59 25 2e 34 66 45 25 2e 34 66 00 G1Y%.4fE%.4f. 00008c62 : 8c62: 47 31 5a 25 2e 32 66 00 G1Z%.2f. 00008c6a : 8c6a: 47 31 58 35 30 59 31 35 35 00 G1X50Y155. 00008c74 : 8c74: 8b 8a df 6a 1d 6c 19 8a 0f 8a 05 8a ...j.l...... 00008c80 : 8c80: 47 31 58 25 2e 34 66 45 25 2e 34 66 00 G1X%.4fE%.4f. 00008c8d : 8c8d: 47 31 46 31 30 38 30 00 G1F1080. 00008c95 : 8c95: 7d 8a 70 8a 63 8a 57 8a 8b 8a 48 8a 3d 8a 2d 8a }.p.c.W...H.=.-. 8ca5: 26 8a &. 00008ca7 : 8ca7: 54 25 64 00 T%d. 00008cab : 8cab: 47 31 5a 30 2e 34 00 G1Z0.4. 00008cb2 : 8cb2: 47 31 59 2d 33 46 31 30 30 30 00 G1Y-3F1000. 00008cbd : 8cbd: e3 6a 9a 8a 95 8a 91 8a 8b 8a .j........ 00008cc7 : 8cc7: 4d 38 34 20 58 59 00 M84 XY. 00008cce : 8cce: 47 31 20 58 31 32 35 20 5a 32 30 30 20 46 31 30 G1 X125 Z200 F10 8cde: 30 30 00 00. 00008ce1 : 8ce1: 4d 33 31 30 20 41 20 46 31 00 M310 A F1. 00008ceb : 8ceb: 47 31 20 58 31 32 35 20 59 31 30 35 20 5a 31 20 G1 X125 Y105 Z1 8cfb: 46 38 30 30 30 00 F8000. 00008d01 : 8d01: 49 6e 76 61 6c 69 64 20 50 49 44 20 63 61 6c 2e Invalid PID cal. 8d11: 20 72 65 73 75 6c 74 73 2e 20 4e 6f 74 20 73 74 results. Not st 8d21: 6f 72 65 64 20 74 6f 20 45 45 50 52 4f 4d 2e 00 ored to EEPROM.. 00008d31 : 8d31: 4d 33 30 31 20 50 25 2e 32 66 20 49 25 2e 32 66 M301 P%.2f I%.2f 8d41: 20 44 25 2e 32 66 00 D%.2f. 00008d48 : 8d48: 4d 33 30 33 20 45 30 20 53 25 33 75 00 M303 E0 S%3u. 00008d55 : 8d55: 52 43 00 RC. 00008d58 : 8d58: 44 45 56 00 DEV. 00008d5c : 8d5c: 42 45 54 41 00 BETA. 00008d61 : 8d61: 41 4c 50 48 41 00 ALPHA. 00008d67 : 8d67: 00 00 21 00 24 00 27 00 2a 00 2d 00 30 00 33 00 ..!.$.'.*.-.0.3. 8d77: 01 01 00 00 04 01 07 01 0a 01 .......... 00008d81 : 8d81: 00 00 22 00 25 00 28 00 2b 00 2e 00 31 00 34 00 ..".%.(.+...1.4. 8d91: 02 01 00 00 05 01 08 01 0b 01 .......... 00008d9b : 8d9b: 00 00 20 00 23 00 26 00 29 00 2c 00 2f 00 32 00 .. .#.&.).,./.2. 8dab: 00 01 00 00 03 01 06 01 09 01 .......... 00008db5 : 8db5: 05 05 05 05 07 05 08 08 08 08 02 02 02 02 0a 0a ................ 8dc5: 08 08 04 04 04 04 01 01 01 01 01 01 01 01 03 03 ................ 8dd5: 03 03 03 03 03 03 04 07 07 07 0c 0c 0c 0c 0c 0c ................ 8de5: 0c 0c 02 02 02 02 06 06 06 06 06 06 06 06 0b 0b ................ 8df5: 0b 0b 0b 0b 0b 0b 07 07 0a 0a 0a 0a 0a 0a 05 05 ................ 8e05: 05 04 04 04 08 08 ...... 00008e0b : 8e0b: 01 02 10 20 20 08 08 10 20 40 10 20 40 80 02 01 ... ... @. @... 8e1b: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 80 40 ........... @..@ 8e2b: 20 10 08 04 02 01 80 04 02 01 80 40 20 10 08 04 ..........@ ... 8e3b: 02 01 08 04 02 01 01 02 04 08 10 20 40 80 01 02 ........... @... 8e4b: 04 08 10 20 40 80 10 08 04 08 80 10 20 40 04 40 ... @....... @.@ 8e5b: 80 10 20 40 04 80 .. @.. 00008e61 : 8e61: 00 00 0a 0b 02 09 0c 0d 0e 08 07 03 04 01 00 00 ................ ... 8e8d: 12 11 10 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00008eb7 : 8eb7: 33 2e 31 34 2e 31 00 3.14.1. 00008ebe : 8ebe: 0a 20 4f 72 69 67 69 6e 61 6c 20 50 72 75 73 61 . Original Prusa 8ece: 20 69 33 0a 20 20 20 50 72 75 73 61 20 52 65 73 i3. Prusa Res 8ede: 65 61 72 63 68 0a 25 32 30 2e 32 30 53 00 earch.%20.20S. 00008eec : 8eec: 4c 61 6e 67 75 61 67 65 20 75 70 64 61 74 65 00 Language update. 00008efc : 8efc: 43 5a 50 58 00 CZPX. 00008f01 : 8f01: 3b 53 00 ;S. 00008f04 : 8f04: 53 70 6f 6f 6c 4a 6f 69 6e 20 69 73 20 00 SpoolJoin is . 00008f12 : 8f12: 61 64 63 5f 69 6e 69 74 00 adc_init. 00008f1b : 8f1b: 20 0a 20 0a 20 0a 20 00 . . . . 00008f23 : 8f23: 41 6c 6c 20 44 61 74 61 00 All Data. 00008f2c : 8f2c: 53 65 72 76 69 63 65 20 70 72 65 70 00 Service prep. 00008f39 : 8f39: 53 68 69 70 70 69 6e 67 20 70 72 65 70 00 Shipping prep. 00008f47 : 8f47: 53 74 61 74 69 73 74 69 63 73 00 Statistics. 00008f52 : 8f52: 4c 61 6e 67 75 61 67 65 00 Language. 00008f5b <_ZZL13factory_resetcE3__c.lto_priv.554>: 8f5b: 45 52 41 53 49 4e 47 20 61 6c 6c 20 64 61 74 61 ERASING all data ... 00008f6c : 8f6c: 46 61 63 74 6f 72 79 20 52 45 53 45 54 00 Factory RESET. 00008f7a : 8f7a: 50 52 55 53 41 33 44 46 57 00 PRUSA3DFW. 00008f84 <_ZL8MSG_INT4.lto_priv.504>: 8f84: 49 4e 54 34 00 INT4. 00008f89 : 8f89: 03 00 0e 00 01 00 40 00 ......@. 00008f91 : 8f91: 03 00 02 00 00 00 04 00 ........ 00008f99 <_ZZ5setupE3__c__12_>: 8f99: 4e 4f 43 54 55 41 00 NOCTUA. 00008fa0 <_ZZ5setupE3__c__11_>: 8fa0: 41 4c 54 46 41 4e 00 ALTFAN. 00008fa7 : 8fa7: 70 72 75 73 61 33 64 00 prusa3d. 00008faf : 8faf: 32 30 32 35 2d 30 34 2d 32 32 20 32 32 3a 30 33 2025-04-22 22:03 8fbf: 3a 35 33 00 :53. 00008fc3 : 8fc3: 20 33 2e 31 34 2e 31 2d 38 32 37 39 5f 37 37 33 3.14.1-8279_773 8fd3: 31 30 32 34 65 64 00 1024ed. 00008fda : 8fda: 73 74 61 72 74 00 start. 00008fe0 : 8fe0: 53 4e 20 75 70 64 61 74 65 20 66 61 69 6c 65 64 SN update failed ... 00008ff1 : 8ff1: 53 4e 20 75 70 64 61 74 65 64 00 SN updated. 00008ffc : 8ffc: 43 5a 50 58 00 CZPX. 00009001 : 9001: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 59 CRASH_DETECTEDXY ... 00009012 : 9012: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 59 00 CRASH_DETECTEDY. 00009022 : 9022: 43 52 41 53 48 5f 44 45 54 45 43 54 45 44 58 00 CRASH_DETECTEDX. 00009032 : 9032: 4d 32 39 00 M29. 00009036 : 9036: 25 2d 39 2e 39 53 5b 00 %-9.9S[. 0000903e : 903e: 54 4d 20 65 73 74 69 6d 61 74 69 6f 6e 20 64 69 TM estimation di 904e: 64 20 6e 6f 74 20 63 6f 6e 76 65 72 67 65 00 d not converge. 0000905d : 905d: 54 4d 20 69 74 65 72 3a 25 75 20 76 3a 25 2e 32 TM iter:%u v:%.2 906d: 66 20 65 3a 25 2e 33 66 0a 00 f e:%.3f.. 00009077 : 9077: 33 33 29 42 00 00 58 41 9a 99 8d 41 33 33 53 40 33)B..XA...A33S@ 00009087 : 9087: 20 0a 20 0a 20 00 . . . 0000908d : 908d: 4d 4d 55 32 3a 00 MMU2:. 00009093 : 9093: 4d 65 61 73 75 72 65 20 63 65 6e 74 65 72 20 20 Measure center ... 000090a4 : 90a4: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 65 xyzcal_measure_e 90b4: 6e 74 65 72 0a 00 nter.. 000090ba : 90ba: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 38 20 63 xyzcal_spiral8 c 90ca: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d 90da: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d 90ea: 20 61 64 3d 25 64 0a 00 ad=%d.. 000090f2 : 90f2: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 6e xyzcal_searchZ n 9102: 6f 20 73 69 67 6e 61 6c 0a 20 78 3d 25 6c 64 20 o signal. x=%ld 9112: 79 3d 25 6c 64 20 7a 3d 25 6c 64 0a 00 y=%ld z=%ld.. 0000911f : 911f: 20 4f 4e 2d 53 49 47 4e 41 4c 20 61 74 20 78 3d ON-SIGNAL at x= 912f: 25 64 20 79 3d 25 64 20 7a 3d 25 64 20 61 64 3d %d y=%d z=%d ad= 913f: 25 64 0a 00 %d.. 00009143 : 9143: 78 79 7a 63 61 6c 5f 73 65 61 72 63 68 5a 20 78 xyzcal_searchZ x 9153: 3d 25 6c 64 20 79 3d 25 6c 64 20 7a 3d 25 6c 64 =%ld y=%ld z=%ld 9163: 0a 00 .. 00009165 : 9165: 25 30 32 78 00 %02x. 0000916a : 916a: 20 5b 25 66 20 25 66 5d 20 6d 6d 20 70 61 74 74 [%f %f] mm patt 917a: 65 72 6e 20 63 65 6e 74 65 72 0a 00 ern center.. 00009186 : 9186: 20 5b 25 66 20 25 66 5d 5b 25 66 5d 20 6d 6d 20 [%f %f][%f] mm 9196: 64 69 76 65 72 67 65 6e 63 65 0a 00 divergence.. 000091a2 : 91a2: 00 00 f0 00 f8 01 fc 03 fe 07 fe 07 fe 07 fe 07 ................ 91b2: fc 03 f8 01 f0 00 00 00 ........ 000091ba : 91ba: 00 00 00 00 f0 00 f8 01 fc 03 fc 03 fc 03 fc 03 ................ 91ca: f8 01 f0 00 00 00 00 00 ........ 000091d2 : 91d2: 78 79 7a 63 61 6c 5f 6d 65 61 73 75 72 65 5f 6c xyzcal_measure_l 91e2: 65 61 76 65 0a 00 eave.. 000091e8 : 91e8: 20 3c 20 00 < . 000091ec : 91ec: 57 41 52 4e 49 4e 47 3a 20 46 72 6f 6e 74 20 70 WARNING: Front p 91fc: 6f 69 6e 74 20 6e 6f 74 20 72 65 61 63 68 61 62 oint not reachab 920c: 6c 65 2e 20 59 20 63 6f 6f 72 64 69 6e 61 74 65 le. Y coordinate 921c: 3a 00 :. 0000921e : ... 0000921f : 921f: 00 00 40 41 00 00 c0 40 00 00 5c 43 00 00 c0 40 ..@A...@..\C...@ 922f: 00 00 5c 43 00 00 46 43 00 00 40 41 00 00 46 43 ..\C..FC..@A..FC 0000923f : 923f: 25 64 2f 34 00 %d/4. 00009244 : 9244: 49 74 65 72 61 74 69 6f 6e 3a 20 00 Iteration: . 00009250 : 9250: 43 61 6c 69 62 72 61 74 69 6f 6e 20 66 61 69 6c Calibration fail 9260: 65 64 21 20 43 68 65 63 6b 20 74 68 65 20 61 78 ed! Check the ax 9270: 65 73 20 61 6e 64 20 72 75 6e 20 61 67 61 69 6e es and run again 9280: 2e 00 .. 00009282 : 9282: 4d 49 4e 54 45 4d 50 20 42 45 44 20 66 69 78 65 MINTEMP BED fixe 9292: 64 00 d. 00009294 : 9294: 4d 49 4e 54 45 4d 50 20 48 4f 54 45 4e 44 20 66 MINTEMP HOTEND f 92a4: 69 78 65 64 00 ixed. 000092a9 : 92a9: 24 f4 d4 30 50 c3 8e 20 c2 a2 40 17 82 8b 70 11 $..0P.. ..@...p. 92b9: 12 7a 91 0d 81 6c d9 0a a8 61 e1 08 c7 58 66 07 .z...l...a...Xf. 92c9: 61 51 43 06 1e 4b 5d 05 c1 45 a7 04 1a 41 11 04 aQC..K]..E...A.. 92d9: 09 3d 98 03 71 39 31 03 40 36 db 02 65 33 91 02 .=..q91.@6..e3.. 92e9: d4 30 54 02 80 2e 1d 02 63 2c ee 01 75 2a c5 01 .0T.....c,..u*.. 92f9: b0 28 a0 01 10 27 81 01 8f 25 64 01 2b 24 4b 01 .(...'...%d.+$K. 9309: e0 22 34 01 ac 21 1f 01 8d 20 0d 01 80 1f fc 00 ."4..!... ...... 9319: 84 1e ed 00 97 1d df 00 b8 1c d2 00 e6 1b c6 00 ................ 9329: 20 1b bc 00 64 1a b2 00 b2 19 a8 00 0a 19 a0 00 ...d........... 9339: 6a 18 99 00 d1 17 91 00 40 17 8b 00 b5 16 84 00 j.......@....... 9349: 31 16 7e 00 b3 15 79 00 3a 15 73 00 c7 14 6f 00 1.~...y.:.s...o. 9359: 58 14 6a 00 ee 13 66 00 88 13 63 00 25 13 5e 00 X.j...f...c.%.^. 9369: c7 12 5b 00 6c 12 57 00 15 12 54 00 c1 11 51 00 ..[.l.W...T...Q. 9379: 70 11 4f 00 21 11 4b 00 d6 10 49 00 8d 10 47 00 p.O.!.K...I...G. 9389: 46 10 44 00 02 10 42 00 c0 0f 40 00 80 0f 3e 00 F.D...B...@...>. 9399: 42 0f 3c 00 06 0f 3b 00 cb 0e 38 00 93 0e 37 00 B.<...;...8...7. 93a9: 5c 0e 35 00 27 0e 34 00 f3 0d 32 00 c1 0d 31 00 \.5.'.4...2...1. 93b9: 90 0d 30 00 60 0d 2e 00 32 0d 2d 00 05 0d 2c 00 ..0.`...2.-...,. 93c9: d9 0c 2b 00 ae 0c 29 00 85 0c 29 00 5c 0c 27 00 ..+...)...).\.'. 93d9: 35 0c 27 00 0e 0c 26 00 e8 0b 24 00 c4 0b 24 00 5.'...&...$...$. 93e9: a0 0b 23 00 7d 0b 23 00 5a 0b 21 00 39 0b 21 00 ..#.}.#.Z.!.9.!. 93f9: 18 0b 20 00 f8 0a 1f 00 d9 0a 1e 00 bb 0a 1e 00 .. ............. 9409: 9d 0a 1d 00 80 0a 1d 00 63 0a 1c 00 47 0a 1b 00 ........c...G... 9419: 2c 0a 1b 00 11 0a 1a 00 f7 09 1a 00 dd 09 19 00 ,............... 9429: c4 09 19 00 ab 09 19 00 92 09 17 00 7b 09 18 00 ............{... 9439: 63 09 17 00 4c 09 16 00 36 09 16 00 20 09 16 00 c...L...6... ... 9449: 0a 09 15 00 f5 08 15 00 e0 08 14 00 cc 08 14 00 ................ 9459: b8 08 14 00 a4 08 14 00 90 08 13 00 7d 08 12 00 ............}... 9469: 6b 08 13 00 58 08 12 00 46 08 12 00 34 08 11 00 k...X...F...4... 9479: 23 08 11 00 12 08 11 00 01 08 11 00 f0 07 10 00 #............... 9489: e0 07 10 00 d0 07 10 00 c0 07 10 00 b0 07 0f 00 ................ 9499: a1 07 10 00 91 07 0e 00 83 07 0f 00 74 07 0f 00 ............t... 94a9: 65 07 0e 00 57 07 0e 00 49 07 0e 00 3b 07 0d 00 e...W...I...;... 94b9: 2e 07 0e 00 20 07 0d 00 13 07 0d 00 06 07 0d 00 .... ........... 94c9: f9 06 0c 00 ed 06 0d 00 e0 06 0c 00 d4 06 0c 00 ................ 94d9: c8 06 0c 00 bc 06 0c 00 b0 06 0c 00 a4 06 0b 00 ................ 94e9: 99 06 0c 00 8d 06 0b 00 82 06 0b 00 77 06 0b 00 ............w... 94f9: 6c 06 0b 00 61 06 0a 00 57 06 0b 00 4c 06 0a 00 l...a...W...L... 9509: 42 06 0a 00 38 06 0a 00 2e 06 0a 00 24 06 0a 00 B...8.......$... 9519: 1a 06 0a 00 10 06 09 00 07 06 0a 00 fd 05 09 00 ................ 9529: f4 05 09 00 eb 05 09 00 e2 05 09 00 d9 05 09 00 ................ 9539: d0 05 09 00 c7 05 09 00 be 05 09 00 b5 05 08 00 ................ 9549: ad 05 08 00 a5 05 09 00 9c 05 08 00 94 05 08 00 ................ 9559: 8c 05 08 00 84 05 08 00 7c 05 08 00 74 05 08 00 ........|...t... 9569: 6c 05 07 00 65 05 08 00 5d 05 07 00 56 05 08 00 l...e...]...V... 9579: 4e 05 07 00 47 05 07 00 40 05 08 00 38 05 07 00 N...G...@...8... 9589: 31 05 07 00 2a 05 07 00 23 05 07 00 1c 05 06 00 1...*...#....... 9599: 16 05 07 00 0f 05 07 00 08 05 06 00 02 05 07 00 ................ 95a9: fb 04 06 00 f5 04 07 00 ee 04 06 00 e8 04 06 00 ................ 95b9: e2 04 07 00 db 04 06 00 d5 04 06 00 cf 04 06 00 ................ 95c9: c9 04 06 00 c3 04 06 00 bd 04 06 00 b7 04 06 00 ................ 95d9: b1 04 05 00 ac 04 06 00 a6 04 06 00 a0 04 05 00 ................ 95e9: 9b 04 06 00 95 04 05 00 90 04 06 00 8a 04 05 00 ................ 95f9: 85 04 05 00 80 04 06 00 7a 04 05 00 75 04 05 00 ........z...u... 9609: 70 04 05 00 6b 04 05 00 66 04 05 00 61 04 05 00 p...k...f...a... 9619: 5c 04 05 00 57 04 05 00 52 04 05 00 4d 04 05 00 \...W...R...M... 9629: 48 04 05 00 43 04 05 00 3e 04 04 00 3a 04 05 00 H...C...>...:... 9639: 35 04 05 00 30 04 04 00 2c 04 05 00 27 04 04 00 5...0...,...'... 9649: 23 04 05 00 1e 04 04 00 1a 04 04 00 16 04 05 00 #............... 9659: 11 04 04 00 0d 04 04 00 09 04 05 00 04 04 04 00 ................ 9669: 00 04 04 00 fc 03 04 00 f8 03 04 00 f4 03 04 00 ................ 9679: f0 03 04 00 ec 03 04 00 e8 03 04 00 e4 03 04 00 ................ 9689: e0 03 04 00 dc 03 04 00 d8 03 04 00 d4 03 04 00 ................ 9699: d0 03 04 00 cc 03 04 00 c8 03 03 00 c5 03 03 00 ................ 000096a9 : 96a9: 24 f4 04 d9 20 1b c4 0c 5c 0e 98 04 c4 09 5f 02 $... ...\....._. 96b9: 65 07 71 01 f4 05 f9 00 fb 04 b3 00 48 04 87 00 e.q.........H... 96c9: c1 03 69 00 58 03 55 00 03 03 45 00 be 02 3a 00 ..i.X.U...E...:. 96d9: 84 02 31 00 53 02 2a 00 29 02 25 00 04 02 20 00 ..1.S.*.).%... . 96e9: e4 01 1c 00 c8 01 19 00 af 01 17 00 98 01 14 00 ................ 96f9: 84 01 13 00 71 01 10 00 61 01 10 00 51 01 0e 00 ....q...a...Q... 9709: 43 01 0d 00 36 01 0b 00 2b 01 0b 00 20 01 0b 00 C...6...+... ... 9719: 15 01 09 00 0c 01 09 00 03 01 08 00 fb 00 08 00 ................ 9729: f3 00 08 00 eb 00 07 00 e4 00 06 00 de 00 06 00 ................ 9739: d8 00 06 00 d2 00 06 00 cc 00 05 00 c7 00 05 00 ................ 9749: c2 00 05 00 bd 00 04 00 b9 00 04 00 b5 00 04 00 ................ 9759: b1 00 04 00 ad 00 04 00 a9 00 04 00 a5 00 03 00 ................ 9769: a2 00 03 00 9f 00 04 00 9b 00 03 00 98 00 03 00 ................ 9779: 95 00 02 00 93 00 03 00 90 00 03 00 8d 00 02 00 ................ 9789: 8b 00 03 00 88 00 02 00 86 00 02 00 84 00 03 00 ................ 9799: 81 00 02 00 7f 00 02 00 7d 00 02 00 7b 00 02 00 ........}...{... 97a9: 79 00 02 00 77 00 01 00 76 00 02 00 74 00 02 00 y...w...v...t... 97b9: 72 00 01 00 71 00 02 00 6f 00 02 00 6d 00 01 00 r...q...o...m... 97c9: 6c 00 02 00 6a 00 01 00 69 00 02 00 67 00 01 00 l...j...i...g... 97d9: 66 00 01 00 65 00 01 00 64 00 02 00 62 00 01 00 f...e...d...b... 97e9: 61 00 01 00 60 00 01 00 5f 00 02 00 5d 00 01 00 a...`..._...]... 97f9: 5c 00 01 00 5b 00 01 00 5a 00 01 00 59 00 01 00 \...[...Z...Y... 9809: 58 00 01 00 57 00 01 00 56 00 01 00 55 00 01 00 X...W...V...U... 9819: 54 00 01 00 53 00 00 00 53 00 01 00 52 00 01 00 T...S...S...R... 9829: 51 00 01 00 50 00 01 00 4f 00 01 00 4e 00 00 00 Q...P...O...N... 9839: 4e 00 01 00 4d 00 01 00 4c 00 01 00 4b 00 00 00 N...M...L...K... 9849: 4b 00 01 00 4a 00 01 00 49 00 01 00 48 00 00 00 K...J...I...H... 9859: 48 00 01 00 47 00 01 00 46 00 00 00 46 00 01 00 H...G...F...F... 9869: 45 00 00 00 45 00 01 00 44 00 01 00 43 00 00 00 E...E...D...C... 9879: 43 00 01 00 42 00 00 00 42 00 01 00 41 00 00 00 C...B...B...A... 9889: 41 00 01 00 40 00 01 00 3f 00 00 00 3f 00 01 00 A...@...?...?... 9899: 3e 00 00 00 3e 00 01 00 3d 00 00 00 3d 00 01 00 >...>...=...=... 98a9: 3c 00 00 00 3c 00 00 00 3c 00 01 00 3b 00 00 00 <...<...<...;... 98b9: 3b 00 01 00 3a 00 00 00 3a 00 01 00 39 00 00 00 ;...:...:...9... 98c9: 39 00 01 00 38 00 00 00 38 00 00 00 38 00 01 00 9...8...8...8... 98d9: 37 00 00 00 37 00 01 00 36 00 00 00 36 00 00 00 7...7...6...6... 98e9: 36 00 01 00 35 00 00 00 35 00 00 00 35 00 01 00 6...5...5...5... 98f9: 34 00 00 00 34 00 00 00 34 00 01 00 33 00 00 00 4...4...4...3... 9909: 33 00 00 00 33 00 01 00 32 00 00 00 32 00 00 00 3...3...2...2... 9919: 32 00 01 00 31 00 00 00 31 00 00 00 31 00 01 00 2...1...1...1... 9929: 30 00 00 00 30 00 00 00 30 00 01 00 2f 00 00 00 0...0...0.../... 9939: 2f 00 00 00 2f 00 00 00 2f 00 01 00 2e 00 00 00 /.../.../....... 9949: 2e 00 00 00 2e 00 01 00 2d 00 00 00 2d 00 00 00 ........-...-... 9959: 2d 00 00 00 2d 00 01 00 2c 00 00 00 2c 00 00 00 -...-...,...,... 9969: 2c 00 00 00 2c 00 01 00 2b 00 00 00 2b 00 00 00 ,...,...+...+... 9979: 2b 00 00 00 2b 00 01 00 2a 00 00 00 2a 00 00 00 +...+...*...*... 9989: 2a 00 00 00 2a 00 01 00 29 00 00 00 29 00 00 00 *...*...)...)... 9999: 29 00 00 00 29 00 00 00 29 00 01 00 28 00 00 00 )...)...)...(... 99a9: 28 00 00 00 28 00 00 00 28 00 00 00 28 00 01 00 (...(...(...(... 99b9: 27 00 00 00 27 00 00 00 27 00 00 00 27 00 00 00 '...'...'...'... 99c9: 27 00 01 00 26 00 00 00 26 00 00 00 26 00 00 00 '...&...&...&... 99d9: 26 00 00 00 26 00 01 00 25 00 00 00 25 00 00 00 &...&...%...%... 99e9: 25 00 00 00 25 00 00 00 25 00 00 00 25 00 01 00 %...%...%...%... 99f9: 24 00 00 00 24 00 00 00 24 00 00 00 24 00 00 00 $...$...$...$... 9a09: 24 00 01 00 23 00 00 00 23 00 00 00 23 00 00 00 $...#...#...#... 9a19: 23 00 00 00 23 00 00 00 23 00 00 00 23 00 01 00 #...#...#...#... 9a29: 22 00 00 00 22 00 00 00 22 00 00 00 22 00 00 00 "..."..."..."... 9a39: 22 00 00 00 22 00 01 00 21 00 00 00 21 00 00 00 "..."...!...!... 9a49: 21 00 00 00 21 00 00 00 21 00 00 00 21 00 00 00 !...!...!...!... 9a59: 21 00 01 00 20 00 00 00 20 00 00 00 20 00 00 00 !... ... ... ... 9a69: 20 00 00 00 20 00 00 00 20 00 00 00 20 00 00 00 ... ... ... ... 9a79: 20 00 01 00 1f 00 00 00 1f 00 00 00 1f 00 00 00 ............... 9a89: 1f 00 00 00 1f 00 00 00 1f 00 00 00 1f 00 01 00 ................ 9a99: 1e 00 00 00 1e 00 00 00 1e 00 00 00 1e 00 00 00 ................ 00009aa9 <_ZZ12PID_autotunefiiE3__c__16_>: 9aa9: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 69 6e PID Autotune fin 9ab9: 69 73 68 65 64 21 20 50 75 74 20 74 68 65 20 6c ished! Put the l 9ac9: 61 73 74 20 4b 70 2c 20 4b 69 20 61 6e 64 20 4b ast Kp, Ki and K 9ad9: 64 20 63 6f 6e 73 74 61 6e 74 73 20 66 72 6f 6d d constants from 9ae9: 20 61 62 6f 76 65 20 69 6e 74 6f 20 43 6f 6e 66 above into Conf 9af9: 69 67 75 72 61 74 69 6f 6e 2e 68 00 iguration.h. 00009b05 <_ZZ12PID_autotunefiiE3__c__15_>: 9b05: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b15: 6c 65 64 21 20 74 69 6d 65 6f 75 74 00 led! timeout. 00009b22 <_ZZ12PID_autotunefiiE3__c__14_>: 9b22: 20 40 3a 00 @:. 00009b26 <_ZZ12PID_autotunefiiE3__c__13_>: 9b26: 54 3a 00 T:. 00009b29 <_ZZ12PID_autotunefiiE3__c__12_>: 9b29: 42 3a 00 B:. 00009b2c <_ZZ12PID_autotunefiiE3__c__11_>: 9b2c: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9b3c: 6c 65 64 21 20 54 65 6d 70 65 72 61 74 75 72 65 led! Temperature 9b4c: 20 74 6f 6f 20 68 69 67 68 00 too high. 00009b56 <_ZZ12PID_autotunefiiE3__c__10_>: 9b56: 20 4b 64 3a 20 00 Kd: . 00009b5c : 9b5c: 20 4b 69 3a 20 00 Ki: . 00009b62 : 9b62: 20 4b 70 3a 20 00 Kp: . 00009b68 : 9b68: 20 43 6c 61 73 73 69 63 20 50 49 44 20 00 Classic PID . 00009b76 : 9b76: 20 54 75 3a 20 00 Tu: . 00009b7c : 9b7c: 20 4b 75 3a 20 00 Ku: . 00009b82 : 9b82: 20 6d 61 78 3a 20 00 max: . 00009b89 : 9b89: 20 6d 69 6e 3a 20 00 min: . 00009b90 : 9b90: 20 64 3a 20 00 d: . 00009b95 : 9b95: 20 62 69 61 73 3a 20 00 bias: . 00009b9d : 9b9d: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 73 74 61 PID Autotune sta 9bad: 72 74 00 rt. 00009bb0 : 9bb0: 50 49 44 20 41 75 74 6f 74 75 6e 65 20 66 61 69 PID Autotune fai 9bc0: 6c 65 64 2e 20 42 61 64 20 65 78 74 72 75 64 65 led. Bad extrude 9bd0: 72 20 6e 75 6d 62 65 72 2e 00 r number.. 00009bda : 9bda: 54 4d 4c 20 25 64 20 25 64 20 25 78 20 25 6c 78 TML %d %d %x %lx 9bea: 20 25 6c 78 0a 00 %lx.. 00009bf0 : 9bf0: 4d 49 4e 54 45 4d 50 00 MINTEMP. 00009bf8 : 9bf8: 4d 49 4e 54 45 4d 50 20 42 45 44 00 MINTEMP BED. 00009c04 : 9c04: 4d 49 4e 54 45 4d 50 20 41 4d 42 00 MINTEMP AMB. 00009c10 : 9c10: 4d 41 58 54 45 4d 50 00 MAXTEMP. 00009c18 : 9c18: 4d 41 58 54 45 4d 50 20 42 45 44 00 MAXTEMP BED. 00009c24 : 9c24: 4d 41 58 54 45 4d 50 20 41 4d 42 00 MAXTEMP AMB. 00009c30 : 9c30: 54 4d 3a 20 65 72 72 6f 72 20 63 6c 65 61 72 65 TM: error cleare 9c40: 64 00 d. 00009c42 : 9c42: 54 4d 3a 20 65 72 72 6f 72 20 74 72 69 67 67 65 TM: error trigge 9c52: 72 65 64 21 00 red!. 00009c57 : 9c57: 54 4d 3a 20 65 72 72 6f 72 20 7c 25 66 7c 3e 25 TM: error |%f|>% 9c67: 66 0a 00 f.. 00009c6a : 9c6a: 70 01 2c 01 90 01 27 01 b0 01 22 01 c0 01 1d 01 p.,...'..."..... 9c7a: f0 01 18 01 10 02 13 01 30 02 0e 01 60 02 09 01 ........0...`... 9c8a: 90 02 04 01 c0 02 ff 00 00 03 fa 00 40 03 f5 00 ............@... 9c9a: 80 03 f0 00 d0 03 eb 00 20 04 e6 00 70 04 e1 00 ........ ...p... 9caa: e0 04 dc 00 40 05 d7 00 c0 05 d2 00 40 06 cd 00 ....@.......@... 9cba: d0 06 c8 00 80 07 c3 00 30 08 be 00 f0 08 b9 00 ........0....... 9cca: c0 09 b4 00 b0 0a af 00 b0 0b aa 00 d0 0c a5 00 ................ 9cda: 00 0e a0 00 50 0f 9b 00 c0 10 96 00 50 12 91 00 ....P.......P... 9cea: 00 14 8c 00 c0 15 87 00 b0 17 82 00 b0 19 7d 00 ..............}. 9cfa: d0 1b 78 00 00 1e 73 00 40 20 6e 00 90 22 69 00 ..x...s.@ n.."i. 9d0a: f0 24 64 00 40 27 5f 00 90 29 5a 00 e0 2b 55 00 .$d.@'_..)Z..+U. 9d1a: 10 2e 50 00 20 30 4b 00 10 32 46 00 e0 33 41 00 ..P. 0K..2F..3A. 9d2a: 90 35 3c 00 10 37 37 00 70 38 32 00 a0 39 2d 00 .5<..77.p82..9-. 9d3a: b0 3a 28 00 a0 3b 23 00 60 3c 1e 00 10 3d 19 00 .:(..;#.`<...=.. 9d4a: 90 3d 14 00 10 3e 0f 00 70 3e 0a 00 c0 3e 05 00 .=...>..p>...>.. 9d5a: 00 3f 00 00 .?.. 00009d5e : 9d5e: 90 13 7d 00 b0 15 78 00 f0 17 73 00 60 1a 6e 00 ..}...x...s.`.n. 9d6e: f0 1c 69 00 a0 1f 64 00 50 22 5f 00 20 25 5a 00 ..i...d.P"_. %Z. 9d7e: e0 27 55 00 90 2a 50 00 20 2d 4b 00 a0 2f 46 00 .'U..*P. -K../F. 9d8e: f0 31 41 00 10 34 3c 00 f0 35 37 00 a0 37 32 00 .1A..4<..57..72. 9d9e: 20 39 2d 00 60 3a 28 00 70 3b 23 00 60 3c 1e 00 9-.`:(.p;#.`<.. 9dae: 20 3d 19 00 c0 3d 14 00 40 3e 0f 00 a0 3e 0a 00 =...=..@>...>.. 9dbe: f0 3e 05 00 40 3f 00 00 70 3f fb ff 90 3f f6 ff .>..@?..p?...?.. 9dce: b0 3f f1 ff c0 3f ec ff d0 3f e7 ff e0 3f e2 ff .?...?...?...?.. 9dde: f0 3f dd ff f0 3f d8 ff .?...?.. 00009de6 : 9de6: 20 48 4f 54 45 4e 44 20 54 48 45 52 4d 41 4c 20 HOTEND THERMAL 9df6: 52 55 4e 41 57 41 59 00 RUNAWAY. 00009dfe : 9dfe: 20 48 45 41 54 42 45 44 20 54 48 45 52 4d 41 4c HEATBED THERMAL 9e0e: 20 52 55 4e 41 57 41 59 00 RUNAWAY. 00009e17 : 9e17: 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 00 THERMAL RUNAWAY. 00009e27 : 9e27: 42 45 44 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 BED THERMAL RUNA 9e37: 57 41 59 00 WAY. 00009e3b : 9e3b: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e4b: 20 28 50 52 45 48 45 41 54 20 48 4f 54 45 4e 44 (PREHEAT HOTEND 9e5b: 29 00 ). 00009e5d : 9e5d: 20 54 48 45 52 4d 41 4c 20 52 55 4e 41 57 41 59 THERMAL RUNAWAY 9e6d: 20 28 50 52 45 48 45 41 54 20 48 45 41 54 42 45 (PREHEAT HEATBE 9e7d: 44 29 00 D). 00009e80 : 9e80: 50 52 45 48 45 41 54 20 45 52 52 4f 52 00 PREHEAT ERROR. 00009e8e : 9e8e: 42 45 44 20 50 52 45 48 45 41 54 20 45 52 52 4f BED PREHEAT ERRO 9e9e: 52 00 R. 00009ea0 : 9ea0: 20 74 72 69 67 67 65 72 65 64 21 00 triggered!. 00009eac : 9eac: 48 65 61 74 65 72 73 20 73 77 69 74 63 68 65 64 Heaters switched 9ebc: 20 6f 66 66 2e 20 00 off. . 00009ec3 : 9ec3: 3a 20 00 : . 00009ec6 : 9ec6: 45 72 72 3a 20 00 Err: . 00009ecc : 9ecc: 00 ff 01 02 01 00 02 ff ff fe 00 01 fe 01 ff 00 ................ 00009edc : 9edc: 50 6c 65 61 73 65 20 72 65 73 74 61 72 74 00 Please restart. 00009eeb : 9eeb: 54 4d 3a 20 69 6e 76 61 6c 69 64 20 70 61 72 61 TM: invalid para 9efb: 6d 65 74 65 72 73 2c 20 63 61 6e 6e 6f 74 20 65 meters, cannot e 9f0b: 6e 61 62 6c 65 00 nable. 00009f11 : 9f11: 25 53 20 20 4d 33 31 30 20 50 25 2e 32 66 20 55 %S M310 P%.2f U 9f21: 25 2e 34 66 20 56 25 2e 32 66 20 43 25 2e 32 66 %.4f V%.2f C%.2f 9f31: 20 44 25 2e 34 66 20 4c 25 75 20 53 25 75 20 42 D%.4f L%u S%u B 9f41: 25 75 20 45 25 2e 32 66 20 57 25 2e 32 66 20 54 %u E%.2f W%.2f T 9f51: 25 2e 32 66 0a 00 %.2f.. 00009f57 : 9f57: 25 53 20 20 4d 33 31 30 20 49 25 75 20 52 25 2e %S M310 I%u R%. 9f67: 32 66 0a 00 2f.. 00009f6b : 9f6b: 54 68 65 72 6d 61 6c 20 4d 6f 64 65 6c 20 73 65 Thermal Model se 9f7b: 74 74 69 6e 67 73 3a 00 ttings:. 00009f83 : 9f83: cd cc f4 41 00 00 e8 41 00 00 dc 41 00 00 c4 41 ...A...A...A...A 9f93: 33 33 bb 41 66 66 b2 41 9a 99 a9 41 9a 99 a1 41 33.Aff.A...A...A 9fa3: 66 66 9e 41 33 33 9b 41 00 00 98 41 cd cc 94 41 ff.A33.A...A...A 9fb3: 66 66 92 41 cd cc 90 41 33 33 8f 41 9a 99 8d 41 ff.A...A33.A...A 00009fc3 : 9fc3: 45 2d 6d 6f 74 6f 72 20 63 75 72 72 65 6e 74 20 E-motor current 9fd3: 73 63 61 6c 69 6e 67 20 65 6e 61 62 6c 65 64 00 scaling enabled. 00009fe3 : 9fe3: 01 08 08 01 0a 0a 01 14 14 01 12 12 ............ 00009fef : 9fef: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 6e 74 tmc2130_home_ent 9fff: 65 72 28 61 78 65 73 5f 6d 61 73 6b 3d 30 78 25 er(axes_mask=0x% a00f: 30 32 78 29 0a 00 02x).. 0000a015 : a015: 74 6d 63 32 31 33 30 5f 68 6f 6d 65 5f 65 78 69 tmc2130_home_exi a025: 74 20 74 6d 63 32 31 33 30 5f 73 67 5f 68 6f 6d t tmc2130_sg_hom a035: 69 6e 67 5f 61 78 65 73 5f 6d 61 73 6b 3d 30 78 ing_axes_mask=0x a045: 25 30 32 78 0a 00 %02x.. 0000a04b : a04b: 72 65 73 75 6c 74 20 76 61 6c 75 65 3a 20 25 64 result value: %d a05b: 0a 00 .. 0000a05d : a05d: 20 69 3d 25 32 64 20 63 6e 74 3d 25 32 64 20 76 i=%2d cnt=%2d v a06d: 61 6c 3d 25 32 64 0a 00 al=%2d.. 0000a075 : a075: 63 6c 75 73 74 65 72 73 3a 00 clusters:. 0000a07f : a07f: 20 69 3d 25 32 64 20 73 74 65 70 3d 25 32 64 0a i=%2d step=%2d. ... 0000a090 : a090: 73 6f 72 74 65 64 20 73 61 6d 70 6c 65 73 3a 00 sorted samples:. 0000a0a0 <__vector_51::__c>: a0a0: 55 53 41 52 54 32 20 72 78 20 46 75 6c 6c 21 21 USART2 rx Full!! a0b0: 21 00 !. 0000a0b2 : a0b2: 3a 20 00 : . 0000a0b5 : a0b5: 25 2d 31 32 2e 31 32 53 25 2d 64 2f 36 00 %-12.12S%-d/6. 0000a0c3 : a0c3: 25 33 64 2f 25 2d 33 64 00 %3d/%-3d. 0000a0cc : a0cc: 20 3a 20 00 : . 0000a0d0 : a0d0: 25 33 53 00 %3S. 0000a0d4 : a0d4: 25 2d 37 73 00 %-7s. 0000a0d9 : a0d9: 4e 64 20 25 34 2e 32 66 20 00 Nd %4.2f . 0000a0e3 : a0e3: 25 2d 31 35 2e 31 35 53 25 2d 35 64 0a 25 2d 31 %-15.15S%-5d.%-1 a0f3: 35 2e 31 35 53 25 2d 35 64 0a 00 5.15S%-5d.. 0000a0fe : a0fe: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a10e: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 . %-16.16S%-3d. 0000a11d : a11d: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a12d: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a13d: 25 2d 31 36 2e 31 36 53 25 2d 33 64 00 %-16.16S%-3d. 0000a14a : a14a: 25 53 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 %S. %-16.16S%-3d a15a: 0a 20 25 2d 31 36 2e 31 36 53 25 2d 33 64 0a 20 . %-16.16S%-3d. a16a: 25 2d 37 2e 37 53 58 20 25 2d 33 64 20 20 59 20 %-7.7SX %-3d Y a17a: 25 2d 33 64 00 %-3d. 0000a17f : a17f: 20 25 73 25 33 64 81 20 0a 00 %s%3d. .. 0000a189 : a189: 0a 20 49 52 20 3a 20 20 20 20 20 20 20 25 33 2e . IR : %3. a199: 31 66 56 00 1fV. 0000a19d : a19d: 20 50 57 52 3a 20 20 20 20 20 20 25 34 2e 31 66 PWR: %4.1f a1ad: 56 0a 20 42 45 44 3a 20 20 20 20 20 20 25 34 2e V. BED: %4. a1bd: 31 66 56 00 1fV. 0000a1c1 : a1c1: 25 53 0a 20 58 20 25 64 0a 20 59 20 25 64 00 %S. X %d. Y %d. 0000a1d0 : a1d0: 25 75 2e 25 75 2e 25 75 2e 25 75 00 %u.%u.%u.%u. 0000a1dc <_ZZL16lcd_support_menuvE3__c__16_>: a1dc: 20 00 . 0000a1de <_ZZL16lcd_support_menuvE3__c__15_>: a1de: 20 00 . 0000a1e0 <_ZZL16lcd_support_menuvE3__c__14_>: a1e0: 46 6c 61 73 68 41 69 72 20 49 50 20 41 64 64 72 FlashAir IP Addr a1f0: 3a 00 :. 0000a1f2 <_ZZL16lcd_support_menuvE3__c__13_>: a1f2: 4d 4d 55 20 20 20 20 20 20 20 20 4e 2f 41 00 MMU N/A. 0000a201 <_ZZL16lcd_support_menuvE3__c__12_>: a201: 25 64 2e 25 64 2e 25 64 00 %d.%d.%d. 0000a20a <_ZZL16lcd_support_menuvE3__c__11_>: a20a: 20 46 57 3a 00 FW:. 0000a20f <_ZZL16lcd_support_menuvE3__c__10_>: a20f: 46 69 6c 2e 20 73 65 6e 73 6f 72 20 76 2e 3a 00 Fil. sensor v.:. 0000a21f : a21f: 32 30 32 35 2d 30 34 2d 32 32 00 2025-04-22. 0000a22a : a22a: 45 33 44 52 45 56 4f 5f 48 46 5f 36 30 57 00 E3DREVO_HF_60W. 0000a239 : a239: 45 49 4e 53 79 5f 31 30 61 00 EINSy_10a. 0000a243 : a243: 31 5f 37 35 6d 6d 5f 4d 4b 33 53 00 1_75mm_MK3S. 0000a24f : a24f: 20 48 61 73 68 3a 37 37 33 31 30 32 34 65 64 00 Hash:7731024ed. 0000a25f : a25f: 20 52 65 70 6f 3a 70 72 75 73 61 33 64 00 Repo:prusa3d. 0000a26d : a26d: 20 33 2e 31 34 2e 31 2d 38 32 37 39 00 3.14.1-8279. 0000a27a : a27a: 46 69 72 6d 77 61 72 65 3a 00 Firmware:. 0000a284 : a284: 3e 00 >. 0000a286 <_ZZ24lcd_generic_preheat_menuvE3__c__20_>: a286: 46 4c 45 58 20 2d 20 20 32 34 30 2f 35 30 00 FLEX - 240/50. 0000a295 <_ZZ24lcd_generic_preheat_menuvE3__c__19_>: a295: 46 4c 45 58 20 2d 20 20 32 34 30 00 FLEX - 240. 0000a2a1 <_ZZ24lcd_generic_preheat_menuvE3__c__18_>: a2a1: 50 50 20 20 20 2d 20 20 32 35 34 2f 31 30 30 00 PP - 254/100. 0000a2b1 <_ZZ24lcd_generic_preheat_menuvE3__c__17_>: a2b1: 50 50 20 20 20 2d 20 20 32 35 34 00 PP - 254. 0000a2bd <_ZZ24lcd_generic_preheat_menuvE3__c__16_>: a2bd: 48 49 50 53 20 2d 20 20 32 32 30 2f 31 30 30 00 HIPS - 220/100. 0000a2cd <_ZZ24lcd_generic_preheat_menuvE3__c__15_>: a2cd: 48 49 50 53 20 2d 20 20 32 32 30 00 HIPS - 220. 0000a2d9 <_ZZ24lcd_generic_preheat_menuvE3__c__14_>: a2d9: 41 42 53 20 20 2d 20 20 32 35 35 2f 31 30 30 00 ABS - 255/100. 0000a2e9 <_ZZ24lcd_generic_preheat_menuvE3__c__13_>: a2e9: 41 42 53 20 20 2d 20 20 32 35 35 00 ABS - 255. 0000a2f5 <_ZZ24lcd_generic_preheat_menuvE3__c__12_>: a2f5: 50 41 20 20 20 2d 20 20 32 37 35 2f 39 30 00 PA - 275/90. 0000a304 <_ZZ24lcd_generic_preheat_menuvE3__c__11_>: a304: 50 41 20 20 20 2d 20 20 32 37 35 00 PA - 275. 0000a310 <_ZZ24lcd_generic_preheat_menuvE3__c__10_>: a310: 50 56 42 20 20 2d 20 20 32 31 35 2f 37 35 00 PVB - 215/75. 0000a31f : a31f: 50 56 42 20 20 2d 20 20 32 31 35 00 PVB - 215. 0000a32b : a32b: 50 43 20 20 20 2d 20 20 32 37 35 2f 31 31 30 00 PC - 275/110. 0000a33b : a33b: 50 43 20 20 20 2d 20 20 32 37 35 00 PC - 275. 0000a347 : a347: 41 53 41 20 20 2d 20 20 32 36 30 2f 31 30 35 00 ASA - 260/105. 0000a357 : a357: 41 53 41 20 20 2d 20 20 32 36 30 00 ASA - 260. 0000a363 : a363: 50 45 54 20 20 2d 20 20 32 33 30 2f 38 35 00 PET - 230/85. 0000a372 : a372: 50 45 54 20 20 2d 20 20 32 33 30 00 PET - 230. 0000a37e : a37e: 50 4c 41 20 20 2d 20 20 32 31 35 2f 36 30 00 PLA - 215/60. 0000a38d : a38d: 50 4c 41 20 20 2d 20 20 32 31 35 00 PLA - 215. 0000a399 : a399: 25 2d 31 32 2e 31 32 53 25 2b 38 2e 31 66 00 %-12.12S%+8.1f. 0000a3a8 : a3a8: 45 78 74 72 75 64 65 72 3a 00 Extruder:. 0000a3b2 : a3b2: 25 63 25 31 37 2e 32 66 6d 6d 00 %c%17.2fmm. 0000a3bd : a3bd: 58 3a 00 X:. 0000a3c0 : a3c0: 59 3a 00 Y:. 0000a3c3 : a3c3: 5a 3a 00 Z:. 0000a3c6 : a3c6: 25 63 25 2d 31 33 2e 31 33 53 25 2b 35 2e 33 66 %c%-13.13S%+5.3f ... 0000a3d7 : a3d7: 25 33 75 00 %3u. 0000a3db : a3db: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a3eb: 6e 20 66 61 69 6c 65 64 2e 20 43 6f 6e 74 69 6e n failed. Contin a3fb: 75 65 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 ue with pressing a40b: 20 74 68 65 20 6b 6e 6f 62 2e 00 the knob.. 0000a416 : a416: 50 49 4e 44 41 20 63 61 6c 69 62 72 61 74 69 6f PINDA calibratio a426: 6e 20 64 6f 6e 65 2e 20 43 6f 6e 74 69 6e 75 65 n done. Continue a436: 20 77 69 74 68 20 70 72 65 73 73 69 6e 67 20 74 with pressing t a446: 68 65 20 6b 6e 6f 62 2e 00 he knob.. 0000a44f : a44f: 47 38 30 00 G80. 0000a453 : a453: 4d 34 35 00 M45. 0000a457 : a457: 4d 34 35 20 5a 00 M45 Z. 0000a45d : a45d: 47 37 36 00 G76. 0000a461 : a461: 4d 37 30 31 20 50 30 00 M701 P0. 0000a469 : a469: 57 69 7a 61 72 64 20 73 74 61 74 65 3a 20 25 64 Wizard state: %d a479: 0a 00 .. 0000a47b : a47b: 4d 39 31 34 00 M914. 0000a480 : a480: 4d 39 31 35 00 M915. 0000a485 : a485: 45 78 70 65 72 69 6d 65 6e 74 61 6c 00 Experimental. 0000a492 : a492: 46 73 65 6e 73 6f 72 20 44 65 74 65 63 74 69 6f Fsensor Detectio a4a2: 6e 00 n. 0000a4a4 : a4a4: 30 2e 38 30 00 0.80. 0000a4a9 : a4a9: 30 2e 36 30 00 0.60. 0000a4ae : a4ae: 30 2e 34 30 00 0.40. 0000a4b3 : a4b3: 30 2e 32 35 00 0.25. 0000a4b8 : a4b8: 52 65 73 65 74 20 4d 4d 55 00 Reset MMU. 0000a4c2 : a4c2: 4d 4d 55 00 MMU. 0000a4c6 : a4c6: 78 79 7a 63 61 6c 5f 73 70 69 72 61 6c 32 20 63 xyzcal_spiral2 c a4d6: 78 3d 25 64 20 63 79 3d 25 64 20 7a 30 3d 25 64 x=%d cy=%d z0=%d a4e6: 20 64 7a 3d 25 64 20 72 61 64 69 75 73 3d 25 64 dz=%d radius=%d a4f6: 20 61 64 3d 25 64 0a 00 ad=%d.. 0000a4fe <_ZL4endl.lto_priv.390>: a4fe: 0a 00 .. 0000a500 : a500: 43 6f 75 6e 74 64 6f 77 6e 3a 20 25 64 20 00 Countdown: %d . 0000a50f : a50f: 25 64 0a 00 %d.. 0000a513 : a513: 53 63 61 6e 20 63 6f 75 6e 74 64 6f 77 6e 3a 20 Scan countdown: ... 0000a524 : a524: 50 61 74 74 65 72 6e 20 63 65 6e 74 65 72 20 5b Pattern center [ a534: 25 66 20 25 66 5d 2c 20 6d 61 74 63 68 20 25 66 %f %f], match %f a544: 25 25 0a 00 %%.. 0000a548 : a548: 20 5b 25 66 2c 20 25 66 5d 5b 25 66 5d 20 66 69 [%f, %f][%f] fi a558: 6e 61 6c 20 63 69 72 63 6c 65 0a 00 nal circle.. 0000a564 : a564: 74 6d 63 32 31 33 30 5f 67 6f 74 6f 5f 73 74 65 tmc2130_goto_ste a574: 70 20 25 64 20 25 64 20 25 64 20 25 64 20 0a 00 p %d %d %d %d .. 0000a584 <_ZL16ramming_sequence.lto_priv.395>: a584: e0 2d 90 3e 89 88 b2 41 11 36 9c 3e 77 77 c1 41 .-.>...A.6.>ww.A a594: 29 cb b0 3e ef ee da 41 ba 49 cc 3e ef ee fc 41 )..>...A.I.>...A a5a4: 61 c3 f3 3e ef ee 16 42 9c a2 13 3f cd cc 36 42 a..>...B...?..6B a5b4: 8a b0 11 3f ab aa 56 42 88 63 dd 3d ab aa 56 42 ...?..VB.c.=..VB a5c4: b8 af 43 3f 55 55 72 42 18 26 53 3f 33 b3 82 42 ..C?UUrB.&S?3..B a5d4: 30 2a 59 3f ef 6e 86 42 00 00 70 c1 00 00 c8 42 0*Y?.n.B..p....B a5e4: 00 00 c4 c1 00 00 a0 41 00 00 e0 c0 00 00 20 41 .......A...... A a5f4: 00 00 60 c0 00 00 c0 40 00 00 a0 41 22 22 f2 40 ..`....@...A"".@ a604: 00 00 a0 c1 9a 99 a1 40 00 00 0c c2 55 55 05 42 .......@....UU.B 0000a614 <_ZZN4MMU213ProtocolLogic18ResetRetryAttemptsEvE3__c.lto_priv.393>: a614: 52 65 73 65 74 52 65 74 72 79 41 74 74 65 6d 70 ResetRetryAttemp a624: 74 73 00 ts. 0000a627 : a627: 43 6f 6f 6c 69 6e 67 20 74 69 6d 65 72 20 73 74 Cooling timer st a637: 6f 70 70 65 64 00 opped. 0000a63d : a63d: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 00 Heater cooldown. 0000a64d : a64d: 43 6f 6f 6c 69 6e 67 20 54 69 6d 65 6f 75 74 20 Cooling Timeout a65d: 73 74 61 72 74 65 64 00 started. 0000a665 : a665: 53 61 76 69 6e 67 20 61 6e 64 20 70 61 72 6b 69 Saving and parki a675: 6e 67 00 ng. 0000a678 : a678: 48 65 61 74 65 72 20 63 6f 6f 6c 64 6f 77 6e 20 Heater cooldown a688: 70 65 6e 64 69 6e 67 00 pending. 0000a690 : a690: 52 65 73 75 6d 69 6e 67 20 58 59 5a 00 Resuming XYZ. 0000a69d : a69d: 4d 4d 55 32 74 6f 6f 6c 3d 00 MMU2tool=. 0000a6a7 <_ZL9mmu2Magic.lto_priv.374>: a6a7: 4d 4d 55 32 3a 00 MMU2:. 0000a6ad : a6ad: 57 72 69 74 69 6e 67 20 74 6f 20 66 69 6c 65 3a Writing to file: a6bd: 20 00 . 0000a6bf : a6bf: 46 69 6c 65 20 61 6c 72 65 61 64 79 20 6f 70 65 File already ope a6cf: 6e 65 64 00 ned. 0000a6d3 : a6d3: e3 59 d2 59 be 59 a9 59 93 59 80 59 6a 59 56 59 .Y.Y.Y.Y.Y.YjYVY a6e3: 45 59 2f 59 be 59 d2 59 1b 59 0c 59 f8 58 e7 58 EY/Y.Y.Y.Y.Y.X.X a6f3: d2 58 76 5c bc 58 aa 58 97 58 86 58 71 58 5e 58 .Xv\.X.X.X.XqX^X a703: 4a 58 35 58 2c 58 1a 58 05 58 JX5X,X.X.X 0000a70d : a70d: 4d 36 30 30 20 41 55 54 4f 00 M600 AUTO. 0000a717 : a717: 46 49 4e 44 41 20 66 69 6c 61 6d 65 6e 74 20 72 FINDA filament r a727: 75 6e 6f 75 74 21 00 unout!. 0000a72e : a72e: 43 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 20 74 69 Communication ti a73e: 6d 65 6f 75 74 00 meout. 0000a744 : a744: 50 72 6f 74 6f 63 6f 6c 20 45 72 72 6f 72 00 Protocol Error. 0000a753 : a753: 03 00 03 ... 0000a756 : a756: 56 65 72 73 69 6f 6e 20 6d 69 73 6d 61 74 63 68 Version mismatch ... 0000a767 : a767: 43 6f 6d 6d 61 6e 64 20 45 72 72 6f 72 00 Command Error. 0000a775 : a775: 43 6f 6d 6d 61 6e 64 20 72 65 6a 65 63 74 65 64 Command rejected ... 0000a786 : a786: 4d 4d 55 20 42 75 74 74 6f 6e 20 70 75 73 68 65 MMU Button pushe a796: 64 00 d. 0000a798 : a798: 52 65 74 72 79 42 75 74 74 6f 6e 50 72 65 73 73 RetryButtonPress a7a8: 65 64 00 ed. 0000a7ab <_ZN4MMU2L11errorTitlesE.lto_priv.511>: a7ab: 40 5c 2b 5c 14 5c ff 5b ea 5b d6 5b c6 5b af 5b @\+\.\.[.[.[.[.[ a7bb: 98 5b 81 5b 6d 5b 59 5b 43 5b 43 5b 43 5b 2e 5b .[.[m[Y[C[C[C[.[ a7cb: 2e 5b 2e 5b 1b 5b 1b 5b 1b 5b 08 5b 08 5b 08 5b .[.[.[.[.[.[.[.[ a7db: f1 5a f1 5a f1 5a dc 5a dc 5a dc 5a c6 5a c6 5a .Z.Z.Z.Z.Z.Z.Z.Z a7eb: c6 5a b6 5a a1 5a 8b 5a 75 5a 66 5a 59 5a 42 5a .Z.Z.Z.ZuZfZYZBZ a7fb: 2f 5a 1d 5a 0a 5a f8 59 e8 59 /Z.Z.Z.Y.Y 0000a805 : a805: 42 75 74 74 6f 6e 00 Button. 0000a80c : a80c: 43 68 65 63 6b 55 73 65 72 49 6e 70 75 74 2d 62 CheckUserInput-b a81c: 74 6e 4c 4d 52 20 00 tnLMR . 0000a823 <_ZZN4MMU231ReportErrorHookSensorLineRenderEvE3__c.lto_priv.510>: a823: 46 49 3a 20 20 46 53 3a 20 20 20 20 3e 20 20 82 FI: FS: > . a833: 20 20 20 81 00 .. 0000a838 : a838: 48 6f 74 65 6e 64 20 74 65 6d 70 65 72 61 74 75 Hotend temperatu a848: 72 65 20 72 65 61 63 68 65 64 00 re reached. 0000a853 : a853: 52 65 73 75 6d 69 6e 67 20 54 65 6d 70 00 Resuming Temp. 0000a861 : a861: 43 6f 6f 6c 64 6f 77 6e 20 66 6c 61 67 20 63 6c Cooldown flag cl a871: 65 61 72 65 64 00 eared. 0000a877 : a877: 20 57 3a 00 W:. 0000a87b : a87b: 20 45 3a 00 E:. 0000a87f : a87f: 54 3a 00 T:. 0000a882 : a882: 4e 6f 20 30 78 46 46 20 72 65 63 65 69 76 65 64 No 0xFF received ... 0000a893 : a893: 53 65 6e 64 69 6e 67 20 30 78 46 46 00 Sending 0xFF. 0000a8a0 : a8a0: 46 69 6c 65 20 73 65 6c 65 63 74 65 64 00 File selected. 0000a8ae : a8ae: 20 53 69 7a 65 3a 20 00 Size: . 0000a8b6 : a8b6: 46 69 6c 65 20 6f 70 65 6e 65 64 3a 20 00 File opened: . 0000a8c4 : a8c4: 4e 6f 77 20 66 72 65 73 68 20 66 69 6c 65 3a 20 Now fresh file: ... 0000a8d5 : a8d5: 4e 6f 77 20 64 6f 69 6e 67 20 66 69 6c 65 3a 20 Now doing file: ... 0000a8e6 : a8e6: 22 20 70 6f 73 00 " pos. 0000a8ec : a8ec: 22 20 70 61 72 65 6e 74 3a 22 00 " parent:". 0000a8f7 : a8f7: 53 55 42 52 4f 55 54 49 4e 45 20 43 41 4c 4c 20 SUBROUTINE CALL a907: 74 61 72 67 65 74 3a 22 00 target:". 0000a910 : a910: 74 72 79 69 6e 67 20 74 6f 20 63 61 6c 6c 20 73 trying to call s a920: 75 62 2d 67 63 6f 64 65 20 66 69 6c 65 73 20 77 ub-gcode files w a930: 69 74 68 20 74 6f 6f 20 6d 61 6e 79 20 6c 65 76 ith too many lev a940: 65 6c 73 2e 00 els.. 0000a945 : a945: 20 22 25 73 22 00 "%s". 0000a94b : a94b: 20 25 23 6c 78 00 %#lx. 0000a951 : a951: 44 49 52 5f 45 58 49 54 00 DIR_EXIT. 0000a95a : a95a: 44 49 52 5f 45 4e 54 45 52 3a 20 25 73 20 22 25 DIR_ENTER: %s "% a96a: 73 22 0a 00 s".. 0000a96e : a96e: 61 75 74 6f 25 69 2e 67 00 auto%i.g. 0000a977 : a977: 04 1a .. 0000a979 : a979: 44 65 63 72 65 6d 65 6e 74 52 65 74 72 79 41 74 DecrementRetryAt a989: 74 65 6d 70 74 73 00 tempts. 0000a990 : a990: 08 1b 1c ... 0000a993 : a993: 0b 14 .. 0000a995 <_ZZN4MMU213ProtocolLogic33ResetCommunicationTimeoutAttemptsEvE3__c.lto_priv.394>: a995: 52 53 54 43 6f 6d 6d 54 69 6d 65 6f 75 74 00 RSTCommTimeout. 0000a9a4 : a9a4: 2c 20 6c 61 73 74 20 62 79 74 65 73 3a 20 00 , last bytes: . 0000a9b3 <_ZL10bufferFull.lto_priv.573>: a9b3: 22 20 66 61 69 6c 65 64 3a 20 42 75 66 66 65 72 " failed: Buffer a9c3: 20 66 75 6c 6c 21 00 full!. 0000a9ca : a9ca: 45 72 72 6f 72 3a 00 Error:. 0000a9d1 : a9d1: 22 00 ". 0000a9d3 : a9d3: 45 6e 71 75 65 69 6e 67 20 74 6f 20 74 68 65 20 Enqueing to the a9e3: 66 72 6f 6e 74 3a 20 22 00 front: ". 0000a9ec <_ZL9mmu2Magic.lto_priv.375>: a9ec: 4d 4d 55 32 3a 00 MMU2:. 0000a9f2 : a9f2: 65 63 68 6f 3a 00 echo:. 0000a9f8 : a9f8: 3e 53 30 2a 63 36 2e 00 >S0*c6.. 0000aa00 : aa00: 4d 4d 55 20 69 73 20 00 MMU is . 0000aa08 : aa08: 25 2e 31 30 53 20 00 %.10S . 0000aa0f : aa0f: 25 34 64 00 %4d. 0000aa13 : aa13: 45 78 72 65 6d 65 20 73 70 61 6e 20 6f 66 20 74 Exreme span of t aa23: 68 65 20 5a 20 76 61 6c 75 65 73 21 00 he Z values!. 0000aa30 : aa30: 25 64 2f 39 00 %d/9. 0000aa35 : aa35: 4d 4d 55 32 3a 00 MMU2:. 0000aa3b : aa3b: 25 33 64 00 %3d. 0000aa3f : aa3f: 18 01 04 19 02 0a ...... 0000aa45 : aa45: 2b 64 b5 63 3b 63 ce 62 85 62 f3 61 7b 61 13 61 +d.c;c.b.b.a{a.a aa55: c4 60 a4 60 58 60 a4 60 41 60 41 60 41 60 41 60 .`.`X`.`A`A`A`A` aa65: 41 60 41 60 41 60 41 60 41 60 41 60 41 60 41 60 A`A`A`A`A`A`A`A` aa75: 41 60 41 60 41 60 41 60 41 60 41 60 41 60 41 60 A`A`A`A`A`A`A`A` aa85: 41 60 41 60 0a 60 c9 5f 7f 5f 0c 5f d7 5e 8d 5e A`A`.`._._._.^.^ aa95: 43 5e e5 5d ac 5d 6a 5d 4d 5d C^.].]j]M] 0000aa9f : aa9f: 01 01 01 01 01 01 01 02 71 01 71 01 32 32 32 03 ........q.q.222. aaaf: 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 ................ aabf: 03 03 93 93 24 38 03 93 03 01 02 56 03 ....$8.....V. 0000aacc : aacc: 65 00 66 00 67 00 68 00 69 00 6a 00 6b 00 6c 00 e.f.g.h.i.j.k.l. aadc: 73 00 74 00 7d 00 7e 00 c9 00 d3 00 dd 00 ca 00 s.t.}.~......... aaec: d4 00 de 00 2d 01 37 01 41 01 2e 01 38 01 42 01 ....-.7.A...8.B. aafc: 2f 01 39 01 43 01 30 01 3a 01 44 01 31 01 3b 01 /.9.C.0.:.D.1.;. ab0c: 45 01 32 01 91 01 92 01 f5 01 f6 01 f7 01 f8 01 E.2............. ab1c: f9 01 fa 01 fb 01 fc 01 84 03 .......... 0000ab26 : ab26: b8 64 21 65 ad 64 a4 64 9d 64 eb 4b 64 3c 96 64 .d!e.d.d.d.Kd<.d ab36: 8c 64 .d 0000ab38 : ab38: 25 2e 32 30 53 0a 70 72 75 73 61 2e 69 6f 2f 30 %.20S.prusa.io/0 ab48: 34 25 68 75 00 4%hu. 0000ab4d : ab4d: 20 55 70 67 72 61 64 69 6e 67 20 78 66 6c 61 73 Upgrading xflas ab5d: 68 0a 20 44 6f 20 6e 6f 74 20 64 69 73 63 6f 6e h. Do not discon ab6d: 6e 65 63 74 21 00 nect!. 0000ab73 : ab73: 77 32 35 78 32 30 63 6c 5f 63 66 6d 0a 00 w25x20cl_cfm.. 0000ab81 : ab81: 77 32 35 78 32 30 63 6c 5f 65 6e 74 65 72 0a 00 w25x20cl_enter.. 0000ab91 : ab91: 73 74 61 72 74 0a 00 start.. 0000ab98 : ab98: 72 65 63 6f 76 65 72 5f 6d 61 63 68 69 6e 65 5f recover_machine_ aba8: 73 74 61 74 65 5f 61 66 74 65 72 5f 70 6f 77 65 state_after_powe abb8: 72 5f 70 61 6e 69 63 2c 20 69 6e 69 74 69 61 6c r_panic, initial abc8: 20 00 . 0000abca <_ZZL25restore_print_from_eeprombE3__c__12_>: abca: 50 52 55 53 41 20 75 76 6c 6f 00 PRUSA uvlo. 0000abd5 <_ZZL25restore_print_from_eeprombE3__c__11_>: abd5: 47 34 20 53 30 00 G4 S0. 0000abdb <_ZZL25restore_print_from_eeprombE3__c__10_>: abdb: 4d 31 31 30 20 4e 25 6c 75 00 M110 N%lu. 0000abe5 : abe5: 4d 32 36 20 53 25 6c 75 00 M26 S%lu. 0000abee : abee: 4d 31 30 36 20 53 25 75 00 M106 S%u. 0000abf7 : abf7: 47 31 20 46 25 64 00 G1 F%d. 0000abfe : abfe: 4d 38 32 00 M82. 0000ac02 : ac02: 47 39 32 20 45 25 2d 2e 33 66 00 G92 E%-.3f. 0000ac0d : ac0d: 4d 32 30 34 20 50 25 2d 2e 31 66 20 52 25 2d 2e M204 P%-.1f R%-. ac1d: 31 66 20 54 25 2d 2e 31 66 00 1f T%-.1f. 0000ac27 : ac27: 47 31 20 5a 25 2d 2e 33 66 00 G1 Z%-.3f. 0000ac31 : ac31: 50 52 55 53 41 20 4d 42 4c 20 56 31 00 PRUSA MBL V1. 0000ac3e : ac3e: 47 31 20 58 25 2d 2e 33 66 20 59 25 2d 2e 33 66 G1 X%-.3f Y%-.3f ac4e: 20 46 33 30 30 30 00 F3000. 0000ac55 : ac55: 2c 20 66 65 65 64 6d 75 6c 74 69 70 6c 79 3a 00 , feedmultiply:. 0000ac65 : ac65: 46 65 65 64 72 61 74 65 3a 00 Feedrate:. 0000ac6f : ac6f: 47 31 20 45 35 20 46 31 32 30 00 G1 E5 F120. 0000ac7a : ac7a: 4d 31 30 39 20 53 25 64 00 M109 S%d. 0000ac83 : ac83: 4d 31 34 30 20 53 25 64 00 M140 S%d. 0000ac8c : ac8c: 4d 31 30 34 20 53 25 64 00 M104 S%d. 0000ac95 : ac95: 47 32 38 20 58 20 59 00 G28 X Y. 0000ac9d : ac9d: 47 31 20 5a 25 2e 33 66 20 46 38 30 30 00 G1 Z%.3f F800. 0000acab : acab: 00 00 21 10 42 20 63 30 84 40 a5 50 c6 60 e7 70 ..!.B c0.@.P.`.p acbb: 08 81 29 91 4a a1 6b b1 8c c1 ad d1 ce e1 ef f1 ..).J.k......... accb: 31 12 10 02 73 32 52 22 b5 52 94 42 f7 72 d6 62 1...s2R".R.B.r.b acdb: 39 93 18 83 7b b3 5a a3 bd d3 9c c3 ff f3 de e3 9...{.Z......... aceb: 62 24 43 34 20 04 01 14 e6 64 c7 74 a4 44 85 54 b$C4 ....d.t.D.T acfb: 6a a5 4b b5 28 85 09 95 ee e5 cf f5 ac c5 8d d5 j.K.(........... ad0b: 53 36 72 26 11 16 30 06 d7 76 f6 66 95 56 b4 46 S6r&..0..v.f.V.F ad1b: 5b b7 7a a7 19 97 38 87 df f7 fe e7 9d d7 bc c7 [.z...8......... ad2b: c4 48 e5 58 86 68 a7 78 40 08 61 18 02 28 23 38 .H.X.h.x@.a..(#8 ad3b: cc c9 ed d9 8e e9 af f9 48 89 69 99 0a a9 2b b9 ........H.i...+. ad4b: f5 5a d4 4a b7 7a 96 6a 71 1a 50 0a 33 3a 12 2a .Z.J.z.jq.P.3:.* ad5b: fd db dc cb bf fb 9e eb 79 9b 58 8b 3b bb 1a ab ........y.X.;... ad6b: a6 6c 87 7c e4 4c c5 5c 22 2c 03 3c 60 0c 41 1c .l.|.L.\",.<`.A. ad7b: ae ed 8f fd ec cd cd dd 2a ad 0b bd 68 8d 49 9d ........*...h.I. ad8b: 97 7e b6 6e d5 5e f4 4e 13 3e 32 2e 51 1e 70 0e .~.n.^.N.>2.Q.p. ad9b: 9f ff be ef dd df fc cf 1b bf 3a af 59 9f 78 8f ..........:.Y.x. adab: 88 91 a9 81 ca b1 eb a1 0c d1 2d c1 4e f1 6f e1 ..........-.N.o. adbb: 80 10 a1 00 c2 30 e3 20 04 50 25 40 46 70 67 60 .....0. .P%@Fpg` adcb: b9 83 98 93 fb a3 da b3 3d c3 1c d3 7f e3 5e f3 ........=.....^. addb: b1 02 90 12 f3 22 d2 32 35 42 14 52 77 62 56 72 .....".25B.RwbVr adeb: ea b5 cb a5 a8 95 89 85 6e f5 4f e5 2c d5 0d c5 ........n.O.,... adfb: e2 34 c3 24 a0 14 81 04 66 74 47 64 24 54 05 44 .4.$....ftGd$T.D ae0b: db a7 fa b7 99 87 b8 97 5f e7 7e f7 1d c7 3c d7 ........_.~...<. ae1b: d3 26 f2 36 91 06 b0 16 57 66 76 76 15 46 34 56 .&.6....Wfvv.F4V ae2b: 4c d9 6d c9 0e f9 2f e9 c8 99 e9 89 8a b9 ab a9 L.m.../......... ae3b: 44 58 65 48 06 78 27 68 c0 18 e1 08 82 38 a3 28 DXeH.x'h.....8.( ae4b: 7d cb 5c db 3f eb 1e fb f9 8b d8 9b bb ab 9a bb }.\.?........... ae5b: 75 4a 54 5a 37 6a 16 7a f1 0a d0 1a b3 2a 92 3a uJTZ7j.z.....*.: ae6b: 2e fd 0f ed 6c dd 4d cd aa bd 8b ad e8 9d c9 8d ....l.M......... ae7b: 26 7c 07 6c 64 5c 45 4c a2 3c 83 2c e0 1c c1 0c &|.ld\EL.<.,.... ae8b: 1f ef 3e ff 5d cf 7c df 9b af ba bf d9 8f f8 9f ..>.].|......... ae9b: 17 6e 36 7e 55 4e 74 5e 93 2e b2 3e d1 0e f0 1e .n6~UNt^...>.... 0000aeab : aeab: 7c 3c 3e 3f 2f 2a 22 5c 00 |<>?/*"\. 0000aeb4 <__ctors_start>: aeb4: 30 3b cpi r19, 0xB0 ; 176 0000aeb6 <__ctors_end>: aeb6: 2a 65 ori r18, 0x5A ; 90 0000aeb8 <__dtors_end>: aeb8: 11 24 eor r1, r1 aeba: 1f be out 0x3f, r1 ; 63 aebc: cf ef ldi r28, 0xFF ; 255 aebe: d1 e2 ldi r29, 0x21 ; 33 aec0: de bf out 0x3e, r29 ; 62 aec2: cd bf out 0x3d, r28 ; 61 aec4: 00 e0 ldi r16, 0x00 ; 0 aec6: 0c bf out 0x3c, r16 ; 60 0000aec8 <__do_copy_data>: aec8: 13 e0 ldi r17, 0x03 ; 3 aeca: a0 e0 ldi r26, 0x00 ; 0 aecc: b2 e0 ldi r27, 0x02 ; 2 aece: ea eb ldi r30, 0xBA ; 186 aed0: f8 ec ldi r31, 0xC8 ; 200 aed2: 03 e0 ldi r16, 0x03 ; 3 aed4: 0b bf out 0x3b, r16 ; 59 aed6: 02 c0 rjmp .+4 ; 0xaedc <__do_copy_data+0x14> aed8: 07 90 elpm r0, Z+ aeda: 0d 92 st X+, r0 aedc: a6 32 cpi r26, 0x26 ; 38 aede: b1 07 cpc r27, r17 aee0: d9 f7 brne .-10 ; 0xaed8 <__do_copy_data+0x10> 0000aee2 <__do_clear_bss>: aee2: 28 e1 ldi r18, 0x18 ; 24 aee4: a6 e2 ldi r26, 0x26 ; 38 aee6: b3 e0 ldi r27, 0x03 ; 3 aee8: 01 c0 rjmp .+2 ; 0xaeec <.do_clear_bss_start> 0000aeea <.do_clear_bss_loop>: aeea: 1d 92 st X+, r1 0000aeec <.do_clear_bss_start>: aeec: a9 31 cpi r26, 0x19 ; 25 aeee: b2 07 cpc r27, r18 aef0: e1 f7 brne .-8 ; 0xaeea <.do_clear_bss_loop> 0000aef2 <__do_global_ctors>: aef2: 17 e5 ldi r17, 0x57 ; 87 aef4: cb e5 ldi r28, 0x5B ; 91 aef6: d7 e5 ldi r29, 0x57 ; 87 aef8: 00 e0 ldi r16, 0x00 ; 0 aefa: 06 c0 rjmp .+12 ; 0xaf08 <__do_global_ctors+0x16> aefc: 21 97 sbiw r28, 0x01 ; 1 aefe: 01 09 sbc r16, r1 af00: 80 2f mov r24, r16 af02: fe 01 movw r30, r28 af04: 0f 94 a1 de call 0x3bd42 ; 0x3bd42 <__tablejump2__> af08: ca 35 cpi r28, 0x5A ; 90 af0a: d1 07 cpc r29, r17 af0c: 80 e0 ldi r24, 0x00 ; 0 af0e: 08 07 cpc r16, r24 af10: a9 f7 brne .-22 ; 0xaefc <__do_global_ctors+0xa> af12: 0e 94 e6 f9 call 0x1f3cc ; 0x1f3cc
af16: 0d 94 4b e4 jmp 0x3c896 ; 0x3c896 <__do_global_dtors> 0000af1a <__bad_interrupt>: af1a: 0c 94 20 68 jmp 0xd040 ; 0xd040 <__vector_default> 0000af1e : af1e: 2f 92 push r2 af20: 3f 92 push r3 af22: 4f 92 push r4 af24: 5f 92 push r5 af26: 6f 92 push r6 af28: 7f 92 push r7 af2a: 8f 92 push r8 af2c: 9f 92 push r9 af2e: af 92 push r10 af30: bf 92 push r11 af32: cf 92 push r12 af34: df 92 push r13 af36: ef 92 push r14 af38: ff 92 push r15 af3a: 0f 93 push r16 af3c: 1f 93 push r17 af3e: cf 93 push r28 af40: df 93 push r29 af42: cd b7 in r28, 0x3d ; 61 af44: de b7 in r29, 0x3e ; 62 af46: 2f 97 sbiw r28, 0x0f ; 15 af48: 0f b6 in r0, 0x3f ; 63 af4a: f8 94 cli af4c: de bf out 0x3e, r29 ; 62 af4e: 0f be out 0x3f, r0 ; 63 af50: cd bf out 0x3d, r28 ; 61 af52: 6c 01 movw r12, r24 af54: 1b 01 movw r2, r22 af56: 5a 01 movw r10, r20 af58: fc 01 movw r30, r24 af5a: 17 82 std Z+7, r1 ; 0x07 af5c: 16 82 std Z+6, r1 ; 0x06 af5e: 83 81 ldd r24, Z+3 ; 0x03 af60: 9e 01 movw r18, r28 af62: 2f 5f subi r18, 0xFF ; 255 af64: 3f 4f sbci r19, 0xFF ; 255 af66: 49 01 movw r8, r18 af68: 81 fd sbrc r24, 1 af6a: d2 c0 rjmp .+420 ; 0xb110 af6c: 8f ef ldi r24, 0xFF ; 255 af6e: 9f ef ldi r25, 0xFF ; 255 af70: ee c2 rjmp .+1500 ; 0xb54e af72: f1 2c mov r15, r1 af74: 51 2c mov r5, r1 af76: 00 e0 ldi r16, 0x00 ; 0 af78: 00 32 cpi r16, 0x20 ; 32 af7a: 38 f4 brcc .+14 ; 0xaf8a af7c: 8b 32 cpi r24, 0x2B ; 43 af7e: 09 f1 breq .+66 ; 0xafc2 af80: 90 f4 brcc .+36 ; 0xafa6 af82: 80 32 cpi r24, 0x20 ; 32 af84: f9 f0 breq .+62 ; 0xafc4 af86: 83 32 cpi r24, 0x23 ; 35 af88: 09 f1 breq .+66 ; 0xafcc af8a: 07 fd sbrc r16, 7 af8c: 34 c0 rjmp .+104 ; 0xaff6 af8e: 20 ed ldi r18, 0xD0 ; 208 af90: 28 0f add r18, r24 af92: 2a 30 cpi r18, 0x0A ; 10 af94: 20 f5 brcc .+72 ; 0xafde af96: 06 ff sbrs r16, 6 af98: 1b c0 rjmp .+54 ; 0xafd0 af9a: fa e0 ldi r31, 0x0A ; 10 af9c: ff 9e mul r15, r31 af9e: 20 0d add r18, r0 afa0: 11 24 eor r1, r1 afa2: f2 2e mov r15, r18 afa4: 05 c0 rjmp .+10 ; 0xafb0 afa6: 8d 32 cpi r24, 0x2D ; 45 afa8: 79 f0 breq .+30 ; 0xafc8 afaa: 80 33 cpi r24, 0x30 ; 48 afac: 71 f7 brne .-36 ; 0xaf8a afae: 01 60 ori r16, 0x01 ; 1 afb0: f1 01 movw r30, r2 afb2: 93 fd sbrc r25, 3 afb4: 85 91 lpm r24, Z+ afb6: 93 ff sbrs r25, 3 afb8: 81 91 ld r24, Z+ afba: 1f 01 movw r2, r30 afbc: 81 11 cpse r24, r1 afbe: dc cf rjmp .-72 ; 0xaf78 afc0: 1a c0 rjmp .+52 ; 0xaff6 afc2: 02 60 ori r16, 0x02 ; 2 afc4: 04 60 ori r16, 0x04 ; 4 afc6: f4 cf rjmp .-24 ; 0xafb0 afc8: 08 60 ori r16, 0x08 ; 8 afca: f2 cf rjmp .-28 ; 0xafb0 afcc: 00 61 ori r16, 0x10 ; 16 afce: f0 cf rjmp .-32 ; 0xafb0 afd0: 3a e0 ldi r19, 0x0A ; 10 afd2: 53 9e mul r5, r19 afd4: 20 0d add r18, r0 afd6: 11 24 eor r1, r1 afd8: 52 2e mov r5, r18 afda: 00 62 ori r16, 0x20 ; 32 afdc: e9 cf rjmp .-46 ; 0xafb0 afde: 8e 32 cpi r24, 0x2E ; 46 afe0: 21 f4 brne .+8 ; 0xafea afe2: 06 fd sbrc r16, 6 afe4: b1 c2 rjmp .+1378 ; 0xb548 afe6: 00 64 ori r16, 0x40 ; 64 afe8: e3 cf rjmp .-58 ; 0xafb0 afea: 8c 36 cpi r24, 0x6C ; 108 afec: 11 f4 brne .+4 ; 0xaff2 afee: 00 68 ori r16, 0x80 ; 128 aff0: df cf rjmp .-66 ; 0xafb0 aff2: 88 36 cpi r24, 0x68 ; 104 aff4: e9 f2 breq .-70 ; 0xafb0 aff6: 9b eb ldi r25, 0xBB ; 187 aff8: 98 0f add r25, r24 affa: 93 30 cpi r25, 0x03 ; 3 affc: 08 f0 brcs .+2 ; 0xb000 affe: 5f c0 rjmp .+190 ; 0xb0be b000: 00 61 ori r16, 0x10 ; 16 b002: 80 5e subi r24, 0xE0 ; 224 b004: 06 fd sbrc r16, 6 b006: 02 c0 rjmp .+4 ; 0xb00c b008: 46 e0 ldi r20, 0x06 ; 6 b00a: f4 2e mov r15, r20 b00c: 10 2f mov r17, r16 b00e: 1f 73 andi r17, 0x3F ; 63 b010: 85 36 cpi r24, 0x65 ; 101 b012: 09 f0 breq .+2 ; 0xb016 b014: 5b c0 rjmp .+182 ; 0xb0cc b016: 10 64 ori r17, 0x40 ; 64 b018: 17 ff sbrs r17, 7 b01a: 61 c0 rjmp .+194 ; 0xb0de b01c: 8f 2d mov r24, r15 b01e: 9b e3 ldi r25, 0x3B ; 59 b020: 9f 15 cp r25, r15 b022: 08 f4 brcc .+2 ; 0xb026 b024: 8b e3 ldi r24, 0x3B ; 59 b026: 44 24 eor r4, r4 b028: 43 94 inc r4 b02a: 48 0e add r4, r24 b02c: 27 e0 ldi r18, 0x07 ; 7 b02e: 35 01 movw r6, r10 b030: f4 e0 ldi r31, 0x04 ; 4 b032: 6f 0e add r6, r31 b034: 71 1c adc r7, r1 b036: f5 01 movw r30, r10 b038: 60 81 ld r22, Z b03a: 71 81 ldd r23, Z+1 ; 0x01 b03c: 82 81 ldd r24, Z+2 ; 0x02 b03e: 93 81 ldd r25, Z+3 ; 0x03 b040: 04 2d mov r16, r4 b042: a4 01 movw r20, r8 b044: 0f 94 4a da call 0x3b494 ; 0x3b494 <__ftoa_engine> b048: 5c 01 movw r10, r24 b04a: f9 81 ldd r31, Y+1 ; 0x01 b04c: fc 87 std Y+12, r31 ; 0x0c b04e: f0 ff sbrs r31, 0 b050: 03 c0 rjmp .+6 ; 0xb058 b052: 0d e2 ldi r16, 0x2D ; 45 b054: f3 ff sbrs r31, 3 b056: 07 c0 rjmp .+14 ; 0xb066 b058: 0b e2 ldi r16, 0x2B ; 43 b05a: 11 fd sbrc r17, 1 b05c: 04 c0 rjmp .+8 ; 0xb066 b05e: 01 2f mov r16, r17 b060: 04 70 andi r16, 0x04 ; 4 b062: 12 fd sbrc r17, 2 b064: 00 e2 ldi r16, 0x20 ; 32 b066: 2c 85 ldd r18, Y+12 ; 0x0c b068: 2c 70 andi r18, 0x0C ; 12 b06a: e2 2e mov r14, r18 b06c: 09 f4 brne .+2 ; 0xb070 b06e: 6b c0 rjmp .+214 ; 0xb146 b070: 01 11 cpse r16, r1 b072: d8 c2 rjmp .+1456 ; 0xb624 b074: f3 e0 ldi r31, 0x03 ; 3 b076: e1 2c mov r14, r1 b078: f5 15 cp r31, r5 b07a: a0 f4 brcc .+40 ; 0xb0a4 b07c: 83 e0 ldi r24, 0x03 ; 3 b07e: e5 2c mov r14, r5 b080: e8 1a sub r14, r24 b082: 13 fd sbrc r17, 3 b084: 08 c0 rjmp .+16 ; 0xb096 b086: b6 01 movw r22, r12 b088: 80 e2 ldi r24, 0x20 ; 32 b08a: 90 e0 ldi r25, 0x00 ; 0 b08c: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b090: ea 94 dec r14 b092: e1 10 cpse r14, r1 b094: f8 cf rjmp .-16 ; 0xb086 b096: 00 23 and r16, r16 b098: 29 f0 breq .+10 ; 0xb0a4 b09a: b6 01 movw r22, r12 b09c: 80 2f mov r24, r16 b09e: 90 e0 ldi r25, 0x00 ; 0 b0a0: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b0a4: 3c 85 ldd r19, Y+12 ; 0x0c b0a6: 28 ee ldi r18, 0xE8 ; 232 b0a8: a2 2e mov r10, r18 b0aa: 26 e7 ldi r18, 0x76 ; 118 b0ac: b2 2e mov r11, r18 b0ae: 33 fd sbrc r19, 3 b0b0: 04 c0 rjmp .+8 ; 0xb0ba b0b2: 9c ee ldi r25, 0xEC ; 236 b0b4: a9 2e mov r10, r25 b0b6: 96 e7 ldi r25, 0x76 ; 118 b0b8: b9 2e mov r11, r25 b0ba: 10 71 andi r17, 0x10 ; 16 b0bc: 22 c0 rjmp .+68 ; 0xb102 b0be: 9b e9 ldi r25, 0x9B ; 155 b0c0: 98 0f add r25, r24 b0c2: 93 30 cpi r25, 0x03 ; 3 b0c4: 08 f0 brcs .+2 ; 0xb0c8 b0c6: 47 c1 rjmp .+654 ; 0xb356 b0c8: 0f 7e andi r16, 0xEF ; 239 b0ca: 9c cf rjmp .-200 ; 0xb004 b0cc: 86 36 cpi r24, 0x66 ; 102 b0ce: 11 f4 brne .+4 ; 0xb0d4 b0d0: 10 68 ori r17, 0x80 ; 128 b0d2: a2 cf rjmp .-188 ; 0xb018 b0d4: ff 20 and r15, r15 b0d6: 09 f4 brne .+2 ; 0xb0da b0d8: 9f cf rjmp .-194 ; 0xb018 b0da: fa 94 dec r15 b0dc: 9d cf rjmp .-198 ; 0xb018 b0de: e7 e0 ldi r30, 0x07 ; 7 b0e0: 2f 2d mov r18, r15 b0e2: ef 15 cp r30, r15 b0e4: 18 f4 brcc .+6 ; 0xb0ec b0e6: 27 e0 ldi r18, 0x07 ; 7 b0e8: 37 e0 ldi r19, 0x07 ; 7 b0ea: f3 2e mov r15, r19 b0ec: 41 2c mov r4, r1 b0ee: 9f cf rjmp .-194 ; 0xb02e b0f0: 11 11 cpse r17, r1 b0f2: 80 52 subi r24, 0x20 ; 32 b0f4: b6 01 movw r22, r12 b0f6: 90 e0 ldi r25, 0x00 ; 0 b0f8: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b0fc: 8f ef ldi r24, 0xFF ; 255 b0fe: a8 1a sub r10, r24 b100: b8 0a sbc r11, r24 b102: f5 01 movw r30, r10 b104: 84 91 lpm r24, Z b106: 81 11 cpse r24, r1 b108: f3 cf rjmp .-26 ; 0xb0f0 b10a: e1 10 cpse r14, r1 b10c: 84 c2 rjmp .+1288 ; 0xb616 b10e: 53 01 movw r10, r6 b110: f6 01 movw r30, r12 b112: 93 81 ldd r25, Z+3 ; 0x03 b114: f1 01 movw r30, r2 b116: 93 fd sbrc r25, 3 b118: 85 91 lpm r24, Z+ b11a: 93 ff sbrs r25, 3 b11c: 81 91 ld r24, Z+ b11e: 1f 01 movw r2, r30 b120: 88 23 and r24, r24 b122: 09 f4 brne .+2 ; 0xb126 b124: 11 c2 rjmp .+1058 ; 0xb548 b126: 85 32 cpi r24, 0x25 ; 37 b128: 41 f4 brne .+16 ; 0xb13a b12a: 93 fd sbrc r25, 3 b12c: 85 91 lpm r24, Z+ b12e: 93 ff sbrs r25, 3 b130: 81 91 ld r24, Z+ b132: 1f 01 movw r2, r30 b134: 85 32 cpi r24, 0x25 ; 37 b136: 09 f0 breq .+2 ; 0xb13a b138: 1c cf rjmp .-456 ; 0xaf72 b13a: b6 01 movw r22, r12 b13c: 90 e0 ldi r25, 0x00 ; 0 b13e: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b142: 35 01 movw r6, r10 b144: e4 cf rjmp .-56 ; 0xb10e b146: 17 ff sbrs r17, 7 b148: 6f c0 rjmp .+222 ; 0xb228 b14a: 4a 0c add r4, r10 b14c: fc 85 ldd r31, Y+12 ; 0x0c b14e: f4 ff sbrs r31, 4 b150: 04 c0 rjmp .+8 ; 0xb15a b152: 8a 81 ldd r24, Y+2 ; 0x02 b154: 81 33 cpi r24, 0x31 ; 49 b156: 09 f4 brne .+2 ; 0xb15a b158: 4a 94 dec r4 b15a: 14 14 cp r1, r4 b15c: 0c f0 brlt .+2 ; 0xb160 b15e: 86 c0 rjmp .+268 ; 0xb26c b160: 28 e0 ldi r18, 0x08 ; 8 b162: 24 15 cp r18, r4 b164: 10 f4 brcc .+4 ; 0xb16a b166: 88 e0 ldi r24, 0x08 ; 8 b168: 48 2e mov r4, r24 b16a: 85 e0 ldi r24, 0x05 ; 5 b16c: 90 e0 ldi r25, 0x00 ; 0 b16e: 17 ff sbrs r17, 7 b170: 06 c0 rjmp .+12 ; 0xb17e b172: c5 01 movw r24, r10 b174: b7 fe sbrs r11, 7 b176: 02 c0 rjmp .+4 ; 0xb17c b178: 90 e0 ldi r25, 0x00 ; 0 b17a: 80 e0 ldi r24, 0x00 ; 0 b17c: 01 96 adiw r24, 0x01 ; 1 b17e: 01 11 cpse r16, r1 b180: 01 96 adiw r24, 0x01 ; 1 b182: ff 20 and r15, r15 b184: 31 f0 breq .+12 ; 0xb192 b186: 2f 2d mov r18, r15 b188: 30 e0 ldi r19, 0x00 ; 0 b18a: 2f 5f subi r18, 0xFF ; 255 b18c: 3f 4f sbci r19, 0xFF ; 255 b18e: 82 0f add r24, r18 b190: 93 1f adc r25, r19 b192: 58 16 cp r5, r24 b194: 19 06 cpc r1, r25 b196: 19 f0 breq .+6 ; 0xb19e b198: 14 f0 brlt .+4 ; 0xb19e b19a: e5 2c mov r14, r5 b19c: e8 1a sub r14, r24 b19e: 81 2f mov r24, r17 b1a0: 89 70 andi r24, 0x09 ; 9 b1a2: 11 f4 brne .+4 ; 0xb1a8 b1a4: e1 10 cpse r14, r1 b1a6: 67 c0 rjmp .+206 ; 0xb276 b1a8: 00 23 and r16, r16 b1aa: 29 f0 breq .+10 ; 0xb1b6 b1ac: b6 01 movw r22, r12 b1ae: 80 2f mov r24, r16 b1b0: 90 e0 ldi r25, 0x00 ; 0 b1b2: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b1b6: 13 fd sbrc r17, 3 b1b8: 02 c0 rjmp .+4 ; 0xb1be b1ba: e1 10 cpse r14, r1 b1bc: 63 c0 rjmp .+198 ; 0xb284 b1be: 17 ff sbrs r17, 7 b1c0: 7c c0 rjmp .+248 ; 0xb2ba b1c2: 85 01 movw r16, r10 b1c4: b7 fe sbrs r11, 7 b1c6: 02 c0 rjmp .+4 ; 0xb1cc b1c8: 10 e0 ldi r17, 0x00 ; 0 b1ca: 00 e0 ldi r16, 0x00 ; 0 b1cc: c5 01 movw r24, r10 b1ce: 84 19 sub r24, r4 b1d0: 91 09 sbc r25, r1 b1d2: 2c 01 movw r4, r24 b1d4: 6f 2d mov r22, r15 b1d6: 70 e0 ldi r23, 0x00 ; 0 b1d8: ee 27 eor r30, r30 b1da: ff 27 eor r31, r31 b1dc: e6 1b sub r30, r22 b1de: f7 0b sbc r31, r23 b1e0: ff 87 std Y+15, r31 ; 0x0f b1e2: ee 87 std Y+14, r30 ; 0x0e b1e4: 0f 3f cpi r16, 0xFF ; 255 b1e6: 10 07 cpc r17, r16 b1e8: 29 f4 brne .+10 ; 0xb1f4 b1ea: b6 01 movw r22, r12 b1ec: 8e e2 ldi r24, 0x2E ; 46 b1ee: 90 e0 ldi r25, 0x00 ; 0 b1f0: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b1f4: a0 16 cp r10, r16 b1f6: b1 06 cpc r11, r17 b1f8: 0c f4 brge .+2 ; 0xb1fc b1fa: 4b c0 rjmp .+150 ; 0xb292 b1fc: 40 16 cp r4, r16 b1fe: 51 06 cpc r5, r17 b200: 0c f0 brlt .+2 ; 0xb204 b202: 47 c0 rjmp .+142 ; 0xb292 b204: f5 01 movw r30, r10 b206: e0 1b sub r30, r16 b208: f1 0b sbc r31, r17 b20a: e8 0d add r30, r8 b20c: f9 1d adc r31, r9 b20e: 81 81 ldd r24, Z+1 ; 0x01 b210: 01 50 subi r16, 0x01 ; 1 b212: 11 09 sbc r17, r1 b214: 2e 85 ldd r18, Y+14 ; 0x0e b216: 3f 85 ldd r19, Y+15 ; 0x0f b218: 02 17 cp r16, r18 b21a: 13 07 cpc r17, r19 b21c: e4 f1 brlt .+120 ; 0xb296 b21e: b6 01 movw r22, r12 b220: 90 e0 ldi r25, 0x00 ; 0 b222: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b226: de cf rjmp .-68 ; 0xb1e4 b228: 16 fd sbrc r17, 6 b22a: 9f cf rjmp .-194 ; 0xb16a b22c: ef 2d mov r30, r15 b22e: f0 e0 ldi r31, 0x00 ; 0 b230: ea 15 cp r30, r10 b232: fb 05 cpc r31, r11 b234: 34 f0 brlt .+12 ; 0xb242 b236: 3c ef ldi r19, 0xFC ; 252 b238: a3 16 cp r10, r19 b23a: 3f ef ldi r19, 0xFF ; 255 b23c: b3 06 cpc r11, r19 b23e: 0c f0 brlt .+2 ; 0xb242 b240: 10 68 ori r17, 0x80 ; 128 b242: 32 96 adiw r30, 0x02 ; 2 b244: e8 0d add r30, r8 b246: f9 1d adc r31, r9 b248: 01 c0 rjmp .+2 ; 0xb24c b24a: fa 94 dec r15 b24c: ff 20 and r15, r15 b24e: 19 f0 breq .+6 ; 0xb256 b250: 82 91 ld r24, -Z b252: 80 33 cpi r24, 0x30 ; 48 b254: d1 f3 breq .-12 ; 0xb24a b256: 17 ff sbrs r17, 7 b258: 88 cf rjmp .-240 ; 0xb16a b25a: 44 24 eor r4, r4 b25c: 43 94 inc r4 b25e: 4f 0c add r4, r15 b260: fa 14 cp r15, r10 b262: 1b 04 cpc r1, r11 b264: 31 f0 breq .+12 ; 0xb272 b266: 2c f0 brlt .+10 ; 0xb272 b268: fa 18 sub r15, r10 b26a: 7f cf rjmp .-258 ; 0xb16a b26c: 44 24 eor r4, r4 b26e: 43 94 inc r4 b270: 7c cf rjmp .-264 ; 0xb16a b272: f1 2c mov r15, r1 b274: 7a cf rjmp .-268 ; 0xb16a b276: b6 01 movw r22, r12 b278: 80 e2 ldi r24, 0x20 ; 32 b27a: 90 e0 ldi r25, 0x00 ; 0 b27c: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b280: ea 94 dec r14 b282: 90 cf rjmp .-224 ; 0xb1a4 b284: b6 01 movw r22, r12 b286: 80 e3 ldi r24, 0x30 ; 48 b288: 90 e0 ldi r25, 0x00 ; 0 b28a: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b28e: ea 94 dec r14 b290: 94 cf rjmp .-216 ; 0xb1ba b292: 80 e3 ldi r24, 0x30 ; 48 b294: bd cf rjmp .-134 ; 0xb210 b296: a0 16 cp r10, r16 b298: b1 06 cpc r11, r17 b29a: 41 f4 brne .+16 ; 0xb2ac b29c: 9a 81 ldd r25, Y+2 ; 0x02 b29e: 96 33 cpi r25, 0x36 ; 54 b2a0: 50 f4 brcc .+20 ; 0xb2b6 b2a2: 95 33 cpi r25, 0x35 ; 53 b2a4: 19 f4 brne .+6 ; 0xb2ac b2a6: 3c 85 ldd r19, Y+12 ; 0x0c b2a8: 34 ff sbrs r19, 4 b2aa: 05 c0 rjmp .+10 ; 0xb2b6 b2ac: b6 01 movw r22, r12 b2ae: 90 e0 ldi r25, 0x00 ; 0 b2b0: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b2b4: 2a cf rjmp .-428 ; 0xb10a b2b6: 81 e3 ldi r24, 0x31 ; 49 b2b8: f9 cf rjmp .-14 ; 0xb2ac b2ba: 8a 81 ldd r24, Y+2 ; 0x02 b2bc: 81 33 cpi r24, 0x31 ; 49 b2be: 19 f0 breq .+6 ; 0xb2c6 b2c0: 9c 85 ldd r25, Y+12 ; 0x0c b2c2: 9f 7e andi r25, 0xEF ; 239 b2c4: 9c 87 std Y+12, r25 ; 0x0c b2c6: b6 01 movw r22, r12 b2c8: 90 e0 ldi r25, 0x00 ; 0 b2ca: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b2ce: ff 20 and r15, r15 b2d0: a9 f0 breq .+42 ; 0xb2fc b2d2: b6 01 movw r22, r12 b2d4: 8e e2 ldi r24, 0x2E ; 46 b2d6: 90 e0 ldi r25, 0x00 ; 0 b2d8: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b2dc: f3 94 inc r15 b2de: f3 94 inc r15 b2e0: e2 e0 ldi r30, 0x02 ; 2 b2e2: 01 e0 ldi r16, 0x01 ; 1 b2e4: 0e 0f add r16, r30 b2e6: e8 0d add r30, r8 b2e8: f9 2d mov r31, r9 b2ea: f1 1d adc r31, r1 b2ec: 80 81 ld r24, Z b2ee: b6 01 movw r22, r12 b2f0: 90 e0 ldi r25, 0x00 ; 0 b2f2: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b2f6: e0 2f mov r30, r16 b2f8: 0f 11 cpse r16, r15 b2fa: f3 cf rjmp .-26 ; 0xb2e2 b2fc: 85 e6 ldi r24, 0x65 ; 101 b2fe: 90 e0 ldi r25, 0x00 ; 0 b300: 14 ff sbrs r17, 4 b302: 02 c0 rjmp .+4 ; 0xb308 b304: 85 e4 ldi r24, 0x45 ; 69 b306: 90 e0 ldi r25, 0x00 ; 0 b308: b6 01 movw r22, r12 b30a: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b30e: b7 fc sbrc r11, 7 b310: 06 c0 rjmp .+12 ; 0xb31e b312: a1 14 cp r10, r1 b314: b1 04 cpc r11, r1 b316: c1 f4 brne .+48 ; 0xb348 b318: ec 85 ldd r30, Y+12 ; 0x0c b31a: e4 ff sbrs r30, 4 b31c: 15 c0 rjmp .+42 ; 0xb348 b31e: b1 94 neg r11 b320: a1 94 neg r10 b322: b1 08 sbc r11, r1 b324: 8d e2 ldi r24, 0x2D ; 45 b326: b6 01 movw r22, r12 b328: 90 e0 ldi r25, 0x00 ; 0 b32a: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b32e: 80 e3 ldi r24, 0x30 ; 48 b330: 2a e0 ldi r18, 0x0A ; 10 b332: a2 16 cp r10, r18 b334: b1 04 cpc r11, r1 b336: 54 f4 brge .+20 ; 0xb34c b338: b6 01 movw r22, r12 b33a: 90 e0 ldi r25, 0x00 ; 0 b33c: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b340: b6 01 movw r22, r12 b342: c5 01 movw r24, r10 b344: c0 96 adiw r24, 0x30 ; 48 b346: b4 cf rjmp .-152 ; 0xb2b0 b348: 8b e2 ldi r24, 0x2B ; 43 b34a: ed cf rjmp .-38 ; 0xb326 b34c: 8f 5f subi r24, 0xFF ; 255 b34e: fa e0 ldi r31, 0x0A ; 10 b350: af 1a sub r10, r31 b352: b1 08 sbc r11, r1 b354: ed cf rjmp .-38 ; 0xb330 b356: 83 36 cpi r24, 0x63 ; 99 b358: c9 f0 breq .+50 ; 0xb38c b35a: 83 37 cpi r24, 0x73 ; 115 b35c: 71 f1 breq .+92 ; 0xb3ba b35e: 83 35 cpi r24, 0x53 ; 83 b360: 09 f0 breq .+2 ; 0xb364 b362: 5b c0 rjmp .+182 ; 0xb41a b364: 35 01 movw r6, r10 b366: f2 e0 ldi r31, 0x02 ; 2 b368: 6f 0e add r6, r31 b36a: 71 1c adc r7, r1 b36c: f5 01 movw r30, r10 b36e: a0 80 ld r10, Z b370: b1 80 ldd r11, Z+1 ; 0x01 b372: 6f 2d mov r22, r15 b374: 70 e0 ldi r23, 0x00 ; 0 b376: 06 fd sbrc r16, 6 b378: 02 c0 rjmp .+4 ; 0xb37e b37a: 6f ef ldi r22, 0xFF ; 255 b37c: 7f ef ldi r23, 0xFF ; 255 b37e: c5 01 movw r24, r10 b380: 0f 94 8d db call 0x3b71a ; 0x3b71a b384: 9d 87 std Y+13, r25 ; 0x0d b386: 8c 87 std Y+12, r24 ; 0x0c b388: 00 68 ori r16, 0x80 ; 128 b38a: 0d c0 rjmp .+26 ; 0xb3a6 b38c: 35 01 movw r6, r10 b38e: 32 e0 ldi r19, 0x02 ; 2 b390: 63 0e add r6, r19 b392: 71 1c adc r7, r1 b394: f5 01 movw r30, r10 b396: 80 81 ld r24, Z b398: 89 83 std Y+1, r24 ; 0x01 b39a: 21 e0 ldi r18, 0x01 ; 1 b39c: 30 e0 ldi r19, 0x00 ; 0 b39e: 3d 87 std Y+13, r19 ; 0x0d b3a0: 2c 87 std Y+12, r18 ; 0x0c b3a2: 54 01 movw r10, r8 b3a4: 0f 77 andi r16, 0x7F ; 127 b3a6: 03 fd sbrc r16, 3 b3a8: 06 c0 rjmp .+12 ; 0xb3b6 b3aa: 2c 85 ldd r18, Y+12 ; 0x0c b3ac: 3d 85 ldd r19, Y+13 ; 0x0d b3ae: 52 16 cp r5, r18 b3b0: 13 06 cpc r1, r19 b3b2: 09 f0 breq .+2 ; 0xb3b6 b3b4: a8 f4 brcc .+42 ; 0xb3e0 b3b6: e5 2c mov r14, r5 b3b8: 2b c0 rjmp .+86 ; 0xb410 b3ba: 35 01 movw r6, r10 b3bc: 32 e0 ldi r19, 0x02 ; 2 b3be: 63 0e add r6, r19 b3c0: 71 1c adc r7, r1 b3c2: f5 01 movw r30, r10 b3c4: a0 80 ld r10, Z b3c6: b1 80 ldd r11, Z+1 ; 0x01 b3c8: 6f 2d mov r22, r15 b3ca: 70 e0 ldi r23, 0x00 ; 0 b3cc: 06 fd sbrc r16, 6 b3ce: 02 c0 rjmp .+4 ; 0xb3d4 b3d0: 6f ef ldi r22, 0xFF ; 255 b3d2: 7f ef ldi r23, 0xFF ; 255 b3d4: c5 01 movw r24, r10 b3d6: 0f 94 b2 db call 0x3b764 ; 0x3b764 b3da: 9d 87 std Y+13, r25 ; 0x0d b3dc: 8c 87 std Y+12, r24 ; 0x0c b3de: e2 cf rjmp .-60 ; 0xb3a4 b3e0: b6 01 movw r22, r12 b3e2: 80 e2 ldi r24, 0x20 ; 32 b3e4: 90 e0 ldi r25, 0x00 ; 0 b3e6: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b3ea: 5a 94 dec r5 b3ec: de cf rjmp .-68 ; 0xb3aa b3ee: f5 01 movw r30, r10 b3f0: 07 fd sbrc r16, 7 b3f2: 85 91 lpm r24, Z+ b3f4: 07 ff sbrs r16, 7 b3f6: 81 91 ld r24, Z+ b3f8: 5f 01 movw r10, r30 b3fa: b6 01 movw r22, r12 b3fc: 90 e0 ldi r25, 0x00 ; 0 b3fe: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b402: e1 10 cpse r14, r1 b404: ea 94 dec r14 b406: 8c 85 ldd r24, Y+12 ; 0x0c b408: 9d 85 ldd r25, Y+13 ; 0x0d b40a: 01 97 sbiw r24, 0x01 ; 1 b40c: 9d 87 std Y+13, r25 ; 0x0d b40e: 8c 87 std Y+12, r24 ; 0x0c b410: ec 85 ldd r30, Y+12 ; 0x0c b412: fd 85 ldd r31, Y+13 ; 0x0d b414: ef 2b or r30, r31 b416: 59 f7 brne .-42 ; 0xb3ee b418: 78 ce rjmp .-784 ; 0xb10a b41a: 84 36 cpi r24, 0x64 ; 100 b41c: 19 f0 breq .+6 ; 0xb424 b41e: 89 36 cpi r24, 0x69 ; 105 b420: 09 f0 breq .+2 ; 0xb424 b422: 74 c0 rjmp .+232 ; 0xb50c b424: 35 01 movw r6, r10 b426: 07 ff sbrs r16, 7 b428: 66 c0 rjmp .+204 ; 0xb4f6 b42a: f4 e0 ldi r31, 0x04 ; 4 b42c: 6f 0e add r6, r31 b42e: 71 1c adc r7, r1 b430: f5 01 movw r30, r10 b432: 60 81 ld r22, Z b434: 71 81 ldd r23, Z+1 ; 0x01 b436: 82 81 ldd r24, Z+2 ; 0x02 b438: 93 81 ldd r25, Z+3 ; 0x03 b43a: 10 2f mov r17, r16 b43c: 1f 76 andi r17, 0x6F ; 111 b43e: 97 ff sbrs r25, 7 b440: 08 c0 rjmp .+16 ; 0xb452 b442: 90 95 com r25 b444: 80 95 com r24 b446: 70 95 com r23 b448: 61 95 neg r22 b44a: 7f 4f sbci r23, 0xFF ; 255 b44c: 8f 4f sbci r24, 0xFF ; 255 b44e: 9f 4f sbci r25, 0xFF ; 255 b450: 10 68 ori r17, 0x80 ; 128 b452: 2a e0 ldi r18, 0x0A ; 10 b454: 30 e0 ldi r19, 0x00 ; 0 b456: a4 01 movw r20, r8 b458: 0f 94 20 dd call 0x3ba40 ; 0x3ba40 <__ultoa_invert> b45c: a8 2e mov r10, r24 b45e: a8 18 sub r10, r8 b460: ba 2c mov r11, r10 b462: 01 2f mov r16, r17 b464: 16 ff sbrs r17, 6 b466: 0a c0 rjmp .+20 ; 0xb47c b468: 0e 7f andi r16, 0xFE ; 254 b46a: af 14 cp r10, r15 b46c: 38 f4 brcc .+14 ; 0xb47c b46e: 14 ff sbrs r17, 4 b470: 04 c0 rjmp .+8 ; 0xb47a b472: 12 fd sbrc r17, 2 b474: 02 c0 rjmp .+4 ; 0xb47a b476: 01 2f mov r16, r17 b478: 0e 7e andi r16, 0xEE ; 238 b47a: bf 2c mov r11, r15 b47c: 04 ff sbrs r16, 4 b47e: a3 c0 rjmp .+326 ; 0xb5c6 b480: fe 01 movw r30, r28 b482: ea 0d add r30, r10 b484: f1 1d adc r31, r1 b486: 80 81 ld r24, Z b488: 80 33 cpi r24, 0x30 ; 48 b48a: 09 f0 breq .+2 ; 0xb48e b48c: 95 c0 rjmp .+298 ; 0xb5b8 b48e: 09 7e andi r16, 0xE9 ; 233 b490: f0 2f mov r31, r16 b492: f8 70 andi r31, 0x08 ; 8 b494: ef 2e mov r14, r31 b496: 03 fd sbrc r16, 3 b498: a5 c0 rjmp .+330 ; 0xb5e4 b49a: 00 ff sbrs r16, 0 b49c: 9f c0 rjmp .+318 ; 0xb5dc b49e: fa 2c mov r15, r10 b4a0: b5 14 cp r11, r5 b4a2: 10 f4 brcc .+4 ; 0xb4a8 b4a4: f5 0c add r15, r5 b4a6: fb 18 sub r15, r11 b4a8: 04 ff sbrs r16, 4 b4aa: a2 c0 rjmp .+324 ; 0xb5f0 b4ac: b6 01 movw r22, r12 b4ae: 80 e3 ldi r24, 0x30 ; 48 b4b0: 90 e0 ldi r25, 0x00 ; 0 b4b2: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b4b6: 02 ff sbrs r16, 2 b4b8: 09 c0 rjmp .+18 ; 0xb4cc b4ba: 88 e7 ldi r24, 0x78 ; 120 b4bc: 90 e0 ldi r25, 0x00 ; 0 b4be: 01 ff sbrs r16, 1 b4c0: 02 c0 rjmp .+4 ; 0xb4c6 b4c2: 88 e5 ldi r24, 0x58 ; 88 b4c4: 90 e0 ldi r25, 0x00 ; 0 b4c6: b6 01 movw r22, r12 b4c8: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b4cc: af 14 cp r10, r15 b4ce: 08 f4 brcc .+2 ; 0xb4d2 b4d0: 9b c0 rjmp .+310 ; 0xb608 b4d2: aa 94 dec r10 b4d4: 0a 2d mov r16, r10 b4d6: 10 e0 ldi r17, 0x00 ; 0 b4d8: 0f 5f subi r16, 0xFF ; 255 b4da: 1f 4f sbci r17, 0xFF ; 255 b4dc: 08 0d add r16, r8 b4de: 19 1d adc r17, r9 b4e0: f8 01 movw r30, r16 b4e2: 82 91 ld r24, -Z b4e4: 8f 01 movw r16, r30 b4e6: b6 01 movw r22, r12 b4e8: 90 e0 ldi r25, 0x00 ; 0 b4ea: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b4ee: 80 16 cp r8, r16 b4f0: 91 06 cpc r9, r17 b4f2: b1 f7 brne .-20 ; 0xb4e0 b4f4: 0a ce rjmp .-1004 ; 0xb10a b4f6: f2 e0 ldi r31, 0x02 ; 2 b4f8: 6f 0e add r6, r31 b4fa: 71 1c adc r7, r1 b4fc: f5 01 movw r30, r10 b4fe: 60 81 ld r22, Z b500: 71 81 ldd r23, Z+1 ; 0x01 b502: 07 2e mov r0, r23 b504: 00 0c add r0, r0 b506: 88 0b sbc r24, r24 b508: 99 0b sbc r25, r25 b50a: 97 cf rjmp .-210 ; 0xb43a b50c: 10 2f mov r17, r16 b50e: 85 37 cpi r24, 0x75 ; 117 b510: a9 f4 brne .+42 ; 0xb53c b512: 1f 7e andi r17, 0xEF ; 239 b514: 2a e0 ldi r18, 0x0A ; 10 b516: 30 e0 ldi r19, 0x00 ; 0 b518: 35 01 movw r6, r10 b51a: 17 ff sbrs r17, 7 b51c: 44 c0 rjmp .+136 ; 0xb5a6 b51e: f4 e0 ldi r31, 0x04 ; 4 b520: 6f 0e add r6, r31 b522: 71 1c adc r7, r1 b524: f5 01 movw r30, r10 b526: 60 81 ld r22, Z b528: 71 81 ldd r23, Z+1 ; 0x01 b52a: 82 81 ldd r24, Z+2 ; 0x02 b52c: 93 81 ldd r25, Z+3 ; 0x03 b52e: a4 01 movw r20, r8 b530: 0f 94 20 dd call 0x3ba40 ; 0x3ba40 <__ultoa_invert> b534: a8 2e mov r10, r24 b536: a8 18 sub r10, r8 b538: 1f 77 andi r17, 0x7F ; 127 b53a: 92 cf rjmp .-220 ; 0xb460 b53c: 19 7f andi r17, 0xF9 ; 249 b53e: 8f 36 cpi r24, 0x6F ; 111 b540: 79 f1 breq .+94 ; 0xb5a0 b542: f0 f4 brcc .+60 ; 0xb580 b544: 88 35 cpi r24, 0x58 ; 88 b546: 39 f1 breq .+78 ; 0xb596 b548: f6 01 movw r30, r12 b54a: 86 81 ldd r24, Z+6 ; 0x06 b54c: 97 81 ldd r25, Z+7 ; 0x07 b54e: 2f 96 adiw r28, 0x0f ; 15 b550: 0f b6 in r0, 0x3f ; 63 b552: f8 94 cli b554: de bf out 0x3e, r29 ; 62 b556: 0f be out 0x3f, r0 ; 63 b558: cd bf out 0x3d, r28 ; 61 b55a: df 91 pop r29 b55c: cf 91 pop r28 b55e: 1f 91 pop r17 b560: 0f 91 pop r16 b562: ff 90 pop r15 b564: ef 90 pop r14 b566: df 90 pop r13 b568: cf 90 pop r12 b56a: bf 90 pop r11 b56c: af 90 pop r10 b56e: 9f 90 pop r9 b570: 8f 90 pop r8 b572: 7f 90 pop r7 b574: 6f 90 pop r6 b576: 5f 90 pop r5 b578: 4f 90 pop r4 b57a: 3f 90 pop r3 b57c: 2f 90 pop r2 b57e: 08 95 ret b580: 80 37 cpi r24, 0x70 ; 112 b582: 39 f0 breq .+14 ; 0xb592 b584: 88 37 cpi r24, 0x78 ; 120 b586: 01 f7 brne .-64 ; 0xb548 b588: 14 fd sbrc r17, 4 b58a: 14 60 ori r17, 0x04 ; 4 b58c: 20 e1 ldi r18, 0x10 ; 16 b58e: 30 e0 ldi r19, 0x00 ; 0 b590: c3 cf rjmp .-122 ; 0xb518 b592: 10 61 ori r17, 0x10 ; 16 b594: f9 cf rjmp .-14 ; 0xb588 b596: 04 fd sbrc r16, 4 b598: 16 60 ori r17, 0x06 ; 6 b59a: 20 e1 ldi r18, 0x10 ; 16 b59c: 32 e0 ldi r19, 0x02 ; 2 b59e: bc cf rjmp .-136 ; 0xb518 b5a0: 28 e0 ldi r18, 0x08 ; 8 b5a2: 30 e0 ldi r19, 0x00 ; 0 b5a4: b9 cf rjmp .-142 ; 0xb518 b5a6: f2 e0 ldi r31, 0x02 ; 2 b5a8: 6f 0e add r6, r31 b5aa: 71 1c adc r7, r1 b5ac: f5 01 movw r30, r10 b5ae: 60 81 ld r22, Z b5b0: 71 81 ldd r23, Z+1 ; 0x01 b5b2: 90 e0 ldi r25, 0x00 ; 0 b5b4: 80 e0 ldi r24, 0x00 ; 0 b5b6: bb cf rjmp .-138 ; 0xb52e b5b8: 02 fd sbrc r16, 2 b5ba: 02 c0 rjmp .+4 ; 0xb5c0 b5bc: b3 94 inc r11 b5be: 68 cf rjmp .-304 ; 0xb490 b5c0: b3 94 inc r11 b5c2: b3 94 inc r11 b5c4: 65 cf rjmp .-310 ; 0xb490 b5c6: 80 2f mov r24, r16 b5c8: 86 78 andi r24, 0x86 ; 134 b5ca: 09 f4 brne .+2 ; 0xb5ce b5cc: 61 cf rjmp .-318 ; 0xb490 b5ce: f6 cf rjmp .-20 ; 0xb5bc b5d0: b6 01 movw r22, r12 b5d2: 80 e2 ldi r24, 0x20 ; 32 b5d4: 90 e0 ldi r25, 0x00 ; 0 b5d6: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b5da: b3 94 inc r11 b5dc: b5 14 cp r11, r5 b5de: c0 f3 brcs .-16 ; 0xb5d0 b5e0: e1 2c mov r14, r1 b5e2: 62 cf rjmp .-316 ; 0xb4a8 b5e4: e5 2c mov r14, r5 b5e6: eb 18 sub r14, r11 b5e8: b5 14 cp r11, r5 b5ea: 08 f4 brcc .+2 ; 0xb5ee b5ec: 5d cf rjmp .-326 ; 0xb4a8 b5ee: f8 cf rjmp .-16 ; 0xb5e0 b5f0: 80 2f mov r24, r16 b5f2: 86 78 andi r24, 0x86 ; 134 b5f4: 09 f4 brne .+2 ; 0xb5f8 b5f6: 6a cf rjmp .-300 ; 0xb4cc b5f8: 8b e2 ldi r24, 0x2B ; 43 b5fa: 01 ff sbrs r16, 1 b5fc: 80 e2 ldi r24, 0x20 ; 32 b5fe: 07 fd sbrc r16, 7 b600: 8d e2 ldi r24, 0x2D ; 45 b602: b6 01 movw r22, r12 b604: 90 e0 ldi r25, 0x00 ; 0 b606: 60 cf rjmp .-320 ; 0xb4c8 b608: b6 01 movw r22, r12 b60a: 80 e3 ldi r24, 0x30 ; 48 b60c: 90 e0 ldi r25, 0x00 ; 0 b60e: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b612: fa 94 dec r15 b614: 5b cf rjmp .-330 ; 0xb4cc b616: b6 01 movw r22, r12 b618: 80 e2 ldi r24, 0x20 ; 32 b61a: 90 e0 ldi r25, 0x00 ; 0 b61c: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 b620: ea 94 dec r14 b622: 73 cd rjmp .-1306 ; 0xb10a b624: 24 e0 ldi r18, 0x04 ; 4 b626: e1 2c mov r14, r1 b628: 25 15 cp r18, r5 b62a: 08 f0 brcs .+2 ; 0xb62e b62c: 36 cd rjmp .-1428 ; 0xb09a b62e: 84 e0 ldi r24, 0x04 ; 4 b630: 26 cd rjmp .-1460 ; 0xb07e 0000b632 : 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 ( b632: 20 e0 ldi r18, 0x00 ; 0 b634: 30 e0 ldi r19, 0x00 ; 0 b636: 40 e8 ldi r20, 0x80 ; 128 b638: 5f eb ldi r21, 0xBF ; 191 b63a: 60 91 ab 02 lds r22, 0x02AB ; 0x8002ab b63e: 70 91 ac 02 lds r23, 0x02AC ; 0x8002ac b642: 80 91 ad 02 lds r24, 0x02AD ; 0x8002ad b646: 90 91 ae 02 lds r25, 0x02AE ; 0x8002ae b64a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> b64e: 88 23 and r24, r24 b650: 21 f1 breq .+72 ; 0xb69a (saved_start_position[0] != SAVED_START_POSITION_UNSET) && ( (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_SDCARD) || b652: e0 91 70 12 lds r30, 0x1270 ; 0x801270 b656: f0 91 71 12 lds r31, 0x1271 ; 0x801271 b65a: ed 57 subi r30, 0x7D ; 125 b65c: 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) && ( b65e: 80 81 ld r24, Z b660: 8b 7f andi r24, 0xFB ; 251 b662: 82 30 cpi r24, 0x02 ; 2 b664: d1 f4 brne .+52 ; 0xb69a (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)); b666: 80 e1 ldi r24, 0x10 ; 16 b668: eb ea ldi r30, 0xAB ; 171 b66a: f2 e0 ldi r31, 0x02 ; 2 b66c: a3 e4 ldi r26, 0x43 ; 67 b66e: b7 e0 ldi r27, 0x07 ; 7 b670: 01 90 ld r0, Z+ b672: 0d 92 st X+, r0 b674: 8a 95 dec r24 b676: e1 f7 brne .-8 ; 0xb670 saved_start_position[0] = SAVED_START_POSITION_UNSET; b678: 80 e0 ldi r24, 0x00 ; 0 b67a: 90 e0 ldi r25, 0x00 ; 0 b67c: a0 e8 ldi r26, 0x80 ; 128 b67e: bf eb ldi r27, 0xBF ; 191 b680: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab b684: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac b688: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad b68c: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae return saved_segment_idx; b690: 80 91 0b 18 lds r24, 0x180B ; 0x80180b b694: 90 91 0c 18 lds r25, 0x180C ; 0x80180c b698: 08 95 ret } else return 1; //begin with the first segment b69a: 81 e0 ldi r24, 0x01 ; 1 b69c: 90 e0 ldi r25, 0x00 ; 0 } b69e: 08 95 ret 0000b6a0 : 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) { b6a0: cf 92 push r12 b6a2: df 92 push r13 b6a4: ef 92 push r14 b6a6: ff 92 push r15 b6a8: 0f 93 push r16 b6aa: 1f 93 push r17 b6ac: cf 93 push r28 b6ae: 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); b6b0: 90 e0 ldi r25, 0x00 ; 0 b6b2: ec 01 movw r28, r24 b6b4: cc 0f add r28, r28 b6b6: dd 1f adc r29, r29 b6b8: cc 0f add r28, r28 b6ba: dd 1f adc r29, r29 b6bc: fe 01 movw r30, r28 b6be: e6 56 subi r30, 0x66 ; 102 b6c0: 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); b6c2: 25 91 lpm r18, Z+ b6c4: 35 91 lpm r19, Z+ b6c6: 45 91 lpm r20, Z+ b6c8: 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]; b6ca: fe 01 movw r30, r28 b6cc: ea 53 subi r30, 0x3A ; 58 b6ce: f9 4f sbci r31, 0xF9 ; 249 b6d0: c0 80 ld r12, Z b6d2: d1 80 ldd r13, Z+1 ; 0x01 b6d4: e2 80 ldd r14, Z+2 ; 0x02 b6d6: f3 80 ldd r15, Z+3 ; 0x03 b6d8: 8e 01 movw r16, r28 b6da: 0d 5b subi r16, 0xBD ; 189 b6dc: 18 4f sbci r17, 0xF8 ; 248 b6de: c7 01 movw r24, r14 b6e0: b6 01 movw r22, r12 b6e2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> b6e6: f8 01 movw r30, r16 b6e8: 60 83 st Z, r22 b6ea: 71 83 std Z+1, r23 ; 0x01 b6ec: 82 83 std Z+2, r24 ; 0x02 b6ee: 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); b6f0: fe 01 movw r30, r28 b6f2: e2 57 subi r30, 0x72 ; 114 b6f4: 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); b6f6: 25 91 lpm r18, Z+ b6f8: 35 91 lpm r19, Z+ b6fa: 45 91 lpm r20, Z+ b6fc: 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]; b6fe: 8e 01 movw r16, r28 b700: 0f 5d subi r16, 0xDF ; 223 b702: 1d 4f sbci r17, 0xFD ; 253 b704: c7 01 movw r24, r14 b706: b6 01 movw r22, r12 b708: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> b70c: f8 01 movw r30, r16 b70e: 60 83 st Z, r22 b710: 71 83 std Z+1, r23 ; 0x01 b712: 82 83 std Z+2, r24 ; 0x02 b714: 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); b716: fe 01 movw r30, r28 b718: ee 57 subi r30, 0x7E ; 126 b71a: 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); b71c: 25 91 lpm r18, Z+ b71e: 35 91 lpm r19, Z+ b720: 45 91 lpm r20, Z+ b722: 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]; b724: cb 5e subi r28, 0xEB ; 235 b726: dd 4f sbci r29, 0xFD ; 253 b728: c7 01 movw r24, r14 b72a: b6 01 movw r22, r12 b72c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> b730: 68 83 st Y, r22 b732: 79 83 std Y+1, r23 ; 0x01 b734: 8a 83 std Y+2, r24 ; 0x02 b736: 9b 83 std Y+3, r25 ; 0x03 } b738: df 91 pop r29 b73a: cf 91 pop r28 b73c: 1f 91 pop r17 b73e: 0f 91 pop r16 b740: ff 90 pop r15 b742: ef 90 pop r14 b744: df 90 pop r13 b746: cf 90 pop r12 b748: 08 95 ret 0000b74a : 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)); } b74a: 80 e1 ldi r24, 0x10 ; 16 b74c: e4 e5 ldi r30, 0x54 ; 84 b74e: f5 e0 ldi r31, 0x05 ; 5 b750: a3 e4 ldi r26, 0x43 ; 67 b752: b7 e0 ldi r27, 0x07 ; 7 b754: 01 90 ld r0, Z+ b756: 0d 92 st X+, r0 b758: 8a 95 dec r24 b75a: e1 f7 brne .-8 ; 0xb754 b75c: 08 95 ret 0000b75e : /// @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)); b75e: ed e0 ldi r30, 0x0D ; 13 b760: fc e7 ldi r31, 0x7C ; 124 b762: 83 30 cpi r24, 0x03 ; 3 b764: 21 f0 breq .+8 ; 0xb76e b766: e8 2f mov r30, r24 b768: f0 e0 ldi r31, 0x00 ; 0 b76a: e6 5f subi r30, 0xF6 ; 246 b76c: f3 48 sbci r31, 0x83 ; 131 b76e: 84 91 lpm r24, Z } b770: 08 95 ret 0000b772 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b772: 40 91 81 10 lds r20, 0x1081 ; 0x801081 b776: 50 91 82 10 lds r21, 0x1082 ; 0x801082 return 0; b77a: 90 e0 ldi r25, 0x00 ; 0 b77c: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) b77e: 41 15 cp r20, r1 b780: 51 05 cpc r21, r1 b782: b1 f1 breq .+108 ; 0xb7f0 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { b784: 20 91 70 12 lds r18, 0x1270 ; 0x801270 b788: 30 91 71 12 lds r19, 0x1271 ; 0x801271 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; b78c: 90 e0 ldi r25, 0x00 ; 0 b78e: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { b790: f9 01 movw r30, r18 b792: ed 57 subi r30, 0x7D ; 125 b794: ff 4e sbci r31, 0xEF ; 239 b796: a0 81 ld r26, Z b798: a2 30 cpi r26, 0x02 ; 2 b79a: 21 f4 brne .+8 ; 0xb7a4 sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; b79c: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; b79e: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; b7a0: 86 0f add r24, r22 b7a2: 97 1f adc r25, r23 } if (-- _buflen == 0) b7a4: 41 50 subi r20, 0x01 ; 1 b7a6: 51 09 sbc r21, r1 b7a8: 19 f1 breq .+70 ; 0xb7f0 b7aa: f9 01 movw r30, r18 b7ac: ea 57 subi r30, 0x7A ; 122 b7ae: 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) ; b7b0: a1 91 ld r26, Z+ b7b2: 9f 01 movw r18, r30 b7b4: 23 58 subi r18, 0x83 ; 131 b7b6: 30 41 sbci r19, 0x10 ; 16 b7b8: a1 11 cpse r26, r1 b7ba: fa cf rjmp .-12 ; 0xb7b0 b7bc: f9 01 movw r30, r18 b7be: ed 57 subi r30, 0x7D ; 125 b7c0: 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) ; b7c2: 2d 3e cpi r18, 0xED ; 237 b7c4: a1 e0 ldi r26, 0x01 ; 1 b7c6: 3a 07 cpc r19, r26 b7c8: 30 f4 brcc .+12 ; 0xb7d6 b7ca: a1 91 ld r26, Z+ b7cc: a1 11 cpse r26, r1 b7ce: e0 cf rjmp .-64 ; 0xb790 b7d0: 2f 5f subi r18, 0xFF ; 255 b7d2: 3f 4f sbci r19, 0xFF ; 255 b7d4: f6 cf rjmp .-20 ; 0xb7c2 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { b7d6: 2d 3e cpi r18, 0xED ; 237 b7d8: e1 e0 ldi r30, 0x01 ; 1 b7da: 3e 07 cpc r19, r30 b7dc: c9 f6 brne .-78 ; 0xb790 b7de: e3 e8 ldi r30, 0x83 ; 131 b7e0: f0 e1 ldi r31, 0x10 ; 16 b7e2: 9f 01 movw r18, r30 b7e4: 23 58 subi r18, 0x83 ; 131 b7e6: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; b7e8: a1 91 ld r26, Z+ b7ea: aa 23 and r26, r26 b7ec: d1 f3 breq .-12 ; 0xb7e2 b7ee: d0 cf rjmp .-96 ; 0xb790 } } return sdlen; } b7f0: 08 95 ret 0000b7f2 : memset((void*)adc_values, 0, sizeof(adc_values)); } static void adc_setmux(uint8_t ch) { ch &= 0x0f; b7f2: 98 2f mov r25, r24 b7f4: 9f 70 andi r25, 0x0F ; 15 if (ch & 0x08) ADCSRB |= (1 << MUX5); b7f6: 83 ff sbrs r24, 3 b7f8: 0d c0 rjmp .+26 ; 0xb814 b7fa: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b7fe: 88 60 ori r24, 0x08 ; 8 else ADCSRB &= ~(1 << MUX5); b800: 80 93 7b 00 sts 0x007B, r24 ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); b804: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> b808: 88 7f andi r24, 0xF8 ; 248 b80a: 97 70 andi r25, 0x07 ; 7 b80c: 89 2b or r24, r25 b80e: 80 93 7c 00 sts 0x007C, r24 ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> } b812: 08 95 ret static void adc_setmux(uint8_t ch) { ch &= 0x0f; if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); b814: 80 91 7b 00 lds r24, 0x007B ; 0x80007b <__TEXT_REGION_LENGTH__+0x7c207b> b818: 87 7f andi r24, 0xF7 ; 247 b81a: f2 cf rjmp .-28 ; 0xb800 0000b81c : 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)); }; b81c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 b820: 90 91 98 03 lds r25, 0x0398 ; 0x800398 b824: 4a e0 ldi r20, 0x0A ; 10 b826: 50 e0 ldi r21, 0x00 ; 0 b828: 70 e0 ldi r23, 0x00 ; 0 b82a: 60 e0 ldi r22, 0x00 ; 0 b82c: 01 96 adiw r24, 0x01 ; 1 b82e: 0f 94 1c d9 call 0x3b238 ; 0x3b238 b832: 86 2f mov r24, r22 b834: 08 95 ret 0000b836 : // 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)); }; b836: 80 91 97 03 lds r24, 0x0397 ; 0x800397 b83a: 90 91 98 03 lds r25, 0x0398 ; 0x800398 b83e: 4a e0 ldi r20, 0x0A ; 10 b840: 50 e0 ldi r21, 0x00 ; 0 b842: 70 e0 ldi r23, 0x00 ; 0 b844: 60 e0 ldi r22, 0x00 ; 0 b846: 01 96 adiw r24, 0x01 ; 1 b848: 0f 94 1c d9 call 0x3b238 ; 0x3b238 b84c: cb 01 movw r24, r22 b84e: 08 95 ret 0000b850 : // 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); } b850: 80 91 97 03 lds r24, 0x0397 ; 0x800397 b854: 90 91 98 03 lds r25, 0x0398 ; 0x800398 b858: 4a e0 ldi r20, 0x0A ; 10 b85a: 50 e0 ldi r21, 0x00 ; 0 b85c: 70 e0 ldi r23, 0x00 ; 0 b85e: 60 e0 ldi r22, 0x00 ; 0 b860: 01 96 adiw r24, 0x01 ; 1 b862: 0d 94 1c d9 jmp 0x3b238 ; 0x3b238 0000b866 : // 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; b866: 80 91 95 04 lds r24, 0x0495 ; 0x800495 b86a: 90 91 96 04 lds r25, 0x0496 ; 0x800496 b86e: 90 93 94 04 sts 0x0494, r25 ; 0x800494 b872: 80 93 93 04 sts 0x0493, r24 ; 0x800493 void FlushSerialRequestResend() { //char cmdbuffer[bufindr][100]="Resend:"; MYSERIAL.flush(); printf_P(_N("%S: %ld\n%S\n"), _n("Resend"), gcode_LastN + 1, MSG_OK); b876: 8a e0 ldi r24, 0x0A ; 10 b878: 9e e6 ldi r25, 0x6E ; 110 b87a: 9f 93 push r25 b87c: 8f 93 push r24 b87e: 80 91 7c 03 lds r24, 0x037C ; 0x80037c b882: 90 91 7d 03 lds r25, 0x037D ; 0x80037d b886: a0 91 7e 03 lds r26, 0x037E ; 0x80037e b88a: b0 91 7f 03 lds r27, 0x037F ; 0x80037f b88e: 01 96 adiw r24, 0x01 ; 1 b890: a1 1d adc r26, r1 b892: b1 1d adc r27, r1 b894: bf 93 push r27 b896: af 93 push r26 b898: 9f 93 push r25 b89a: 8f 93 push r24 b89c: 89 ee ldi r24, 0xE9 ; 233 b89e: 96 e6 ldi r25, 0x66 ; 102 b8a0: 9f 93 push r25 b8a2: 8f 93 push r24 b8a4: 80 ef ldi r24, 0xF0 ; 240 b8a6: 96 e6 ldi r25, 0x66 ; 102 b8a8: 9f 93 push r25 b8aa: 8f 93 push r24 b8ac: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 b8b0: 8d b7 in r24, 0x3d ; 61 b8b2: 9e b7 in r25, 0x3e ; 62 b8b4: 0a 96 adiw r24, 0x0a ; 10 b8b6: 0f b6 in r0, 0x3f ; 63 b8b8: f8 94 cli b8ba: 9e bf out 0x3e, r25 ; 62 b8bc: 0f be out 0x3f, r0 ; 63 b8be: 8d bf out 0x3d, r24 ; 61 } b8c0: 08 95 ret 0000b8c2 : 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) { b8c2: 0f 93 push r16 b8c4: 1f 93 push r17 b8c6: cf 93 push r28 b8c8: df 93 push r29 b8ca: ec 01 movw r28, r24 b8cc: c6 0f add r28, r22 b8ce: d7 1f adc r29, r23 const uint8_t *p = (const uint8_t*)__p; while (__n--) { b8d0: 8c 17 cp r24, r28 b8d2: 9d 07 cpc r25, r29 b8d4: 79 f0 breq .+30 ; 0xb8f4 if (eeprom_read_byte(p++) != EEPROM_EMPTY_VALUE) b8d6: 8c 01 movw r16, r24 b8d8: 0f 5f subi r16, 0xFF ; 255 b8da: 1f 4f sbci r17, 0xFF ; 255 b8dc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 b8e0: 8f 3f cpi r24, 0xFF ; 255 b8e2: 31 f0 breq .+12 ; 0xb8f0 return true; b8e4: 81 e0 ldi r24, 0x01 ; 1 } return false; } b8e6: df 91 pop r29 b8e8: cf 91 pop r28 b8ea: 1f 91 pop r17 b8ec: 0f 91 pop r16 b8ee: 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) b8f0: c8 01 movw r24, r16 b8f2: ee cf rjmp .-36 ; 0xb8d0 return true; } return false; b8f4: 80 e0 ldi r24, 0x00 ; 0 b8f6: f7 cf rjmp .-18 ; 0xb8e6 0000b8f8 : #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; } b8f8: 68 2f mov r22, r24 b8fa: 88 0f add r24, r24 b8fc: 77 0b sbc r23, r23 b8fe: 80 91 70 12 lds r24, 0x1270 ; 0x801270 b902: 90 91 71 12 lds r25, 0x1271 ; 0x801271 b906: 8a 57 subi r24, 0x7A ; 122 b908: 9f 4e sbci r25, 0xEF ; 239 b90a: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 b90e: 9c 01 movw r18, r24 b910: 90 93 98 03 sts 0x0398, r25 ; 0x800398 b914: 80 93 97 03 sts 0x0397, r24 ; 0x800397 b918: 81 e0 ldi r24, 0x01 ; 1 b91a: 23 2b or r18, r19 b91c: 09 f4 brne .+2 ; 0xb920 b91e: 80 e0 ldi r24, 0x00 ; 0 b920: 08 95 ret 0000b922 : #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 { b922: 0f 93 push r16 b924: 1f 93 push r17 b926: cf 93 push r28 b928: df 93 push r29 b92a: 8c 01 movw r16, r24 b92c: 86 2f mov r24, r22 b92e: ea 01 movw r28, r20 if (code_seen(code)) { b930: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 b934: 88 23 and r24, r24 b936: 19 f1 breq .+70 ; 0xb97e // Verify value is within allowed range int16_t temp = code_value_short(); b938: 0e 94 1b 5c call 0xb836 ; 0xb836 if (abs(temp) > BED_ADJUSTMENT_UM_MAX) { b93c: 9c 01 movw r18, r24 b93e: 97 ff sbrs r25, 7 b940: 03 c0 rjmp .+6 ; 0xb948 b942: 31 95 neg r19 b944: 21 95 neg r18 b946: 31 09 sbc r19, r1 b948: 25 36 cpi r18, 0x65 ; 101 b94a: 31 05 cpc r19, r1 b94c: 9c f0 brlt .+38 ; 0xb974 printf_P(PSTR("%SExcessive bed leveling correction: %i microns\n"), errormagic, temp); b94e: 9f 93 push r25 b950: 8f 93 push r24 b952: 8a ec ldi r24, 0xCA ; 202 b954: 99 ea ldi r25, 0xA9 ; 169 b956: 9f 93 push r25 b958: 8f 93 push r24 b95a: 8f ef ldi r24, 0xFF ; 255 b95c: 9c e7 ldi r25, 0x7C ; 124 b95e: 9f 93 push r25 b960: 8f 93 push r24 b962: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 b966: 0f 90 pop r0 b968: 0f 90 pop r0 b96a: 0f 90 pop r0 b96c: 0f 90 pop r0 b96e: 0f 90 pop r0 b970: 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; b972: 80 e0 ldi r24, 0x00 ; 0 }; b974: df 91 pop r29 b976: cf 91 pop r28 b978: 1f 91 pop r17 b97a: 0f 91 pop r16 b97c: 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) { b97e: f8 01 movw r30, r16 b980: 80 81 ld r24, Z b982: 88 23 and r24, r24 b984: b1 f3 breq .-20 ; 0xb972 return (int8_t)eeprom_read_byte(eep_address); b986: ce 01 movw r24, r28 } return 0; }; b988: df 91 pop r29 b98a: cf 91 pop r28 b98c: 1f 91 pop r17 b98e: 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); b990: 0d 94 91 dd jmp 0x3bb22 ; 0x3bb22 0000b994 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); b994: 60 e0 ldi r22, 0x00 ; 0 b996: 86 e6 ldi r24, 0x66 ; 102 b998: 9f e0 ldi r25, 0x0F ; 15 b99a: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a b99e: 60 e0 ldi r22, 0x00 ; 0 b9a0: 88 e6 ldi r24, 0x68 ; 104 b9a2: 9f e0 ldi r25, 0x0F ; 15 b9a4: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a b9a8: 60 e0 ldi r22, 0x00 ; 0 b9aa: 85 e6 ldi r24, 0x65 ; 101 b9ac: 9f e0 ldi r25, 0x0F ; 15 b9ae: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a b9b2: 60 e0 ldi r22, 0x00 ; 0 b9b4: 84 e6 ldi r24, 0x64 ; 100 b9b6: 9f e0 ldi r25, 0x0F ; 15 b9b8: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a b9bc: 60 e0 ldi r22, 0x00 ; 0 b9be: 82 ed ldi r24, 0xD2 ; 210 b9c0: 9e e0 ldi r25, 0x0E ; 14 b9c2: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a b9c6: 60 e0 ldi r22, 0x00 ; 0 b9c8: 8f ec ldi r24, 0xCF ; 207 b9ca: 9e e0 ldi r25, 0x0E ; 14 b9cc: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0000b9d0 : return altfanStatus.isAltfan; } void altfanOverride_toggle() { altfanStatus.altfanOverride = !altfanStatus.altfanOverride; b9d0: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> b9d4: 81 fb bst r24, 1 b9d6: 66 27 eor r22, r22 b9d8: 60 f9 bld r22, 0 b9da: 91 e0 ldi r25, 0x01 ; 1 b9dc: 69 27 eor r22, r25 b9de: 60 fb bst r22, 0 b9e0: 81 f9 bld r24, 1 b9e2: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> b9e6: 8b e2 ldi r24, 0x2B ; 43 b9e8: 9d e0 ldi r25, 0x0D ; 13 b9ea: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0000b9ee : // 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) b9ee: 80 36 cpi r24, 0x60 ; 96 b9f0: 91 05 cpc r25, r1 b9f2: f8 f4 brcc .+62 ; 0xba32 return false; if (bufindr == bufindw && buflen > 0) b9f4: 40 91 70 12 lds r20, 0x1270 ; 0x801270 b9f8: 50 91 71 12 lds r21, 0x1271 ; 0x801271 b9fc: 20 91 7e 10 lds r18, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> ba00: 30 91 7f 10 lds r19, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> ba04: 42 17 cp r20, r18 ba06: 53 07 cpc r21, r19 ba08: 39 f4 brne .+14 ; 0xba18 ba0a: 60 91 81 10 lds r22, 0x1081 ; 0x801081 ba0e: 70 91 82 10 lds r23, 0x1082 ; 0x801082 ba12: 16 16 cp r1, r22 ba14: 17 06 cpc r1, r23 ba16: 6c f0 brlt .+26 ; 0xba32 // 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); ba18: b9 01 movw r22, r18 ba1a: 68 0f add r22, r24 ba1c: 79 1f adc r23, r25 ba1e: fb 01 movw r30, r22 ba20: e3 59 subi r30, 0x93 ; 147 ba22: ff 4f sbci r31, 0xFF ; 255 if (bufindw < bufindr) ba24: 24 17 cp r18, r20 ba26: 35 07 cpc r19, r21 ba28: 30 f4 brcc .+12 ; 0xba36 // Simple case. There is a contiguous space between the write buffer and the read buffer. return endw + CMDBUFFER_RESERVE_FRONT <= bufindr; ba2a: 81 e0 ldi r24, 0x01 ; 1 ba2c: 4e 17 cp r20, r30 ba2e: 5f 07 cpc r21, r31 ba30: 08 f4 brcc .+2 ; 0xba34 // 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; ba32: 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; } ba34: 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? ba36: ee 3e cpi r30, 0xEE ; 238 ba38: f1 40 sbci r31, 0x01 ; 1 ba3a: f8 f0 brcs .+62 ; 0xba7a // 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); ba3c: 6c 5f subi r22, 0xFC ; 252 ba3e: 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) || ba40: 6e 3e cpi r22, 0xEE ; 238 ba42: 71 40 sbci r23, 0x01 ; 1 ba44: 18 f4 brcc .+6 ; 0xba4c // Could one fit to the end, and the reserve to the start? (endw <= sizeof(cmdbuffer) && CMDBUFFER_RESERVE_FRONT <= bufindr)) ba46: 49 36 cpi r20, 0x69 ; 105 ba48: 51 05 cpc r21, r1 ba4a: b8 f4 brcc .+46 ; 0xba7a return true; // Could one fit both to the start? if (len_asked + (1 + CMDHDRSIZE) + CMDBUFFER_RESERVE_FRONT <= bufindr) { ba4c: 83 59 subi r24, 0x93 ; 147 ba4e: 9f 4f sbci r25, 0xFF ; 255 ba50: 48 17 cp r20, r24 ba52: 59 07 cpc r21, r25 ba54: 70 f3 brcs .-36 ; 0xba32 // Mark the rest of the buffer as used. memset(cmdbuffer+bufindw, 0, sizeof(cmdbuffer)-bufindw); ba56: 4d ee ldi r20, 0xED ; 237 ba58: 51 e0 ldi r21, 0x01 ; 1 ba5a: 42 1b sub r20, r18 ba5c: 53 0b sbc r21, r19 ba5e: 70 e0 ldi r23, 0x00 ; 0 ba60: 60 e0 ldi r22, 0x00 ; 0 ba62: c9 01 movw r24, r18 ba64: 8d 57 subi r24, 0x7D ; 125 ba66: 9f 4e sbci r25, 0xEF ; 239 ba68: 0f 94 c3 e3 call 0x3c786 ; 0x3c786 // 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; } ba6c: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); ba6e: f8 94 cli ba70: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> ba74: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.571> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; ba78: 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; ba7a: 81 e0 ldi r24, 0x01 ; 1 ba7c: 08 95 ret 0000ba7e : //we have no temp compensation data } } #endif //ndef PINDA_THERMISTOR float temp_comp_interpolation(float inp_temperature) { ba7e: 2f 92 push r2 ba80: 3f 92 push r3 ba82: 4f 92 push r4 ba84: 5f 92 push r5 ba86: 6f 92 push r6 ba88: 7f 92 push r7 ba8a: 8f 92 push r8 ba8c: 9f 92 push r9 ba8e: af 92 push r10 ba90: bf 92 push r11 ba92: cf 92 push r12 ba94: df 92 push r13 ba96: ef 92 push r14 ba98: ff 92 push r15 ba9a: 0f 93 push r16 ba9c: 1f 93 push r17 ba9e: cf 93 push r28 baa0: df 93 push r29 baa2: cd b7 in r28, 0x3d ; 61 baa4: de b7 in r29, 0x3e ; 62 baa6: cc 58 subi r28, 0x8C ; 140 baa8: d2 40 sbci r29, 0x02 ; 2 baaa: 0f b6 in r0, 0x3f ; 63 baac: f8 94 cli baae: de bf out 0x3e, r29 ; 62 bab0: 0f be out 0x3f, r0 ; 63 bab2: cd bf out 0x3d, r28 ; 61 bab4: cb 58 subi r28, 0x8B ; 139 bab6: dd 4f sbci r29, 0xFD ; 253 bab8: 68 83 st Y, r22 baba: 79 83 std Y+1, r23 ; 0x01 babc: 8a 83 std Y+2, r24 ; 0x02 babe: 9b 83 std Y+3, r25 ; 0x03 bac0: c5 57 subi r28, 0x75 ; 117 bac2: 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; bac4: fe 01 movw r30, r28 bac6: e7 54 subi r30, 0x47 ; 71 bac8: fe 4f sbci r31, 0xFE ; 254 baca: 88 e2 ldi r24, 0x28 ; 40 bacc: df 01 movw r26, r30 bace: 1d 92 st X+, r1 bad0: 8a 95 dec r24 bad2: e9 f7 brne .-6 ; 0xbace bad4: e8 5b subi r30, 0xB8 ; 184 bad6: f1 40 sbci r31, 0x01 ; 1 bad8: 1f 01 movw r2, r30 bada: 80 e9 ldi r24, 0x90 ; 144 badc: 91 e0 ldi r25, 0x01 ; 1 bade: df 01 movw r26, r30 bae0: fc 01 movw r30, r24 bae2: 1d 92 st X+, r1 bae4: 31 97 sbiw r30, 0x01 ; 1 bae6: e9 f7 brne .-6 ; 0xbae2 int shift[10]; int temp_C[10]; n = 6; //number of measured points shift[0] = 0; bae8: c7 5a subi r28, 0xA7 ; 167 baea: dd 4f sbci r29, 0xFD ; 253 baec: 19 82 std Y+1, r1 ; 0x01 baee: 18 82 st Y, r1 baf0: c9 55 subi r28, 0x59 ; 89 baf2: d2 40 sbci r29, 0x02 ; 2 baf4: 9e 01 movw r18, r28 baf6: 2f 51 subi r18, 0x1F ; 31 baf8: 3e 4f sbci r19, 0xFE ; 254 bafa: c1 59 subi r28, 0x91 ; 145 bafc: dd 4f sbci r29, 0xFD ; 253 bafe: 39 83 std Y+1, r19 ; 0x01 bb00: 28 83 st Y, r18 bb02: cf 56 subi r28, 0x6F ; 111 bb04: d2 40 sbci r29, 0x02 ; 2 bb06: 8e 01 movw r16, r28 bb08: 07 5a subi r16, 0xA7 ; 167 bb0a: 1d 4f sbci r17, 0xFD ; 253 bb0c: ce 01 movw r24, r28 bb0e: 8f 5c subi r24, 0xCF ; 207 bb10: 9d 4f sbci r25, 0xFD ; 253 bb12: c3 59 subi r28, 0x93 ; 147 bb14: dd 4f sbci r29, 0xFD ; 253 bb16: 99 83 std Y+1, r25 ; 0x01 bb18: 88 83 st Y, r24 bb1a: cd 56 subi r28, 0x6D ; 109 bb1c: d2 40 sbci r29, 0x02 ; 2 bb1e: 3c 01 movw r6, r24 bb20: 49 01 movw r8, r18 bb22: 40 eb ldi r20, 0xB0 ; 176 bb24: a4 2e mov r10, r20 bb26: 4f e0 ldi r20, 0x0F ; 15 bb28: b4 2e mov r11, r20 bb2a: 53 e2 ldi r21, 0x23 ; 35 bb2c: c5 2e mov r12, r21 bb2e: d1 2c mov r13, r1 for (i = 0; i < n; i++) { bb30: f1 2c mov r15, r1 bb32: 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]; bb34: b6 01 movw r22, r12 bb36: 0d 2c mov r0, r13 bb38: 00 0c add r0, r0 bb3a: 88 0b sbc r24, r24 bb3c: 99 0b sbc r25, r25 bb3e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> bb42: d4 01 movw r26, r8 bb44: 6d 93 st X+, r22 bb46: 7d 93 st X+, r23 bb48: 8d 93 st X+, r24 bb4a: 9d 93 st X+, r25 bb4c: 4d 01 movw r8, r26 f[i] = (float)shift[i]; bb4e: f8 01 movw r30, r16 bb50: 61 91 ld r22, Z+ bb52: 71 91 ld r23, Z+ bb54: 8f 01 movw r16, r30 bb56: 07 2e mov r0, r23 bb58: 00 0c add r0, r0 bb5a: 88 0b sbc r24, r24 bb5c: 99 0b sbc r25, r25 bb5e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> bb62: d3 01 movw r26, r6 bb64: 6d 93 st X+, r22 bb66: 7d 93 st X+, r23 bb68: 8d 93 st X+, r24 bb6a: 9d 93 st X+, r25 bb6c: 3d 01 movw r6, r26 int temp_C[10]; n = 6; //number of measured points shift[0] = 0; for (i = 0; i < n; i++) { bb6e: bf ef ldi r27, 0xFF ; 255 bb70: eb 1a sub r14, r27 bb72: fb 0a sbc r15, r27 bb74: e6 e0 ldi r30, 0x06 ; 6 bb76: ee 16 cp r14, r30 bb78: f1 04 cpc r15, r1 bb7a: 09 f0 breq .+2 ; 0xbb7e bb7c: 38 c3 rjmp .+1648 ; 0xc1ee 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; bb7e: cb 58 subi r28, 0x8B ; 139 bb80: dd 4f sbci r29, 0xFD ; 253 bb82: 28 81 ld r18, Y bb84: 39 81 ldd r19, Y+1 ; 0x01 bb86: 4a 81 ldd r20, Y+2 ; 0x02 bb88: 5b 81 ldd r21, Y+3 ; 0x03 bb8a: c5 57 subi r28, 0x75 ; 117 bb8c: d2 40 sbci r29, 0x02 ; 2 bb8e: c1 59 subi r28, 0x91 ; 145 bb90: dd 4f sbci r29, 0xFD ; 253 bb92: a8 81 ld r26, Y bb94: b9 81 ldd r27, Y+1 ; 0x01 bb96: cf 56 subi r28, 0x6F ; 111 bb98: d2 40 sbci r29, 0x02 ; 2 bb9a: 6d 91 ld r22, X+ bb9c: 7d 91 ld r23, X+ bb9e: 8d 91 ld r24, X+ bba0: 9c 91 ld r25, X bba2: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> bba6: 41 2c mov r4, r1 bba8: 51 2c mov r5, r1 bbaa: 32 01 movw r6, r4 bbac: 18 16 cp r1, r24 bbae: 0c f4 brge .+2 ; 0xbbb2 bbb0: 02 c3 rjmp .+1540 ; 0xc1b6 bbb2: c3 59 subi r28, 0x93 ; 147 bbb4: dd 4f sbci r29, 0xFD ; 253 bbb6: 08 81 ld r16, Y bbb8: 19 81 ldd r17, Y+1 ; 0x01 bbba: cd 56 subi r28, 0x6D ; 109 bbbc: d2 40 sbci r29, 0x02 ; 2 bbbe: 0c 5e subi r16, 0xEC ; 236 bbc0: 1f 4f sbci r17, 0xFF ; 255 bbc2: c1 59 subi r28, 0x91 ; 145 bbc4: dd 4f sbci r29, 0xFD ; 253 bbc6: e8 80 ld r14, Y bbc8: f9 80 ldd r15, Y+1 ; 0x01 bbca: cf 56 subi r28, 0x6F ; 111 bbcc: d2 40 sbci r29, 0x02 ; 2 bbce: b4 e1 ldi r27, 0x14 ; 20 bbd0: eb 0e add r14, r27 bbd2: f1 1c adc r15, r1 bbd4: 6e 01 movw r12, r28 bbd6: ef ed ldi r30, 0xDF ; 223 bbd8: ce 1a sub r12, r30 bbda: ed ef ldi r30, 0xFD ; 253 bbdc: de 0a sbc r13, r30 bbde: 9e 01 movw r18, r28 bbe0: 2b 55 subi r18, 0x5B ; 91 bbe2: 3e 4f sbci r19, 0xFE ; 254 bbe4: cf 58 subi r28, 0x8F ; 143 bbe6: dd 4f sbci r29, 0xFD ; 253 bbe8: 39 83 std Y+1, r19 ; 0x01 bbea: 28 83 st Y, r18 bbec: c1 57 subi r28, 0x71 ; 113 bbee: 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]); bbf0: d8 01 movw r26, r16 bbf2: 4d 90 ld r4, X+ bbf4: 5d 90 ld r5, X+ bbf6: 6d 90 ld r6, X+ bbf8: 7c 90 ld r7, X bbfa: f7 01 movw r30, r14 bbfc: 60 81 ld r22, Z bbfe: 71 81 ldd r23, Z+1 ; 0x01 bc00: 82 81 ldd r24, Z+2 ; 0x02 bc02: 93 81 ldd r25, Z+3 ; 0x03 bc04: d7 01 movw r26, r14 bc06: 5e 91 ld r21, -X bc08: 4e 91 ld r20, -X bc0a: 3e 91 ld r19, -X bc0c: 2e 91 ld r18, -X bc0e: 7d 01 movw r14, r26 bc10: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> bc14: 4b 01 movw r8, r22 bc16: 5c 01 movw r10, r24 bc18: f8 01 movw r30, r16 bc1a: 52 91 ld r21, -Z bc1c: 42 91 ld r20, -Z bc1e: 32 91 ld r19, -Z bc20: 22 91 ld r18, -Z bc22: 8f 01 movw r16, r30 bc24: c3 01 movw r24, r6 bc26: b2 01 movw r22, r4 bc28: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> bc2c: a5 01 movw r20, r10 bc2e: 94 01 movw r18, r8 bc30: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> bc34: d6 01 movw r26, r12 bc36: 9e 93 st -X, r25 bc38: 8e 93 st -X, r24 bc3a: 7e 93 st -X, r23 bc3c: 6e 93 st -X, r22 bc3e: 6d 01 movw r12, r26 h[i - 1] = x[i] - x[i - 1]; bc40: cf 58 subi r28, 0x8F ; 143 bc42: dd 4f sbci r29, 0xFD ; 253 bc44: e8 81 ld r30, Y bc46: f9 81 ldd r31, Y+1 ; 0x01 bc48: c1 57 subi r28, 0x71 ; 113 bc4a: d2 40 sbci r29, 0x02 ; 2 bc4c: b2 92 st -Z, r11 bc4e: a2 92 st -Z, r10 bc50: 92 92 st -Z, r9 bc52: 82 92 st -Z, r8 bc54: cf 58 subi r28, 0x8F ; 143 bc56: dd 4f sbci r29, 0xFD ; 253 bc58: f9 83 std Y+1, r31 ; 0x01 bc5a: e8 83 st Y, r30 bc5c: c1 57 subi r28, 0x71 ; 113 bc5e: 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--) { bc60: c3 59 subi r28, 0x93 ; 147 bc62: dd 4f sbci r29, 0xFD ; 253 bc64: 28 81 ld r18, Y bc66: 39 81 ldd r19, Y+1 ; 0x01 bc68: cd 56 subi r28, 0x6D ; 109 bc6a: d2 40 sbci r29, 0x02 ; 2 bc6c: 02 17 cp r16, r18 bc6e: 13 07 cpc r17, r19 bc70: 09 f0 breq .+2 ; 0xbc74 bc72: be cf rjmp .-132 ; 0xbbf0 bc74: 4e 01 movw r8, r28 bc76: 3f e6 ldi r19, 0x6F ; 111 bc78: 83 1a sub r8, r19 bc7a: 3e ef ldi r19, 0xFE ; 254 bc7c: 93 0a sbc r9, r19 bc7e: 5e 01 movw r10, r28 bc80: 83 ef ldi r24, 0xF3 ; 243 bc82: a8 1a sub r10, r24 bc84: 8d ef ldi r24, 0xFD ; 253 bc86: b8 0a sbc r11, r24 bc88: 61 01 movw r12, r2 bc8a: 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 bcae: 9b 01 movw r18, r22 bcb0: ac 01 movw r20, r24 bcb2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> bcb6: f8 01 movw r30, r16 bcb8: 64 a7 std Z+44, r22 ; 0x2c bcba: 75 a7 std Z+45, r23 ; 0x2d bcbc: 86 a7 std Z+46, r24 ; 0x2e bcbe: 97 a7 std Z+47, r25 ; 0x2f if (i != 1) { bcc0: f1 e0 ldi r31, 0x01 ; 1 bcc2: ef 16 cp r14, r31 bcc4: f1 04 cpc r15, r1 bcc6: 61 f0 breq .+24 ; 0xbce0 m[i][i - 1] = h[i - 1]; bcc8: d8 01 movw r26, r16 bcca: 98 96 adiw r26, 0x28 ; 40 bccc: 4d 92 st X+, r4 bcce: 5d 92 st X+, r5 bcd0: 6d 92 st X+, r6 bcd2: 7c 92 st X, r7 bcd4: 9b 97 sbiw r26, 0x2b ; 43 m[i - 1][i] = h[i - 1]; bcd6: f8 01 movw r30, r16 bcd8: 44 82 std Z+4, r4 ; 0x04 bcda: 55 82 std Z+5, r5 ; 0x05 bcdc: 66 82 std Z+6, r6 ; 0x06 bcde: 77 82 std Z+7, r7 ; 0x07 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); bce0: ff ef ldi r31, 0xFF ; 255 bce2: ef 1a sub r14, r31 bce4: ff 0a sbc r15, r31 bce6: f5 01 movw r30, r10 bce8: 20 81 ld r18, Z bcea: 31 81 ldd r19, Z+1 ; 0x01 bcec: 42 81 ldd r20, Z+2 ; 0x02 bcee: 53 81 ldd r21, Z+3 ; 0x03 bcf0: 84 e0 ldi r24, 0x04 ; 4 bcf2: a8 0e add r10, r24 bcf4: b1 1c adc r11, r1 bcf6: 64 81 ldd r22, Z+4 ; 0x04 bcf8: 75 81 ldd r23, Z+5 ; 0x05 bcfa: 86 81 ldd r24, Z+6 ; 0x06 bcfc: 97 81 ldd r25, Z+7 ; 0x07 bcfe: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> bd02: 20 e0 ldi r18, 0x00 ; 0 bd04: 30 e0 ldi r19, 0x00 ; 0 bd06: 40 ec ldi r20, 0xC0 ; 192 bd08: 50 e4 ldi r21, 0x40 ; 64 bd0a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> bd0e: d6 01 movw r26, r12 bd10: dc 96 adiw r26, 0x3c ; 60 bd12: 6d 93 st X+, r22 bd14: 7d 93 st X+, r23 bd16: 8d 93 st X+, r24 bd18: 9c 93 st X, r25 bd1a: df 97 sbiw r26, 0x3f ; 63 bd1c: 04 5d subi r16, 0xD4 ; 212 bd1e: 1f 4f sbci r17, 0xFF ; 255 bd20: b8 e2 ldi r27, 0x28 ; 40 bd22: cb 0e add r12, r27 bd24: 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 bd2e: b1 cf rjmp .-158 ; 0xbc92 bd30: 7e 01 movw r14, r28 bd32: fd e2 ldi r31, 0x2D ; 45 bd34: ef 0e add r14, r31 bd36: f1 1c adc r15, r1 bd38: 28 e2 ldi r18, 0x28 ; 40 bd3a: a2 2e mov r10, r18 bd3c: b1 2c mov r11, r1 bd3e: 00 eb ldi r16, 0xB0 ; 176 bd40: 1f ef ldi r17, 0xFF ; 255 bd42: 24 e0 ldi r18, 0x04 ; 4 bd44: 22 0e add r2, r18 bd46: 31 1c adc r3, r1 } m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bd64: 2b 01 movw r4, r22 bd66: 3c 01 movw r6, r24 bd68: 61 01 movw r12, r2 bd6a: c0 1a sub r12, r16 bd6c: d1 0a sbc r13, r17 for (j = 1; j <= n - 1; j++) bd6e: 88 24 eor r8, r8 bd70: 83 94 inc r8 bd72: 91 2c mov r9, r1 m[i + 1][j] -= temp*m[i][j]; bd74: f6 01 movw r30, r12 bd76: e0 0f add r30, r16 bd78: f1 1f adc r31, r17 bd7a: ea 0d add r30, r10 bd7c: fb 1d adc r31, r11 bd7e: 20 81 ld r18, Z bd80: 31 81 ldd r19, Z+1 ; 0x01 bd82: 42 81 ldd r20, Z+2 ; 0x02 bd84: 53 81 ldd r21, Z+3 ; 0x03 bd86: c3 01 movw r24, r6 bd88: b2 01 movw r22, r4 bd8a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> bd8e: 9b 01 movw r18, r22 bd90: ac 01 movw r20, r24 bd92: f6 01 movw r30, r12 bd94: 60 81 ld r22, Z bd96: 71 81 ldd r23, Z+1 ; 0x01 bd98: 82 81 ldd r24, Z+2 ; 0x02 bd9a: 93 81 ldd r25, Z+3 ; 0x03 bd9c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> bda0: d6 01 movw r26, r12 bda2: 6d 93 st X+, r22 bda4: 7d 93 st X+, r23 bda6: 8d 93 st X+, r24 bda8: 9d 93 st X+, r25 bdaa: 6d 01 movw r12, r26 m[i][n - 1] = 6 * (F[i + 1] - F[i]); } //*********** forward elimination ************** for (i = 1; i bdba: 3c e2 ldi r19, 0x2C ; 44 bdbc: e3 0e add r14, r19 bdbe: f1 1c adc r15, r1 bdc0: 08 52 subi r16, 0x28 ; 40 bdc2: 11 09 sbc r17, r1 bdc4: 88 e2 ldi r24, 0x28 ; 40 bdc6: a8 0e add r10, r24 bdc8: 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 bdd2: ba cf rjmp .-140 ; 0xbd48 bdd4: 1e 01 movw r2, r28 bdd6: f5 eb ldi r31, 0xB5 ; 181 bdd8: 2f 0e add r2, r31 bdda: 31 1c adc r3, r1 bddc: 6e 01 movw r12, r28 bdde: 21 eb ldi r18, 0xB1 ; 177 bde0: c2 0e add r12, r18 bde2: d1 1c adc r13, r1 bde4: 7e 01 movw r14, r28 bde6: 37 e3 ldi r19, 0x37 ; 55 bde8: e3 1a sub r14, r19 bdea: 3e ef ldi r19, 0xFE ; 254 bdec: 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--) { bdee: 04 e0 ldi r16, 0x04 ; 4 bdf0: 10 e0 ldi r17, 0x00 ; 0 bdf2: 48 01 movw r8, r16 bdf4: b1 2c mov r11, r1 bdf6: a1 2c mov r10, r1 sum = 0; bdf8: 41 2c mov r4, r1 bdfa: 51 2c mov r5, r1 bdfc: 32 01 movw r6, r4 for (j = i; j <= n - 2; j++) sum += m[i][j] * s[j]; bdfe: f6 01 movw r30, r12 be00: ea 0d add r30, r10 be02: fb 1d adc r31, r11 be04: d7 01 movw r26, r14 be06: aa 0d add r26, r10 be08: bb 1d adc r27, r11 be0a: 2d 91 ld r18, X+ be0c: 3d 91 ld r19, X+ be0e: 4d 91 ld r20, X+ be10: 5c 91 ld r21, X be12: 60 81 ld r22, Z be14: 71 81 ldd r23, Z+1 ; 0x01 be16: 82 81 ldd r24, Z+2 ; 0x02 be18: 93 81 ldd r25, Z+3 ; 0x03 be1a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> be1e: 9b 01 movw r18, r22 be20: ac 01 movw r20, r24 be22: c3 01 movw r24, r6 be24: b2 01 movw r22, r4 be26: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> be2a: 2b 01 movw r4, r22 be2c: 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++) be2e: 8f ef ldi r24, 0xFF ; 255 be30: 88 1a sub r8, r24 be32: 98 0a sbc r9, r24 be34: 94 e0 ldi r25, 0x04 ; 4 be36: a9 0e add r10, r25 be38: b1 1c adc r11, r1 be3a: a5 e0 ldi r26, 0x05 ; 5 be3c: 8a 16 cp r8, r26 be3e: 91 04 cpc r9, r1 be40: f1 f6 brne .-68 ; 0xbdfe sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; be42: a3 01 movw r20, r6 be44: 92 01 movw r18, r4 be46: f1 01 movw r30, r2 be48: 60 81 ld r22, Z be4a: 71 81 ldd r23, Z+1 ; 0x01 be4c: 82 81 ldd r24, Z+2 ; 0x02 be4e: 93 81 ldd r25, Z+3 ; 0x03 be50: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> be54: d6 01 movw r26, r12 be56: 2d 91 ld r18, X+ be58: 3d 91 ld r19, X+ be5a: 4d 91 ld r20, X+ be5c: 5c 91 ld r21, X be5e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> be62: f7 01 movw r30, r14 be64: 60 83 st Z, r22 be66: 71 83 std Z+1, r23 ; 0x01 be68: 82 83 std Z+2, r24 ; 0x02 be6a: 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--) { be6c: 01 50 subi r16, 0x01 ; 1 be6e: 11 09 sbc r17, r1 be70: f8 e2 ldi r31, 0x28 ; 40 be72: 2f 1a sub r2, r31 be74: 31 08 sbc r3, r1 be76: 2c e2 ldi r18, 0x2C ; 44 be78: c2 1a sub r12, r18 be7a: d1 08 sbc r13, r1 be7c: 34 e0 ldi r19, 0x04 ; 4 be7e: e3 1a sub r14, r19 be80: f1 08 sbc r15, r1 be82: 01 15 cp r16, r1 be84: 11 05 cpc r17, r1 be86: 09 f0 breq .+2 ; 0xbe8a be88: b4 cf rjmp .-152 ; 0xbdf2 sum += m[i][j] * s[j]; s[i] = (m[i][n - 1] - sum) / m[i][i]; } for (i = 0; i x[i + 1])) { be8a: cb 50 subi r28, 0x0B ; 11 be8c: de 4f sbci r29, 0xFE ; 254 be8e: 88 81 ld r24, Y be90: 99 81 ldd r25, Y+1 ; 0x01 be92: aa 81 ldd r26, Y+2 ; 0x02 be94: bb 81 ldd r27, Y+3 ; 0x03 be96: c5 5f subi r28, 0xF5 ; 245 be98: d1 40 sbci r29, 0x01 ; 1 be9a: cf 57 subi r28, 0x7F ; 127 be9c: dd 4f sbci r29, 0xFD ; 253 be9e: 88 83 st Y, r24 bea0: 99 83 std Y+1, r25 ; 0x01 bea2: aa 83 std Y+2, r26 ; 0x02 bea4: bb 83 std Y+3, r27 ; 0x03 bea6: c1 58 subi r28, 0x81 ; 129 bea8: d2 40 sbci r29, 0x02 ; 2 beaa: 1e 01 movw r2, r28 beac: 97 e4 ldi r25, 0x47 ; 71 beae: 29 1a sub r2, r25 beb0: 9e ef ldi r25, 0xFE ; 254 beb2: 39 0a sbc r3, r25 beb4: 10 e0 ldi r17, 0x00 ; 0 beb6: 00 e0 ldi r16, 0x00 ; 0 beb8: c1 59 subi r28, 0x91 ; 145 beba: dd 4f sbci r29, 0xFD ; 253 bebc: a8 81 ld r26, Y bebe: b9 81 ldd r27, Y+1 ; 0x01 bec0: cf 56 subi r28, 0x6F ; 111 bec2: d2 40 sbci r29, 0x02 ; 2 bec4: cd 90 ld r12, X+ bec6: dd 90 ld r13, X+ bec8: ed 90 ld r14, X+ beca: fd 90 ld r15, X+ becc: c1 59 subi r28, 0x91 ; 145 bece: dd 4f sbci r29, 0xFD ; 253 bed0: b9 83 std Y+1, r27 ; 0x01 bed2: a8 83 st Y, r26 bed4: cf 56 subi r28, 0x6F ; 111 bed6: d2 40 sbci r29, 0x02 ; 2 bed8: cb 58 subi r28, 0x8B ; 139 beda: dd 4f sbci r29, 0xFD ; 253 bedc: 28 81 ld r18, Y bede: 39 81 ldd r19, Y+1 ; 0x01 bee0: 4a 81 ldd r20, Y+2 ; 0x02 bee2: 5b 81 ldd r21, Y+3 ; 0x03 bee4: c5 57 subi r28, 0x75 ; 117 bee6: d2 40 sbci r29, 0x02 ; 2 bee8: c7 01 movw r24, r14 beea: b6 01 movw r22, r12 beec: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> bef0: 18 16 cp r1, r24 bef2: b4 f0 brlt .+44 ; 0xbf20 bef4: cb 58 subi r28, 0x8B ; 139 bef6: dd 4f sbci r29, 0xFD ; 253 bef8: 28 81 ld r18, Y befa: 39 81 ldd r19, Y+1 ; 0x01 befc: 4a 81 ldd r20, Y+2 ; 0x02 befe: 5b 81 ldd r21, Y+3 ; 0x03 bf00: c5 57 subi r28, 0x75 ; 117 bf02: d2 40 sbci r29, 0x02 ; 2 bf04: c1 59 subi r28, 0x91 ; 145 bf06: dd 4f sbci r29, 0xFD ; 253 bf08: e8 81 ld r30, Y bf0a: f9 81 ldd r31, Y+1 ; 0x01 bf0c: cf 56 subi r28, 0x6F ; 111 bf0e: d2 40 sbci r29, 0x02 ; 2 bf10: 60 81 ld r22, Z bf12: 71 81 ldd r23, Z+1 ; 0x01 bf14: 82 81 ldd r24, Z+2 ; 0x02 bf16: 93 81 ldd r25, Z+3 ; 0x03 bf18: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> bf1c: 87 ff sbrs r24, 7 bf1e: 18 c0 rjmp .+48 ; 0xbf50 bf20: 04 30 cpi r16, 0x04 ; 4 bf22: 11 05 cpc r17, r1 bf24: 09 f0 breq .+2 ; 0xbf28 bf26: 30 c1 rjmp .+608 ; 0xc188 bf28: cb 58 subi r28, 0x8B ; 139 bf2a: dd 4f sbci r29, 0xFD ; 253 bf2c: 28 81 ld r18, Y bf2e: 39 81 ldd r19, Y+1 ; 0x01 bf30: 4a 81 ldd r20, Y+2 ; 0x02 bf32: 5b 81 ldd r21, Y+3 ; 0x03 bf34: c5 57 subi r28, 0x75 ; 117 bf36: d2 40 sbci r29, 0x02 ; 2 bf38: cf 57 subi r28, 0x7F ; 127 bf3a: dd 4f sbci r29, 0xFD ; 253 bf3c: 68 81 ld r22, Y bf3e: 79 81 ldd r23, Y+1 ; 0x01 bf40: 8a 81 ldd r24, Y+2 ; 0x02 bf42: 9b 81 ldd r25, Y+3 ; 0x03 bf44: c1 58 subi r28, 0x81 ; 129 bf46: d2 40 sbci r29, 0x02 ; 2 bf48: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> bf4c: 87 ff sbrs r24, 7 bf4e: 1c c1 rjmp .+568 ; 0xc188 a = (s[i + 1] - s[i]) / (6 * h[i]); bf50: d1 01 movw r26, r2 bf52: 14 96 adiw r26, 0x04 ; 4 bf54: 8d 90 ld r8, X+ bf56: 9d 90 ld r9, X+ bf58: ad 90 ld r10, X+ bf5a: bc 90 ld r11, X bf5c: 17 97 sbiw r26, 0x07 ; 7 bf5e: 8d 91 ld r24, X+ bf60: 9d 91 ld r25, X+ bf62: 0d 90 ld r0, X+ bf64: bc 91 ld r27, X bf66: a0 2d mov r26, r0 bf68: cf 58 subi r28, 0x8F ; 143 bf6a: dd 4f sbci r29, 0xFD ; 253 bf6c: 88 83 st Y, r24 bf6e: 99 83 std Y+1, r25 ; 0x01 bf70: aa 83 std Y+2, r26 ; 0x02 bf72: bb 83 std Y+3, r27 ; 0x03 bf74: c1 57 subi r28, 0x71 ; 113 bf76: d2 40 sbci r29, 0x02 ; 2 bf78: f8 01 movw r30, r16 bf7a: ee 0f add r30, r30 bf7c: ff 1f adc r31, r31 bf7e: ee 0f add r30, r30 bf80: ff 1f adc r31, r31 bf82: 21 e9 ldi r18, 0x91 ; 145 bf84: 31 e0 ldi r19, 0x01 ; 1 bf86: 2c 0f add r18, r28 bf88: 3d 1f adc r19, r29 bf8a: e2 0f add r30, r18 bf8c: f3 1f adc r31, r19 bf8e: 40 80 ld r4, Z bf90: 51 80 ldd r5, Z+1 ; 0x01 bf92: 62 80 ldd r6, Z+2 ; 0x02 bf94: 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; bf96: c3 59 subi r28, 0x93 ; 147 bf98: dd 4f sbci r29, 0xFD ; 253 bf9a: a8 81 ld r26, Y bf9c: b9 81 ldd r27, Y+1 ; 0x01 bf9e: cd 56 subi r28, 0x6D ; 109 bfa0: d2 40 sbci r29, 0x02 ; 2 bfa2: 8d 91 ld r24, X+ bfa4: 9d 91 ld r25, X+ bfa6: 0d 90 ld r0, X+ bfa8: bc 91 ld r27, X bfaa: a0 2d mov r26, r0 bfac: c3 58 subi r28, 0x83 ; 131 bfae: dd 4f sbci r29, 0xFD ; 253 bfb0: 88 83 st Y, r24 bfb2: 99 83 std Y+1, r25 ; 0x01 bfb4: aa 83 std Y+2, r26 ; 0x02 bfb6: bb 83 std Y+3, r27 ; 0x03 bfb8: cd 57 subi r28, 0x7D ; 125 bfba: 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; bfbc: a7 01 movw r20, r14 bfbe: 96 01 movw r18, r12 bfc0: cb 58 subi r28, 0x8B ; 139 bfc2: dd 4f sbci r29, 0xFD ; 253 bfc4: 68 81 ld r22, Y bfc6: 79 81 ldd r23, Y+1 ; 0x01 bfc8: 8a 81 ldd r24, Y+2 ; 0x02 bfca: 9b 81 ldd r25, Y+3 ; 0x03 bfcc: c5 57 subi r28, 0x75 ; 117 bfce: d2 40 sbci r29, 0x02 ; 2 bfd0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> bfd4: 6b 01 movw r12, r22 bfd6: 7c 01 movw r14, r24 bfd8: 20 e0 ldi r18, 0x00 ; 0 bfda: 30 e0 ldi r19, 0x00 ; 0 bfdc: 40 e4 ldi r20, 0x40 ; 64 bfde: 50 e4 ldi r21, 0x40 ; 64 bfe0: 0f 94 29 e2 call 0x3c452 ; 0x3c452 bfe4: cb 57 subi r28, 0x7B ; 123 bfe6: dd 4f sbci r29, 0xFD ; 253 bfe8: 68 83 st Y, r22 bfea: 79 83 std Y+1, r23 ; 0x01 bfec: 8a 83 std Y+2, r24 ; 0x02 bfee: 9b 83 std Y+3, r25 ; 0x03 bff0: c5 58 subi r28, 0x85 ; 133 bff2: 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; bff4: c3 58 subi r28, 0x83 ; 131 bff6: dd 4f sbci r29, 0xFD ; 253 bff8: 28 81 ld r18, Y bffa: 39 81 ldd r19, Y+1 ; 0x01 bffc: 4a 81 ldd r20, Y+2 ; 0x02 bffe: 5b 81 ldd r21, Y+3 ; 0x03 c000: cd 57 subi r28, 0x7D ; 125 c002: d2 40 sbci r29, 0x02 ; 2 c004: c3 59 subi r28, 0x93 ; 147 c006: dd 4f sbci r29, 0xFD ; 253 c008: e8 81 ld r30, Y c00a: f9 81 ldd r31, Y+1 ; 0x01 c00c: cd 56 subi r28, 0x6D ; 109 c00e: d2 40 sbci r29, 0x02 ; 2 c010: 64 81 ldd r22, Z+4 ; 0x04 c012: 75 81 ldd r23, Z+5 ; 0x05 c014: 86 81 ldd r24, Z+6 ; 0x06 c016: 97 81 ldd r25, Z+7 ; 0x07 c018: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> c01c: a3 01 movw r20, r6 c01e: 92 01 movw r18, r4 c020: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> c024: c7 58 subi r28, 0x87 ; 135 c026: dd 4f sbci r29, 0xFD ; 253 c028: 68 83 st Y, r22 c02a: 79 83 std Y+1, r23 ; 0x01 c02c: 8a 83 std Y+2, r24 ; 0x02 c02e: 9b 83 std Y+3, r25 ; 0x03 c030: c9 57 subi r28, 0x79 ; 121 c032: d2 40 sbci r29, 0x02 ; 2 c034: a3 01 movw r20, r6 c036: 92 01 movw r18, r4 c038: c3 01 movw r24, r6 c03a: b2 01 movw r22, r4 c03c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> c040: cf 58 subi r28, 0x8F ; 143 c042: dd 4f sbci r29, 0xFD ; 253 c044: 28 81 ld r18, Y c046: 39 81 ldd r19, Y+1 ; 0x01 c048: 4a 81 ldd r20, Y+2 ; 0x02 c04a: 5b 81 ldd r21, Y+3 ; 0x03 c04c: c1 57 subi r28, 0x71 ; 113 c04e: d2 40 sbci r29, 0x02 ; 2 c050: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c054: c7 57 subi r28, 0x77 ; 119 c056: dd 4f sbci r29, 0xFD ; 253 c058: 68 83 st Y, r22 c05a: 79 83 std Y+1, r23 ; 0x01 c05c: 8a 83 std Y+2, r24 ; 0x02 c05e: 9b 83 std Y+3, r25 ; 0x03 c060: c9 58 subi r28, 0x89 ; 137 c062: d2 40 sbci r29, 0x02 ; 2 c064: a3 01 movw r20, r6 c066: 92 01 movw r18, r4 c068: c5 01 movw r24, r10 c06a: b4 01 movw r22, r8 c06c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c070: 9b 01 movw r18, r22 c072: ac 01 movw r20, r24 c074: c7 57 subi r28, 0x77 ; 119 c076: dd 4f sbci r29, 0xFD ; 253 c078: 68 81 ld r22, Y c07a: 79 81 ldd r23, Y+1 ; 0x01 c07c: 8a 81 ldd r24, Y+2 ; 0x02 c07e: 9b 81 ldd r25, Y+3 ; 0x03 c080: c9 58 subi r28, 0x89 ; 137 c082: d2 40 sbci r29, 0x02 ; 2 c084: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> c088: 20 e0 ldi r18, 0x00 ; 0 c08a: 30 e0 ldi r19, 0x00 ; 0 c08c: 40 ec ldi r20, 0xC0 ; 192 c08e: 50 e4 ldi r21, 0x40 ; 64 c090: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> c094: 9b 01 movw r18, r22 c096: ac 01 movw r20, r24 c098: c7 58 subi r28, 0x87 ; 135 c09a: dd 4f sbci r29, 0xFD ; 253 c09c: 68 81 ld r22, Y c09e: 79 81 ldd r23, Y+1 ; 0x01 c0a0: 8a 81 ldd r24, Y+2 ; 0x02 c0a2: 9b 81 ldd r25, Y+3 ; 0x03 c0a4: c9 57 subi r28, 0x79 ; 121 c0a6: d2 40 sbci r29, 0x02 ; 2 c0a8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__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; c0ac: a7 01 movw r20, r14 c0ae: 96 01 movw r18, r12 c0b0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c0b4: c7 58 subi r28, 0x87 ; 135 c0b6: dd 4f sbci r29, 0xFD ; 253 c0b8: 68 83 st Y, r22 c0ba: 79 83 std Y+1, r23 ; 0x01 c0bc: 8a 83 std Y+2, r24 ; 0x02 c0be: 9b 83 std Y+3, r25 ; 0x03 c0c0: c9 57 subi r28, 0x79 ; 121 c0c2: 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]); c0c4: cf 58 subi r28, 0x8F ; 143 c0c6: dd 4f sbci r29, 0xFD ; 253 c0c8: 28 81 ld r18, Y c0ca: 39 81 ldd r19, Y+1 ; 0x01 c0cc: 4a 81 ldd r20, Y+2 ; 0x02 c0ce: 5b 81 ldd r21, Y+3 ; 0x03 c0d0: c1 57 subi r28, 0x71 ; 113 c0d2: d2 40 sbci r29, 0x02 ; 2 c0d4: c5 01 movw r24, r10 c0d6: b4 01 movw r22, r8 c0d8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> c0dc: 4b 01 movw r8, r22 c0de: 5c 01 movw r10, r24 c0e0: 20 e0 ldi r18, 0x00 ; 0 c0e2: 30 e0 ldi r19, 0x00 ; 0 c0e4: 40 ec ldi r20, 0xC0 ; 192 c0e6: 50 e4 ldi r21, 0x40 ; 64 c0e8: c3 01 movw r24, r6 c0ea: b2 01 movw r22, r4 c0ec: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c0f0: 9b 01 movw r18, r22 c0f2: ac 01 movw r20, r24 c0f4: c5 01 movw r24, r10 c0f6: b4 01 movw r22, r8 c0f8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__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; c0fc: cb 57 subi r28, 0x7B ; 123 c0fe: dd 4f sbci r29, 0xFD ; 253 c100: 28 81 ld r18, Y c102: 39 81 ldd r19, Y+1 ; 0x01 c104: 4a 81 ldd r20, Y+2 ; 0x02 c106: 5b 81 ldd r21, Y+3 ; 0x03 c108: c5 58 subi r28, 0x85 ; 133 c10a: d2 40 sbci r29, 0x02 ; 2 c10c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c110: 4b 01 movw r8, r22 c112: 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; c114: 20 e0 ldi r18, 0x00 ; 0 c116: 30 e0 ldi r19, 0x00 ; 0 c118: 40 e0 ldi r20, 0x00 ; 0 c11a: 5f e3 ldi r21, 0x3F ; 63 c11c: cf 58 subi r28, 0x8F ; 143 c11e: dd 4f sbci r29, 0xFD ; 253 c120: 68 81 ld r22, Y c122: 79 81 ldd r23, Y+1 ; 0x01 c124: 8a 81 ldd r24, Y+2 ; 0x02 c126: 9b 81 ldd r25, Y+3 ; 0x03 c128: c1 57 subi r28, 0x71 ; 113 c12a: d2 40 sbci r29, 0x02 ; 2 c12c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c130: 2b 01 movw r4, r22 c132: 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; c134: a7 01 movw r20, r14 c136: 96 01 movw r18, r12 c138: c7 01 movw r24, r14 c13a: b6 01 movw r22, r12 c13c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c140: 9b 01 movw r18, r22 c142: ac 01 movw r20, r24 c144: c3 01 movw r24, r6 c146: b2 01 movw r22, r4 c148: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c14c: 9b 01 movw r18, r22 c14e: ac 01 movw r20, r24 c150: c5 01 movw r24, r10 c152: b4 01 movw r22, r8 c154: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> c158: 9b 01 movw r18, r22 c15a: ac 01 movw r20, r24 c15c: c7 58 subi r28, 0x87 ; 135 c15e: dd 4f sbci r29, 0xFD ; 253 c160: 68 81 ld r22, Y c162: 79 81 ldd r23, Y+1 ; 0x01 c164: 8a 81 ldd r24, Y+2 ; 0x02 c166: 9b 81 ldd r25, Y+3 ; 0x03 c168: c9 57 subi r28, 0x79 ; 121 c16a: d2 40 sbci r29, 0x02 ; 2 c16c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> c170: c3 58 subi r28, 0x83 ; 131 c172: dd 4f sbci r29, 0xFD ; 253 c174: 28 81 ld r18, Y c176: 39 81 ldd r19, Y+1 ; 0x01 c178: 4a 81 ldd r20, Y+2 ; 0x02 c17a: 5b 81 ldd r21, Y+3 ; 0x03 c17c: cd 57 subi r28, 0x7D ; 125 c17e: d2 40 sbci r29, 0x02 ; 2 c180: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> c184: 2b 01 movw r4, r22 c186: 3c 01 movw r6, r24 c188: 0f 5f subi r16, 0xFF ; 255 c18a: 1f 4f sbci r17, 0xFF ; 255 c18c: f4 e0 ldi r31, 0x04 ; 4 c18e: 2f 0e add r2, r31 c190: 31 1c adc r3, r1 c192: c3 59 subi r28, 0x93 ; 147 c194: dd 4f sbci r29, 0xFD ; 253 c196: 28 81 ld r18, Y c198: 39 81 ldd r19, Y+1 ; 0x01 c19a: cd 56 subi r28, 0x6D ; 109 c19c: d2 40 sbci r29, 0x02 ; 2 c19e: 2c 5f subi r18, 0xFC ; 252 c1a0: 3f 4f sbci r19, 0xFF ; 255 c1a2: c3 59 subi r28, 0x93 ; 147 c1a4: dd 4f sbci r29, 0xFD ; 253 c1a6: 39 83 std Y+1, r19 ; 0x01 c1a8: 28 83 st Y, r18 c1aa: cd 56 subi r28, 0x6D ; 109 c1ac: 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 c1b4: 81 ce rjmp .-766 ; 0xbeb8 sum = a*pow((inp_temperature - x[i]), 3) + b*pow((inp_temperature - x[i]), 2) + c*(inp_temperature - x[i]) + d; } return sum; } c1b6: c3 01 movw r24, r6 c1b8: b2 01 movw r22, r4 c1ba: c4 57 subi r28, 0x74 ; 116 c1bc: dd 4f sbci r29, 0xFD ; 253 c1be: 0f b6 in r0, 0x3f ; 63 c1c0: f8 94 cli c1c2: de bf out 0x3e, r29 ; 62 c1c4: 0f be out 0x3f, r0 ; 63 c1c6: cd bf out 0x3d, r28 ; 61 c1c8: df 91 pop r29 c1ca: cf 91 pop r28 c1cc: 1f 91 pop r17 c1ce: 0f 91 pop r16 c1d0: ff 90 pop r15 c1d2: ef 90 pop r14 c1d4: df 90 pop r13 c1d6: cf 90 pop r12 c1d8: bf 90 pop r11 c1da: af 90 pop r10 c1dc: 9f 90 pop r9 c1de: 8f 90 pop r8 c1e0: 7f 90 pop r7 c1e2: 6f 90 pop r6 c1e4: 5f 90 pop r5 c1e6: 4f 90 pop r4 c1e8: 3f 90 pop r3 c1ea: 2f 90 pop r2 c1ec: 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)); c1ee: c5 01 movw r24, r10 c1f0: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e c1f4: d8 01 movw r26, r16 c1f6: 8d 93 st X+, r24 c1f8: 9c 93 st X, r25 c1fa: b5 e0 ldi r27, 0x05 ; 5 c1fc: cb 0e add r12, r27 c1fe: d1 1c adc r13, r1 c200: e2 e0 ldi r30, 0x02 ; 2 c202: ae 0e add r10, r30 c204: b1 1c adc r11, r1 c206: 96 cc rjmp .-1748 ; 0xbb34 0000c208 : eFilamentAction = FilamentAction::None; } // Common gcode shared by the gcodes. This saves some flash memory static void gcodes_M704_M705_M706(uint16_t gcode) { c208: 0f 93 push r16 c20a: 1f 93 push r17 c20c: cf 93 push r28 uint8_t mmuSlotIndex = 0xffU; if (MMU2::mmu2.Enabled() && code_seen('P')) c20e: 20 91 98 13 lds r18, 0x1398 ; 0x801398 c212: 21 30 cpi r18, 0x01 ; 1 c214: 79 f5 brne .+94 ; 0xc274 c216: 8c 01 movw r16, r24 c218: 80 e5 ldi r24, 0x50 ; 80 c21a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 c21e: 88 23 and r24, r24 c220: 49 f1 breq .+82 ; 0xc274 { mmuSlotIndex = code_value_uint8(); c222: 0e 94 0e 5c call 0xb81c ; 0xb81c c226: c8 2f mov r28, r24 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { c228: 85 30 cpi r24, 0x05 ; 5 c22a: 20 f5 brcc .+72 ; 0xc274 switch (gcode) c22c: 01 3c cpi r16, 0xC1 ; 193 c22e: 82 e0 ldi r24, 0x02 ; 2 c230: 18 07 cpc r17, r24 c232: 49 f0 breq .+18 ; 0xc246 c234: 02 3c cpi r16, 0xC2 ; 194 c236: 12 40 sbci r17, 0x02 ; 2 c238: 69 f0 breq .+26 ; 0xc254 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c23a: 8c 2f mov r24, r28 default: break; } } } } c23c: cf 91 pop r28 c23e: 1f 91 pop r17 c240: 0f 91 pop r16 mmuSlotIndex = code_value_uint8(); if (mmuSlotIndex < MMU_FILAMENT_COUNT) { switch (gcode) { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); c242: 0d 94 85 a0 jmp 0x3410a ; 0x3410a break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c246: 60 e0 ldi r22, 0x00 ; 0 c248: 8c 2f mov r24, r28 default: break; } } } } c24a: cf 91 pop r28 c24c: 1f 91 pop r17 c24e: 0f 91 pop r16 { case 704: MMU2::mmu2.load_filament(mmuSlotIndex); break; case 705: MMU2::mmu2.eject_filament(mmuSlotIndex, false); c250: 0d 94 c8 a0 jmp 0x34190 ; 0x34190 break; case 706: #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0){ c254: 8e ec ldi r24, 0xCE ; 206 c256: 9e e0 ldi r25, 0x0E ; 14 c258: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 c25c: 88 23 and r24, r24 c25e: 51 f0 breq .+20 ; 0xc274 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { c260: 0f 94 56 88 call 0x310ac ; 0x310ac c264: 88 23 and r24, r24 c266: 31 f0 breq .+12 ; 0xc274 c268: 8c 2f mov r24, r28 default: break; } } } } c26a: cf 91 pop r28 c26c: 1f 91 pop r17 c26e: 0f 91 pop r16 c270: 0d 94 45 a1 jmp 0x3428a ; 0x3428a c274: cf 91 pop r28 c276: 1f 91 pop r17 c278: 0f 91 pop r16 c27a: 08 95 ret 0000c27c : #ifdef TMC2130 void change_power_mode_live(uint8_t mode) { c27c: cf 93 push r28 c27e: 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(); c280: 0f 94 2c 59 call 0x2b258 ; 0x2b258 cli(); c284: f8 94 cli tmc2130_mode = mode; c286: c0 93 6c 06 sts 0x066C, r28 ; 0x80066c update_mode_profile(); c28a: 0f 94 c7 aa call 0x3558e ; 0x3558e 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(); c28e: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 1 #else 0 #endif ) , enableECool(enableECool) { } c292: 88 0f add r24, r24 tmc2130_init(TMCInitParams(FarmOrUserECool())); c294: 82 70 andi r24, 0x02 ; 2 c296: 0f 94 21 3c call 0x27842 ; 0x27842 // 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(); c29a: 0f 94 86 59 call 0x2b30c ; 0x2b30c sei(); c29e: 78 94 sei } c2a0: cf 91 pop r28 c2a2: 08 95 ret 0000c2a4 : 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);} c2a4: 8f 92 push r8 c2a6: 9f 92 push r9 c2a8: af 92 push r10 c2aa: bf 92 push r11 c2ac: cf 92 push r12 c2ae: df 92 push r13 c2b0: ef 92 push r14 c2b2: ff 92 push r15 c2b4: 0f 93 push r16 c2b6: 1f 93 push r17 c2b8: cf 93 push r28 c2ba: df 93 push r29 c2bc: 00 91 97 03 lds r16, 0x0397 ; 0x800397 c2c0: 10 91 98 03 lds r17, 0x0398 ; 0x800398 c2c4: 0f 5f subi r16, 0xFF ; 255 c2c6: 1f 4f sbci r17, 0xFF ; 255 if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c2c8: 68 01 movw r12, r16 c2ca: 8f ef ldi r24, 0xFF ; 255 c2cc: c8 1a sub r12, r24 c2ce: d8 0a sbc r13, r24 c2d0: d8 01 movw r26, r16 c2d2: dc 91 ld r29, X } while (isspace(c)); c2d4: 8d 2f mov r24, r29 c2d6: 90 e0 ldi r25, 0x00 ; 0 c2d8: 0f 94 22 db call 0x3b644 ; 0x3b644 c2dc: 7c 01 movw r14, r24 c2de: 89 2b or r24, r25 c2e0: 01 f5 brne .+64 ; 0xc322 flag = 0; if (c == '-') { c2e2: dd 32 cpi r29, 0x2D ; 45 c2e4: 01 f5 brne .+64 ; 0xc326 flag = FL_MINUS; c = *nptr++; c2e6: 68 01 movw r12, r16 c2e8: b2 e0 ldi r27, 0x02 ; 2 c2ea: cb 0e add r12, r27 c2ec: d1 1c adc r13, r1 c2ee: f8 01 movw r30, r16 c2f0: d1 81 ldd r29, Z+1 ; 0x01 c = *nptr++; } while (isspace(c)); flag = 0; if (c == '-') { flag = FL_MINUS; c2f2: c1 e0 ldi r28, 0x01 ; 1 } else if (c == '+') { c = *nptr++; } if (!strncasecmp_P(nptr - 1, pstr_inf, 3)) { c2f4: 86 01 movw r16, r12 c2f6: 01 50 subi r16, 0x01 ; 1 c2f8: 11 09 sbc r17, r1 c2fa: 43 e0 ldi r20, 0x03 ; 3 c2fc: 50 e0 ldi r21, 0x00 ; 0 c2fe: 61 e4 ldi r22, 0x41 ; 65 c300: 7c e7 ldi r23, 0x7C ; 124 c302: c8 01 movw r24, r16 c304: 0f 94 58 db call 0x3b6b0 ; 0x3b6b0 c308: 89 2b or r24, r25 c30a: c1 f4 brne .+48 ; 0xc33c nptr += 2; if (!strncasecmp_P(nptr, pstr_inity, 5)) nptr += 5; if (endptr) *endptr = (char*)nptr; return flag & FL_MINUS ? -INFINITY : +INFINITY; c30c: 60 e0 ldi r22, 0x00 ; 0 c30e: 70 e0 ldi r23, 0x00 ; 0 c310: 80 e8 ldi r24, 0x80 ; 128 c312: 9f ef ldi r25, 0xFF ; 255 c314: c1 11 cpse r28, r1 c316: db c0 rjmp .+438 ; 0xc4ce c318: 60 e0 ldi r22, 0x00 ; 0 c31a: 70 e0 ldi r23, 0x00 ; 0 c31c: 80 e8 ldi r24, 0x80 ; 128 c31e: 9f e7 ldi r25, 0x7F ; 127 c320: d6 c0 rjmp .+428 ; 0xc4ce if (endptr) *endptr = (char*)nptr; do { c = *nptr++; c322: 86 01 movw r16, r12 c324: d1 cf rjmp .-94 ; 0xc2c8 flag = 0; if (c == '-') { flag = FL_MINUS; c = *nptr++; } else if (c == '+') { c326: db 32 cpi r29, 0x2B ; 43 c328: 39 f4 brne .+14 ; 0xc338 c = *nptr++; c32a: 68 01 movw r12, r16 c32c: f2 e0 ldi r31, 0x02 ; 2 c32e: cf 0e add r12, r31 c330: d1 1c adc r13, r1 c332: d8 01 movw r26, r16 c334: 11 96 adiw r26, 0x01 ; 1 c336: dc 91 ld r29, X do { c = *nptr++; } while (isspace(c)); flag = 0; c338: c0 e0 ldi r28, 0x00 ; 0 c33a: dc cf rjmp .-72 ; 0xc2f4 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)) { c33c: 43 e0 ldi r20, 0x03 ; 3 c33e: 50 e0 ldi r21, 0x00 ; 0 c340: 6e e3 ldi r22, 0x3E ; 62 c342: 7c e7 ldi r23, 0x7C ; 124 c344: c8 01 movw r24, r16 c346: 0f 94 58 db call 0x3b6b0 ; 0x3b6b0 c34a: 89 2b or r24, r25 c34c: 09 f4 brne .+2 ; 0xc350 c34e: cc c0 rjmp .+408 ; 0xc4e8 c350: f6 01 movw r30, r12 *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; exp = 0; c352: 10 e0 ldi r17, 0x00 ; 0 c354: 00 e0 ldi r16, 0x00 ; 0 if (endptr) *endptr = (char*)nptr + 2; return NAN; } x.u32 = 0; c356: 20 e0 ldi r18, 0x00 ; 0 c358: 30 e0 ldi r19, 0x00 ; 0 c35a: a9 01 movw r20, r18 c35c: 6f 01 movw r12, r30 exp = 0; while (1) { c -= '0'; c35e: d0 53 subi r29, 0x30 ; 48 if (c <= 9) { c360: da 30 cpi r29, 0x0A ; 10 c362: 60 f5 brcc .+88 ; 0xc3bc flag |= FL_ANY; c364: bc 2e mov r11, r28 c366: 68 94 set c368: b1 f8 bld r11, 1 c36a: 8c 2f mov r24, r28 c36c: 88 70 andi r24, 0x08 ; 8 if (flag & FL_OVFL) { c36e: c2 ff sbrs r28, 2 c370: 09 c0 rjmp .+18 ; 0xc384 if (!(flag & FL_DOT)) c372: 81 11 cpse r24, r1 c374: 02 c0 rjmp .+4 ; 0xc37a exp += 1; c376: 0f 5f subi r16, 0xFF ; 255 c378: 1f 4f sbci r17, 0xFF ; 255 c37a: 31 96 adiw r30, 0x01 ; 1 flag |= FL_DOT; } else { break; } c = *nptr++; c37c: d6 01 movw r26, r12 c37e: dc 91 ld r29, X c380: cb 2d mov r28, r11 c382: ec cf rjmp .-40 ; 0xc35c if (flag & FL_OVFL) { if (!(flag & FL_DOT)) exp += 1; } else { if (flag & FL_DOT) c384: 88 23 and r24, r24 c386: 11 f0 breq .+4 ; 0xc38c exp -= 1; c388: 01 50 subi r16, 0x01 ; 1 c38a: 11 09 sbc r17, r1 /* x.u32 = x.u32 * 10 + c */ x.u32 = (((x.u32 << 2) + x.u32) << 1) + c; c38c: a5 e0 ldi r26, 0x05 ; 5 c38e: b0 e0 ldi r27, 0x00 ; 0 c390: 0f 94 26 de call 0x3bc4c ; 0x3bc4c <__muluhisi3> c394: 9b 01 movw r18, r22 c396: ac 01 movw r20, r24 c398: 22 0f add r18, r18 c39a: 33 1f adc r19, r19 c39c: 44 1f adc r20, r20 c39e: 55 1f adc r21, r21 c3a0: 2d 0f add r18, r29 c3a2: 31 1d adc r19, r1 c3a4: 41 1d adc r20, r1 c3a6: 51 1d adc r21, r1 if (x.u32 >= (ULONG_MAX - 9) / 10) c3a8: 28 39 cpi r18, 0x98 ; 152 c3aa: b9 e9 ldi r27, 0x99 ; 153 c3ac: 3b 07 cpc r19, r27 c3ae: 4b 07 cpc r20, r27 c3b0: b9 e1 ldi r27, 0x19 ; 25 c3b2: 5b 07 cpc r21, r27 c3b4: 10 f3 brcs .-60 ; 0xc37a flag |= FL_OVFL; c3b6: c6 60 ori r28, 0x06 ; 6 c3b8: bc 2e mov r11, r28 c3ba: df cf rjmp .-66 ; 0xc37a } } else if (c == (('.' - '0') & 0xff) && !(flag & FL_DOT)) { c3bc: de 3f cpi r29, 0xFE ; 254 c3be: 31 f4 brne .+12 ; 0xc3cc c3c0: c3 fd sbrc r28, 3 c3c2: 33 c0 rjmp .+102 ; 0xc42a flag |= FL_DOT; c3c4: bc 2e mov r11, r28 c3c6: 68 94 set c3c8: b3 f8 bld r11, 3 c3ca: d7 cf rjmp .-82 ; 0xc37a } c = *nptr++; } // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) c3cc: d5 33 cpi r29, 0x35 ; 53 c3ce: 69 f5 brne .+90 ; 0xc42a { int i; c = *nptr++; c3d0: 80 81 ld r24, Z i = 2; if (c == '-') { c3d2: 8d 32 cpi r24, 0x2D ; 45 c3d4: 31 f4 brne .+12 ; 0xc3e2 flag |= FL_MEXP; c3d6: c0 61 ori r28, 0x10 ; 16 c = *nptr++; c3d8: bf 01 movw r22, r30 } else if (c == '+') { c = *nptr++; c3da: 6e 5f subi r22, 0xFE ; 254 c3dc: 7f 4f sbci r23, 0xFF ; 255 c3de: 81 81 ldd r24, Z+1 ; 0x01 c3e0: 05 c0 rjmp .+10 ; 0xc3ec c3e2: bf 01 movw r22, r30 i = 2; if (c == '-') { flag |= FL_MEXP; c = *nptr++; } else if (c == '+') { c3e4: 8b 32 cpi r24, 0x2B ; 43 c3e6: c9 f3 breq .-14 ; 0xc3da // Check for exponent "E", but disable capital E if (c == (('e' - '0') & 0xff) /*|| c == (('E' - '0') & 0xff)*/) { int i; c = *nptr++; c3e8: 6f 5f subi r22, 0xFF ; 255 c3ea: 7f 4f sbci r23, 0xFF ; 255 c = *nptr++; } else { i = 1; } c -= '0'; c3ec: 80 53 subi r24, 0x30 ; 48 if (c > 9) { c3ee: 8a 30 cpi r24, 0x0A ; 10 c3f0: e0 f4 brcc .+56 ; 0xc42a c3f2: fb 01 movw r30, r22 nptr -= i; } else { i = 0; do { if (i < 3200) c3f4: b0 e8 ldi r27, 0x80 ; 128 c3f6: eb 16 cp r14, r27 c3f8: bc e0 ldi r27, 0x0C ; 12 c3fa: fb 06 cpc r15, r27 c3fc: 5c f4 brge .+22 ; 0xc414 i = (((i << 2) + i) << 1) + c; /* i = 10*i + c */ c3fe: b7 01 movw r22, r14 c400: 66 0f add r22, r22 c402: 77 1f adc r23, r23 c404: 66 0f add r22, r22 c406: 77 1f adc r23, r23 c408: e6 0e add r14, r22 c40a: f7 1e adc r15, r23 c40c: ee 0c add r14, r14 c40e: ff 1c adc r15, r15 c410: e8 0e add r14, r24 c412: f1 1c adc r15, r1 c = *nptr++ - '0'; c414: 81 91 ld r24, Z+ c416: 80 53 subi r24, 0x30 ; 48 } while (c <= 9); c418: 8a 30 cpi r24, 0x0A ; 10 c41a: 60 f3 brcs .-40 ; 0xc3f4 if (flag & FL_MEXP) c41c: c4 ff sbrs r28, 4 c41e: 03 c0 rjmp .+6 ; 0xc426 i = -i; c420: f1 94 neg r15 c422: e1 94 neg r14 c424: f1 08 sbc r15, r1 exp += i; c426: 0e 0d add r16, r14 c428: 1f 1d adc r17, r15 } if ((flag & FL_ANY) && endptr) *endptr = (char*)nptr - 1; x.flt = __floatunsisf(x.u32); /* manually */ c42a: ca 01 movw r24, r20 c42c: b9 01 movw r22, r18 c42e: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> if ((flag & FL_MINUS) && (flag & FL_ANY)) c432: c3 70 andi r28, 0x03 ; 3 c434: c3 30 cpi r28, 0x03 ; 3 c436: 09 f4 brne .+2 ; 0xc43a x.flt = -x.flt; c438: 90 58 subi r25, 0x80 ; 128 c43a: 4b 01 movw r8, r22 c43c: 5c 01 movw r10, r24 if (x.flt != 0) { c43e: 20 e0 ldi r18, 0x00 ; 0 c440: 30 e0 ldi r19, 0x00 ; 0 c442: a9 01 movw r20, r18 c444: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> c448: 88 23 and r24, r24 c44a: 09 f4 brne .+2 ; 0xc44e c44c: 3e c0 rjmp .+124 ; 0xc4ca if (exp < 0) { nptr = (void*)(pwr_m10 + 5); exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c44e: ca e3 ldi r28, 0x3A ; 58 c450: 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) { c452: 17 ff sbrs r17, 7 c454: 05 c0 rjmp .+10 ; 0xc460 nptr = (void*)(pwr_m10 + 5); exp = -exp; c456: 11 95 neg r17 c458: 01 95 neg r16 c45a: 11 09 sbc r17, r1 x.flt = -x.flt; if (x.flt != 0) { int pwr; if (exp < 0) { nptr = (void*)(pwr_m10 + 5); c45c: c2 e2 ldi r28, 0x22 ; 34 c45e: dc e7 ldi r29, 0x7C ; 124 c460: 6e 01 movw r12, r28 c462: e8 e1 ldi r30, 0x18 ; 24 c464: ce 1a sub r12, r30 c466: d1 08 sbc r13, r1 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); c468: 80 e2 ldi r24, 0x20 ; 32 c46a: e8 2e mov r14, r24 c46c: f1 2c mov r15, r1 c46e: 0d c0 rjmp .+26 ; 0xc48a for (; exp >= pwr; exp -= pwr) { union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); c470: fe 01 movw r30, r28 c472: 25 91 lpm r18, Z+ c474: 35 91 lpm r19, Z+ c476: 45 91 lpm r20, Z+ c478: 54 91 lpm r21, Z } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c47a: 0e 19 sub r16, r14 c47c: 1f 09 sbc r17, r15 union { unsigned long u32; float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; c47e: c5 01 movw r24, r10 c480: b4 01 movw r22, r8 c482: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c486: 4b 01 movw r8, r22 c488: 5c 01 movw r10, r24 c48a: d5 01 movw r26, r10 c48c: c4 01 movw r24, r8 } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { for (; exp >= pwr; exp -= pwr) { c48e: 0e 15 cp r16, r14 c490: 1f 05 cpc r17, r15 c492: 74 f7 brge .-36 ; 0xc470 float flt; } y; y.u32 = pgm_read_dword((float*)nptr); x.flt *= y.flt; } nptr -= sizeof(float); c494: 24 97 sbiw r28, 0x04 ; 4 exp = -exp; } else { nptr = (void*)(pwr_p10 + 5); } for (pwr = 32; pwr; pwr >>= 1) { c496: f5 94 asr r15 c498: e7 94 ror r14 c49a: cc 16 cp r12, r28 c49c: dd 06 cpc r13, r29 c49e: a9 f7 brne .-22 ; 0xc48a not plus or minus infinity, and not NaN. */ __ATTR_CONST__ static inline int isfinite (double __x) { unsigned char __exp; __asm__ ( c4a0: 8a 2f mov r24, r26 c4a2: 88 0f add r24, r24 c4a4: 8b 2f mov r24, r27 c4a6: 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) c4a8: 8f 3f cpi r24, 0xFF ; 255 c4aa: 49 f0 breq .+18 ; 0xc4be c4ac: 20 e0 ldi r18, 0x00 ; 0 c4ae: 30 e0 ldi r19, 0x00 ; 0 c4b0: a9 01 movw r20, r18 c4b2: c5 01 movw r24, r10 c4b4: b4 01 movw r22, r8 c4b6: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> c4ba: 81 11 cpse r24, r1 c4bc: 06 c0 rjmp .+12 ; 0xc4ca errno = ERANGE; c4be: 82 e2 ldi r24, 0x22 ; 34 c4c0: 90 e0 ldi r25, 0x00 ; 0 c4c2: 90 93 0e 18 sts 0x180E, r25 ; 0x80180e c4c6: 80 93 0d 18 sts 0x180D, r24 ; 0x80180d } return x.flt; c4ca: c5 01 movw r24, r10 c4cc: b4 01 movw r22, r8 c4ce: df 91 pop r29 c4d0: cf 91 pop r28 c4d2: 1f 91 pop r17 c4d4: 0f 91 pop r16 c4d6: ff 90 pop r15 c4d8: ef 90 pop r14 c4da: df 90 pop r13 c4dc: cf 90 pop r12 c4de: bf 90 pop r11 c4e0: af 90 pop r10 c4e2: 9f 90 pop r9 c4e4: 8f 90 pop r8 c4e6: 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; c4e8: 60 e0 ldi r22, 0x00 ; 0 c4ea: 70 e0 ldi r23, 0x00 ; 0 c4ec: 80 ec ldi r24, 0xC0 ; 192 c4ee: 9f e7 ldi r25, 0x7F ; 127 c4f0: ee cf rjmp .-36 ; 0xc4ce 0000c4f2 : } } } #endif //MOTHERBOARD == BOARD_RAMBO_MINI_1_0 || MOTHERBOARD == BOARD_RAMBO_MINI_1_3 void get_coordinates() { c4f2: 2f 92 push r2 c4f4: 3f 92 push r3 c4f6: 4f 92 push r4 c4f8: 5f 92 push r5 c4fa: 6f 92 push r6 c4fc: 7f 92 push r7 c4fe: 8f 92 push r8 c500: 9f 92 push r9 c502: af 92 push r10 c504: bf 92 push r11 c506: cf 92 push r12 c508: df 92 push r13 c50a: ef 92 push r14 c50c: ff 92 push r15 c50e: 0f 93 push r16 c510: 1f 93 push r17 c512: cf 93 push r28 c514: df 93 push r29 c516: 00 d0 rcall .+0 ; 0xc518 c518: cd b7 in r28, 0x3d ; 61 c51a: de b7 in r29, 0x3e ; 62 c51c: 8d ed ldi r24, 0xDD ; 221 c51e: c8 2e mov r12, r24 c520: 82 e0 ldi r24, 0x02 ; 2 c522: d8 2e mov r13, r24 c524: 84 e5 ldi r24, 0x54 ; 84 c526: 95 e0 ldi r25, 0x05 ; 5 c528: 9b 83 std Y+3, r25 ; 0x03 c52a: 8a 83 std Y+2, r24 ; 0x02 c52c: 93 e4 ldi r25, 0x43 ; 67 c52e: e9 2e mov r14, r25 c530: 97 e0 ldi r25, 0x07 ; 7 c532: f9 2e mov r15, r25 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i < NUM_AXIS; i++, mask <<= 1) { c534: 33 24 eor r3, r3 c536: 33 94 inc r3 c538: 00 e0 ldi r16, 0x00 ; 0 if(code_seen(axis_codes[i])) c53a: f6 01 movw r30, r12 c53c: 81 91 ld r24, Z+ c53e: 6f 01 movw r12, r30 c540: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 c544: 28 2e mov r2, r24 c546: 88 23 and r24, r24 c548: 09 f4 brne .+2 ; 0xc54c c54a: a6 c0 rjmp .+332 ; 0xc698 { bool relative = axis_relative_modes & mask; c54c: 10 91 e1 03 lds r17, 0x03E1 ; 0x8003e1 c550: 13 21 and r17, r3 destination[i] = code_value(); c552: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 c556: 2b 01 movw r4, r22 c558: 3c 01 movw r6, r24 c55a: ea 81 ldd r30, Y+2 ; 0x02 c55c: fb 81 ldd r31, Y+3 ; 0x03 c55e: 40 82 st Z, r4 c560: 51 82 std Z+1, r5 ; 0x01 c562: 62 82 std Z+2, r6 ; 0x02 c564: 73 82 std Z+3, r7 ; 0x03 if (i == E_AXIS) { c566: 03 30 cpi r16, 0x03 ; 3 c568: 09 f0 breq .+2 ; 0xc56c c56a: 46 c0 rjmp .+140 ; 0xc5f8 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; c56c: f1 e0 ldi r31, 0x01 ; 1 c56e: f9 83 std Y+1, r31 ; 0x01 c570: 11 11 cpse r17, r1 c572: 01 c0 rjmp .+2 ; 0xc576 c574: 19 82 std Y+1, r1 ; 0x01 destination[i] = code_value(); if (i == E_AXIS) { float emult = extruder_multiplier[active_extruder]; c576: 80 90 bb 02 lds r8, 0x02BB ; 0x8002bb c57a: 90 90 bc 02 lds r9, 0x02BC ; 0x8002bc c57e: a0 90 bd 02 lds r10, 0x02BD ; 0x8002bd c582: b0 90 be 02 lds r11, 0x02BE ; 0x8002be if (emult != 1.) { c586: 20 e0 ldi r18, 0x00 ; 0 c588: 30 e0 ldi r19, 0x00 ; 0 c58a: 40 e8 ldi r20, 0x80 ; 128 c58c: 5f e3 ldi r21, 0x3F ; 63 c58e: c5 01 movw r24, r10 c590: b4 01 movw r22, r8 c592: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> c596: 88 23 and r24, r24 c598: 59 f1 breq .+86 ; 0xc5f0 if (! relative) { c59a: 11 11 cpse r17, r1 c59c: 15 c0 rjmp .+42 ; 0xc5c8 destination[i] -= current_position[i]; c59e: 20 91 4f 07 lds r18, 0x074F ; 0x80074f c5a2: 30 91 50 07 lds r19, 0x0750 ; 0x800750 c5a6: 40 91 51 07 lds r20, 0x0751 ; 0x800751 c5aa: 50 91 52 07 lds r21, 0x0752 ; 0x800752 c5ae: c3 01 movw r24, r6 c5b0: b2 01 movw r22, r4 c5b2: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> c5b6: 60 93 60 05 sts 0x0560, r22 ; 0x800560 c5ba: 70 93 61 05 sts 0x0561, r23 ; 0x800561 c5be: 80 93 62 05 sts 0x0562, r24 ; 0x800562 c5c2: 90 93 63 05 sts 0x0563, r25 ; 0x800563 relative = true; c5c6: 29 82 std Y+1, r2 ; 0x01 } destination[i] *= emult; c5c8: a5 01 movw r20, r10 c5ca: 94 01 movw r18, r8 c5cc: 60 91 60 05 lds r22, 0x0560 ; 0x800560 c5d0: 70 91 61 05 lds r23, 0x0561 ; 0x800561 c5d4: 80 91 62 05 lds r24, 0x0562 ; 0x800562 c5d8: 90 91 63 05 lds r25, 0x0563 ; 0x800563 c5dc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> c5e0: 60 93 60 05 sts 0x0560, r22 ; 0x800560 c5e4: 70 93 61 05 sts 0x0561, r23 ; 0x800561 c5e8: 80 93 62 05 sts 0x0562, r24 ; 0x800562 c5ec: 90 93 63 05 sts 0x0563, r25 ; 0x800563 } } if (relative) c5f0: e9 81 ldd r30, Y+1 ; 0x01 c5f2: e1 11 cpse r30, r1 c5f4: 03 c0 rjmp .+6 ; 0xc5fc c5f6: 22 c0 rjmp .+68 ; 0xc63c c5f8: 11 23 and r17, r17 c5fa: 99 f0 breq .+38 ; 0xc622 destination[i] += current_position[i]; c5fc: f7 01 movw r30, r14 c5fe: 20 81 ld r18, Z c600: 31 81 ldd r19, Z+1 ; 0x01 c602: 42 81 ldd r20, Z+2 ; 0x02 c604: 53 81 ldd r21, Z+3 ; 0x03 c606: ea 81 ldd r30, Y+2 ; 0x02 c608: fb 81 ldd r31, Y+3 ; 0x03 c60a: 60 81 ld r22, Z c60c: 71 81 ldd r23, Z+1 ; 0x01 c60e: 82 81 ldd r24, Z+2 ; 0x02 c610: 93 81 ldd r25, Z+3 ; 0x03 c612: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> c616: ea 81 ldd r30, Y+2 ; 0x02 c618: fb 81 ldd r31, Y+3 ; 0x03 c61a: 60 83 st Z, r22 c61c: 71 83 std Z+1, r23 ; 0x01 c61e: 82 83 std Z+2, r24 ; 0x02 c620: 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) { c622: 0f 5f subi r16, 0xFF ; 255 c624: 33 0c add r3, r3 c626: 8a 81 ldd r24, Y+2 ; 0x02 c628: 9b 81 ldd r25, Y+3 ; 0x03 c62a: 04 96 adiw r24, 0x04 ; 4 c62c: 9b 83 std Y+3, r25 ; 0x03 c62e: 8a 83 std Y+2, r24 ; 0x02 c630: 94 e0 ldi r25, 0x04 ; 4 c632: e9 0e add r14, r25 c634: f1 1c adc r15, r1 c636: 04 30 cpi r16, 0x04 ; 4 c638: 09 f0 breq .+2 ; 0xc63c c63a: 7f cf rjmp .-258 ; 0xc53a 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')) { c63c: 86 e4 ldi r24, 0x46 ; 70 c63e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 c642: 88 23 and r24, r24 c644: 99 f0 breq .+38 ; 0xc66c const float next_feedrate = code_value(); c646: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 c64a: 6b 01 movw r12, r22 c64c: 7c 01 movw r14, r24 if(next_feedrate > 0.f) feedrate = next_feedrate; c64e: 20 e0 ldi r18, 0x00 ; 0 c650: 30 e0 ldi r19, 0x00 ; 0 c652: a9 01 movw r20, r18 c654: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> c658: 18 16 cp r1, r24 c65a: 44 f4 brge .+16 ; 0xc66c c65c: c0 92 90 02 sts 0x0290, r12 ; 0x800290 c660: d0 92 91 02 sts 0x0291, r13 ; 0x800291 c664: e0 92 92 02 sts 0x0292, r14 ; 0x800292 c668: f0 92 93 02 sts 0x0293, r15 ; 0x800293 } } c66c: 0f 90 pop r0 c66e: 0f 90 pop r0 c670: 0f 90 pop r0 c672: df 91 pop r29 c674: cf 91 pop r28 c676: 1f 91 pop r17 c678: 0f 91 pop r16 c67a: ff 90 pop r15 c67c: ef 90 pop r14 c67e: df 90 pop r13 c680: cf 90 pop r12 c682: bf 90 pop r11 c684: af 90 pop r10 c686: 9f 90 pop r9 c688: 8f 90 pop r8 c68a: 7f 90 pop r7 c68c: 6f 90 pop r6 c68e: 5f 90 pop r5 c690: 4f 90 pop r4 c692: 3f 90 pop r3 c694: 2f 90 pop r2 c696: 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? c698: f7 01 movw r30, r14 c69a: 80 81 ld r24, Z c69c: 91 81 ldd r25, Z+1 ; 0x01 c69e: a2 81 ldd r26, Z+2 ; 0x02 c6a0: b3 81 ldd r27, Z+3 ; 0x03 c6a2: ea 81 ldd r30, Y+2 ; 0x02 c6a4: fb 81 ldd r31, Y+3 ; 0x03 c6a6: 80 83 st Z, r24 c6a8: 91 83 std Z+1, r25 ; 0x01 c6aa: a2 83 std Z+2, r26 ; 0x02 c6ac: b3 83 std Z+3, r27 ; 0x03 c6ae: b9 cf rjmp .-142 ; 0xc622 0000c6b0 : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { c6b0: 2f 92 push r2 c6b2: 3f 92 push r3 c6b4: 4f 92 push r4 c6b6: 5f 92 push r5 c6b8: 6f 92 push r6 c6ba: 7f 92 push r7 c6bc: 8f 92 push r8 c6be: 9f 92 push r9 c6c0: af 92 push r10 c6c2: bf 92 push r11 c6c4: cf 92 push r12 c6c6: df 92 push r13 c6c8: ef 92 push r14 c6ca: ff 92 push r15 c6cc: 0f 93 push r16 c6ce: 1f 93 push r17 c6d0: cf 93 push r28 c6d2: df 93 push r29 c6d4: cd b7 in r28, 0x3d ; 61 c6d6: de b7 in r29, 0x3e ; 62 c6d8: 65 97 sbiw r28, 0x15 ; 21 c6da: 0f b6 in r0, 0x3f ; 63 c6dc: f8 94 cli c6de: de bf out 0x3e, r29 ; 62 c6e0: 0f be out 0x3f, r0 ; 63 c6e2: cd bf out 0x3d, r28 ; 61 c6e4: 69 8b std Y+17, r22 ; 0x11 c6e6: 7a 8b std Y+18, r23 ; 0x12 c6e8: 8b 8b std Y+19, r24 ; 0x13 c6ea: 9c 8b std Y+20, r25 ; 0x14 c6ec: 49 01 movw r8, r18 c6ee: 5a 01 movw r10, r20 c6f0: 30 2e mov r3, r16 c6f2: cd 8a std Y+21, r12 ; 0x15 c6f4: 2d 2c mov r2, r13 KEEPALIVE_STATE(NOT_BUSY); c6f6: 81 e0 ldi r24, 0x01 ; 1 c6f8: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); c6fc: df 92 push r13 c6fe: 2d 89 ldd r18, Y+21 ; 0x15 c700: 2f 93 push r18 c702: 1f 92 push r1 c704: ef 92 push r14 c706: 8b e2 ldi r24, 0x2B ; 43 c708: 96 e6 ldi r25, 0x66 ; 102 c70a: 9f 93 push r25 c70c: 8f 93 push r24 c70e: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 daddr_t count = -1; // RW the entire space by default if (code_seen('A')) c712: 81 e4 ldi r24, 0x41 ; 65 c714: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 c718: 0f 90 pop r0 c71a: 0f 90 pop r0 c71c: 0f 90 pop r0 c71e: 0f 90 pop r0 c720: 0f 90 pop r0 c722: 0f 90 pop r0 c724: 88 23 and r24, r24 c726: a1 f0 breq .+40 ; 0xc750 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); c728: 80 91 97 03 lds r24, 0x0397 ; 0x800397 c72c: 90 91 98 03 lds r25, 0x0398 ; 0x800398 c730: fc 01 movw r30, r24 c732: 21 81 ldd r18, Z+1 ; 0x01 c734: 28 37 cpi r18, 0x78 ; 120 c736: 09 f0 breq .+2 ; 0xc73a c738: 69 c0 rjmp .+210 ; 0xc80c c73a: 40 e1 ldi r20, 0x10 ; 16 c73c: 50 e0 ldi r21, 0x00 ; 0 c73e: 70 e0 ldi r23, 0x00 ; 0 c740: 60 e0 ldi r22, 0x00 ; 0 c742: 02 96 adiw r24, 0x02 ; 2 c744: 0f 94 1c d9 call 0x3b238 ; 0x3b238 c748: 69 8b std Y+17, r22 ; 0x11 c74a: 7a 8b std Y+18, r23 ; 0x12 c74c: 8b 8b std Y+19, r24 ; 0x13 c74e: 9c 8b std Y+20, r25 ; 0x14 if (code_seen('C')) c750: 83 e4 ldi r24, 0x43 ; 67 c752: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 c756: 88 23 and r24, r24 c758: 09 f4 brne .+2 ; 0xc75c c75a: 65 c0 rjmp .+202 ; 0xc826 count = code_value_long(); c75c: 0e 94 28 5c call 0xb850 ; 0xb850 c760: 2b 01 movw r4, r22 c762: 3c 01 movw r6, r24 c764: c9 88 ldd r12, Y+17 ; 0x11 c766: da 88 ldd r13, Y+18 ; 0x12 c768: eb 88 ldd r14, Y+19 ; 0x13 c76a: fc 88 ldd r15, Y+20 ; 0x14 c76c: 8c 14 cp r8, r12 c76e: 9d 04 cpc r9, r13 c770: ae 04 cpc r10, r14 c772: bf 04 cpc r11, r15 c774: 10 f4 brcc .+4 ; 0xc77a c776: 75 01 movw r14, r10 c778: 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) c77a: d3 01 movw r26, r6 c77c: c2 01 movw r24, r4 c77e: 8c 0d add r24, r12 c780: 9d 1d adc r25, r13 c782: ae 1d adc r26, r14 c784: bf 1d adc r27, r15 c786: 88 16 cp r8, r24 c788: 99 06 cpc r9, r25 c78a: aa 06 cpc r10, r26 c78c: bb 06 cpc r11, r27 c78e: 28 f0 brcs .+10 ; 0xc79a c790: 8c 15 cp r24, r12 c792: 9d 05 cpc r25, r13 c794: ae 05 cpc r26, r14 c796: bf 05 cpc r27, r15 c798: 30 f4 brcc .+12 ; 0xc7a6 count = addr_end - addr_start; c79a: 24 01 movw r4, r8 c79c: 35 01 movw r6, r10 c79e: 4c 18 sub r4, r12 c7a0: 5d 08 sbc r5, r13 c7a2: 6e 08 sbc r6, r14 c7a4: 7f 08 sbc r7, r15 if (code_seen('X')) c7a6: 88 e5 ldi r24, 0x58 ; 88 c7a8: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 c7ac: 88 23 and r24, r24 c7ae: 09 f4 brne .+2 ; 0xc7b2 c7b0: 91 c0 rjmp .+290 ; 0xc8d4 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); c7b2: 20 91 97 03 lds r18, 0x0397 ; 0x800397 c7b6: 30 91 98 03 lds r19, 0x0398 ; 0x800398 c7ba: 2f 5f subi r18, 0xFF ; 255 c7bc: 3f 4f sbci r19, 0xFF ; 255 c7be: fe 01 movw r30, r28 c7c0: 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; c7c2: 10 e0 ldi r17, 0x00 ; 0 c7c4: 00 e0 ldi r16, 0x00 ; 0 c7c6: 4f 01 movw r8, r30 c7c8: d9 01 movw r26, r18 while (*hex) c7ca: 8c 91 ld r24, X c7cc: 2f 5f subi r18, 0xFF ; 255 c7ce: 3f 4f sbci r19, 0xFF ; 255 c7d0: 88 23 and r24, r24 c7d2: 09 f4 brne .+2 ; 0xc7d6 c7d4: 3f c0 rjmp .+126 ; 0xc854 { if (count && (parsed >= count)) break; c7d6: 00 31 cpi r16, 0x10 ; 16 c7d8: 11 05 cpc r17, r1 c7da: e1 f1 breq .+120 ; 0xc854 char c = *(hex++); if (c == ' ') continue; c7dc: 80 32 cpi r24, 0x20 ; 32 c7de: a1 f3 breq .-24 ; 0xc7c8 if (c == '\n') break; c7e0: 8a 30 cpi r24, 0x0A ; 10 c7e2: c1 f1 breq .+112 ; 0xc854 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); c7e4: 90 ed ldi r25, 0xD0 ; 208 c7e6: 98 0f add r25, r24 c7e8: 9a 30 cpi r25, 0x0A ; 10 c7ea: 10 f5 brcc .+68 ; 0xc830 c7ec: 82 95 swap r24 c7ee: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); c7f0: 9d 01 movw r18, r26 c7f2: 2e 5f subi r18, 0xFE ; 254 c7f4: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); c7f6: 11 96 adiw r26, 0x01 ; 1 c7f8: 9c 91 ld r25, X c7fa: 40 ed ldi r20, 0xD0 ; 208 c7fc: 49 0f add r20, r25 c7fe: 4a 30 cpi r20, 0x0A ; 10 c800: f8 f4 brcc .+62 ; 0xc840 c802: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; c804: 81 93 st Z+, r24 parsed++; c806: 0f 5f subi r16, 0xFF ; 255 c808: 1f 4f sbci r17, 0xFF ; 255 c80a: de cf rjmp .-68 ; 0xc7c8 { 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(); c80c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 c810: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> c814: 9b 01 movw r18, r22 c816: 77 0f add r23, r23 c818: 44 0b sbc r20, r20 c81a: 55 0b sbc r21, r21 c81c: 29 8b std Y+17, r18 ; 0x11 c81e: 3a 8b std Y+18, r19 ; 0x12 c820: 4b 8b std Y+19, r20 ; 0x13 c822: 5c 8b std Y+20, r21 ; 0x14 c824: 95 cf rjmp .-214 ; 0xc750 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 c826: 44 24 eor r4, r4 c828: 4a 94 dec r4 c82a: 54 2c mov r5, r4 c82c: 32 01 movw r6, r4 c82e: 9a cf rjmp .-204 ; 0xc764 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); c830: 9f e9 ldi r25, 0x9F ; 159 c832: 98 0f add r25, r24 c834: 96 30 cpi r25, 0x06 ; 6 c836: 58 f4 brcc .+22 ; 0xc84e c838: 82 95 swap r24 c83a: 80 7f andi r24, 0xF0 ; 240 c83c: 80 57 subi r24, 0x70 ; 112 c83e: d8 cf rjmp .-80 ; 0xc7f0 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); c840: 4f e9 ldi r20, 0x9F ; 159 c842: 49 0f add r20, r25 c844: 46 30 cpi r20, 0x06 ; 6 c846: 18 f4 brcc .+6 ; 0xc84e c848: 97 55 subi r25, 0x57 ; 87 c84a: 89 2b or r24, r25 c84c: db cf rjmp .-74 ; 0xc804 else return -parsed; c84e: 11 95 neg r17 c850: 01 95 neg r16 c852: 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); c854: 28 01 movw r4, r16 c856: 01 2e mov r0, r17 c858: 00 0c add r0, r0 c85a: 66 08 sbc r6, r6 c85c: 77 08 sbc r7, r7 write_mem(addr_start, count, data, type); c85e: da 8a std Y+18, r13 ; 0x12 c860: 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++) c862: b1 2c mov r11, r1 c864: a1 2c mov r10, r1 c866: 0a 15 cp r16, r10 c868: 1b 05 cpc r17, r11 c86a: f1 f0 breq .+60 ; 0xc8a8 { switch (type) c86c: 33 20 and r3, r3 c86e: 39 f0 breq .+14 ; 0xc87e c870: 31 e0 ldi r19, 0x01 ; 1 c872: 33 16 cp r3, r19 c874: 71 f0 breq .+28 ; 0xc892 } // 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++) c876: 4f ef ldi r20, 0xFF ; 255 c878: a4 1a sub r10, r20 c87a: b4 0a sbc r11, r20 c87c: f4 cf rjmp .-24 ; 0xc866 { switch (type) { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; c87e: f4 01 movw r30, r8 c880: ea 0d add r30, r10 c882: fb 1d adc r31, r11 c884: 80 81 ld r24, Z c886: e9 89 ldd r30, Y+17 ; 0x11 c888: fa 89 ldd r31, Y+18 ; 0x12 c88a: ea 0d add r30, r10 c88c: fb 1d adc r31, r11 c88e: 80 83 st Z, r24 c890: f2 cf rjmp .-28 ; 0xc876 case dcode_mem_t::eeprom: eeprom_write_byte_notify((uint8_t*)address, data[i]); break; c892: f4 01 movw r30, r8 c894: ea 0d add r30, r10 c896: 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); c898: 60 81 ld r22, Z c89a: 89 89 ldd r24, Y+17 ; 0x11 c89c: 9a 89 ldd r25, Y+18 ; 0x12 c89e: 8a 0d add r24, r10 c8a0: 9b 1d adc r25, r11 c8a2: 0f 94 d9 dd call 0x3bbb2 ; 0x3bbb2 c8a6: e7 cf rjmp .-50 ; 0xc876 { 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); c8a8: ff 92 push r15 c8aa: ef 92 push r14 c8ac: df 92 push r13 c8ae: cf 92 push r12 c8b0: 2f 92 push r2 c8b2: 5d 89 ldd r21, Y+21 ; 0x15 c8b4: 5f 93 push r21 c8b6: 7f 92 push r7 c8b8: 6f 92 push r6 c8ba: 5f 92 push r5 c8bc: 4f 92 push r4 c8be: 8f ef ldi r24, 0xFF ; 255 c8c0: 95 e6 ldi r25, 0x65 ; 101 c8c2: 9f 93 push r25 c8c4: 8f 93 push r24 c8c6: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 c8ca: 0f b6 in r0, 0x3f ; 63 c8cc: f8 94 cli c8ce: de bf out 0x3e, r29 ; 62 c8d0: 0f be out 0x3f, r0 ; 63 c8d2: 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); c8d4: 03 2d mov r16, r3 c8d6: a3 01 movw r20, r6 c8d8: 92 01 movw r18, r4 c8da: c7 01 movw r24, r14 c8dc: b6 01 movw r22, r12 c8de: 0f 94 df 86 call 0x30dbe ; 0x30dbe } c8e2: 65 96 adiw r28, 0x15 ; 21 c8e4: 0f b6 in r0, 0x3f ; 63 c8e6: f8 94 cli c8e8: de bf out 0x3e, r29 ; 62 c8ea: 0f be out 0x3f, r0 ; 63 c8ec: cd bf out 0x3d, r28 ; 61 c8ee: df 91 pop r29 c8f0: cf 91 pop r28 c8f2: 1f 91 pop r17 c8f4: 0f 91 pop r16 c8f6: ff 90 pop r15 c8f8: ef 90 pop r14 c8fa: df 90 pop r13 c8fc: cf 90 pop r12 c8fe: bf 90 pop r11 c900: af 90 pop r10 c902: 9f 90 pop r9 c904: 8f 90 pop r8 c906: 7f 90 pop r7 c908: 6f 90 pop r6 c90a: 5f 90 pop r5 c90c: 4f 90 pop r4 c90e: 3f 90 pop r3 c910: 2f 90 pop r2 c912: 08 95 ret 0000c914 : #define DBG(args...) printf_P(args) inline void print_hex_nibble(uint8_t val) { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); c914: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> c918: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> c91c: 90 e0 ldi r25, 0x00 ; 0 c91e: 8a 30 cpi r24, 0x0A ; 10 c920: 20 f0 brcs .+8 ; 0xc92a c922: 89 5a subi r24, 0xA9 ; 169 c924: 9f 4f sbci r25, 0xFF ; 255 c926: 0d 94 f9 db jmp 0x3b7f2 ; 0x3b7f2 c92a: c0 96 adiw r24, 0x30 ; 48 c92c: fc cf rjmp .-8 ; 0xc926 0000c92e : 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); c92e: 84 ff sbrs r24, 4 c930: 18 c0 rjmp .+48 ; 0xc962 c932: 8d 9a sbi 0x11, 5 ; 17 WRITE(LCD_PINS_D5, value & 0x20); c934: 85 ff sbrs r24, 5 c936: 17 c0 rjmp .+46 ; 0xc966 c938: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); c93a: 2f b7 in r18, 0x3f ; 63 c93c: 86 ff sbrs r24, 6 c93e: 15 c0 rjmp .+42 ; 0xc96a c940: f8 94 cli c942: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c946: 90 68 ori r25, 0x80 ; 128 c948: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c94c: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); c94e: 87 ff sbrs r24, 7 c950: 11 c0 rjmp .+34 ; 0xc974 c952: 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); c954: 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); c956: 85 e0 ldi r24, 0x05 ; 5 c958: 8a 95 dec r24 c95a: f1 f7 brne .-4 ; 0xc958 c95c: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); c95e: 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(); } c960: 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); c962: 8d 98 cbi 0x11, 5 ; 17 c964: e7 cf rjmp .-50 ; 0xc934 WRITE(LCD_PINS_D5, value & 0x20); c966: a4 98 cbi 0x14, 4 ; 20 c968: e8 cf rjmp .-48 ; 0xc93a WRITE(LCD_PINS_D6, value & 0x40); c96a: f8 94 cli c96c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> c970: 9f 77 andi r25, 0x7F ; 127 c972: ea cf rjmp .-44 ; 0xc948 WRITE(LCD_PINS_D7, value & 0x80); c974: a3 98 cbi 0x14, 3 ; 20 c976: ee cf rjmp .-36 ; 0xc954 0000c978 : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { c978: 0f 93 push r16 c97a: 1f 93 push r17 c97c: cf 93 push r28 c97e: df 93 push r29 c980: c8 2f mov r28, r24 c982: d6 2f mov r29, r22 c984: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); c986: 60 ff sbrs r22, 0 c988: 15 c0 rjmp .+42 ; 0xc9b4 c98a: 5d 9a sbi 0x0b, 5 ; 11 c98c: 8a e1 ldi r24, 0x1A ; 26 c98e: 8a 95 dec r24 c990: f1 f7 brne .-4 ; 0xc98e c992: 00 c0 rjmp .+0 ; 0xc994 _delay_us(5); lcd_writebits(data); c994: 8c 2f mov r24, r28 c996: 0e 94 97 64 call 0xc92e ; 0xc92e #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { c99a: d1 fd sbrc r29, 1 c99c: 04 c0 rjmp .+8 ; 0xc9a6 // _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 c99e: 8c 2f mov r24, r28 c9a0: 82 95 swap r24 c9a2: 0e 94 97 64 call 0xc92e ; 0xc92e } #endif delayMicroseconds(duration); c9a6: c8 01 movw r24, r16 } c9a8: df 91 pop r29 c9aa: cf 91 pop r28 c9ac: 1f 91 pop r17 c9ae: 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); c9b0: 0c 94 02 df jmp 0x1be04 ; 0x1be04 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); c9b4: 5d 98 cbi 0x0b, 5 ; 11 c9b6: ea cf rjmp .-44 ; 0xc98c 0000c9b8 : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { c9b8: cf 92 push r12 c9ba: df 92 push r13 c9bc: ef 92 push r14 c9be: ff 92 push r15 c9c0: cf 93 push r28 c9c2: df 93 push r29 c9c4: ec 01 movw r28, r24 c9c6: 6a 01 movw r12, r20 c9c8: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) c9ca: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 c9ce: 6f 3f cpi r22, 0xFF ; 255 c9d0: 7f 4f sbci r23, 0xFF ; 255 c9d2: 8f 4f sbci r24, 0xFF ; 255 c9d4: 9f 4f sbci r25, 0xFF ; 255 c9d6: 59 f4 brne .+22 ; 0xc9ee 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); c9d8: b7 01 movw r22, r14 c9da: a6 01 movw r20, r12 c9dc: 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); } c9de: df 91 pop r29 c9e0: cf 91 pop r28 c9e2: ff 90 pop r15 c9e4: ef 90 pop r14 c9e6: df 90 pop r13 c9e8: cf 90 pop r12 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); c9ea: 0d 94 e7 dd jmp 0x3bbce ; 0x3bbce } 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); } c9ee: df 91 pop r29 c9f0: cf 91 pop r28 c9f2: ff 90 pop r15 c9f4: ef 90 pop r14 c9f6: df 90 pop r13 c9f8: cf 90 pop r12 c9fa: 08 95 ret 0000c9fc : /// 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)); c9fc: 80 e1 ldi r24, 0x10 ; 16 c9fe: e3 e4 ldi r30, 0x43 ; 67 ca00: f7 e0 ldi r31, 0x07 ; 7 ca02: ab e9 ldi r26, 0x9B ; 155 ca04: b2 e0 ldi r27, 0x02 ; 2 ca06: 01 90 ld r0, Z+ ca08: 0d 92 st X+, r0 ca0a: 8a 95 dec r24 ca0c: e1 f7 brne .-8 ; 0xca06 saved_feedmultiply2 = feedmultiply; //save feedmultiply ca0e: 80 91 39 02 lds r24, 0x0239 ; 0x800239 ca12: 90 91 3a 02 lds r25, 0x023A ; 0x80023a ca16: 90 93 74 03 sts 0x0374, r25 ; 0x800374 ca1a: 80 93 73 03 sts 0x0373, r24 ; 0x800373 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); ca1e: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d ca22: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e ca26: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae ca2a: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_bed_temperature = (uint8_t)degTargetBed(); ca2e: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b ca32: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; ca36: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 ca3a: 83 fb bst r24, 3 ca3c: 88 27 eor r24, r24 ca3e: 80 f9 bld r24, 0 ca40: 80 93 06 18 sts 0x1806, r24 ; 0x801806 saved_fan_speed = fanSpeed; ca44: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 ca48: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac isPartialBackupAvailable = true; ca4c: 81 e0 ldi r24, 0x01 ; 1 ca4e: 80 93 53 07 sts 0x0753, r24 ; 0x800753 } ca52: 08 95 ret 0000ca54 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } ca54: cf 93 push r28 ca56: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { ca58: 8e ef ldi r24, 0xFE ; 254 ca5a: 96 e1 ldi r25, 0x16 ; 22 ca5c: 0e 94 bc 78 call 0xf178 ; 0xf178 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader ca60: 8c e3 ldi r24, 0x3C ; 60 ca62: 95 e1 ldi r25, 0x15 ; 21 ca64: 89 2b or r24, r25 ca66: 51 f0 breq .+20 ; 0xca7c <_GLOBAL__sub_D_card+0x28> ca68: ce e0 ldi r28, 0x0E ; 14 ca6a: d6 e1 ldi r29, 0x16 ; 22 ca6c: a3 97 sbiw r28, 0x23 ; 35 ca6e: ce 01 movw r24, r28 ca70: 0e 94 bc 78 call 0xf178 ; 0xf178 ca74: 85 e1 ldi r24, 0x15 ; 21 ca76: cc 33 cpi r28, 0x3C ; 60 ca78: d8 07 cpc r29, r24 ca7a: c1 f7 brne .-16 ; 0xca6c <_GLOBAL__sub_D_card+0x18> ca7c: 89 e1 ldi r24, 0x19 ; 25 ca7e: 95 e1 ldi r25, 0x15 ; 21 ca80: 0e 94 bc 78 call 0xf178 ; 0xf178 ca84: 84 ef ldi r24, 0xF4 ; 244 ca86: 94 e1 ldi r25, 0x14 ; 20 ca88: df 91 pop r29 ca8a: cf 91 pop r28 ca8c: 0c 94 bc 78 jmp 0xf178 ; 0xf178 0000ca90 : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { ca90: cf 93 push r28 ca92: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; ca94: c3 e4 ldi r28, 0x43 ; 67 ca96: d7 e0 ldi r29, 0x07 ; 7 ca98: 20 e0 ldi r18, 0x00 ; 0 ca9a: 30 e0 ldi r19, 0x00 ; 0 ca9c: 48 ec ldi r20, 0xC8 ; 200 ca9e: 51 e4 ldi r21, 0x41 ; 65 caa0: 6c 85 ldd r22, Y+12 ; 0x0c caa2: 7d 85 ldd r23, Y+13 ; 0x0d caa4: 8e 85 ldd r24, Y+14 ; 0x0e caa6: 9f 85 ldd r25, Y+15 ; 0x0f caa8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> caac: 6c 87 std Y+12, r22 ; 0x0c caae: 7d 87 std Y+13, r23 ; 0x0d cab0: 8e 87 std Y+14, r24 ; 0x0e cab2: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cab4: 63 e3 ldi r22, 0x33 ; 51 cab6: 73 e3 ldi r23, 0x33 ; 51 cab8: 83 e5 ldi r24, 0x53 ; 83 caba: 90 e4 ldi r25, 0x40 ; 64 } cabc: df 91 pop r29 cabe: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); cac0: 0d 94 93 ba jmp 0x37526 ; 0x37526 0000cac4 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); cac4: 60 e0 ldi r22, 0x00 ; 0 cac6: 85 ea ldi r24, 0xA5 ; 165 cac8: 9f e0 ldi r25, 0x0F ; 15 caca: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a cace: 60 e0 ldi r22, 0x00 ; 0 cad0: 8f e7 ldi r24, 0x7F ; 127 cad2: 9c e0 ldi r25, 0x0C ; 12 cad4: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a // 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; cad8: 80 e0 ldi r24, 0x00 ; 0 cada: 90 e0 ldi r25, 0x00 ; 0 cadc: a0 e8 ldi r26, 0x80 ; 128 cade: bf eb ldi r27, 0xBF ; 191 cae0: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cae4: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cae8: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad caec: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_printing_type = PowerPanic::PRINT_TYPE_NONE; caf0: 82 e0 ldi r24, 0x02 ; 2 caf2: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; caf6: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a } cafa: 08 95 ret 0000cafc : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) cafc: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad cb00: 90 91 ae 05 lds r25, 0x05AE ; 0x8005ae cb04: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d cb08: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e cb0c: 28 17 cp r18, r24 cb0e: 39 07 cpc r19, r25 cb10: 71 f0 breq .+28 ; 0xcb2e return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; cb12: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e cb16: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; cb1a: 81 e0 ldi r24, 0x01 ; 1 cb1c: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df wait_for_heater(_millis(), active_extruder); cb20: 0f 94 8b 3f call 0x27f16 ; 0x27f16 cb24: 0f 94 97 82 call 0x3052e ; 0x3052e heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; cb28: 82 e0 ldi r24, 0x02 ; 2 cb2a: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df } } cb2e: 08 95 ret 0000cb30 : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { cb30: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a cb34: 88 23 and r24, r24 cb36: 41 f0 breq .+16 ; 0xcb48 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; cb38: 80 91 39 02 lds r24, 0x0239 ; 0x800239 cb3c: 90 91 3a 02 lds r25, 0x023A ; 0x80023a cb40: 90 93 74 03 sts 0x0374, r25 ; 0x800374 cb44: 80 93 73 03 sts 0x0373, r24 ; 0x800373 } cb48: 08 95 ret 0000cb4a : //not sd printing nor usb printing } } void save_planner_global_state() { if (current_block && !(mesh_bed_leveling_flag || homing_flag)) cb4a: 80 91 a2 05 lds r24, 0x05A2 ; 0x8005a2 cb4e: 90 91 a3 05 lds r25, 0x05A3 ; 0x8005a3 cb52: 00 97 sbiw r24, 0x00 ; 0 cb54: 29 f1 breq .+74 ; 0xcba0 cb56: 20 91 59 0e lds r18, 0x0E59 ; 0x800e59 cb5a: 21 11 cpse r18, r1 cb5c: 21 c0 rjmp .+66 ; 0xcba0 cb5e: 20 91 58 0e lds r18, 0x0E58 ; 0x800e58 cb62: 21 11 cpse r18, r1 cb64: 1d c0 rjmp .+58 ; 0xcba0 { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); cb66: fc 01 movw r30, r24 cb68: e8 5a subi r30, 0xA8 ; 168 cb6a: ff 4f sbci r31, 0xFF ; 255 cb6c: 20 e1 ldi r18, 0x10 ; 16 cb6e: ab ea ldi r26, 0xAB ; 171 cb70: b2 e0 ldi r27, 0x02 ; 2 cb72: 01 90 ld r0, Z+ cb74: 0d 92 st X+, r0 cb76: 2a 95 dec r18 cb78: e1 f7 brne .-8 ; 0xcb72 saved_feedrate2 = current_block->gcode_feedrate; cb7a: fc 01 movw r30, r24 cb7c: e6 59 subi r30, 0x96 ; 150 cb7e: ff 4f sbci r31, 0xFF ; 255 cb80: 20 81 ld r18, Z cb82: 31 81 ldd r19, Z+1 ; 0x01 cb84: 30 93 01 18 sts 0x1801, r19 ; 0x801801 cb88: 20 93 00 18 sts 0x1800, r18 ; 0x801800 saved_segment_idx = current_block->segment_idx; cb8c: 88 59 subi r24, 0x98 ; 152 cb8e: 9f 4f sbci r25, 0xFF ; 255 cb90: fc 01 movw r30, r24 cb92: 80 81 ld r24, Z cb94: 91 81 ldd r25, Z+1 ; 0x01 cb96: 90 93 0c 18 sts 0x180C, r25 ; 0x80180c cb9a: 80 93 0b 18 sts 0x180B, r24 ; 0x80180b cb9e: 08 95 ret } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; cba0: 80 e0 ldi r24, 0x00 ; 0 cba2: 90 e0 ldi r25, 0x00 ; 0 cba4: a0 e8 ldi r26, 0x80 ; 128 cba6: bf eb ldi r27, 0xBF ; 191 cba8: 80 93 ab 02 sts 0x02AB, r24 ; 0x8002ab cbac: 90 93 ac 02 sts 0x02AC, r25 ; 0x8002ac cbb0: a0 93 ad 02 sts 0x02AD, r26 ; 0x8002ad cbb4: b0 93 ae 02 sts 0x02AE, r27 ; 0x8002ae saved_feedrate2 = feedrate; cbb8: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cbbc: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cbc0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cbc4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cbc8: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> cbcc: 70 93 01 18 sts 0x1801, r23 ; 0x801801 cbd0: 60 93 00 18 sts 0x1800, r22 ; 0x801800 saved_segment_idx = 0; cbd4: 10 92 0c 18 sts 0x180C, r1 ; 0x80180c cbd8: 10 92 0b 18 sts 0x180B, r1 ; 0x80180b } } cbdc: 08 95 ret 0000cbde : SERIAL_PROTOCOLPGM(" E:0 B:"); SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } void save_print_file_state() { cbde: cf 92 push r12 cbe0: df 92 push r13 cbe2: ef 92 push r14 cbe4: ff 92 push r15 uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { cbe6: 80 91 6e 14 lds r24, 0x146E ; 0x80146e cbea: 88 23 and r24, r24 cbec: d9 f1 breq .+118 ; 0xcc64 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue cbee: 80 91 84 03 lds r24, 0x0384 ; 0x800384 cbf2: 90 91 85 03 lds r25, 0x0385 ; 0x800385 cbf6: a0 91 86 03 lds r26, 0x0386 ; 0x800386 cbfa: b0 91 87 03 lds r27, 0x0387 ; 0x800387 cbfe: 80 93 02 18 sts 0x1802, r24 ; 0x801802 cc02: 90 93 03 18 sts 0x1803, r25 ; 0x801803 cc06: a0 93 04 18 sts 0x1804, r26 ; 0x801804 cc0a: b0 93 05 18 sts 0x1805, r27 ; 0x801805 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner cc0e: 0f 94 55 aa call 0x354aa ; 0x354aa saved_sdpos -= sdlen_planner; cc12: c0 90 02 18 lds r12, 0x1802 ; 0x801802 cc16: d0 90 03 18 lds r13, 0x1803 ; 0x801803 cc1a: e0 90 04 18 lds r14, 0x1804 ; 0x801804 cc1e: f0 90 05 18 lds r15, 0x1805 ; 0x801805 cc22: c8 1a sub r12, r24 cc24: d9 0a sbc r13, r25 cc26: e1 08 sbc r14, r1 cc28: f1 08 sbc r15, r1 cc2a: c0 92 02 18 sts 0x1802, r12 ; 0x801802 cc2e: d0 92 03 18 sts 0x1803, r13 ; 0x801803 cc32: e0 92 04 18 sts 0x1804, r14 ; 0x801804 cc36: f0 92 05 18 sts 0x1805, r15 ; 0x801805 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue cc3a: 0e 94 b9 5b call 0xb772 ; 0xb772 saved_sdpos -= sdlen_cmdqueue; cc3e: c8 1a sub r12, r24 cc40: d9 0a sbc r13, r25 cc42: e1 08 sbc r14, r1 cc44: f1 08 sbc r15, r1 cc46: c0 92 02 18 sts 0x1802, r12 ; 0x801802 cc4a: d0 92 03 18 sts 0x1803, r13 ; 0x801803 cc4e: e0 92 04 18 sts 0x1804, r14 ; 0x801804 cc52: f0 92 05 18 sts 0x1805, r15 ; 0x801805 saved_printing_type = PowerPanic::PRINT_TYPE_SD; cc56: 10 92 6a 02 sts 0x026A, r1 ; 0x80026a } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; //not sd printing nor usb printing } } cc5a: ff 90 pop r15 cc5c: ef 90 pop r14 cc5e: df 90 pop r13 cc60: cf 90 pop r12 cc62: 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 cc64: 80 91 11 05 lds r24, 0x0511 ; 0x800511 cc68: 88 23 and r24, r24 cc6a: b1 f1 breq .+108 ; 0xccd8 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue cc6c: 80 91 7c 03 lds r24, 0x037C ; 0x80037c cc70: 90 91 7d 03 lds r25, 0x037D ; 0x80037d cc74: a0 91 7e 03 lds r26, 0x037E ; 0x80037e cc78: b0 91 7f 03 lds r27, 0x037F ; 0x80037f cc7c: 80 93 02 18 sts 0x1802, r24 ; 0x801802 cc80: 90 93 03 18 sts 0x1803, r25 ; 0x801803 cc84: a0 93 04 18 sts 0x1804, r26 ; 0x801804 cc88: b0 93 05 18 sts 0x1805, r27 ; 0x801805 //reuse planner_calc_sd_length function for getting number of lines of commands in planner: nlines = planner_calc_sd_length(); //number of lines of commands in planner cc8c: 0f 94 55 aa call 0x354aa ; 0x354aa saved_sdpos -= nlines; cc90: 40 91 02 18 lds r20, 0x1802 ; 0x801802 cc94: 50 91 03 18 lds r21, 0x1803 ; 0x801803 cc98: 60 91 04 18 lds r22, 0x1804 ; 0x801804 cc9c: 70 91 05 18 lds r23, 0x1805 ; 0x801805 cca0: 48 1b sub r20, r24 cca2: 51 09 sbc r21, r1 cca4: 61 09 sbc r22, r1 cca6: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer cca8: 80 91 81 10 lds r24, 0x1081 ; 0x801081 ccac: 90 91 82 10 lds r25, 0x1082 ; 0x801082 ccb0: 09 2e mov r0, r25 ccb2: 00 0c add r0, r0 ccb4: aa 0b sbc r26, r26 ccb6: bb 0b sbc r27, r27 ccb8: 48 1b sub r20, r24 ccba: 59 0b sbc r21, r25 ccbc: 6a 0b sbc r22, r26 ccbe: 7b 0b sbc r23, r27 ccc0: 40 93 02 18 sts 0x1802, r20 ; 0x801802 ccc4: 50 93 03 18 sts 0x1803, r21 ; 0x801803 ccc8: 60 93 04 18 sts 0x1804, r22 ; 0x801804 cccc: 70 93 05 18 sts 0x1805, r23 ; 0x801805 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; ccd0: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; ccd2: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a ccd6: c1 cf rjmp .-126 ; 0xcc5a ccd8: 82 e0 ldi r24, 0x02 ; 2 ccda: fb cf rjmp .-10 ; 0xccd2 0000ccdc : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { ccdc: cf 92 push r12 ccde: df 92 push r13 cce0: ef 92 push r14 cce2: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cce4: c0 90 06 07 lds r12, 0x0706 ; 0x800706 cce8: d0 90 07 07 lds r13, 0x0707 ; 0x800707 ccec: e0 90 08 07 lds r14, 0x0708 ; 0x800708 ccf0: f0 90 09 07 lds r15, 0x0709 ; 0x800709 } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; if (cs.volumetric_enabled && diameter > 0.f) { ccf4: 80 91 05 07 lds r24, 0x0705 ; 0x800705 ccf8: 88 23 and r24, r24 ccfa: 09 f4 brne .+2 ; 0xccfe ccfc: 4e c0 rjmp .+156 ; 0xcd9a ccfe: 20 e0 ldi r18, 0x00 ; 0 cd00: 30 e0 ldi r19, 0x00 ; 0 cd02: a9 01 movw r20, r18 cd04: c7 01 movw r24, r14 cd06: b6 01 movw r22, r12 cd08: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> cd0c: 18 16 cp r1, r24 cd0e: 0c f0 brlt .+2 ; 0xcd12 cd10: 44 c0 rjmp .+136 ; 0xcd9a float area = M_PI * diameter * diameter * 0.25; cd12: 2b ed ldi r18, 0xDB ; 219 cd14: 3f e0 ldi r19, 0x0F ; 15 cd16: 49 e4 ldi r20, 0x49 ; 73 cd18: 50 e4 ldi r21, 0x40 ; 64 cd1a: c7 01 movw r24, r14 cd1c: b6 01 movw r22, r12 cd1e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> cd22: a7 01 movw r20, r14 cd24: 96 01 movw r18, r12 cd26: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> cd2a: 20 e0 ldi r18, 0x00 ; 0 cd2c: 30 e0 ldi r19, 0x00 ; 0 cd2e: 40 e8 ldi r20, 0x80 ; 128 cd30: 5e e3 ldi r21, 0x3E ; 62 cd32: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> cd36: 9b 01 movw r18, r22 cd38: ac 01 movw r20, r24 out = 1.f / area; cd3a: 60 e0 ldi r22, 0x00 ; 0 cd3c: 70 e0 ldi r23, 0x00 ; 0 cd3e: 80 e8 ldi r24, 0x80 ; 128 cd40: 9f e3 ldi r25, 0x3F ; 63 cd42: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> cd46: 6b 01 movw r12, r22 cd48: 7c 01 movw r14, r24 } if (extrudemultiply != 100) cd4a: 60 91 94 02 lds r22, 0x0294 ; 0x800294 cd4e: 70 91 95 02 lds r23, 0x0295 ; 0x800295 cd52: 64 36 cpi r22, 0x64 ; 100 cd54: 71 05 cpc r23, r1 cd56: a1 f0 breq .+40 ; 0xcd80 out *= float(extrudemultiply) * 0.01f; cd58: 07 2e mov r0, r23 cd5a: 00 0c add r0, r0 cd5c: 88 0b sbc r24, r24 cd5e: 99 0b sbc r25, r25 cd60: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> cd64: 2a e0 ldi r18, 0x0A ; 10 cd66: 37 ed ldi r19, 0xD7 ; 215 cd68: 43 e2 ldi r20, 0x23 ; 35 cd6a: 5c e3 ldi r21, 0x3C ; 60 cd6c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> cd70: 9b 01 movw r18, r22 cd72: ac 01 movw r20, r24 cd74: c7 01 movw r24, r14 cd76: b6 01 movw r22, r12 cd78: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> cd7c: 6b 01 movw r12, r22 cd7e: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); cd80: c0 92 bb 02 sts 0x02BB, r12 ; 0x8002bb cd84: d0 92 bc 02 sts 0x02BC, r13 ; 0x8002bc cd88: e0 92 bd 02 sts 0x02BD, r14 ; 0x8002bd cd8c: 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 } cd90: ff 90 pop r15 cd92: ef 90 pop r14 cd94: df 90 pop r13 cd96: cf 90 pop r12 cd98: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; cd9a: c1 2c mov r12, r1 cd9c: d1 2c mov r13, r1 cd9e: 80 e8 ldi r24, 0x80 ; 128 cda0: e8 2e mov r14, r24 cda2: 8f e3 ldi r24, 0x3F ; 63 cda4: f8 2e mov r15, r24 cda6: d1 cf rjmp .-94 ; 0xcd4a 0000cda8 : } } #endif //FAST_PWM_FAN void save_statistics() { cda8: 8f 92 push r8 cdaa: 9f 92 push r9 cdac: af 92 push r10 cdae: bf 92 push r11 cdb0: cf 92 push r12 cdb2: df 92 push r13 cdb4: ef 92 push r14 cdb6: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: centimeter cdb8: 81 ef ldi r24, 0xF1 ; 241 cdba: 9f e0 ldi r25, 0x0F ; 15 cdbc: 0f 94 81 7c call 0x2f902 ; 0x2f902 cdc0: 6b 01 movw r12, r22 cdc2: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min cdc4: 8d ee ldi r24, 0xED ; 237 cdc6: 9f e0 ldi r25, 0x0F ; 15 cdc8: 0f 94 81 7c call 0x2f902 ; 0x2f902 cdcc: 4b 01 movw r8, r22 cdce: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; cdd0: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce cdd4: 2c e3 ldi r18, 0x3C ; 60 cdd6: 30 e0 ldi r19, 0x00 ; 0 cdd8: 40 e0 ldi r20, 0x00 ; 0 cdda: 50 e0 ldi r21, 0x00 ; 0 cddc: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min cde0: ba 01 movw r22, r20 cde2: a9 01 movw r20, r18 cde4: 48 0d add r20, r8 cde6: 59 1d adc r21, r9 cde8: 6a 1d adc r22, r10 cdea: 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); cdec: 8d ee ldi r24, 0xED ; 237 cdee: 9f e0 ldi r25, 0x0F ; 15 cdf0: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); cdf4: 60 91 62 06 lds r22, 0x0662 ; 0x800662 cdf8: 70 91 63 06 lds r23, 0x0663 ; 0x800663 cdfc: 80 91 64 06 lds r24, 0x0664 ; 0x800664 ce00: 90 91 65 06 lds r25, 0x0665 ; 0x800665 ce04: 28 ee ldi r18, 0xE8 ; 232 ce06: 33 e0 ldi r19, 0x03 ; 3 ce08: 40 e0 ldi r20, 0x00 ; 0 ce0a: 50 e0 ldi r21, 0x00 ; 0 ce0c: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> ce10: ba 01 movw r22, r20 ce12: a9 01 movw r20, r18 ce14: 4c 0d add r20, r12 ce16: 5d 1d adc r21, r13 ce18: 6e 1d adc r22, r14 ce1a: 7f 1d adc r23, r15 ce1c: 81 ef ldi r24, 0xF1 ; 241 ce1e: 9f e0 ldi r25, 0x0F ; 15 ce20: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e print_job_timer.reset(); ce24: 0f 94 b6 58 call 0x2b16c ; 0x2b16c total_filament_used = 0; ce28: 10 92 62 06 sts 0x0662, r1 ; 0x800662 ce2c: 10 92 63 06 sts 0x0663, r1 ; 0x800663 ce30: 10 92 64 06 sts 0x0664, r1 ; 0x800664 ce34: 10 92 65 06 sts 0x0665, r1 ; 0x800665 if (MMU2::mmu2.Enabled()) { ce38: 80 91 98 13 lds r24, 0x1398 ; 0x801398 ce3c: 81 30 cpi r24, 0x01 ; 1 ce3e: 81 f4 brne .+32 ; 0xce60 eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); ce40: 60 91 9c 13 lds r22, 0x139C ; 0x80139c ce44: 70 91 9d 13 lds r23, 0x139D ; 0x80139d ce48: 90 e0 ldi r25, 0x00 ; 0 ce4a: 80 e0 ldi r24, 0x00 ; 0 ce4c: 0f 94 69 7c call 0x2f8d2 ; 0x2f8d2 /// @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; }; ce50: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d ce54: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } ce58: 10 92 9f 13 sts 0x139F, r1 ; 0x80139f ce5c: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e // @@TODO why were EEPROM_MMU_FAIL_TOT and EEPROM_MMU_LOAD_FAIL_TOT behaving differently - i.e. updated with every change? MMU2::mmu2.ClearToolChangeCounter(); MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } ce60: ff 90 pop r15 ce62: ef 90 pop r14 ce64: df 90 pop r13 ce66: cf 90 pop r12 ce68: bf 90 pop r11 ce6a: af 90 pop r10 ce6c: 9f 90 pop r9 ce6e: 8f 90 pop r8 ce70: 08 95 ret 0000ce72 : } #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); ce72: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 ce76: 1f 92 push r1 ce78: 8f 93 push r24 ce7a: 80 91 6d 03 lds r24, 0x036D ; 0x80036d ce7e: 1f 92 push r1 ce80: 8f 93 push r24 ce82: e1 eb ldi r30, 0xB1 ; 177 ce84: f4 e0 ldi r31, 0x04 ; 4 ce86: 42 81 ldd r20, Z+2 ; 0x02 ce88: 53 81 ldd r21, Z+3 ; 0x03 ce8a: 2c e3 ldi r18, 0x3C ; 60 ce8c: 24 9f mul r18, r20 ce8e: c0 01 movw r24, r0 ce90: 25 9f mul r18, r21 ce92: 90 0d add r25, r0 ce94: 11 24 eor r1, r1 ce96: 9f 93 push r25 ce98: 8f 93 push r24 ce9a: 40 81 ld r20, Z ce9c: 51 81 ldd r21, Z+1 ; 0x01 ce9e: 24 9f mul r18, r20 cea0: c0 01 movw r24, r0 cea2: 25 9f mul r18, r21 cea4: 90 0d add r25, r0 cea6: 11 24 eor r1, r1 cea8: 9f 93 push r25 ceaa: 8f 93 push r24 ceac: 82 ec ldi r24, 0xC2 ; 194 ceae: 96 e6 ldi r25, 0x66 ; 102 ceb0: 9f 93 push r25 ceb2: 8f 93 push r24 ceb4: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 ceb8: 8d b7 in r24, 0x3d ; 61 ceba: 9e b7 in r25, 0x3e ; 62 cebc: 0a 96 adiw r24, 0x0a ; 10 cebe: 0f b6 in r0, 0x3f ; 63 cec0: f8 94 cli cec2: 9e bf out 0x3e, r25 ; 62 cec4: 0f be out 0x3f, r0 ; 63 cec6: 8d bf out 0x3d, r24 ; 61 } cec8: 08 95 ret 0000ceca : // 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) { ceca: cf 93 push r28 cecc: 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); cece: 8f ef ldi r24, 0xFF ; 255 ced0: 9f e0 ldi r25, 0x0F ; 15 ced2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (silent == 1 || tmc2130_mode == TMC2130_MODE_SILENT) { ced6: 81 30 cpi r24, 0x01 ; 1 ced8: 21 f0 breq .+8 ; 0xcee2 ceda: 80 91 6c 06 lds r24, 0x066C ; 0x80066c cede: 81 30 cpi r24, 0x01 ; 1 cee0: 29 f4 brne .+10 ; 0xceec //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); cee2: 81 e0 ldi r24, 0x01 ; 1 cee4: 8c 27 eor r24, r28 } } cee6: 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); cee8: 0c 94 3e 61 jmp 0xc27c ; 0xc27c } } ceec: cf 91 pop r28 ceee: 08 95 ret 0000cef0 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cef0: 88 e8 ldi r24, 0x88 ; 136 cef2: 93 e0 ldi r25, 0x03 ; 3 cef4: 0d 94 2e 42 jmp 0x2845c ; 0x2845c ::start()> 0000cef8 : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cef8: 20 e0 ldi r18, 0x00 ; 0 cefa: 30 e0 ldi r19, 0x00 ; 0 cefc: 40 e7 ldi r20, 0x70 ; 112 cefe: 52 e4 ldi r21, 0x42 ; 66 cf00: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> } cf04: 08 95 ret 0000cf06 : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cf06: 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; cf0a: 40 91 68 03 lds r20, 0x0368 ; 0x800368 cf0e: 50 91 69 03 lds r21, 0x0369 ; 0x800369 cf12: 60 91 6a 03 lds r22, 0x036A ; 0x80036a cf16: 70 91 6b 03 lds r23, 0x036B ; 0x80036b cf1a: 40 93 90 02 sts 0x0290, r20 ; 0x800290 cf1e: 50 93 91 02 sts 0x0291, r21 ; 0x800291 cf22: 60 93 92 02 sts 0x0292, r22 ; 0x800292 cf26: 70 93 93 02 sts 0x0293, r23 ; 0x800293 feedmultiply = original_feedmultiply; cf2a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cf2e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cf32: 88 e8 ldi r24, 0x88 ; 136 cf34: 93 e0 ldi r25, 0x03 ; 3 cf36: 0d 94 2e 42 jmp 0x2845c ; 0x2845c ::start()> 0000cf3a : 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) { cf3a: 1f 93 push r17 cf3c: cf 93 push r28 cf3e: df 93 push r29 cf40: 18 2f mov r17, r24 saved_feedrate = feedrate; cf42: 80 91 90 02 lds r24, 0x0290 ; 0x800290 cf46: 90 91 91 02 lds r25, 0x0291 ; 0x800291 cf4a: a0 91 92 02 lds r26, 0x0292 ; 0x800292 cf4e: b0 91 93 02 lds r27, 0x0293 ; 0x800293 cf52: 80 93 68 03 sts 0x0368, r24 ; 0x800368 cf56: 90 93 69 03 sts 0x0369, r25 ; 0x800369 cf5a: a0 93 6a 03 sts 0x036A, r26 ; 0x80036a cf5e: b0 93 6b 03 sts 0x036B, r27 ; 0x80036b int l_feedmultiply = feedmultiply; cf62: c0 91 39 02 lds r28, 0x0239 ; 0x800239 cf66: d0 91 3a 02 lds r29, 0x023A ; 0x80023a feedmultiply = 100; cf6a: 84 e6 ldi r24, 0x64 ; 100 cf6c: 90 e0 ldi r25, 0x00 ; 0 cf6e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a cf72: 80 93 39 02 sts 0x0239, r24 ; 0x800239 previous_millis_cmd.start(); cf76: 88 e8 ldi r24, 0x88 ; 136 cf78: 93 e0 ldi r25, 0x03 ; 3 cf7a: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> cf7e: 10 93 8f 02 sts 0x028F, r17 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(enable_endstops_now); return l_feedmultiply; } cf82: ce 01 movw r24, r28 cf84: df 91 pop r29 cf86: cf 91 pop r28 cf88: 1f 91 pop r17 cf8a: 08 95 ret 0000cf8c : cf8c: 40 e0 ldi r20, 0x00 ; 0 cf8e: 50 e0 ldi r21, 0x00 ; 0 cf90: ba 01 movw r22, r20 cf92: 8d ee ldi r24, 0xED ; 237 cf94: 9f e0 ldi r25, 0x0F ; 15 cf96: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e cf9a: 40 e0 ldi r20, 0x00 ; 0 cf9c: 50 e0 ldi r21, 0x00 ; 0 cf9e: ba 01 movw r22, r20 cfa0: 81 ef ldi r24, 0xF1 ; 241 cfa2: 9f e0 ldi r25, 0x0F ; 15 cfa4: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 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(); cfa8: 0e 94 ca 5c call 0xb994 ; 0xb994 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); cfac: 70 e0 ldi r23, 0x00 ; 0 cfae: 60 e0 ldi r22, 0x00 ; 0 cfb0: 85 e0 ldi r24, 0x05 ; 5 cfb2: 9f e0 ldi r25, 0x0F ; 15 cfb4: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 cfb8: 70 e0 ldi r23, 0x00 ; 0 cfba: 60 e0 ldi r22, 0x00 ; 0 cfbc: 83 e0 ldi r24, 0x03 ; 3 cfbe: 9f e0 ldi r25, 0x0F ; 15 cfc0: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 cfc4: 70 e0 ldi r23, 0x00 ; 0 cfc6: 60 e0 ldi r22, 0x00 ; 0 cfc8: 81 e0 ldi r24, 0x01 ; 1 cfca: 9f e0 ldi r25, 0x0F ; 15 cfcc: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 cfd0: 70 e0 ldi r23, 0x00 ; 0 cfd2: 60 e0 ldi r22, 0x00 ; 0 cfd4: 8f ef ldi r24, 0xFF ; 255 cfd6: 9e e0 ldi r25, 0x0E ; 14 cfd8: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 cfdc: 70 e0 ldi r23, 0x00 ; 0 cfde: 60 e0 ldi r22, 0x00 ; 0 cfe0: 83 ed ldi r24, 0xD3 ; 211 cfe2: 9e e0 ldi r25, 0x0E ; 14 cfe4: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 cfe8: 70 e0 ldi r23, 0x00 ; 0 cfea: 60 e0 ldi r22, 0x00 ; 0 cfec: 80 ed ldi r24, 0xD0 ; 208 cfee: 9e e0 ldi r25, 0x0E ; 14 cff0: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); cff4: 40 e0 ldi r20, 0x00 ; 0 cff6: 50 e0 ldi r21, 0x00 ; 0 cff8: ba 01 movw r22, r20 cffa: 88 ea ldi r24, 0xA8 ; 168 cffc: 9c e0 ldi r25, 0x0C ; 12 cffe: 0d 94 c7 dd jmp 0x3bb8e ; 0x3bb8e 0000d002 : wdt_disable(); } } void softReset(void) { cli(); d002: 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" ); d004: 88 e1 ldi r24, 0x18 ; 24 d006: 98 e0 ldi r25, 0x08 ; 8 d008: 0f b6 in r0, 0x3f ; 63 d00a: f8 94 cli d00c: a8 95 wdr d00e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d012: 0f be out 0x3f, r0 ; 63 d014: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> d018: ff cf rjmp .-2 ; 0xd018 0000d01a : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { d01a: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); d01c: 9f b7 in r25, 0x3f ; 63 d01e: f8 94 cli d020: e2 e0 ldi r30, 0x02 ; 2 d022: f1 e0 ldi r31, 0x01 ; 1 d024: 80 81 ld r24, Z d026: 84 60 ori r24, 0x04 ; 4 d028: 80 83 st Z, r24 d02a: 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); d02c: 6c 2f mov r22, r28 d02e: 83 e0 ldi r24, 0x03 ; 3 d030: 9d e0 ldi r25, 0x0D ; 13 d032: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a eeprom_update_byte_notify((uint8_t*)EEPROM_FW_CRASH_FLAG, (uint8_t)reason); #ifdef EMERGENCY_DUMP xfdump_full_dump_and_reset(reason); d036: 8c 2f mov r24, r28 d038: 0e 94 3b e4 call 0x1c876 ; 0x1c876 #elif defined(EMERGENCY_SERIAL_DUMP) if(emergency_serial_dump) serial_dump_and_reset(reason); #endif softReset(); d03c: 0e 94 01 68 call 0xd002 ; 0xd002 0000d040 <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { d040: 1f 92 push r1 d042: 0f 92 push r0 d044: 0f b6 in r0, 0x3f ; 63 d046: 0f 92 push r0 d048: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); d04a: 83 e0 ldi r24, 0x03 ; 3 d04c: 0e 94 0d 68 call 0xd01a ; 0xd01a 0000d050 <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { d050: 1f 92 push r1 d052: 0f 92 push r0 d054: 0f b6 in r0, 0x3f ; 63 d056: 0f 92 push r0 d058: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); d05a: 82 e0 ldi r24, 0x02 ; 2 d05c: 0e 94 0d 68 call 0xd01a ; 0xd01a 0000d060 : } #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); d060: 85 ea ldi r24, 0xA5 ; 165 d062: 9f e0 ldi r25, 0x0F ; 15 d064: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 d068: 91 e0 ldi r25, 0x01 ; 1 d06a: 81 11 cpse r24, r1 d06c: 01 c0 rjmp .+2 ; 0xd070 d06e: 90 e0 ldi r25, 0x00 ; 0 } d070: 89 2f mov r24, r25 d072: 08 95 ret 0000d074 : 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(); d074: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 d078: 81 11 cpse r24, r1 d07a: 06 c0 rjmp .+12 ; 0xd088 d07c: 81 e0 ldi r24, 0x01 ; 1 d07e: 90 91 9d 03 lds r25, 0x039D ; 0x80039d d082: 92 30 cpi r25, 0x02 ; 2 d084: 09 f0 breq .+2 ; 0xd088 d086: 80 e0 ldi r24, 0x00 ; 0 } d088: 08 95 ret 0000d08a : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); d08a: 80 91 6e 14 lds r24, 0x146E ; 0x80146e d08e: 81 11 cpse r24, r1 d090: 0a c0 rjmp .+20 ; 0xd0a6 d092: 80 91 11 05 lds r24, 0x0511 ; 0x800511 d096: 81 11 cpse r24, r1 d098: 06 c0 rjmp .+12 ; 0xd0a6 d09a: 81 e0 ldi r24, 0x01 ; 1 d09c: 90 91 9d 03 lds r25, 0x039D ; 0x80039d d0a0: 91 30 cpi r25, 0x01 ; 1 d0a2: 09 f0 breq .+2 ; 0xd0a6 d0a4: 80 e0 ldi r24, 0x00 ; 0 } d0a6: 08 95 ret 0000d0a8 : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { d0a8: cf 93 push r28 d0aa: df 93 push r29 return ( !homing_flag d0ac: c0 91 58 0e lds r28, 0x0E58 ; 0x800e58 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0b0: c1 11 cpse r28, r1 d0b2: 1f c0 rjmp .+62 ; 0xd0f2 && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag d0b4: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 d0b8: 81 11 cpse r24, r1 d0ba: 1c c0 rjmp .+56 ; 0xd0f4 && !printingIsPaused() d0bc: 0e 94 3a 68 call 0xd074 ; 0xd074 d0c0: 81 11 cpse r24, r1 d0c2: 18 c0 rjmp .+48 ; 0xd0f4 && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0c4: d0 91 65 0e lds r29, 0x0E65 ; 0x800e65 d0c8: d4 30 cpi r29, 0x04 ; 4 d0ca: 61 f4 brne .+24 ; 0xd0e4 d0cc: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d d0d0: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e d0d4: 89 2b or r24, r25 d0d6: 91 f4 brne .+36 ; 0xd0fc d0d8: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b d0dc: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c d0e0: 89 2b or r24, r25 d0e2: 61 f4 brne .+24 ; 0xd0fc || printJobOngoing() d0e4: 0e 94 45 68 call 0xd08a ; 0xd08a d0e8: c8 2f mov r28, r24 d0ea: 81 11 cpse r24, r1 d0ec: 03 c0 rjmp .+6 ; 0xd0f4 || lcd_commands_type == LcdCommands::Idle d0ee: c1 e0 ldi r28, 0x01 ; 1 d0f0: 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) d0f2: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } d0f4: 8c 2f mov r24, r28 d0f6: df 91 pop r29 d0f8: cf 91 pop r28 d0fa: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) d0fc: c1 e0 ldi r28, 0x01 ; 1 d0fe: fa cf rjmp .-12 ; 0xd0f4 0000d100 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); d100: 0e 94 54 68 call 0xd0a8 ; 0xd0a8 d104: 88 23 and r24, r24 d106: 89 f0 breq .+34 ; 0xd12a d108: 20 e0 ldi r18, 0x00 ; 0 d10a: 30 e0 ldi r19, 0x00 ; 0 d10c: 40 e0 ldi r20, 0x00 ; 0 d10e: 50 e4 ldi r21, 0x40 ; 64 d110: 60 91 4b 07 lds r22, 0x074B ; 0x80074b d114: 70 91 4c 07 lds r23, 0x074C ; 0x80074c d118: 80 91 4d 07 lds r24, 0x074D ; 0x80074d d11c: 90 91 4e 07 lds r25, 0x074E ; 0x80074e d120: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> d124: 88 1f adc r24, r24 d126: 88 27 eor r24, r24 d128: 88 1f adc r24, r24 } d12a: 08 95 ret 0000d12c : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() d12c: 0e 94 45 68 call 0xd08a ; 0xd08a || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; d130: 81 11 cpse r24, r1 d132: 18 c0 rjmp .+48 ; 0xd164 return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() d134: 0e 94 3a 68 call 0xd074 ; 0xd074 d138: 81 11 cpse r24, r1 d13a: 14 c0 rjmp .+40 ; 0xd164 || saved_printing d13c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a d140: 81 11 cpse r24, r1 d142: 10 c0 rjmp .+32 ; 0xd164 || (lcd_commands_type != LcdCommands::Idle) d144: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 d148: 81 11 cpse r24, r1 d14a: 0b c0 rjmp .+22 ; 0xd162 || MMU2::mmu2.MMU_PRINT_SAVED() d14c: 80 91 99 13 lds r24, 0x1399 ; 0x801399 d150: 81 11 cpse r24, r1 d152: 07 c0 rjmp .+14 ; 0xd162 || homing_flag d154: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 d158: 81 11 cpse r24, r1 d15a: 04 c0 rjmp .+8 ; 0xd164 || mesh_bed_leveling_flag; d15c: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 d160: 08 95 ret d162: 81 e0 ldi r24, 0x01 ; 1 } d164: 08 95 ret 0000d166 : // accordingly refreshCurrentScaling(); } void __attribute__((noinline)) setiHold(uint8_t ih) { iHold = vSense ? ih : ih >> 1; d166: fc 01 movw r30, r24 d168: 20 81 ld r18, Z d16a: 21 11 cpse r18, r1 d16c: 01 c0 rjmp .+2 ; 0xd170 d16e: 66 95 lsr r22 d170: fc 01 movw r30, r24 d172: 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() } d174: 08 95 ret 0000d176 : 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) { d176: fc 01 movw r30, r24 iRun = ir; d178: 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); d17a: 21 e0 ldi r18, 0x01 ; 1 d17c: 60 32 cpi r22, 0x20 ; 32 d17e: 08 f0 brcs .+2 ; 0xd182 d180: 20 e0 ldi r18, 0x00 ; 0 if (vSense != newvSense) { d182: 90 81 ld r25, Z d184: 29 17 cp r18, r25 d186: 81 f0 breq .+32 ; 0xd1a8 d188: 82 81 ldd r24, Z+2 ; 0x02 // Update currents to match current scaling if (vSense) { d18a: 99 23 and r25, r25 d18c: 51 f0 breq .+20 ; 0xd1a2 // 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; d18e: 90 e0 ldi r25, 0x00 ; 0 d190: 95 95 asr r25 d192: 87 95 ror r24 d194: 82 83 std Z+2, r24 ; 0x02 iRun >>= 1; d196: 70 e0 ldi r23, 0x00 ; 0 d198: 75 95 asr r23 d19a: 67 95 ror r22 d19c: 61 83 std Z+1, r22 ; 0x01 // Keep in mind, only a change in iRun can change vSense. iHold <<= 1; } // Update vSense vSense = newvSense; d19e: 20 83 st Z, r18 d1a0: 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; d1a2: 88 0f add r24, r24 d1a4: 82 83 std Z+2, r24 ; 0x02 d1a6: fb cf rjmp .-10 ; 0xd19e } // Update vSense vSense = newvSense; } else if (!vSense) { d1a8: 21 11 cpse r18, r1 d1aa: 04 c0 rjmp .+8 ; 0xd1b4 // 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; d1ac: 70 e0 ldi r23, 0x00 ; 0 d1ae: 75 95 asr r23 d1b0: 67 95 ror r22 d1b2: 61 83 std Z+1, r22 ; 0x01 iRun = ir; // Refresh the vSense bit and take care of updating Hold/Run currents // accordingly refreshCurrentScaling(); } d1b4: 08 95 ret 0000d1b6 : } #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; } d1b6: 20 91 70 12 lds r18, 0x1270 ; 0x801270 d1ba: 30 91 71 12 lds r19, 0x1271 ; 0x801271 d1be: bc 01 movw r22, r24 d1c0: c9 01 movw r24, r18 d1c2: 8a 57 subi r24, 0x7A ; 122 d1c4: 9f 4e sbci r25, 0xEF ; 239 d1c6: 0f 94 98 db call 0x3b730 ; 0x3b730 d1ca: 9c 01 movw r18, r24 d1cc: 90 93 98 03 sts 0x0398, r25 ; 0x800398 d1d0: 80 93 97 03 sts 0x0397, r24 ; 0x800397 d1d4: 81 e0 ldi r24, 0x01 ; 1 d1d6: 23 2b or r18, r19 d1d8: 09 f4 brne .+2 ; 0xd1dc d1da: 80 e0 ldi r24, 0x00 ; 0 d1dc: 08 95 ret 0000d1de : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } d1de: 80 e1 ldi r24, 0x10 ; 16 d1e0: e3 e4 ldi r30, 0x43 ; 67 d1e2: f7 e0 ldi r31, 0x07 ; 7 d1e4: a4 e5 ldi r26, 0x54 ; 84 d1e6: b5 e0 ldi r27, 0x05 ; 5 d1e8: 01 90 ld r0, Z+ d1ea: 0d 92 st X+, r0 d1ec: 8a 95 dec r24 d1ee: e1 f7 brne .-8 ; 0xd1e8 d1f0: 08 95 ret 0000d1f2 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { d1f2: 4f 92 push r4 d1f4: 5f 92 push r5 d1f6: 6f 92 push r6 d1f8: 7f 92 push r7 d1fa: 8f 92 push r8 d1fc: 9f 92 push r9 d1fe: af 92 push r10 d200: bf 92 push r11 d202: cf 92 push r12 d204: df 92 push r13 d206: ef 92 push r14 d208: ff 92 push r15 d20a: 0f 93 push r16 d20c: 1f 93 push r17 d20e: cf 93 push r28 d210: df 93 push r29 d212: 00 d0 rcall .+0 ; 0xd214 d214: 00 d0 rcall .+0 ; 0xd216 d216: 1f 92 push r1 d218: 1f 92 push r1 d21a: cd b7 in r28, 0x3d ; 61 d21c: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; d21e: 20 91 5a 0e lds r18, 0x0E5A ; 0x800e5a d222: 22 23 and r18, r18 d224: 09 f4 brne .+2 ; 0xd228 d226: 73 c1 rjmp .+742 ; 0xd50e #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; d228: 20 91 e2 03 lds r18, 0x03E2 ; 0x8003e2 d22c: 22 30 cpi r18, 0x02 ; 2 d22e: 09 f4 brne .+2 ; 0xd232 d230: 6e c1 rjmp .+732 ; 0xd50e if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb d232: 20 91 e2 03 lds r18, 0x03E2 ; 0x8003e2 d236: 21 30 cpi r18, 0x01 ; 1 d238: 11 f4 brne .+4 ; 0xd23e d23a: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 d23e: 2b 01 movw r4, r22 d240: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; d242: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // restore bed temperature (bed can be disabled during a thermal warning) if ((uint8_t)degBed() != saved_bed_temperature) d246: 10 91 af 05 lds r17, 0x05AF ; 0x8005af d24a: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 d24e: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 d252: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 d256: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 d25a: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> d25e: 61 17 cp r22, r17 d260: 31 f0 breq .+12 ; 0xd26e resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; d262: 81 2f mov r24, r17 d264: 90 e0 ldi r25, 0x00 ; 0 d266: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c d26a: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); d26e: 0e 94 7e 65 call 0xcafc ; 0xcafc // Restore saved fan speed fanSpeed = saved_fan_speed; d272: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac d276: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; d27a: 90 91 e1 03 lds r25, 0x03E1 ; 0x8003e1 d27e: 80 91 06 18 lds r24, 0x1806 ; 0x801806 d282: 81 95 neg r24 d284: 89 27 eor r24, r25 d286: 88 70 andi r24, 0x08 ; 8 d288: 89 27 eor r24, r25 d28a: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 float e = saved_pos[E_AXIS] - e_move; d28e: a3 01 movw r20, r6 d290: 92 01 movw r18, r4 d292: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d296: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d29a: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d29e: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d2a2: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> d2a6: 6d 83 std Y+5, r22 ; 0x05 d2a8: 7e 83 std Y+6, r23 ; 0x06 d2aa: 8f 83 std Y+7, r24 ; 0x07 d2ac: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); d2ae: ce 01 movw r24, r28 d2b0: 05 96 adiw r24, 0x05 ; 5 d2b2: 0f 94 e4 aa call 0x355c8 ; 0x355c8 #ifdef FANCHECK fans_check_enabled = false; d2b6: 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) d2ba: 20 e0 ldi r18, 0x00 ; 0 d2bc: 30 e0 ldi r19, 0x00 ; 0 d2be: 40 e8 ldi r20, 0x80 ; 128 d2c0: 5f eb ldi r21, 0xBF ; 191 d2c2: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d2c6: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d2ca: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d2ce: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d2d2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> d2d6: 81 11 cpse r24, r1 d2d8: 20 c0 rjmp .+64 ; 0xd31a { saved_pos[X_AXIS] = current_position[X_AXIS]; d2da: 80 91 43 07 lds r24, 0x0743 ; 0x800743 d2de: 90 91 44 07 lds r25, 0x0744 ; 0x800744 d2e2: a0 91 45 07 lds r26, 0x0745 ; 0x800745 d2e6: b0 91 46 07 lds r27, 0x0746 ; 0x800746 d2ea: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b d2ee: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c d2f2: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d d2f6: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_pos[Y_AXIS] = current_position[Y_AXIS]; d2fa: 80 91 47 07 lds r24, 0x0747 ; 0x800747 d2fe: 90 91 48 07 lds r25, 0x0748 ; 0x800748 d302: a0 91 49 07 lds r26, 0x0749 ; 0x800749 d306: b0 91 4a 07 lds r27, 0x074A ; 0x80074a d30a: 80 93 9f 02 sts 0x029F, r24 ; 0x80029f d30e: 90 93 a0 02 sts 0x02A0, r25 ; 0x8002a0 d312: a0 93 a1 02 sts 0x02A1, r26 ; 0x8002a1 d316: 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); d31a: a3 01 movw r20, r6 d31c: 92 01 movw r18, r4 d31e: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d322: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d326: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d32a: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d32e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> d332: 69 83 std Y+1, r22 ; 0x01 d334: 7a 83 std Y+2, r23 ; 0x02 d336: 8b 83 std Y+3, r24 ; 0x03 d338: 9c 83 std Y+4, r25 ; 0x04 d33a: e0 90 4b 07 lds r14, 0x074B ; 0x80074b d33e: f0 90 4c 07 lds r15, 0x074C ; 0x80074c d342: 00 91 4d 07 lds r16, 0x074D ; 0x80074d d346: 10 91 4e 07 lds r17, 0x074E ; 0x80074e d34a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d34e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d352: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d356: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d35a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d35e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d362: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d366: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d36a: 1f 92 push r1 d36c: 1f 92 push r1 d36e: 1f 92 push r1 d370: 1f 92 push r1 d372: e2 e6 ldi r30, 0x62 ; 98 d374: 8e 2e mov r8, r30 d376: e7 e2 ldi r30, 0x27 ; 39 d378: 9e 2e mov r9, r30 d37a: e6 e7 ldi r30, 0x76 ; 118 d37c: ae 2e mov r10, r30 d37e: e2 e4 ldi r30, 0x42 ; 66 d380: be 2e mov r11, r30 d382: fe 01 movw r30, r28 d384: 31 96 adiw r30, 0x01 ; 1 d386: 6f 01 movw r12, r30 d388: 0f 94 3e ab call 0x3567c ; 0x3567c //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); d38c: a3 01 movw r20, r6 d38e: 92 01 movw r18, r4 d390: 60 91 a7 02 lds r22, 0x02A7 ; 0x8002a7 d394: 70 91 a8 02 lds r23, 0x02A8 ; 0x8002a8 d398: 80 91 a9 02 lds r24, 0x02A9 ; 0x8002a9 d39c: 90 91 aa 02 lds r25, 0x02AA ; 0x8002aa d3a0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> d3a4: 69 83 std Y+1, r22 ; 0x01 d3a6: 7a 83 std Y+2, r23 ; 0x02 d3a8: 8b 83 std Y+3, r24 ; 0x03 d3aa: 9c 83 std Y+4, r25 ; 0x04 d3ac: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d3b0: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d3b4: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d3b8: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d3bc: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d3c0: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d3c4: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d3c8: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d3cc: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d3d0: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d3d4: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d3d8: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d3dc: 1f 92 push r1 d3de: 1f 92 push r1 d3e0: 1f 92 push r1 d3e2: 1f 92 push r1 d3e4: 0f 94 3e ab call 0x3567c ; 0x3567c //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); d3e8: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 d3ec: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 d3f0: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 d3f4: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 d3f8: 20 91 9f 02 lds r18, 0x029F ; 0x80029f d3fc: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 d400: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 d404: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 d408: 60 91 9b 02 lds r22, 0x029B ; 0x80029b d40c: 70 91 9c 02 lds r23, 0x029C ; 0x80029c d410: 80 91 9d 02 lds r24, 0x029D ; 0x80029d d414: 90 91 9e 02 lds r25, 0x029E ; 0x80029e d418: 1f 92 push r1 d41a: 1f 92 push r1 d41c: 1f 92 push r1 d41e: 1f 92 push r1 d420: 81 2c mov r8, r1 d422: 91 2c mov r9, r1 d424: f8 ee ldi r31, 0xE8 ; 232 d426: af 2e mov r10, r31 d428: f2 e4 ldi r31, 0x42 ; 66 d42a: bf 2e mov r11, r31 d42c: a7 ea ldi r26, 0xA7 ; 167 d42e: ca 2e mov r12, r26 d430: a2 e0 ldi r26, 0x02 ; 2 d432: da 2e mov r13, r26 d434: 0f 94 3e ab call 0x3567c ; 0x3567c st_synchronize(); d438: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #ifdef FANCHECK fans_check_enabled = true; d43c: 11 e0 ldi r17, 0x01 ; 1 d43e: 10 93 38 02 sts 0x0238, r17 ; 0x800238 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d442: 60 91 00 18 lds r22, 0x1800 ; 0x801800 d446: 70 91 01 18 lds r23, 0x1801 ; 0x801801 d44a: 90 e0 ldi r25, 0x00 ; 0 d44c: 80 e0 ldi r24, 0x00 ; 0 d44e: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> d452: 60 93 90 02 sts 0x0290, r22 ; 0x800290 d456: 70 93 91 02 sts 0x0291, r23 ; 0x800291 d45a: 80 93 92 02 sts 0x0292, r24 ; 0x800292 d45e: 90 93 93 02 sts 0x0293, r25 ; 0x800293 feedmultiply = saved_feedmultiply2; d462: 80 91 73 03 lds r24, 0x0373 ; 0x800373 d466: 90 91 74 03 lds r25, 0x0374 ; 0x800374 d46a: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a d46e: 80 93 39 02 sts 0x0239, r24 ; 0x800239 memcpy(current_position, saved_pos, sizeof(saved_pos)); d472: 80 e1 ldi r24, 0x10 ; 16 d474: eb e9 ldi r30, 0x9B ; 155 d476: f2 e0 ldi r31, 0x02 ; 2 d478: a3 e4 ldi r26, 0x43 ; 67 d47a: b7 e0 ldi r27, 0x07 ; 7 d47c: 01 90 ld r0, Z+ d47e: 0d 92 st X+, r0 d480: 8a 95 dec r24 d482: e1 f7 brne .-8 ; 0xd47c set_destination_to_current(); d484: 0e 94 ef 68 call 0xd1de ; 0xd1de //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d488: 80 91 6a 02 lds r24, 0x026A ; 0x80026a d48c: 0f b6 in r0, 0x3f ; 63 d48e: f8 94 cli d490: de bf out 0x3e, r29 ; 62 d492: 0f be out 0x3f, r0 ; 63 d494: cd bf out 0x3d, r28 ; 61 d496: 81 11 cpse r24, r1 d498: 51 c0 rjmp .+162 ; 0xd53c card.setIndex(saved_sdpos); d49a: 60 91 02 18 lds r22, 0x1802 ; 0x801802 d49e: 70 91 03 18 lds r23, 0x1803 ; 0x801803 d4a2: 80 91 04 18 lds r24, 0x1804 ; 0x801804 d4a6: 90 91 05 18 lds r25, 0x1805 ; 0x801805 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; d4aa: 60 93 82 17 sts 0x1782, r22 ; 0x801782 d4ae: 70 93 83 17 sts 0x1783, r23 ; 0x801783 d4b2: 80 93 84 17 sts 0x1784, r24 ; 0x801784 d4b6: 90 93 85 17 sts 0x1785, r25 ; 0x801785 d4ba: 0f 94 c0 77 call 0x2ef80 ; 0x2ef80 sdpos_atomic = saved_sdpos; d4be: 80 91 02 18 lds r24, 0x1802 ; 0x801802 d4c2: 90 91 03 18 lds r25, 0x1803 ; 0x801803 d4c6: a0 91 04 18 lds r26, 0x1804 ; 0x801804 d4ca: b0 91 05 18 lds r27, 0x1805 ; 0x801805 d4ce: 80 93 84 03 sts 0x0384, r24 ; 0x800384 d4d2: 90 93 85 03 sts 0x0385, r25 ; 0x800385 d4d6: a0 93 86 03 sts 0x0386, r26 ; 0x800386 d4da: b0 93 87 03 sts 0x0387, r27 ; 0x800387 card.sdprinting = true; d4de: 10 93 6e 14 sts 0x146E, r17 ; 0x80146e d4e2: 60 e0 ldi r22, 0x00 ; 0 d4e4: 85 ea ldi r24, 0xA5 ; 165 d4e6: 9f e0 ldi r25, 0x0F ; 15 d4e8: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a d4ec: 60 e0 ldi r22, 0x00 ; 0 d4ee: 8f e7 ldi r24, 0x7F ; 127 d4f0: 9c e0 ldi r25, 0x0C ; 12 d4f2: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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); d4f6: 8a e6 ldi r24, 0x6A ; 106 d4f8: 90 e7 ldi r25, 0x70 ; 112 d4fa: 0f 94 ea 0b call 0x217d4 ; 0x217d4 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d4fe: 82 e0 ldi r24, 0x02 ; 2 d500: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a saved_printing = false; d504: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a planner_aborted = true; // unroll the stack d508: 81 e0 ldi r24, 0x01 ; 1 d50a: 80 93 5d 0e sts 0x0E5D, r24 ; 0x800e5d } d50e: 28 96 adiw r28, 0x08 ; 8 d510: 0f b6 in r0, 0x3f ; 63 d512: f8 94 cli d514: de bf out 0x3e, r29 ; 62 d516: 0f be out 0x3f, r0 ; 63 d518: cd bf out 0x3d, r28 ; 61 d51a: df 91 pop r29 d51c: cf 91 pop r28 d51e: 1f 91 pop r17 d520: 0f 91 pop r16 d522: ff 90 pop r15 d524: ef 90 pop r14 d526: df 90 pop r13 d528: cf 90 pop r12 d52a: bf 90 pop r11 d52c: af 90 pop r10 d52e: 9f 90 pop r9 d530: 8f 90 pop r8 d532: 7f 90 pop r7 d534: 6f 90 pop r6 d536: 5f 90 pop r5 d538: 4f 90 pop r4 d53a: 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 d53c: 81 30 cpi r24, 0x01 ; 1 d53e: 89 f6 brne .-94 ; 0xd4e2 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d540: 80 91 02 18 lds r24, 0x1802 ; 0x801802 d544: 90 91 03 18 lds r25, 0x1803 ; 0x801803 d548: a0 91 04 18 lds r26, 0x1804 ; 0x801804 d54c: b0 91 05 18 lds r27, 0x1805 ; 0x801805 d550: 80 93 7c 03 sts 0x037C, r24 ; 0x80037c d554: 90 93 7d 03 sts 0x037D, r25 ; 0x80037d d558: a0 93 7e 03 sts 0x037E, r26 ; 0x80037e d55c: b0 93 7f 03 sts 0x037F, r27 ; 0x80037f serial_count = 0; d560: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d d564: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c FlushSerialRequestResend(); d568: 0e 94 33 5c call 0xb866 ; 0xb866 d56c: ba cf rjmp .-140 ; 0xd4e2 0000d56e : 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) { d56e: 3f 92 push r3 d570: 4f 92 push r4 d572: 5f 92 push r5 d574: 6f 92 push r6 d576: 7f 92 push r7 d578: 8f 92 push r8 d57a: 9f 92 push r9 d57c: af 92 push r10 d57e: bf 92 push r11 d580: cf 92 push r12 d582: df 92 push r13 d584: ef 92 push r14 d586: ff 92 push r15 d588: 0f 93 push r16 d58a: 1f 93 push r17 d58c: cf 93 push r28 d58e: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d590: 30 90 eb 17 lds r3, 0x17EB ; 0x8017eb d594: 33 20 and r3, r3 d596: 09 f4 brne .+2 ; 0xd59a d598: 80 c0 rjmp .+256 ; 0xd69a d59a: 8b 01 movw r16, r22 d59c: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d59e: 31 fe sbrs r3, 1 d5a0: 54 c0 rjmp .+168 ; 0xd64a // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d5a2: 88 80 ld r8, Y d5a4: 99 80 ldd r9, Y+1 ; 0x01 d5a6: aa 80 ldd r10, Y+2 ; 0x02 d5a8: bb 80 ldd r11, Y+3 ; 0x03 d5aa: fb 01 movw r30, r22 d5ac: c0 80 ld r12, Z d5ae: d1 80 ldd r13, Z+1 ; 0x01 d5b0: e2 80 ldd r14, Z+2 ; 0x02 d5b2: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d5b4: 20 91 c0 17 lds r18, 0x17C0 ; 0x8017c0 d5b8: 30 91 c1 17 lds r19, 0x17C1 ; 0x8017c1 d5bc: 40 91 c2 17 lds r20, 0x17C2 ; 0x8017c2 d5c0: 50 91 c3 17 lds r21, 0x17C3 ; 0x8017c3 d5c4: c5 01 movw r24, r10 d5c6: b4 01 movw r22, r8 d5c8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d5cc: 2b 01 movw r4, r22 d5ce: 3c 01 movw r6, r24 d5d0: 20 91 c4 17 lds r18, 0x17C4 ; 0x8017c4 d5d4: 30 91 c5 17 lds r19, 0x17C5 ; 0x8017c5 d5d8: 40 91 c6 17 lds r20, 0x17C6 ; 0x8017c6 d5dc: 50 91 c7 17 lds r21, 0x17C7 ; 0x8017c7 d5e0: c7 01 movw r24, r14 d5e2: b6 01 movw r22, r12 d5e4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d5e8: 9b 01 movw r18, r22 d5ea: ac 01 movw r20, r24 d5ec: c3 01 movw r24, r6 d5ee: b2 01 movw r22, r4 d5f0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> d5f4: 2b 01 movw r4, r22 d5f6: 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; d5f8: 20 91 b8 17 lds r18, 0x17B8 ; 0x8017b8 d5fc: 30 91 b9 17 lds r19, 0x17B9 ; 0x8017b9 d600: 40 91 ba 17 lds r20, 0x17BA ; 0x8017ba d604: 50 91 bb 17 lds r21, 0x17BB ; 0x8017bb d608: c5 01 movw r24, r10 d60a: b4 01 movw r22, r8 d60c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d610: 4b 01 movw r8, r22 d612: 5c 01 movw r10, r24 d614: 20 91 bc 17 lds r18, 0x17BC ; 0x8017bc d618: 30 91 bd 17 lds r19, 0x17BD ; 0x8017bd d61c: 40 91 be 17 lds r20, 0x17BE ; 0x8017be d620: 50 91 bf 17 lds r21, 0x17BF ; 0x8017bf d624: c7 01 movw r24, r14 d626: b6 01 movw r22, r12 d628: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d62c: 9b 01 movw r18, r22 d62e: ac 01 movw r20, r24 d630: c5 01 movw r24, r10 d632: b4 01 movw r22, r8 d634: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d638: 68 83 st Y, r22 d63a: 79 83 std Y+1, r23 ; 0x01 d63c: 8a 83 std Y+2, r24 ; 0x02 d63e: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d640: f8 01 movw r30, r16 d642: 40 82 st Z, r4 d644: 51 82 std Z+1, r5 ; 0x01 d646: 62 82 std Z+2, r6 ; 0x02 d648: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d64a: 30 fe sbrs r3, 0 d64c: 26 c0 rjmp .+76 ; 0xd69a // Then add the offset. x += world2machine_shift[0]; d64e: 20 91 e3 17 lds r18, 0x17E3 ; 0x8017e3 d652: 30 91 e4 17 lds r19, 0x17E4 ; 0x8017e4 d656: 40 91 e5 17 lds r20, 0x17E5 ; 0x8017e5 d65a: 50 91 e6 17 lds r21, 0x17E6 ; 0x8017e6 d65e: 68 81 ld r22, Y d660: 79 81 ldd r23, Y+1 ; 0x01 d662: 8a 81 ldd r24, Y+2 ; 0x02 d664: 9b 81 ldd r25, Y+3 ; 0x03 d666: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> d66a: 68 83 st Y, r22 d66c: 79 83 std Y+1, r23 ; 0x01 d66e: 8a 83 std Y+2, r24 ; 0x02 d670: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d672: 20 91 e7 17 lds r18, 0x17E7 ; 0x8017e7 d676: 30 91 e8 17 lds r19, 0x17E8 ; 0x8017e8 d67a: 40 91 e9 17 lds r20, 0x17E9 ; 0x8017e9 d67e: 50 91 ea 17 lds r21, 0x17EA ; 0x8017ea d682: f8 01 movw r30, r16 d684: 60 81 ld r22, Z d686: 71 81 ldd r23, Z+1 ; 0x01 d688: 82 81 ldd r24, Z+2 ; 0x02 d68a: 93 81 ldd r25, Z+3 ; 0x03 d68c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> d690: f8 01 movw r30, r16 d692: 60 83 st Z, r22 d694: 71 83 std Z+1, r23 ; 0x01 d696: 82 83 std Z+2, r24 ; 0x02 d698: 93 83 std Z+3, r25 ; 0x03 } } } d69a: df 91 pop r29 d69c: cf 91 pop r28 d69e: 1f 91 pop r17 d6a0: 0f 91 pop r16 d6a2: ff 90 pop r15 d6a4: ef 90 pop r14 d6a6: df 90 pop r13 d6a8: cf 90 pop r12 d6aa: bf 90 pop r11 d6ac: af 90 pop r10 d6ae: 9f 90 pop r9 d6b0: 8f 90 pop r8 d6b2: 7f 90 pop r7 d6b4: 6f 90 pop r6 d6b6: 5f 90 pop r5 d6b8: 4f 90 pop r4 d6ba: 3f 90 pop r3 d6bc: 08 95 ret 0000d6be : } } } inline bool world2machine_clamp(float &x, float &y) { d6be: 2f 92 push r2 d6c0: 3f 92 push r3 d6c2: 4f 92 push r4 d6c4: 5f 92 push r5 d6c6: 6f 92 push r6 d6c8: 7f 92 push r7 d6ca: 8f 92 push r8 d6cc: 9f 92 push r9 d6ce: af 92 push r10 d6d0: bf 92 push r11 d6d2: cf 92 push r12 d6d4: df 92 push r13 d6d6: ef 92 push r14 d6d8: ff 92 push r15 d6da: 0f 93 push r16 d6dc: 1f 93 push r17 d6de: cf 93 push r28 d6e0: df 93 push r29 d6e2: 00 d0 rcall .+0 ; 0xd6e4 d6e4: 00 d0 rcall .+0 ; 0xd6e6 d6e6: 1f 92 push r1 d6e8: 1f 92 push r1 d6ea: cd b7 in r28, 0x3d ; 61 d6ec: de b7 in r29, 0x3e ; 62 d6ee: 8c 01 movw r16, r24 d6f0: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d6f2: fc 01 movw r30, r24 d6f4: 80 81 ld r24, Z d6f6: 91 81 ldd r25, Z+1 ; 0x01 d6f8: a2 81 ldd r26, Z+2 ; 0x02 d6fa: b3 81 ldd r27, Z+3 ; 0x03 d6fc: 89 83 std Y+1, r24 ; 0x01 d6fe: 9a 83 std Y+2, r25 ; 0x02 d700: ab 83 std Y+3, r26 ; 0x03 d702: bc 83 std Y+4, r27 ; 0x04 out_y = y; d704: fb 01 movw r30, r22 d706: 80 81 ld r24, Z d708: 91 81 ldd r25, Z+1 ; 0x01 d70a: a2 81 ldd r26, Z+2 ; 0x02 d70c: b3 81 ldd r27, Z+3 ; 0x03 d70e: 8d 83 std Y+5, r24 ; 0x05 d710: 9e 83 std Y+6, r25 ; 0x06 d712: af 83 std Y+7, r26 ; 0x07 d714: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d716: be 01 movw r22, r28 d718: 6b 5f subi r22, 0xFB ; 251 d71a: 7f 4f sbci r23, 0xFF ; 255 d71c: ce 01 movw r24, r28 d71e: 01 96 adiw r24, 0x01 ; 1 d720: 0e 94 b7 6a call 0xd56e ; 0xd56e inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d724: c9 80 ldd r12, Y+1 ; 0x01 d726: da 80 ldd r13, Y+2 ; 0x02 d728: eb 80 ldd r14, Y+3 ; 0x03 d72a: fc 80 ldd r15, Y+4 ; 0x04 d72c: 20 e0 ldi r18, 0x00 ; 0 d72e: 30 e0 ldi r19, 0x00 ; 0 d730: a9 01 movw r20, r18 d732: c7 01 movw r24, r14 d734: b6 01 movw r22, r12 d736: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> d73a: 87 ff sbrs r24, 7 d73c: 35 c0 rjmp .+106 ; 0xd7a8 tmpx = X_MIN_POS; d73e: 19 82 std Y+1, r1 ; 0x01 d740: 1a 82 std Y+2, r1 ; 0x02 d742: 1b 82 std Y+3, r1 ; 0x03 d744: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d746: ff 24 eor r15, r15 d748: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d74a: 8d 80 ldd r8, Y+5 ; 0x05 d74c: 9e 80 ldd r9, Y+6 ; 0x06 d74e: af 80 ldd r10, Y+7 ; 0x07 d750: b8 84 ldd r11, Y+8 ; 0x08 d752: 20 e0 ldi r18, 0x00 ; 0 d754: 30 e0 ldi r19, 0x00 ; 0 d756: 40 e8 ldi r20, 0x80 ; 128 d758: 50 ec ldi r21, 0xC0 ; 192 d75a: c5 01 movw r24, r10 d75c: b4 01 movw r22, r8 d75e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> d762: 87 ff sbrs r24, 7 d764: 35 c0 rjmp .+106 ; 0xd7d0 tmpy = Y_MIN_POS; d766: 80 e0 ldi r24, 0x00 ; 0 d768: 90 e0 ldi r25, 0x00 ; 0 d76a: a0 e8 ldi r26, 0x80 ; 128 d76c: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d76e: 8d 83 std Y+5, r24 ; 0x05 d770: 9e 83 std Y+6, r25 ; 0x06 d772: af 83 std Y+7, r26 ; 0x07 d774: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d776: cd 80 ldd r12, Y+5 ; 0x05 d778: de 80 ldd r13, Y+6 ; 0x06 d77a: ef 80 ldd r14, Y+7 ; 0x07 d77c: f8 84 ldd r15, Y+8 ; 0x08 d77e: 89 80 ldd r8, Y+1 ; 0x01 d780: 9a 80 ldd r9, Y+2 ; 0x02 d782: ab 80 ldd r10, Y+3 ; 0x03 d784: 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) { d786: 70 90 eb 17 lds r7, 0x17EB ; 0x8017eb d78a: 71 10 cpse r7, r1 d78c: 4c c0 rjmp .+152 ; 0xd826 // No correction. out_x = x; d78e: f8 01 movw r30, r16 d790: 80 82 st Z, r8 d792: 91 82 std Z+1, r9 ; 0x01 d794: a2 82 std Z+2, r10 ; 0x02 d796: b3 82 std Z+3, r11 ; 0x03 out_y = y; d798: f1 01 movw r30, r2 d79a: c0 82 st Z, r12 d79c: d1 82 std Z+1, r13 ; 0x01 d79e: e2 82 std Z+2, r14 ; 0x02 d7a0: 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) { d7a2: ff 24 eor r15, r15 d7a4: f3 94 inc r15 d7a6: 25 c0 rjmp .+74 ; 0xd7f2 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) { d7a8: 20 e0 ldi r18, 0x00 ; 0 d7aa: 30 e0 ldi r19, 0x00 ; 0 d7ac: 4f e7 ldi r20, 0x7F ; 127 d7ae: 53 e4 ldi r21, 0x43 ; 67 d7b0: c7 01 movw r24, r14 d7b2: b6 01 movw r22, r12 d7b4: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d7b8: 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) { d7ba: 18 16 cp r1, r24 d7bc: 34 f6 brge .-116 ; 0xd74a tmpx = X_MAX_POS; d7be: 80 e0 ldi r24, 0x00 ; 0 d7c0: 90 e0 ldi r25, 0x00 ; 0 d7c2: af e7 ldi r26, 0x7F ; 127 d7c4: b3 e4 ldi r27, 0x43 ; 67 d7c6: 89 83 std Y+1, r24 ; 0x01 d7c8: 9a 83 std Y+2, r25 ; 0x02 d7ca: ab 83 std Y+3, r26 ; 0x03 d7cc: bc 83 std Y+4, r27 ; 0x04 d7ce: bb cf rjmp .-138 ; 0xd746 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d7d0: 20 e0 ldi r18, 0x00 ; 0 d7d2: 30 e8 ldi r19, 0x80 ; 128 d7d4: 44 e5 ldi r20, 0x54 ; 84 d7d6: 53 e4 ldi r21, 0x43 ; 67 d7d8: c5 01 movw r24, r10 d7da: b4 01 movw r22, r8 d7dc: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> d7e0: 18 16 cp r1, r24 d7e2: 2c f4 brge .+10 ; 0xd7ee tmpy = Y_MAX_POS; d7e4: 80 e0 ldi r24, 0x00 ; 0 d7e6: 90 e8 ldi r25, 0x80 ; 128 d7e8: a4 e5 ldi r26, 0x54 ; 84 d7ea: b3 e4 ldi r27, 0x43 ; 67 d7ec: c0 cf rjmp .-128 ; 0xd76e clamped = true; } if (clamped) d7ee: f1 10 cpse r15, r1 d7f0: c2 cf rjmp .-124 ; 0xd776 machine2world(tmpx, tmpy, x, y); return clamped; } d7f2: 8f 2d mov r24, r15 d7f4: 28 96 adiw r28, 0x08 ; 8 d7f6: 0f b6 in r0, 0x3f ; 63 d7f8: f8 94 cli d7fa: de bf out 0x3e, r29 ; 62 d7fc: 0f be out 0x3f, r0 ; 63 d7fe: cd bf out 0x3d, r28 ; 61 d800: df 91 pop r29 d802: cf 91 pop r28 d804: 1f 91 pop r17 d806: 0f 91 pop r16 d808: ff 90 pop r15 d80a: ef 90 pop r14 d80c: df 90 pop r13 d80e: cf 90 pop r12 d810: bf 90 pop r11 d812: af 90 pop r10 d814: 9f 90 pop r9 d816: 8f 90 pop r8 d818: 7f 90 pop r7 d81a: 6f 90 pop r6 d81c: 5f 90 pop r5 d81e: 4f 90 pop r4 d820: 3f 90 pop r3 d822: 2f 90 pop r2 d824: 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) { d826: 70 fe sbrs r7, 0 d828: 1c c0 rjmp .+56 ; 0xd862 // Then add the offset. x -= world2machine_shift[0]; d82a: 20 91 e3 17 lds r18, 0x17E3 ; 0x8017e3 d82e: 30 91 e4 17 lds r19, 0x17E4 ; 0x8017e4 d832: 40 91 e5 17 lds r20, 0x17E5 ; 0x8017e5 d836: 50 91 e6 17 lds r21, 0x17E6 ; 0x8017e6 d83a: c5 01 movw r24, r10 d83c: b4 01 movw r22, r8 d83e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> d842: 4b 01 movw r8, r22 d844: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d846: 20 91 e7 17 lds r18, 0x17E7 ; 0x8017e7 d84a: 30 91 e8 17 lds r19, 0x17E8 ; 0x8017e8 d84e: 40 91 e9 17 lds r20, 0x17E9 ; 0x8017e9 d852: 50 91 ea 17 lds r21, 0x17EA ; 0x8017ea d856: c7 01 movw r24, r14 d858: b6 01 movw r22, r12 d85a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> d85e: 6b 01 movw r12, r22 d860: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d862: 71 fe sbrs r7, 1 d864: 9e cf rjmp .-196 ; 0xd7a2 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d866: 20 91 d3 17 lds r18, 0x17D3 ; 0x8017d3 d86a: 30 91 d4 17 lds r19, 0x17D4 ; 0x8017d4 d86e: 40 91 d5 17 lds r20, 0x17D5 ; 0x8017d5 d872: 50 91 d6 17 lds r21, 0x17D6 ; 0x8017d6 d876: c5 01 movw r24, r10 d878: b4 01 movw r22, r8 d87a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d87e: 2b 01 movw r4, r22 d880: 3c 01 movw r6, r24 d882: 20 91 d7 17 lds r18, 0x17D7 ; 0x8017d7 d886: 30 91 d8 17 lds r19, 0x17D8 ; 0x8017d8 d88a: 40 91 d9 17 lds r20, 0x17D9 ; 0x8017d9 d88e: 50 91 da 17 lds r21, 0x17DA ; 0x8017da d892: c7 01 movw r24, r14 d894: b6 01 movw r22, r12 d896: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d89a: 9b 01 movw r18, r22 d89c: ac 01 movw r20, r24 d89e: c3 01 movw r24, r6 d8a0: b2 01 movw r22, r4 d8a2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> d8a6: f8 01 movw r30, r16 d8a8: 60 83 st Z, r22 d8aa: 71 83 std Z+1, r23 ; 0x01 d8ac: 82 83 std Z+2, r24 ; 0x02 d8ae: 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; d8b0: 20 91 db 17 lds r18, 0x17DB ; 0x8017db d8b4: 30 91 dc 17 lds r19, 0x17DC ; 0x8017dc d8b8: 40 91 dd 17 lds r20, 0x17DD ; 0x8017dd d8bc: 50 91 de 17 lds r21, 0x17DE ; 0x8017de d8c0: c5 01 movw r24, r10 d8c2: b4 01 movw r22, r8 d8c4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d8c8: 4b 01 movw r8, r22 d8ca: 5c 01 movw r10, r24 d8cc: 20 91 df 17 lds r18, 0x17DF ; 0x8017df d8d0: 30 91 e0 17 lds r19, 0x17E0 ; 0x8017e0 d8d4: 40 91 e1 17 lds r20, 0x17E1 ; 0x8017e1 d8d8: 50 91 e2 17 lds r21, 0x17E2 ; 0x8017e2 d8dc: c7 01 movw r24, r14 d8de: b6 01 movw r22, r12 d8e0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> d8e4: 9b 01 movw r18, r22 d8e6: ac 01 movw r20, r24 d8e8: c5 01 movw r24, r10 d8ea: b4 01 movw r22, r8 d8ec: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> d8f0: f1 01 movw r30, r2 d8f2: 60 83 st Z, r22 d8f4: 71 83 std Z+1, r23 ; 0x01 d8f6: 82 83 std Z+2, r24 ; 0x02 d8f8: 93 83 std Z+3, r25 ; 0x03 d8fa: 53 cf rjmp .-346 ; 0xd7a2 0000d8fc : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d8fc: cf 92 push r12 d8fe: df 92 push r13 d900: ef 92 push r14 d902: ff 92 push r15 d904: cf 93 push r28 d906: df 93 push r29 d908: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d90a: bc 01 movw r22, r24 d90c: 6c 5f subi r22, 0xFC ; 252 d90e: 7f 4f sbci r23, 0xFF ; 255 d910: 0e 94 5f 6b call 0xd6be ; 0xd6be // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d914: c0 90 29 02 lds r12, 0x0229 ; 0x800229 d918: d0 90 2a 02 lds r13, 0x022A ; 0x80022a d91c: e0 90 2b 02 lds r14, 0x022B ; 0x80022b d920: f0 90 2c 02 lds r15, 0x022C ; 0x80022c d924: a7 01 movw r20, r14 d926: 96 01 movw r18, r12 d928: 68 85 ldd r22, Y+8 ; 0x08 d92a: 79 85 ldd r23, Y+9 ; 0x09 d92c: 8a 85 ldd r24, Y+10 ; 0x0a d92e: 9b 85 ldd r25, Y+11 ; 0x0b d930: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> d934: 87 ff sbrs r24, 7 d936: 04 c0 rjmp .+8 ; 0xd940 d938: c8 86 std Y+8, r12 ; 0x08 d93a: d9 86 std Y+9, r13 ; 0x09 d93c: ea 86 std Y+10, r14 ; 0x0a d93e: 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]; d940: c0 90 1d 02 lds r12, 0x021D ; 0x80021d d944: d0 90 1e 02 lds r13, 0x021E ; 0x80021e d948: e0 90 1f 02 lds r14, 0x021F ; 0x80021f d94c: f0 90 20 02 lds r15, 0x0220 ; 0x800220 d950: a7 01 movw r20, r14 d952: 96 01 movw r18, r12 d954: 68 85 ldd r22, Y+8 ; 0x08 d956: 79 85 ldd r23, Y+9 ; 0x09 d958: 8a 85 ldd r24, Y+10 ; 0x0a d95a: 9b 85 ldd r25, Y+11 ; 0x0b d95c: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> d960: 18 16 cp r1, r24 d962: 24 f4 brge .+8 ; 0xd96c d964: c8 86 std Y+8, r12 ; 0x08 d966: d9 86 std Y+9, r13 ; 0x09 d968: ea 86 std Y+10, r14 ; 0x0a d96a: fb 86 std Y+11, r15 ; 0x0b } } d96c: df 91 pop r29 d96e: cf 91 pop r28 d970: ff 90 pop r15 d972: ef 90 pop r14 d974: df 90 pop r13 d976: cf 90 pop r12 d978: 08 95 ret 0000d97a : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d97a: 2f 92 push r2 d97c: 3f 92 push r3 d97e: 4f 92 push r4 d980: 5f 92 push r5 d982: 6f 92 push r6 d984: 7f 92 push r7 d986: 8f 92 push r8 d988: 9f 92 push r9 d98a: af 92 push r10 d98c: bf 92 push r11 d98e: cf 92 push r12 d990: df 92 push r13 d992: ef 92 push r14 d994: ff 92 push r15 d996: 0f 93 push r16 d998: 1f 93 push r17 d99a: cf 93 push r28 d99c: df 93 push r29 d99e: cd b7 in r28, 0x3d ; 61 d9a0: de b7 in r29, 0x3e ; 62 d9a2: a2 97 sbiw r28, 0x22 ; 34 d9a4: 0f b6 in r0, 0x3f ; 63 d9a6: f8 94 cli d9a8: de bf out 0x3e, r29 ; 62 d9aa: 0f be out 0x3f, r0 ; 63 d9ac: cd bf out 0x3d, r28 ; 61 d9ae: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d9b0: 84 e5 ldi r24, 0x54 ; 84 d9b2: 95 e0 ldi r25, 0x05 ; 5 d9b4: 0e 94 7e 6c call 0xd8fc ; 0xd8fc previous_millis_cmd.start(); d9b8: 88 e8 ldi r24, 0x88 ; 136 d9ba: 93 e0 ldi r25, 0x03 ; 3 d9bc: 0f 94 2e 42 call 0x2845c ; 0x2845c ::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])) { d9c0: 40 90 43 07 lds r4, 0x0743 ; 0x800743 d9c4: 50 90 44 07 lds r5, 0x0744 ; 0x800744 d9c8: 60 90 45 07 lds r6, 0x0745 ; 0x800745 d9cc: 70 90 46 07 lds r7, 0x0746 ; 0x800746 d9d0: c0 90 54 05 lds r12, 0x0554 ; 0x800554 d9d4: d0 90 55 05 lds r13, 0x0555 ; 0x800555 d9d8: e0 90 56 05 lds r14, 0x0556 ; 0x800556 d9dc: f0 90 57 05 lds r15, 0x0557 ; 0x800557 d9e0: a7 01 movw r20, r14 d9e2: 96 01 movw r18, r12 d9e4: c3 01 movw r24, r6 d9e6: b2 01 movw r22, r4 d9e8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> d9ec: 81 11 cpse r24, r1 d9ee: 3f c0 rjmp .+126 ; 0xda6e d9f0: 20 91 58 05 lds r18, 0x0558 ; 0x800558 d9f4: 30 91 59 05 lds r19, 0x0559 ; 0x800559 d9f8: 40 91 5a 05 lds r20, 0x055A ; 0x80055a d9fc: 50 91 5b 05 lds r21, 0x055B ; 0x80055b da00: 60 91 47 07 lds r22, 0x0747 ; 0x800747 da04: 70 91 48 07 lds r23, 0x0748 ; 0x800748 da08: 80 91 49 07 lds r24, 0x0749 ; 0x800749 da0c: 90 91 4a 07 lds r25, 0x074A ; 0x80074a da10: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> da14: 81 11 cpse r24, r1 da16: 2b c0 rjmp .+86 ; 0xda6e plan_buffer_line_destinationXYZE(feedrate/60); da18: 20 e0 ldi r18, 0x00 ; 0 da1a: 30 e0 ldi r19, 0x00 ; 0 da1c: 40 e7 ldi r20, 0x70 ; 112 da1e: 52 e4 ldi r21, 0x42 ; 66 da20: 60 91 90 02 lds r22, 0x0290 ; 0x800290 da24: 70 91 91 02 lds r23, 0x0291 ; 0x800291 da28: 80 91 92 02 lds r24, 0x0292 ; 0x800292 da2c: 90 91 93 02 lds r25, 0x0293 ; 0x800293 da30: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> da34: 0f 94 60 ba call 0x374c0 ; 0x374c0 #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); da38: 0e 94 a5 5b call 0xb74a ; 0xb74a } da3c: a2 96 adiw r28, 0x22 ; 34 da3e: 0f b6 in r0, 0x3f ; 63 da40: f8 94 cli da42: de bf out 0x3e, r29 ; 62 da44: 0f be out 0x3f, r0 ; 63 da46: cd bf out 0x3d, r28 ; 61 da48: df 91 pop r29 da4a: cf 91 pop r28 da4c: 1f 91 pop r17 da4e: 0f 91 pop r16 da50: ff 90 pop r15 da52: ef 90 pop r14 da54: df 90 pop r13 da56: cf 90 pop r12 da58: bf 90 pop r11 da5a: af 90 pop r10 da5c: 9f 90 pop r9 da5e: 8f 90 pop r8 da60: 7f 90 pop r7 da62: 6f 90 pop r6 da64: 5f 90 pop r5 da66: 4f 90 pop r4 da68: 3f 90 pop r3 da6a: 2f 90 pop r2 da6c: 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); da6e: 60 91 39 02 lds r22, 0x0239 ; 0x800239 da72: 70 91 3a 02 lds r23, 0x023A ; 0x80023a da76: 07 2e mov r0, r23 da78: 00 0c add r0, r0 da7a: 88 0b sbc r24, r24 da7c: 99 0b sbc r25, r25 da7e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> da82: 20 91 90 02 lds r18, 0x0290 ; 0x800290 da86: 30 91 91 02 lds r19, 0x0291 ; 0x800291 da8a: 40 91 92 02 lds r20, 0x0292 ; 0x800292 da8e: 50 91 93 02 lds r21, 0x0293 ; 0x800293 da92: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> da96: 2e e3 ldi r18, 0x3E ; 62 da98: 33 ec ldi r19, 0xC3 ; 195 da9a: 4e e2 ldi r20, 0x2E ; 46 da9c: 59 e3 ldi r21, 0x39 ; 57 da9e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> daa2: 6f 83 std Y+7, r22 ; 0x07 daa4: 78 87 std Y+8, r23 ; 0x08 daa6: 89 87 std Y+9, r24 ; 0x09 daa8: 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) { daaa: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 daae: 88 23 and r24, r24 dab0: 09 f4 brne .+2 ; 0xdab4 dab2: 0f c1 rjmp .+542 ; 0xdcd2 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]; dab4: a3 01 movw r20, r6 dab6: 92 01 movw r18, r4 dab8: c7 01 movw r24, r14 daba: b6 01 movw r22, r12 dabc: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> dac0: 2b 01 movw r4, r22 dac2: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; dac4: 20 91 47 07 lds r18, 0x0747 ; 0x800747 dac8: 30 91 48 07 lds r19, 0x0748 ; 0x800748 dacc: 40 91 49 07 lds r20, 0x0749 ; 0x800749 dad0: 50 91 4a 07 lds r21, 0x074A ; 0x80074a dad4: 60 91 58 05 lds r22, 0x0558 ; 0x800558 dad8: 70 91 59 05 lds r23, 0x0559 ; 0x800559 dadc: 80 91 5a 05 lds r24, 0x055A ; 0x80055a dae0: 90 91 5b 05 lds r25, 0x055B ; 0x80055b dae4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> dae8: 6b 87 std Y+11, r22 ; 0x0b daea: 7c 87 std Y+12, r23 ; 0x0c daec: 8d 87 std Y+13, r24 ; 0x0d daee: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); daf0: c3 01 movw r24, r6 daf2: b2 01 movw r22, r4 daf4: 9f 77 andi r25, 0x7F ; 127 daf6: 2b 85 ldd r18, Y+11 ; 0x0b daf8: 3c 85 ldd r19, Y+12 ; 0x0c dafa: 4d 85 ldd r20, Y+13 ; 0x0d dafc: 5e 85 ldd r21, Y+14 ; 0x0e dafe: 5f 77 andi r21, 0x7F ; 127 db00: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> db04: 6b 01 movw r12, r22 db06: 7c 01 movw r14, r24 if (len > 0) db08: 20 e0 ldi r18, 0x00 ; 0 db0a: 30 e0 ldi r19, 0x00 ; 0 db0c: a9 01 movw r20, r18 db0e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> db12: 18 16 cp r1, r24 db14: 0c f0 brlt .+2 ; 0xdb18 db16: dd c0 rjmp .+442 ; 0xdcd2 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); db18: 20 e0 ldi r18, 0x00 ; 0 db1a: 30 e0 ldi r19, 0x00 ; 0 db1c: 40 ef ldi r20, 0xF0 ; 240 db1e: 51 e4 ldi r21, 0x41 ; 65 db20: c7 01 movw r24, r14 db22: b6 01 movw r22, r12 db24: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> db28: 0f 94 97 df call 0x3bf2e ; 0x3bf2e db2c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> db30: 7e 83 std Y+6, r23 ; 0x06 db32: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { db34: 62 30 cpi r22, 0x02 ; 2 db36: 71 05 cpc r23, r1 db38: 08 f4 brcc .+2 ; 0xdb3c db3a: cb c0 rjmp .+406 ; 0xdcd2 db3c: 21 14 cp r2, r1 db3e: 31 04 cpc r3, r1 db40: 09 f4 brne .+2 ; 0xdb44 db42: c7 c0 rjmp .+398 ; 0xdcd2 float dz = z - current_position[Z_AXIS]; db44: 20 91 4b 07 lds r18, 0x074B ; 0x80074b db48: 30 91 4c 07 lds r19, 0x074C ; 0x80074c db4c: 40 91 4d 07 lds r20, 0x074D ; 0x80074d db50: 50 91 4e 07 lds r21, 0x074E ; 0x80074e db54: 60 91 5c 05 lds r22, 0x055C ; 0x80055c db58: 70 91 5d 05 lds r23, 0x055D ; 0x80055d db5c: 80 91 5e 05 lds r24, 0x055E ; 0x80055e db60: 90 91 5f 05 lds r25, 0x055F ; 0x80055f db64: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> db68: 6f 87 std Y+15, r22 ; 0x0f db6a: 78 8b std Y+16, r23 ; 0x10 db6c: 89 8b std Y+17, r24 ; 0x11 db6e: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; db70: 20 91 4f 07 lds r18, 0x074F ; 0x80074f db74: 30 91 50 07 lds r19, 0x0750 ; 0x800750 db78: 40 91 51 07 lds r20, 0x0751 ; 0x800751 db7c: 50 91 52 07 lds r21, 0x0752 ; 0x800752 db80: 60 91 60 05 lds r22, 0x0560 ; 0x800560 db84: 70 91 61 05 lds r23, 0x0561 ; 0x800561 db88: 80 91 62 05 lds r24, 0x0562 ; 0x800562 db8c: 90 91 63 05 lds r25, 0x0563 ; 0x800563 db90: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> db94: 6b 8b std Y+19, r22 ; 0x13 db96: 7c 8b std Y+20, r23 ; 0x14 db98: 8d 8b std Y+21, r24 ; 0x15 db9a: 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); db9c: ad 81 ldd r26, Y+5 ; 0x05 db9e: be 81 ldd r27, Y+6 ; 0x06 dba0: cd 01 movw r24, r26 dba2: b0 e0 ldi r27, 0x00 ; 0 dba4: a0 e0 ldi r26, 0x00 ; 0 dba6: 8f 8f std Y+31, r24 ; 0x1f dba8: 98 a3 std Y+32, r25 ; 0x20 dbaa: a9 a3 std Y+33, r26 ; 0x21 dbac: 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) { dbae: 2d 81 ldd r18, Y+5 ; 0x05 dbb0: 3e 81 ldd r19, Y+6 ; 0x06 dbb2: 22 16 cp r2, r18 dbb4: 33 06 cpc r3, r19 dbb6: 08 f0 brcs .+2 ; 0xdbba dbb8: 8c c0 rjmp .+280 ; 0xdcd2 float t = float(i) / float(n_segments); dbba: b1 01 movw r22, r2 dbbc: 90 e0 ldi r25, 0x00 ; 0 dbbe: 80 e0 ldi r24, 0x00 ; 0 dbc0: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> dbc4: 6b 01 movw r12, r22 dbc6: 7c 01 movw r14, r24 dbc8: 6f 8d ldd r22, Y+31 ; 0x1f dbca: 78 a1 ldd r23, Y+32 ; 0x20 dbcc: 89 a1 ldd r24, Y+33 ; 0x21 dbce: 9a a1 ldd r25, Y+34 ; 0x22 dbd0: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> dbd4: 9b 01 movw r18, r22 dbd6: ac 01 movw r20, r24 dbd8: c7 01 movw r24, r14 dbda: b6 01 movw r22, r12 dbdc: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> dbe0: 6b 01 movw r12, r22 dbe2: 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, dbe4: ac 01 movw r20, r24 dbe6: 9b 01 movw r18, r22 dbe8: 6b 89 ldd r22, Y+19 ; 0x13 dbea: 7c 89 ldd r23, Y+20 ; 0x14 dbec: 8d 89 ldd r24, Y+21 ; 0x15 dbee: 9e 89 ldd r25, Y+22 ; 0x16 dbf0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> dbf4: 9b 01 movw r18, r22 dbf6: ac 01 movw r20, r24 dbf8: 60 91 4f 07 lds r22, 0x074F ; 0x80074f dbfc: 70 91 50 07 lds r23, 0x0750 ; 0x800750 dc00: 80 91 51 07 lds r24, 0x0751 ; 0x800751 dc04: 90 91 52 07 lds r25, 0x0752 ; 0x800752 dc08: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> dc0c: 69 83 std Y+1, r22 ; 0x01 dc0e: 7a 83 std Y+2, r23 ; 0x02 dc10: 8b 83 std Y+3, r24 ; 0x03 dc12: 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, dc14: a7 01 movw r20, r14 dc16: 96 01 movw r18, r12 dc18: 6f 85 ldd r22, Y+15 ; 0x0f dc1a: 78 89 ldd r23, Y+16 ; 0x10 dc1c: 89 89 ldd r24, Y+17 ; 0x11 dc1e: 9a 89 ldd r25, Y+18 ; 0x12 dc20: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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, dc24: 20 91 4b 07 lds r18, 0x074B ; 0x80074b dc28: 30 91 4c 07 lds r19, 0x074C ; 0x80074c dc2c: 40 91 4d 07 lds r20, 0x074D ; 0x80074d dc30: 50 91 4e 07 lds r21, 0x074E ; 0x80074e dc34: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> dc38: 6f 8b std Y+23, r22 ; 0x17 dc3a: 78 8f std Y+24, r23 ; 0x18 dc3c: 89 8f std Y+25, r24 ; 0x19 dc3e: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, dc40: a7 01 movw r20, r14 dc42: 96 01 movw r18, r12 dc44: 6b 85 ldd r22, Y+11 ; 0x0b dc46: 7c 85 ldd r23, Y+12 ; 0x0c dc48: 8d 85 ldd r24, Y+13 ; 0x0d dc4a: 9e 85 ldd r25, Y+14 ; 0x0e dc4c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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, dc50: 20 91 47 07 lds r18, 0x0747 ; 0x800747 dc54: 30 91 48 07 lds r19, 0x0748 ; 0x800748 dc58: 40 91 49 07 lds r20, 0x0749 ; 0x800749 dc5c: 50 91 4a 07 lds r21, 0x074A ; 0x80074a dc60: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> dc64: 6b 8f std Y+27, r22 ; 0x1b dc66: 7c 8f std Y+28, r23 ; 0x1c dc68: 8d 8f std Y+29, r24 ; 0x1d dc6a: 9e 8f std Y+30, r25 ; 0x1e dc6c: a7 01 movw r20, r14 dc6e: 96 01 movw r18, r12 dc70: c3 01 movw r24, r6 dc72: b2 01 movw r22, r4 dc74: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> dc78: 20 91 43 07 lds r18, 0x0743 ; 0x800743 dc7c: 30 91 44 07 lds r19, 0x0744 ; 0x800744 dc80: 40 91 45 07 lds r20, 0x0745 ; 0x800745 dc84: 50 91 46 07 lds r21, 0x0746 ; 0x800746 dc88: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> dc8c: 3f 92 push r3 dc8e: 2f 92 push r2 dc90: a3 e4 ldi r26, 0x43 ; 67 dc92: b7 e0 ldi r27, 0x07 ; 7 dc94: bf 93 push r27 dc96: af 93 push r26 dc98: 8f 80 ldd r8, Y+7 ; 0x07 dc9a: 98 84 ldd r9, Y+8 ; 0x08 dc9c: a9 84 ldd r10, Y+9 ; 0x09 dc9e: ba 84 ldd r11, Y+10 ; 0x0a dca0: de 01 movw r26, r28 dca2: 11 96 adiw r26, 0x01 ; 1 dca4: 6d 01 movw r12, r26 dca6: ef 88 ldd r14, Y+23 ; 0x17 dca8: f8 8c ldd r15, Y+24 ; 0x18 dcaa: 09 8d ldd r16, Y+25 ; 0x19 dcac: 1a 8d ldd r17, Y+26 ; 0x1a dcae: 2b 8d ldd r18, Y+27 ; 0x1b dcb0: 3c 8d ldd r19, Y+28 ; 0x1c dcb2: 4d 8d ldd r20, Y+29 ; 0x1d dcb4: 5e 8d ldd r21, Y+30 ; 0x1e dcb6: 0f 94 3e ab call 0x3567c ; 0x3567c 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) dcba: 0f 90 pop r0 dcbc: 0f 90 pop r0 dcbe: 0f 90 pop r0 dcc0: 0f 90 pop r0 dcc2: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d dcc6: 81 11 cpse r24, r1 dcc8: b7 ce rjmp .-658 ; 0xda38 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) { dcca: bf ef ldi r27, 0xFF ; 255 dccc: 2b 1a sub r2, r27 dcce: 3b 0a sbc r3, r27 dcd0: 6e cf rjmp .-292 ; 0xdbae if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); dcd2: e0 90 5c 05 lds r14, 0x055C ; 0x80055c dcd6: f0 90 5d 05 lds r15, 0x055D ; 0x80055d dcda: 00 91 5e 05 lds r16, 0x055E ; 0x80055e dcde: 10 91 5f 05 lds r17, 0x055F ; 0x80055f dce2: 20 91 58 05 lds r18, 0x0558 ; 0x800558 dce6: 30 91 59 05 lds r19, 0x0559 ; 0x800559 dcea: 40 91 5a 05 lds r20, 0x055A ; 0x80055a dcee: 50 91 5b 05 lds r21, 0x055B ; 0x80055b dcf2: 60 91 54 05 lds r22, 0x0554 ; 0x800554 dcf6: 70 91 55 05 lds r23, 0x0555 ; 0x800555 dcfa: 80 91 56 05 lds r24, 0x0556 ; 0x800556 dcfe: 90 91 57 05 lds r25, 0x0557 ; 0x800557 dd02: 1f 92 push r1 dd04: 1f 92 push r1 dd06: e3 e4 ldi r30, 0x43 ; 67 dd08: f7 e0 ldi r31, 0x07 ; 7 dd0a: ff 93 push r31 dd0c: ef 93 push r30 dd0e: 8f 80 ldd r8, Y+7 ; 0x07 dd10: 98 84 ldd r9, Y+8 ; 0x08 dd12: a9 84 ldd r10, Y+9 ; 0x09 dd14: ba 84 ldd r11, Y+10 ; 0x0a dd16: e0 e6 ldi r30, 0x60 ; 96 dd18: ce 2e mov r12, r30 dd1a: e5 e0 ldi r30, 0x05 ; 5 dd1c: de 2e mov r13, r30 dd1e: 0f 94 3e ab call 0x3567c ; 0x3567c dd22: 0f 90 pop r0 dd24: 0f 90 pop r0 dd26: 0f 90 pop r0 dd28: 0f 90 pop r0 dd2a: 86 ce rjmp .-756 ; 0xda38 0000dd2c : /// @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) { dd2c: cf 92 push r12 dd2e: df 92 push r13 dd30: ef 92 push r14 dd32: ff 92 push r15 dd34: cf 93 push r28 dd36: 9b 01 movw r18, r22 dd38: ac 01 movw r20, r24 float travel_z = current_position[Z_AXIS]; dd3a: c0 90 4b 07 lds r12, 0x074B ; 0x80074b dd3e: d0 90 4c 07 lds r13, 0x074C ; 0x80074c dd42: e0 90 4d 07 lds r14, 0x074D ; 0x80074d dd46: f0 90 4e 07 lds r15, 0x074E ; 0x80074e // Prepare to move Z axis current_position[Z_AXIS] += delta; dd4a: c7 01 movw r24, r14 dd4c: b6 01 movw r22, r12 dd4e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> dd52: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b dd56: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c dd5a: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d dd5e: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) bool z_min_endstop = (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING); dd62: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) dd64: 90 91 42 07 lds r25, 0x0742 ; 0x800742 dd68: 91 11 cpse r25, r1 dd6a: 02 c0 rjmp .+4 ; 0xdd70 dd6c: 84 ff sbrs r24, 4 dd6e: 26 c0 rjmp .+76 ; 0xddbc { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); dd70: 83 e4 ldi r24, 0x43 ; 67 dd72: 97 e0 ldi r25, 0x07 ; 7 dd74: 0e 94 7e 6c call 0xd8fc ; 0xd8fc plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); dd78: e0 91 99 02 lds r30, 0x0299 ; 0x800299 dd7c: f0 91 9a 02 lds r31, 0x029A ; 0x80029a dd80: 60 85 ldd r22, Z+8 ; 0x08 dd82: 71 85 ldd r23, Z+9 ; 0x09 dd84: 82 85 ldd r24, Z+10 ; 0x0a dd86: 93 85 ldd r25, Z+11 ; 0x0b dd88: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); dd8c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; dd90: a7 01 movw r20, r14 dd92: 96 01 movw r18, r12 dd94: 60 91 4b 07 lds r22, 0x074B ; 0x80074b dd98: 70 91 4c 07 lds r23, 0x074C ; 0x80074c dd9c: 80 91 4d 07 lds r24, 0x074D ; 0x80074d dda0: 90 91 4e 07 lds r25, 0x074E ; 0x80074e dda4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> dda8: 6b 01 movw r12, r22 ddaa: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } ddac: c7 01 movw r24, r14 ddae: b6 01 movw r22, r12 ddb0: cf 91 pop r28 ddb2: ff 90 pop r15 ddb4: ef 90 pop r14 ddb6: df 90 pop r13 ddb8: cf 90 pop r12 ddba: 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(); ddbc: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); ddbe: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); ddc2: 81 e0 ldi r24, 0x01 ; 1 ddc4: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 ddc8: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); ddca: 84 e0 ldi r24, 0x04 ; 4 ddcc: 0f 94 93 3b call 0x27726 ; 0x27726 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); ddd0: 65 e5 ldi r22, 0x55 ; 85 ddd2: 75 e5 ldi r23, 0x55 ; 85 ddd4: 85 e5 ldi r24, 0x55 ; 85 ddd6: 91 e4 ldi r25, 0x41 ; 65 ddd8: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); dddc: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; dde0: 82 e0 ldi r24, 0x02 ; 2 dde2: 0f 94 18 59 call 0x2b230 ; 0x2b230 dde6: a7 01 movw r20, r14 dde8: 96 01 movw r18, r12 ddea: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> ddee: 6b 01 movw r12, r22 ddf0: 7c 01 movw r14, r24 #ifdef TMC2130 if (endstop_z_hit_on_purpose()) ddf2: 0f 94 68 64 call 0x2c8d0 ; 0x2c8d0 ddf6: 88 23 and r24, r24 ddf8: 91 f0 breq .+36 ; 0xde1e { // not necessarily exact, but will avoid further vertical moves current_position[Z_AXIS] = max_pos[Z_AXIS]; ddfa: 80 91 1d 02 lds r24, 0x021D ; 0x80021d ddfe: 90 91 1e 02 lds r25, 0x021E ; 0x80021e de02: a0 91 1f 02 lds r26, 0x021F ; 0x80021f de06: b0 91 20 02 lds r27, 0x0220 ; 0x800220 de0a: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b de0e: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c de12: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d de16: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_set_position_curposXYZE(); de1a: 0f 94 53 b9 call 0x372a6 ; 0x372a6 } tmc2130_home_exit(); de1e: 0f 94 64 3b call 0x276c8 ; 0x276c8 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); de22: 8c 2f mov r24, r28 de24: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 de28: c1 cf rjmp .-126 ; 0xddac 0000de2a : // // 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) { de2a: 8f 92 push r8 de2c: 9f 92 push r9 de2e: af 92 push r10 de30: bf 92 push r11 de32: cf 92 push r12 de34: df 92 push r13 de36: ef 92 push r14 de38: ff 92 push r15 de3a: 4b 01 movw r8, r22 de3c: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) de3e: c0 90 4b 07 lds r12, 0x074B ; 0x80074b de42: d0 90 4c 07 lds r13, 0x074C ; 0x80074c de46: e0 90 4d 07 lds r14, 0x074D ; 0x80074d de4a: f0 90 4e 07 lds r15, 0x074E ; 0x80074e de4e: ac 01 movw r20, r24 de50: 9b 01 movw r18, r22 de52: c7 01 movw r24, r14 de54: b6 01 movw r22, r12 de56: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> de5a: 87 ff sbrs r24, 7 de5c: 11 c0 rjmp .+34 ; 0xde80 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); de5e: a5 01 movw r20, r10 de60: 94 01 movw r18, r8 de62: c7 01 movw r24, r14 de64: b6 01 movw r22, r12 de66: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> de6a: 9f 77 andi r25, 0x7F ; 127 } de6c: ff 90 pop r15 de6e: ef 90 pop r14 de70: df 90 pop r13 de72: cf 90 pop r12 de74: bf 90 pop r11 de76: af 90 pop r10 de78: 9f 90 pop r9 de7a: 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)); de7c: 0c 94 96 6e jmp 0xdd2c ; 0xdd2c } de80: ff 90 pop r15 de82: ef 90 pop r14 de84: df 90 pop r13 de86: cf 90 pop r12 de88: bf 90 pop r11 de8a: af 90 pop r10 de8c: 9f 90 pop r9 de8e: 8f 90 pop r8 de90: 08 95 ret 0000de92 : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { de92: e0 e6 ldi r30, 0x60 ; 96 de94: 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; de96: 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]; de98: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty de9a: 8f 37 cpi r24, 0x7F ; 127 de9c: 31 f0 breq .+12 ; 0xdeaa de9e: df 01 movw r26, r30 dea0: 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 dea2: 87 ff sbrs r24, 7 dea4: 07 c0 rjmp .+14 ; 0xdeb4 lcd_custom_characters[i] = c & 0x7F; dea6: 8f 77 andi r24, 0x7F ; 127 dea8: 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++) { deaa: 83 e0 ldi r24, 0x03 ; 3 deac: e8 36 cpi r30, 0x68 ; 104 deae: f8 07 cpc r31, r24 deb0: 99 f7 brne .-26 ; 0xde98 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } deb2: 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; deb4: 9c 93 st X, r25 deb6: f9 cf rjmp .-14 ; 0xdeaa 0000deb8 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) deb8: 90 91 6d 02 lds r25, 0x026D ; 0x80026d debc: 98 17 cp r25, r24 debe: 10 f4 brcc .+4 ; 0xdec4 lcd_draw_update = lcdDrawUpdateOverride; dec0: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d if (!lcd_update_enabled) return; dec4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e dec8: 88 23 and r24, r24 deca: 39 f0 breq .+14 ; 0xdeda if (lcd_lcdupdate_func) decc: e0 91 0f 04 lds r30, 0x040F ; 0x80040f ded0: f0 91 10 04 lds r31, 0x0410 ; 0x800410 ded4: 30 97 sbiw r30, 0x00 ; 0 ded6: 09 f0 breq .+2 ; 0xdeda lcd_lcdupdate_func(); ded8: 19 94 eijmp } deda: 08 95 ret 0000dedc : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { dedc: cf 93 push r28 dede: df 93 push r29 dee0: cd b7 in r28, 0x3d ; 61 dee2: de b7 in r29, 0x3e ; 62 dee4: ae 01 movw r20, r28 dee6: 4a 5f subi r20, 0xFA ; 250 dee8: 5f 4f sbci r21, 0xFF ; 255 deea: fa 01 movw r30, r20 deec: 61 91 ld r22, Z+ deee: 71 91 ld r23, Z+ def0: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); def2: 8f ef ldi r24, 0xFF ; 255 def4: 93 e0 ldi r25, 0x03 ; 3 def6: 0f 94 d8 dc call 0x3b9b0 ; 0x3b9b0 va_end(args); return ret; } defa: df 91 pop r29 defc: cf 91 pop r28 defe: 08 95 ret 0000df00 : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); df00: 6f ef ldi r22, 0xFF ; 255 df02: 73 e0 ldi r23, 0x03 ; 3 df04: 0d 94 29 dc jmp 0x3b852 ; 0x3b852 0000df08 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); df08: 6f ef ldi r22, 0xFF ; 255 df0a: 73 e0 ldi r23, 0x03 ; 3 df0c: 08 2e mov r0, r24 df0e: 00 0c add r0, r0 df10: 99 0b sbc r25, r25 df12: 0d 94 f9 db jmp 0x3b7f2 ; 0x3b7f2 0000df16 : va_end(args); return ret; } void lcd_space(uint8_t n) { df16: cf 93 push r28 df18: c8 2f mov r28, r24 while (n--) lcd_putc(' '); df1a: c1 50 subi r28, 0x01 ; 1 df1c: 20 f0 brcs .+8 ; 0xdf26 df1e: 80 e2 ldi r24, 0x20 ; 32 df20: 0e 94 84 6f call 0xdf08 ; 0xdf08 df24: fa cf rjmp .-12 ; 0xdf1a } df26: cf 91 pop r28 df28: 08 95 ret 0000df2a : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { df2a: cf 93 push r28 df2c: c8 2f mov r28, r24 df2e: 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); df30: 64 30 cpi r22, 0x04 ; 4 df32: 08 f0 brcs .+2 ; 0xdf36 df34: 83 e0 ldi r24, 0x03 ; 3 df36: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f } void lcd_set_cursor(uint8_t col, uint8_t row) { lcd_set_current_row(row); uint8_t addr = col + lcd_get_row_offset(lcd_currline); df3a: 0e 94 af 5b call 0xb75e ; 0xb75e df3e: 8c 0f add r24, r28 lcd_ddram_address = addr; df40: 80 93 5e 03 sts 0x035E, r24 ; 0x80035e delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df44: 44 e6 ldi r20, 0x64 ; 100 df46: 50 e0 ldi r21, 0x00 ; 0 df48: 60 e0 ldi r22, 0x00 ; 0 df4a: 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); } df4c: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df4e: 0c 94 bc 64 jmp 0xc978 ; 0xc978 0000df52 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { df52: cf 93 push r28 df54: df 93 push r29 df56: ea 01 movw r28, r20 lcd_set_cursor(c, r); df58: 0e 94 95 6f call 0xdf2a ; 0xdf2a return fputs_P(str, lcdout); df5c: 6f ef ldi r22, 0xFF ; 255 df5e: 73 e0 ldi r23, 0x03 ; 3 df60: ce 01 movw r24, r28 } df62: df 91 pop r29 df64: 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); df66: 0d 94 29 dc jmp 0x3b852 ; 0x3b852 0000df6a : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { df6a: cf 93 push r28 df6c: c4 2f mov r28, r20 lcd_set_cursor(c, r); df6e: 0e 94 95 6f call 0xdf2a ; 0xdf2a return fputc(ch, lcdout); df72: 6f ef ldi r22, 0xFF ; 255 df74: 73 e0 ldi r23, 0x03 ; 3 df76: 8c 2f mov r24, r28 df78: cc 0f add r28, r28 df7a: 99 0b sbc r25, r25 } df7c: 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); df7e: 0d 94 f9 db jmp 0x3b7f2 ; 0x3b7f2 0000df82 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); df82: 60 e0 ldi r22, 0x00 ; 0 df84: 80 e0 ldi r24, 0x00 ; 0 df86: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_ddram_address = 0; df8a: 10 92 5e 03 sts 0x035E, r1 ; 0x80035e } df8e: 08 95 ret 0000df90 : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df90: 40 e4 ldi r20, 0x40 ; 64 df92: 56 e0 ldi r21, 0x06 ; 6 df94: 60 e0 ldi r22, 0x00 ; 0 df96: 81 e0 ldi r24, 0x01 ; 1 df98: 0e 94 bc 64 call 0xc978 ; 0xc978 // 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; df9c: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f lcd_ddram_address = 0; dfa0: 10 92 5e 03 sts 0x035E, r1 ; 0x80035e lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); dfa4: 48 e0 ldi r20, 0x08 ; 8 dfa6: 50 e0 ldi r21, 0x00 ; 0 dfa8: 6f e7 ldi r22, 0x7F ; 127 dfaa: 70 e0 ldi r23, 0x00 ; 0 dfac: 80 e6 ldi r24, 0x60 ; 96 dfae: 93 e0 ldi r25, 0x03 ; 3 dfb0: 0d 94 c3 e3 jmp 0x3c786 ; 0x3c786 0000dfb4 : } 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) dfb4: 90 91 6e 02 lds r25, 0x026E ; 0x80026e dfb8: 98 17 cp r25, r24 dfba: 09 f1 breq .+66 ; 0xdffe { lcd_update_enabled = enabled; dfbc: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e if (enabled) dfc0: 88 23 and r24, r24 dfc2: e9 f0 breq .+58 ; 0xdffe { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; dfc4: 10 92 38 05 sts 0x0538, r1 ; 0x800538 dfc8: 10 92 37 05 sts 0x0537, r1 ; 0x800537 lcd_encoder_diff = 0; dfcc: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.560> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); dfd0: 88 ed ldi r24, 0xD8 ; 216 dfd2: 93 e0 ldi r25, 0x03 ; 3 dfd4: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; dfd8: 0f 94 8b 3f call 0x27f16 ; 0x27f16 dfdc: 61 50 subi r22, 0x01 ; 1 dfde: 71 09 sbc r23, r1 dfe0: 81 09 sbc r24, r1 dfe2: 91 09 sbc r25, r1 dfe4: 60 93 d4 03 sts 0x03D4, r22 ; 0x8003d4 dfe8: 70 93 d5 03 sts 0x03D5, r23 ; 0x8003d5 dfec: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 dff0: 90 93 d7 03 sts 0x03D7, r25 ; 0x8003d7 // Full update. lcd_clear(); dff4: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_update(2); dff8: 82 e0 ldi r24, 0x02 ; 2 dffa: 0c 94 5c 6f jmp 0xdeb8 ; 0xdeb8 } else { // Clear the LCD always, or let it to the caller? } } } dffe: 08 95 ret 0000e000 : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { e000: cf 93 push r28 e002: c8 2f mov r28, r24 lcd_currline = 0; e004: 10 92 5f 03 sts 0x035F, r1 ; 0x80035f lcd_ddram_address = 0; e008: 10 92 5e 03 sts 0x035E, r1 ; 0x80035e lcd_send(charToSend, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); e00c: 48 e0 ldi r20, 0x08 ; 8 e00e: 50 e0 ldi r21, 0x00 ; 0 e010: 6f e7 ldi r22, 0x7F ; 127 e012: 70 e0 ldi r23, 0x00 ; 0 e014: 80 e6 ldi r24, 0x60 ; 96 e016: 93 e0 ldi r25, 0x03 ; 3 e018: 0f 94 c3 e3 call 0x3c786 ; 0x3c786 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 e01c: 44 e9 ldi r20, 0x94 ; 148 e01e: 51 e1 ldi r21, 0x11 ; 17 e020: 62 e0 ldi r22, 0x02 ; 2 e022: 80 e3 ldi r24, 0x30 ; 48 e024: 0e 94 bc 64 call 0xc978 ; 0xc978 // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e028: 46 e9 ldi r20, 0x96 ; 150 e02a: 50 e0 ldi r21, 0x00 ; 0 e02c: 62 e0 ldi r22, 0x02 ; 2 e02e: 80 e3 ldi r24, 0x30 ; 48 e030: 0e 94 bc 64 call 0xc978 ; 0xc978 // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e034: 46 e9 ldi r20, 0x96 ; 150 e036: 50 e0 ldi r21, 0x00 ; 0 e038: 62 e0 ldi r22, 0x02 ; 2 e03a: 80 e3 ldi r24, 0x30 ; 48 e03c: 0e 94 bc 64 call 0xc978 ; 0xc978 #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e040: 46 e9 ldi r20, 0x96 ; 150 e042: 50 e0 ldi r21, 0x00 ; 0 e044: 62 e0 ldi r22, 0x02 ; 2 e046: 80 e2 ldi r24, 0x20 ; 32 e048: 0e 94 bc 64 call 0xc978 ; 0xc978 #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e04c: 80 91 0d 04 lds r24, 0x040D ; 0x80040d <_ZL19lcd_displayfunction.lto_priv.570> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e050: 44 e6 ldi r20, 0x64 ; 100 e052: 50 e0 ldi r21, 0x00 ; 0 e054: 60 e0 ldi r22, 0x00 ; 0 e056: 80 62 ori r24, 0x20 ; 32 e058: 0e 94 bc 64 call 0xc978 ; 0xc978 } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e05c: 84 e0 ldi r24, 0x04 ; 4 e05e: 80 93 5d 03 sts 0x035D, r24 ; 0x80035d delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e062: 44 e6 ldi r20, 0x64 ; 100 e064: 50 e0 ldi r21, 0x00 ; 0 e066: 60 e0 ldi r22, 0x00 ; 0 e068: 8c e0 ldi r24, 0x0C ; 12 e06a: 0e 94 bc 64 call 0xc978 ; 0xc978 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(); e06e: c1 11 cpse r28, r1 e070: 0e 94 c8 6f call 0xdf90 ; 0xdf90 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e074: 44 e6 ldi r20, 0x64 ; 100 e076: 50 e0 ldi r21, 0x00 ; 0 e078: 60 e0 ldi r22, 0x00 ; 0 e07a: 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); } e07c: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e07e: 0c 94 bc 64 jmp 0xc978 ; 0xc978 0000e082 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e082: 81 e0 ldi r24, 0x01 ; 1 e084: 0c 94 00 70 jmp 0xe000 ; 0xe000 0000e088 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e088: cf 92 push r12 e08a: df 92 push r13 e08c: ff 92 push r15 e08e: 0f 93 push r16 e090: 1f 93 push r17 e092: cf 93 push r28 e094: df 93 push r29 e096: 00 d0 rcall .+0 ; 0xe098 e098: 00 d0 rcall .+0 ; 0xe09a e09a: 1f 92 push r1 e09c: 1f 92 push r1 e09e: cd b7 in r28, 0x3d ; 61 e0a0: de b7 in r29, 0x3e ; 62 if (value == '\n') { e0a2: 8a 30 cpi r24, 0x0A ; 10 e0a4: d9 f4 brne .+54 ; 0xe0dc if (lcd_currline > 3) lcd_currline = -1; e0a6: 80 91 5f 03 lds r24, 0x035F ; 0x80035f e0aa: 84 30 cpi r24, 0x04 ; 4 e0ac: 18 f0 brcs .+6 ; 0xe0b4 e0ae: 8f ef ldi r24, 0xFF ; 255 e0b0: 80 93 5f 03 sts 0x035F, r24 ; 0x80035f lcd_set_cursor(0, lcd_currline + 1); // LF e0b4: 60 91 5f 03 lds r22, 0x035F ; 0x80035f e0b8: 6f 5f subi r22, 0xFF ; 255 e0ba: 80 e0 ldi r24, 0x00 ; 0 e0bc: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e0c0: 28 96 adiw r28, 0x08 ; 8 e0c2: 0f b6 in r0, 0x3f ; 63 e0c4: f8 94 cli e0c6: de bf out 0x3e, r29 ; 62 e0c8: 0f be out 0x3f, r0 ; 63 e0ca: cd bf out 0x3d, r28 ; 61 e0cc: df 91 pop r29 e0ce: cf 91 pop r28 e0d0: 1f 91 pop r17 e0d2: 0f 91 pop r16 e0d4: ff 90 pop r15 e0d6: df 90 pop r13 e0d8: cf 90 pop r12 e0da: 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))) { e0dc: 90 e8 ldi r25, 0x80 ; 128 e0de: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e0e0: 44 e6 ldi r20, 0x64 ; 100 e0e2: 50 e0 ldi r21, 0x00 ; 0 e0e4: 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))) { e0e6: 9a 34 cpi r25, 0x4A ; 74 e0e8: 08 f5 brcc .+66 ; 0xe12c // 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. e0ea: 48 2f mov r20, r24 e0ec: 40 58 subi r20, 0x80 ; 128 e0ee: 55 0b sbc r21, r21 e0f0: 9a 01 movw r18, r20 e0f2: 96 e0 ldi r25, 0x06 ; 6 e0f4: 92 9f mul r25, r18 e0f6: a0 01 movw r20, r0 e0f8: 93 9f mul r25, r19 e0fa: 50 0d add r21, r0 e0fc: 11 24 eor r1, r1 e0fe: fa 01 movw r30, r20 e100: ed 5a subi r30, 0xAD ; 173 e102: f5 48 sbci r31, 0x85 ; 133 e104: f4 90 lpm r15, Z e106: e0 e6 ldi r30, 0x60 ; 96 e108: f3 e0 ldi r31, 0x03 ; 3 e10a: 30 e0 ldi r19, 0x00 ; 0 e10c: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e10e: 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)) { e110: 61 91 ld r22, Z+ e112: 78 2f mov r23, r24 e114: 76 27 eor r23, r22 e116: 7f 77 andi r23, 0x7F ; 127 e118: 89 f4 brne .+34 ; 0xe13c lcd_custom_characters[i] = c; // mark the custom character as used e11a: f9 01 movw r30, r18 e11c: e0 5a subi r30, 0xA0 ; 160 e11e: fc 4f sbci r31, 0xFC ; 252 e120: 80 83 st Z, r24 e122: 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); e124: 44 e6 ldi r20, 0x64 ; 100 e126: 50 e0 ldi r21, 0x00 ; 0 e128: 61 e0 ldi r22, 0x01 ; 1 e12a: 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); e12c: 0e 94 bc 64 call 0xc978 ; 0xc978 lcd_ddram_address++; // no need for preventing ddram overflow e130: 80 91 5e 03 lds r24, 0x035E ; 0x80035e e134: 8f 5f subi r24, 0xFF ; 255 e136: 80 93 5e 03 sts 0x035E, r24 ; 0x80035e e13a: c2 cf rjmp .-124 ; 0xe0c0 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 e13c: 6f 37 cpi r22, 0x7F ; 127 e13e: 09 f0 breq .+2 ; 0xe142 e140: 3c c0 rjmp .+120 ; 0xe1ba lcd_custom_characters[i] = c; // mark the custom character as used e142: f9 01 movw r30, r18 e144: e0 5a subi r30, 0xA0 ; 160 e146: fc 4f sbci r31, 0xFC ; 252 e148: 80 83 st Z, r24 slotToUse = i; e14a: 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; e14c: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e14e: fa 01 movw r30, r20 e150: e2 5b subi r30, 0xB2 ; 178 e152: f5 48 sbci r31, 0x85 ; 133 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e154: 8e 01 movw r16, r28 e156: 0f 5f subi r16, 0xFF ; 255 e158: 1f 4f sbci r17, 0xFF ; 255 e15a: d8 01 movw r26, r16 e15c: 95 91 lpm r25, Z+ e15e: 88 e0 ldi r24, 0x08 ; 8 e160: 18 2e mov r1, r24 0000e162 : e162: 10 fe sbrs r1, 0 e164: 05 90 lpm r0, Z+ e166: 02 94 swap r0 e168: 80 2d mov r24, r0 e16a: 97 95 ror r25 e16c: 88 1f adc r24, r24 e16e: 8d 93 st X+, r24 e170: 1a 94 dec r1 e172: b9 f7 brne .-18 ; 0xe162 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e174: bf 2d mov r27, r15 e176: e8 e0 ldi r30, 0x08 ; 8 e178: be 02 muls r27, r30 e17a: c0 01 movw r24, r0 e17c: 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); e17e: 44 e6 ldi r20, 0x64 ; 100 e180: 50 e0 ldi r21, 0x00 ; 0 e182: 60 e0 ldi r22, 0x00 ; 0 e184: 80 64 ori r24, 0x40 ; 64 e186: 0e 94 bc 64 call 0xc978 ; 0xc978 e18a: 6e 01 movw r12, r28 e18c: f9 e0 ldi r31, 0x09 ; 9 e18e: cf 0e add r12, r31 e190: 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); e192: 44 e6 ldi r20, 0x64 ; 100 e194: 50 e0 ldi r21, 0x00 ; 0 e196: 61 e0 ldi r22, 0x01 ; 1 e198: d8 01 movw r26, r16 e19a: 8d 91 ld r24, X+ e19c: 8d 01 movw r16, r26 e19e: 0e 94 bc 64 call 0xc978 ; 0xc978 : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e1a2: c0 16 cp r12, r16 e1a4: d1 06 cpc r13, r17 e1a6: a9 f7 brne .-22 ; 0xe192 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e1a8: 80 91 5e 03 lds r24, 0x035E ; 0x80035e delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1ac: 44 e6 ldi r20, 0x64 ; 100 e1ae: 50 e0 ldi r21, 0x00 ; 0 e1b0: 60 e0 ldi r22, 0x00 ; 0 e1b2: 80 68 ori r24, 0x80 ; 128 e1b4: 0e 94 bc 64 call 0xc978 ; 0xc978 e1b8: b5 cf rjmp .-150 ; 0xe124 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 e1ba: 67 ff sbrs r22, 7 slotToUse = i; e1bc: 92 2f mov r25, r18 e1be: 2f 5f subi r18, 0xFF ; 255 e1c0: 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++) { e1c2: 28 30 cpi r18, 0x08 ; 8 e1c4: 31 05 cpc r19, r1 e1c6: 09 f0 breq .+2 ; 0xe1ca e1c8: a3 cf rjmp .-186 ; 0xe110 } // 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) { e1ca: 9f 3f cpi r25, 0xFF ; 255 e1cc: 09 f0 breq .+2 ; 0xe1d0 e1ce: be cf rjmp .-132 ; 0xe14c e1d0: a9 cf rjmp .-174 ; 0xe124 0000e1d2 : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e1d2: 8f 92 push r8 e1d4: 9f 92 push r9 e1d6: af 92 push r10 e1d8: bf 92 push r11 e1da: ef 92 push r14 e1dc: ff 92 push r15 e1de: 0f 93 push r16 e1e0: 1f 93 push r17 e1e2: cf 93 push r28 e1e4: df 93 push r29 e1e6: cd b7 in r28, 0x3d ; 61 e1e8: de b7 in r29, 0x3e ; 62 e1ea: a0 97 sbiw r28, 0x20 ; 32 e1ec: 0f b6 in r0, 0x3f ; 63 e1ee: f8 94 cli e1f0: de bf out 0x3e, r29 ; 62 e1f2: 0f be out 0x3f, r0 ; 63 e1f4: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e1f6: 61 15 cp r22, r1 e1f8: 71 05 cpc r23, r1 e1fa: 81 05 cpc r24, r1 e1fc: 91 05 cpc r25, r1 e1fe: 99 f4 brne .+38 ; 0xe226 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e200: 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)); } e202: a0 96 adiw r28, 0x20 ; 32 e204: 0f b6 in r0, 0x3f ; 63 e206: f8 94 cli e208: de bf out 0x3e, r29 ; 62 e20a: 0f be out 0x3f, r0 ; 63 e20c: cd bf out 0x3d, r28 ; 61 e20e: df 91 pop r29 e210: cf 91 pop r28 e212: 1f 91 pop r17 e214: 0f 91 pop r16 e216: ff 90 pop r15 e218: ef 90 pop r14 e21a: bf 90 pop r11 e21c: af 90 pop r10 e21e: 9f 90 pop r9 e220: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e222: 0c 94 44 70 jmp 0xe088 ; 0xe088 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e226: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e228: 84 2e mov r8, r20 e22a: 91 2c mov r9, r1 e22c: b1 2c mov r11, r1 e22e: a1 2c mov r10, r1 e230: 9e 01 movw r18, r28 e232: 2f 5f subi r18, 0xFF ; 255 e234: 3f 4f sbci r19, 0xFF ; 255 e236: 79 01 movw r14, r18 e238: a5 01 movw r20, r10 e23a: 94 01 movw r18, r8 e23c: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> e240: f7 01 movw r30, r14 e242: e0 0f add r30, r16 e244: f1 1d adc r31, r1 e246: 60 83 st Z, r22 n /= base; e248: b9 01 movw r22, r18 e24a: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e24c: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e24e: 61 15 cp r22, r1 e250: 71 05 cpc r23, r1 e252: 81 05 cpc r24, r1 e254: 91 05 cpc r25, r1 e256: 81 f7 brne .-32 ; 0xe238 e258: 0e 0d add r16, r14 e25a: 1f 2d mov r17, r15 e25c: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e25e: e0 16 cp r14, r16 e260: f1 06 cpc r15, r17 e262: 59 f0 breq .+22 ; 0xe27a lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e264: f8 01 movw r30, r16 e266: 82 91 ld r24, -Z e268: 8f 01 movw r16, r30 e26a: 8a 30 cpi r24, 0x0A ; 10 e26c: 20 f4 brcc .+8 ; 0xe276 e26e: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e270: 0e 94 44 70 call 0xe088 ; 0xe088 e274: f4 cf rjmp .-24 ; 0xe25e { 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)); e276: 89 5c subi r24, 0xC9 ; 201 e278: fb cf rjmp .-10 ; 0xe270 } e27a: a0 96 adiw r28, 0x20 ; 32 e27c: 0f b6 in r0, 0x3f ; 63 e27e: f8 94 cli e280: de bf out 0x3e, r29 ; 62 e282: 0f be out 0x3f, r0 ; 63 e284: cd bf out 0x3d, r28 ; 61 e286: df 91 pop r29 e288: cf 91 pop r28 e28a: 1f 91 pop r17 e28c: 0f 91 pop r16 e28e: ff 90 pop r15 e290: ef 90 pop r14 e292: bf 90 pop r11 e294: af 90 pop r10 e296: 9f 90 pop r9 e298: 8f 90 pop r8 e29a: 08 95 ret 0000e29c : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e29c: cf 92 push r12 e29e: df 92 push r13 e2a0: ef 92 push r14 e2a2: ff 92 push r15 e2a4: 6b 01 movw r12, r22 e2a6: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e2a8: f7 fe sbrs r15, 7 e2aa: 0b c0 rjmp .+22 ; 0xe2c2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e2ac: 8d e2 ldi r24, 0x2D ; 45 e2ae: 0e 94 44 70 call 0xe088 ; 0xe088 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e2b2: f0 94 com r15 e2b4: e0 94 com r14 e2b6: d0 94 com r13 e2b8: c0 94 com r12 e2ba: c1 1c adc r12, r1 e2bc: d1 1c adc r13, r1 e2be: e1 1c adc r14, r1 e2c0: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e2c2: 4a e0 ldi r20, 0x0A ; 10 e2c4: c7 01 movw r24, r14 e2c6: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e2c8: ff 90 pop r15 e2ca: ef 90 pop r14 e2cc: df 90 pop r13 e2ce: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e2d0: 0c 94 e9 70 jmp 0xe1d2 ; 0xe1d2 0000e2d4 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e2d4: 0f 93 push r16 e2d6: 1f 93 push r17 e2d8: cf 93 push r28 e2da: 8c 01 movw r16, r24 e2dc: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e2de: cc 23 and r28, r28 e2e0: 59 f0 breq .+22 ; 0xe2f8 e2e2: f8 01 movw r30, r16 e2e4: 24 91 lpm r18, Z e2e6: 22 23 and r18, r18 e2e8: 39 f0 breq .+14 ; 0xe2f8 lcd_write(pgm_read_byte(s++)); e2ea: 0f 5f subi r16, 0xFF ; 255 e2ec: 1f 4f sbci r17, 0xFF ; 255 e2ee: 84 91 lpm r24, Z e2f0: 0e 94 44 70 call 0xe088 ; 0xe088 --len; e2f4: c1 50 subi r28, 0x01 ; 1 e2f6: f3 cf rjmp .-26 ; 0xe2de } lcd_space(len); e2f8: 8c 2f mov r24, r28 e2fa: 0e 94 8b 6f call 0xdf16 ; 0xdf16 return len; } e2fe: 8c 2f mov r24, r28 e300: cf 91 pop r28 e302: 1f 91 pop r17 e304: 0f 91 pop r16 e306: 08 95 ret 0000e308 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e308: 0f 93 push r16 e30a: 1f 93 push r17 e30c: cf 93 push r28 e30e: 8c 01 movw r16, r24 e310: c6 2f mov r28, r22 while (len && *s) { e312: cc 23 and r28, r28 e314: 49 f0 breq .+18 ; 0xe328 e316: f8 01 movw r30, r16 e318: 81 91 ld r24, Z+ e31a: 8f 01 movw r16, r30 e31c: 88 23 and r24, r24 e31e: 21 f0 breq .+8 ; 0xe328 lcd_write(*(s++)); e320: 0e 94 44 70 call 0xe088 ; 0xe088 --len; e324: c1 50 subi r28, 0x01 ; 1 e326: f5 cf rjmp .-22 ; 0xe312 } lcd_space(len); e328: 8c 2f mov r24, r28 e32a: 0e 94 8b 6f call 0xdf16 ; 0xdf16 return len; } e32e: 8c 2f mov r24, r28 e330: cf 91 pop r28 e332: 1f 91 pop r17 e334: 0f 91 pop r16 e336: 08 95 ret 0000e338 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e338: cf 93 push r28 e33a: df 93 push r29 e33c: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e33e: 89 91 ld r24, Y+ e340: 88 23 and r24, r24 e342: 19 f0 breq .+6 ; 0xe34a e344: 0e 94 44 70 call 0xe088 ; 0xe088 e348: fa cf rjmp .-12 ; 0xe33e } e34a: df 91 pop r29 e34c: cf 91 pop r28 e34e: 08 95 ret 0000e350 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e350: 0e 94 44 70 call 0xe088 ; 0xe088 return 0; } e354: 90 e0 ldi r25, 0x00 ; 0 e356: 80 e0 ldi r24, 0x00 ; 0 e358: 08 95 ret 0000e35a : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e35a: 10 92 a8 03 sts 0x03A8, r1 ; 0x8003a8 lcd_longpress_trigger = 0; e35e: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 } e362: 08 95 ret 0000e364 : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e364: cf 93 push r28 bool clicked = LCD_CLICKED; e366: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 e36a: c1 e0 ldi r28, 0x01 ; 1 e36c: 81 11 cpse r24, r1 e36e: 04 c0 rjmp .+8 ; 0xe378 e370: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e372: 8c 2f mov r24, r28 e374: cf 91 pop r28 e376: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e378: 0e 94 ad 71 call 0xe35a ; 0xe35a e37c: fa cf rjmp .-12 ; 0xe372 0000e37e : 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 e37e: e0 e0 ldi r30, 0x00 ; 0 e380: f1 e0 ldi r31, 0x01 ; 1 e382: 85 91 lpm r24, Z+ e384: 95 91 lpm r25, Z+ e386: a5 91 lpm r26, Z+ e388: b4 91 lpm r27, Z e38a: 85 3a cpi r24, 0xA5 ; 165 e38c: 9a 45 sbci r25, 0x5A ; 90 e38e: a4 4b sbci r26, 0xB4 ; 180 e390: bb 44 sbci r27, 0x4B ; 75 e392: 29 f4 brne .+10 ; 0xe39e return pgm_read_word(((uint32_t*)(ui + 10))); //return lang code from progmem e394: ea e0 ldi r30, 0x0A ; 10 e396: f1 e0 ldi r31, 0x01 ; 1 e398: 85 91 lpm r24, Z+ e39a: 94 91 lpm r25, Z e39c: 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 e39e: 8f e3 ldi r24, 0x3F ; 63 e3a0: 9f e3 ldi r25, 0x3F ; 63 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e3a2: 08 95 ret 0000e3a4 : 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); e3a4: 8e ef ldi r24, 0xFE ; 254 e3a6: 9f e0 ldi r25, 0x0F ; 15 e3a8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e3ac: 8e 3f cpi r24, 0xFE ; 254 e3ae: 39 f0 breq .+14 ; 0xe3be e3b0: 91 e0 ldi r25, 0x01 ; 1 e3b2: 20 91 5c 03 lds r18, 0x035C ; 0x80035c e3b6: 28 13 cpse r18, r24 e3b8: 90 e0 ldi r25, 0x00 ; 0 e3ba: 89 2f mov r24, r25 e3bc: 08 95 ret e3be: 80 e0 ldi r24, 0x00 ; 0 } e3c0: 08 95 ret 0000e3c2 : return _n("??"); } void lang_reset(void) { lang_selected = 0; e3c2: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e3c6: 6e ef ldi r22, 0xFE ; 254 e3c8: 8e ef ldi r24, 0xFE ; 254 e3ca: 9f e0 ldi r25, 0x0F ; 15 e3cc: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0000e3d0 : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e3d0: 85 37 cpi r24, 0x75 ; 117 e3d2: 28 e6 ldi r18, 0x68 ; 104 e3d4: 92 07 cpc r25, r18 e3d6: 09 f4 brne .+2 ; 0xe3da e3d8: 59 c0 rjmp .+178 ; 0xe48c e3da: f8 f4 brcc .+62 ; 0xe41a e3dc: 8e 36 cpi r24, 0x6E ; 110 e3de: 25 e6 ldi r18, 0x65 ; 101 e3e0: 92 07 cpc r25, r18 e3e2: 09 f4 brne .+2 ; 0xe3e6 e3e4: 59 c0 rjmp .+178 ; 0xe498 e3e6: 50 f4 brcc .+20 ; 0xe3fc e3e8: 83 37 cpi r24, 0x73 ; 115 e3ea: 23 e6 ldi r18, 0x63 ; 99 e3ec: 92 07 cpc r25, r18 e3ee: b1 f1 breq .+108 ; 0xe45c e3f0: 85 36 cpi r24, 0x65 ; 101 e3f2: 94 46 sbci r25, 0x64 ; 100 e3f4: b1 f1 breq .+108 ; 0xe462 //#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("??"); e3f6: 80 e4 ldi r24, 0x40 ; 64 e3f8: 96 e6 ldi r25, 0x66 ; 102 e3fa: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e3fc: 82 37 cpi r24, 0x72 ; 114 e3fe: 26 e6 ldi r18, 0x66 ; 102 e400: 92 07 cpc r25, r18 e402: 91 f1 breq .+100 ; 0xe468 e404: 82 37 cpi r24, 0x72 ; 114 e406: 28 e6 ldi r18, 0x68 ; 104 e408: 92 07 cpc r25, r18 e40a: 09 f4 brne .+2 ; 0xe40e e40c: 42 c0 rjmp .+132 ; 0xe492 e40e: 83 37 cpi r24, 0x73 ; 115 e410: 95 46 sbci r25, 0x65 ; 101 e412: 89 f7 brne .-30 ; 0xe3f6 { 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"); e414: 87 e9 ldi r24, 0x97 ; 151 e416: 96 e6 ldi r25, 0x66 ; 102 e418: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e41a: 8c 36 cpi r24, 0x6C ; 108 e41c: 20 e7 ldi r18, 0x70 ; 112 e41e: 92 07 cpc r25, r18 e420: 31 f1 breq .+76 ; 0xe46e e422: 70 f4 brcc .+28 ; 0xe440 e424: 8c 36 cpi r24, 0x6C ; 108 e426: 2e e6 ldi r18, 0x6E ; 110 e428: 92 07 cpc r25, r18 e42a: 21 f1 breq .+72 ; 0xe474 e42c: 8f 36 cpi r24, 0x6F ; 111 e42e: 2e e6 ldi r18, 0x6E ; 110 e430: 92 07 cpc r25, r18 e432: 31 f1 breq .+76 ; 0xe480 e434: 84 37 cpi r24, 0x74 ; 116 e436: 99 46 sbci r25, 0x69 ; 105 e438: f1 f6 brne .-68 ; 0xe3f6 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"); e43a: 85 e8 ldi r24, 0x85 ; 133 e43c: 96 e6 ldi r25, 0x66 ; 102 e43e: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e440: 8b 36 cpi r24, 0x6B ; 107 e442: 23 e7 ldi r18, 0x73 ; 115 e444: 92 07 cpc r25, r18 e446: f9 f0 breq .+62 ; 0xe486 e448: 86 37 cpi r24, 0x76 ; 118 e44a: 23 e7 ldi r18, 0x73 ; 115 e44c: 92 07 cpc r25, r18 e44e: a9 f0 breq .+42 ; 0xe47a e450: 8f 36 cpi r24, 0x6F ; 111 e452: 92 47 sbci r25, 0x72 ; 114 e454: 81 f6 brne .-96 ; 0xe3f6 #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 e456: 83 e4 ldi r24, 0x43 ; 67 e458: 96 e6 ldi r25, 0x66 ; 102 e45a: 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"); e45c: 87 ea ldi r24, 0xA7 ; 167 e45e: 96 e6 ldi r25, 0x66 ; 102 e460: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e462: 8f e9 ldi r24, 0x9F ; 159 e464: 96 e6 ldi r25, 0x66 ; 102 e466: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e468: 8e e8 ldi r24, 0x8E ; 142 e46a: 96 e6 ldi r25, 0x66 ; 102 e46c: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e46e: 8e e7 ldi r24, 0x7E ; 126 e470: 96 e6 ldi r25, 0x66 ; 102 e472: 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 e474: 83 e7 ldi r24, 0x73 ; 115 e476: 96 e6 ldi r25, 0x66 ; 102 e478: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e47a: 8b e6 ldi r24, 0x6B ; 107 e47c: 96 e6 ldi r25, 0x66 ; 102 e47e: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e480: 85 e6 ldi r24, 0x65 ; 101 e482: 96 e6 ldi r25, 0x66 ; 102 e484: 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 e486: 8a e5 ldi r24, 0x5A ; 90 e488: 96 e6 ldi r25, 0x66 ; 102 e48a: 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 e48c: 83 e5 ldi r24, 0x53 ; 83 e48e: 96 e6 ldi r25, 0x66 ; 102 e490: 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 e492: 8a e4 ldi r24, 0x4A ; 74 e494: 96 e6 ldi r25, 0x66 ; 102 e496: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e498: 8f ea ldi r24, 0xAF ; 175 e49a: 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("??"); } e49c: 08 95 ret 0000e49e : #endif //XFLASH return 0; } uint16_t lang_get_code(uint8_t lang) { e49e: cf 92 push r12 e4a0: df 92 push r13 e4a2: ef 92 push r14 e4a4: ff 92 push r15 e4a6: 1f 93 push r17 e4a8: cf 93 push r28 e4aa: df 93 push r29 e4ac: cd b7 in r28, 0x3d ; 61 e4ae: de b7 in r29, 0x3e ; 62 e4b0: 60 97 sbiw r28, 0x10 ; 16 e4b2: 0f b6 in r0, 0x3f ; 63 e4b4: f8 94 cli e4b6: de bf out 0x3e, r29 ; 62 e4b8: 0f be out 0x3f, r0 ; 63 e4ba: cd bf out 0x3d, r28 ; 61 if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e4bc: 88 23 and r24, r24 e4be: c1 f1 breq .+112 ; 0xe530 e4c0: 18 2f mov r17, r24 #ifdef XFLASH if (lang == LANG_ID_SEC) e4c2: 81 30 cpi r24, 0x01 ; 1 e4c4: 81 f4 brne .+32 ; 0xe4e6 e4c6: 0e 94 bf 71 call 0xe37e ; 0xe37e table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return LANG_CODE_XX; } e4ca: 60 96 adiw r28, 0x10 ; 16 e4cc: 0f b6 in r0, 0x3f ; 63 e4ce: f8 94 cli e4d0: de bf out 0x3e, r29 ; 62 e4d2: 0f be out 0x3f, r0 ; 63 e4d4: cd bf out 0x3d, r28 ; 61 e4d6: df 91 pop r29 e4d8: cf 91 pop r28 e4da: 1f 91 pop r17 e4dc: ff 90 pop r15 e4de: ef 90 pop r14 e4e0: df 90 pop r13 e4e2: cf 90 pop r12 e4e4: 08 95 ret SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e4e6: 8c e5 ldi r24, 0x5C ; 92 e4e8: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e4ea: 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--; e4ec: 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; e4ee: c1 2c mov r12, r1 e4f0: d1 2c mov r13, r1 e4f2: 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 e4f4: 20 e1 ldi r18, 0x10 ; 16 e4f6: 30 e0 ldi r19, 0x00 ; 0 e4f8: ae 01 movw r20, r28 e4fa: 4f 5f subi r20, 0xFF ; 255 e4fc: 5f 4f sbci r21, 0xFF ; 255 e4fe: c7 01 movw r24, r14 e500: b6 01 movw r22, r12 e502: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc if (header.magic != LANG_MAGIC) break; //break if not valid e506: 89 81 ldd r24, Y+1 ; 0x01 e508: 9a 81 ldd r25, Y+2 ; 0x02 e50a: ab 81 ldd r26, Y+3 ; 0x03 e50c: bc 81 ldd r27, Y+4 ; 0x04 e50e: 85 3a cpi r24, 0xA5 ; 165 e510: 9a 45 sbci r25, 0x5A ; 90 e512: a4 4b sbci r26, 0xB4 ; 180 e514: bb 44 sbci r27, 0x4B ; 75 e516: 79 f4 brne .+30 ; 0xe536 if (--lang == 0) return header.code; e518: 11 50 subi r17, 0x01 ; 1 e51a: 19 f4 brne .+6 ; 0xe522 e51c: 8b 85 ldd r24, Y+11 ; 0x0b e51e: 9c 85 ldd r25, Y+12 ; 0x0c e520: d4 cf rjmp .-88 ; 0xe4ca addr += header.size; //calc address of next table e522: 8d 81 ldd r24, Y+5 ; 0x05 e524: 9e 81 ldd r25, Y+6 ; 0x06 e526: c8 0e add r12, r24 e528: d9 1e adc r13, r25 e52a: e1 1c adc r14, r1 e52c: f1 1c adc r15, r1 e52e: e2 cf rjmp .-60 ; 0xe4f4 return 0; } uint16_t lang_get_code(uint8_t lang) { if (lang == LANG_ID_PRI) return LANG_CODE_EN; //primary lang = EN e530: 8e e6 ldi r24, 0x6E ; 110 e532: 95 e6 ldi r25, 0x65 ; 101 e534: ca cf rjmp .-108 ; 0xe4ca 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; e536: 8f e3 ldi r24, 0x3F ; 63 e538: 9f e3 ldi r25, 0x3F ; 63 e53a: c7 cf rjmp .-114 ; 0xe4ca 0000e53c : sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes return (sum == lt_sum); } uint8_t lang_get_count() { e53c: cf 92 push r12 e53e: df 92 push r13 e540: ef 92 push r14 e542: ff 92 push r15 e544: 1f 93 push r17 e546: cf 93 push r28 e548: df 93 push r29 e54a: cd b7 in r28, 0x3d ; 61 e54c: de b7 in r29, 0x3e ; 62 e54e: 60 97 sbiw r28, 0x10 ; 16 e550: 0f b6 in r0, 0x3f ; 63 e552: f8 94 cli e554: de bf out 0x3e, r29 ; 62 e556: 0f be out 0x3f, r0 ; 63 e558: cd bf out 0x3d, r28 ; 61 if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e55a: ea e4 ldi r30, 0x4A ; 74 e55c: fa e7 ldi r31, 0x7A ; 122 e55e: 85 91 lpm r24, Z+ e560: 95 91 lpm r25, Z+ e562: a5 91 lpm r26, Z+ e564: b4 91 lpm r27, Z return 1; //signature not set - only primary language will be available e566: 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) e568: 8f 3f cpi r24, 0xFF ; 255 e56a: 9f 4f sbci r25, 0xFF ; 255 e56c: af 4f sbci r26, 0xFF ; 255 e56e: bf 4f sbci r27, 0xFF ; 255 e570: 09 f1 breq .+66 ; 0xe5b4 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; e572: 8c e5 ldi r24, 0x5C ; 92 e574: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; e576: 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; e578: c1 2c mov r12, r1 e57a: d1 2c mov r13, r1 e57c: 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) e57e: 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 e580: 20 e1 ldi r18, 0x10 ; 16 e582: 30 e0 ldi r19, 0x00 ; 0 e584: ae 01 movw r20, r28 e586: 4f 5f subi r20, 0xFF ; 255 e588: 5f 4f sbci r21, 0xFF ; 255 e58a: c7 01 movw r24, r14 e58c: b6 01 movw r22, r12 e58e: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc if (header.magic != LANG_MAGIC) break; //break if magic not valid e592: 89 81 ldd r24, Y+1 ; 0x01 e594: 9a 81 ldd r25, Y+2 ; 0x02 e596: ab 81 ldd r26, Y+3 ; 0x03 e598: bc 81 ldd r27, Y+4 ; 0x04 e59a: 85 3a cpi r24, 0xA5 ; 165 e59c: 9a 45 sbci r25, 0x5A ; 90 e59e: a4 4b sbci r26, 0xB4 ; 180 e5a0: bb 44 sbci r27, 0x4B ; 75 e5a2: 41 f4 brne .+16 ; 0xe5b4 addr += header.size; //calc address of next table e5a4: 8d 81 ldd r24, Y+5 ; 0x05 e5a6: 9e 81 ldd r25, Y+6 ; 0x06 e5a8: c8 0e add r12, r24 e5aa: d9 1e adc r13, r25 e5ac: e1 1c adc r14, r1 e5ae: f1 1c adc r15, r1 count++; //inc counter e5b0: 1f 5f subi r17, 0xFF ; 255 e5b2: e6 cf rjmp .-52 ; 0xe580 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } e5b4: 81 2f mov r24, r17 e5b6: 60 96 adiw r28, 0x10 ; 16 e5b8: 0f b6 in r0, 0x3f ; 63 e5ba: f8 94 cli e5bc: de bf out 0x3e, r29 ; 62 e5be: 0f be out 0x3f, r0 ; 63 e5c0: cd bf out 0x3d, r28 ; 61 e5c2: df 91 pop r29 e5c4: cf 91 pop r28 e5c6: 1f 91 pop r17 e5c8: ff 90 pop r15 e5ca: ef 90 pop r14 e5cc: df 90 pop r13 e5ce: cf 90 pop r12 e5d0: 08 95 ret 0000e5d2 : 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) { e5d2: 0f 93 push r16 e5d4: 1f 93 push r17 e5d6: cf 93 push r28 e5d8: c8 2f mov r28, r24 if (lang == LANG_ID_PRI) //primary language e5da: 81 11 cpse r24, r1 e5dc: 06 c0 rjmp .+12 ; 0xe5ea { lang_table = 0; e5de: 10 92 5b 03 sts 0x035B, r1 ; 0x80035b e5e2: 10 92 5a 03 sts 0x035A, r1 ; 0x80035a lang_selected = lang; e5e6: 10 92 5c 03 sts 0x035C, r1 ; 0x80035c } #ifdef XFLASH if (lang_get_code(lang) == lang_get_code(LANG_ID_SEC)) lang = LANG_ID_SEC; e5ea: 8c 2f mov r24, r28 e5ec: 0e 94 4f 72 call 0xe49e ; 0xe49e e5f0: 8c 01 movw r16, r24 e5f2: 0e 94 bf 71 call 0xe37e ; 0xe37e e5f6: 08 17 cp r16, r24 e5f8: 19 07 cpc r17, r25 e5fa: 19 f0 breq .+6 ; 0xe602 if (lang == LANG_ID_SEC) //current secondary language e5fc: c1 30 cpi r28, 0x01 ; 1 e5fe: 09 f0 breq .+2 ; 0xe602 e600: 3e c0 rjmp .+124 ; 0xe67e { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid e602: e0 e0 ldi r30, 0x00 ; 0 e604: f1 e0 ldi r31, 0x01 ; 1 e606: 85 91 lpm r24, Z+ e608: 95 91 lpm r25, Z+ e60a: a5 91 lpm r26, Z+ e60c: b4 91 lpm r27, Z e60e: 85 3a cpi r24, 0xA5 ; 165 e610: 9a 45 sbci r25, 0x5A ; 90 e612: a4 4b sbci r26, 0xB4 ; 180 e614: bb 44 sbci r27, 0x4B ; 75 e616: 09 f0 breq .+2 ; 0xe61a e618: 31 c0 rjmp .+98 ; 0xe67c } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); e61a: e4 e0 ldi r30, 0x04 ; 4 e61c: f1 e0 ldi r31, 0x01 ; 1 e61e: 65 91 lpm r22, Z+ e620: 74 91 lpm r23, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); e622: e8 e0 ldi r30, 0x08 ; 8 e624: f1 e0 ldi r31, 0x01 ; 1 e626: 45 91 lpm r20, Z+ e628: 54 91 lpm r21, Z uint16_t i; for (i = 0; i < size; i++) e62a: 30 e0 ldi r19, 0x00 ; 0 e62c: 20 e0 ldi r18, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; e62e: 90 e0 ldi r25, 0x00 ; 0 e630: 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++) e632: 62 17 cp r22, r18 e634: 73 07 cpc r23, r19 e636: 89 f5 brne .+98 ; 0xe69a sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum e638: 84 1b sub r24, r20 e63a: 95 0b sbc r25, r21 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes e63c: 98 27 eor r25, r24 e63e: 89 27 eor r24, r25 e640: 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)) e642: 48 17 cp r20, r24 e644: 59 07 cpc r21, r25 e646: d1 f4 brne .+52 ; 0xe67c if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e648: ec e0 ldi r30, 0x0C ; 12 e64a: f1 e0 ldi r31, 0x01 ; 1 e64c: 45 91 lpm r20, Z+ e64e: 55 91 lpm r21, Z+ e650: 65 91 lpm r22, Z+ e652: 74 91 lpm r23, Z e654: ea e4 ldi r30, 0x4A ; 74 e656: fa e7 ldi r31, 0x7A ; 122 e658: 85 91 lpm r24, Z+ e65a: 95 91 lpm r25, Z+ e65c: a5 91 lpm r26, Z+ e65e: b4 91 lpm r27, Z e660: 48 17 cp r20, r24 e662: 59 07 cpc r21, r25 e664: 6a 07 cpc r22, r26 e666: 7b 07 cpc r23, r27 e668: 49 f4 brne .+18 ; 0xe67c { lang_table = (lang_table_t*)(_SEC_LANG_TABLE); // set table pointer e66a: 80 e0 ldi r24, 0x00 ; 0 e66c: 91 e0 ldi r25, 0x01 ; 1 e66e: 90 93 5b 03 sts 0x035B, r25 ; 0x80035b e672: 80 93 5a 03 sts 0x035A, r24 ; 0x80035a lang_selected = lang; // set language id e676: 81 e0 ldi r24, 0x01 ; 1 e678: 80 93 5c 03 sts 0x035C, r24 ; 0x80035c if (lang == LANG_ID_SEC) //current secondary language { if (pgm_read_dword(((uint32_t*)_SEC_LANG_TABLE)) == LANG_MAGIC) //magic valid { if (lang_check(_SEC_LANG_TABLE)) if (pgm_read_dword(((uint32_t*)(_SEC_LANG_TABLE + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid e67c: c1 e0 ldi r28, 0x01 ; 1 lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) e67e: 80 91 5c 03 lds r24, 0x035C ; 0x80035c e682: 8c 13 cpse r24, r28 e684: 1c c0 rjmp .+56 ; 0xe6be { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); e686: 6c 2f mov r22, r28 e688: 8e ef ldi r24, 0xFE ; 254 e68a: 9f e0 ldi r25, 0x0F ; 15 e68c: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a return 1; e690: 81 e0 ldi r24, 0x01 ; 1 } return 0; } e692: cf 91 pop r28 e694: 1f 91 pop r17 e696: 0f 91 pop r16 e698: 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); e69a: f9 01 movw r30, r18 e69c: e0 50 subi r30, 0x00 ; 0 e69e: ff 4f sbci r31, 0xFF ; 255 e6a0: e4 91 lpm r30, Z e6a2: f0 e0 ldi r31, 0x00 ; 0 e6a4: a8 e0 ldi r26, 0x08 ; 8 e6a6: 20 fd sbrc r18, 0 e6a8: a0 e0 ldi r26, 0x00 ; 0 e6aa: 02 c0 rjmp .+4 ; 0xe6b0 e6ac: ee 0f add r30, r30 e6ae: ff 1f adc r31, r31 e6b0: aa 95 dec r26 e6b2: e2 f7 brpl .-8 ; 0xe6ac e6b4: 8e 0f add r24, r30 e6b6: 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++) e6b8: 2f 5f subi r18, 0xFF ; 255 e6ba: 3f 4f sbci r19, 0xFF ; 255 e6bc: ba cf rjmp .-140 ; 0xe632 if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; e6be: 80 e0 ldi r24, 0x00 ; 0 e6c0: e8 cf rjmp .-48 ; 0xe692 0000e6c2 : //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. e6c2: 20 91 5c 03 lds r18, 0x035C ; 0x80035c e6c6: 21 11 cpse r18, r1 e6c8: 04 c0 rjmp .+8 ; 0xe6d2 e6ca: fc 01 movw r30, r24 e6cc: 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 } e6ce: cf 01 movw r24, r30 e6d0: 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. e6d2: 40 91 5a 03 lds r20, 0x035A ; 0x80035a e6d6: 50 91 5b 03 lds r21, 0x035B ; 0x80035b e6da: 41 15 cp r20, r1 e6dc: 51 05 cpc r21, r1 e6de: a9 f3 breq .-22 ; 0xe6ca uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id e6e0: fc 01 movw r30, r24 e6e2: 25 91 lpm r18, Z+ e6e4: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. e6e6: 2f 3f cpi r18, 0xFF ; 255 e6e8: 32 07 cpc r19, r18 e6ea: 79 f3 breq .-34 ; 0xe6ca ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset e6ec: f9 01 movw r30, r18 e6ee: 38 96 adiw r30, 0x08 ; 8 e6f0: ee 0f add r30, r30 e6f2: ff 1f adc r31, r31 e6f4: e4 0f add r30, r20 e6f6: f5 1f adc r31, r21 e6f8: 25 91 lpm r18, Z+ e6fa: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character e6fc: fa 01 movw r30, r20 e6fe: e2 0f add r30, r18 e700: f3 1f adc r31, r19 e702: 24 91 lpm r18, Z e704: 22 23 and r18, r18 e706: 09 f3 breq .-62 ; 0xe6ca e708: e2 cf rjmp .-60 ; 0xe6ce 0000e70a : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { e70a: cf 93 push r28 e70c: df 93 push r29 e70e: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; e710: 20 e0 ldi r18, 0x00 ; 0 e712: 30 e0 ldi r19, 0x00 ; 0 e714: 4c e8 ldi r20, 0x8C ; 140 e716: 52 e4 ldi r21, 0x42 ; 66 e718: 60 91 4f 07 lds r22, 0x074F ; 0x80074f e71c: 70 91 50 07 lds r23, 0x0750 ; 0x800750 e720: 80 91 51 07 lds r24, 0x0751 ; 0x800751 e724: 90 91 52 07 lds r25, 0x0752 ; 0x800752 e728: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> e72c: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f e730: 70 93 50 07 sts 0x0750, r23 ; 0x800750 e734: 80 93 51 07 sts 0x0751, r24 ; 0x800751 e738: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); e73c: 60 e0 ldi r22, 0x00 ; 0 e73e: 70 e0 ldi r23, 0x00 ; 0 e740: 80 ea ldi r24, 0xA0 ; 160 e742: 91 e4 ldi r25, 0x41 ; 65 e744: 0f 94 93 ba call 0x37526 ; 0x37526 load_filament_final_feed(); e748: 0e 94 48 65 call 0xca90 ; 0xca90 } void lcd_loading_filament(const char* filament_name) { lcd_clear(); e74c: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); e750: 86 e7 ldi r24, 0x76 ; 118 e752: 9c e5 ldi r25, 0x5C ; 92 e754: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 e758: ac 01 movw r20, r24 e75a: 60 e0 ldi r22, 0x00 ; 0 e75c: 80 e0 ldi r24, 0x00 ; 0 e75e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 if (filament_name[0]) { e762: 88 81 ld r24, Y e764: 88 23 and r24, r24 e766: 39 f0 breq .+14 ; 0xe776 lcd_set_cursor(0, 1); e768: 61 e0 ldi r22, 0x01 ; 1 e76a: 80 e0 ldi r24, 0x00 ; 0 e76c: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print(filament_name); e770: ce 01 movw r24, r28 e772: 0e 94 9c 71 call 0xe338 ; 0xe338 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); e776: 89 e9 ldi r24, 0x99 ; 153 e778: 99 e3 ldi r25, 0x39 ; 57 e77a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 e77e: ac 01 movw r20, r24 e780: 62 e0 ldi r22, 0x02 ; 2 e782: 80 e0 ldi r24, 0x00 ; 0 e784: 0e 94 a9 6f call 0xdf52 ; 0xdf52 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 e788: 83 e4 ldi r24, 0x43 ; 67 e78a: 9b e2 ldi r25, 0x2B ; 43 e78c: 0f 94 d0 36 call 0x26da0 ; 0x26da0 lcd_loading_filament(filament_name); st_synchronize(); } e790: df 91 pop r29 e792: 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(); e794: 0d 94 2c 59 jmp 0x2b258 ; 0x2b258 0000e798 : * 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; e798: 0f 94 dd 76 call 0x2edba ; 0x2edba e79c: 8f 3f cpi r24, 0xFF ; 255 e79e: 11 f1 breq .+68 ; 0xe7e4 lcd_update_enable(false); e7a0: 80 e0 ldi r24, 0x00 ; 0 e7a2: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); e7a6: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); e7aa: 82 ed ldi r24, 0xD2 ; 210 e7ac: 98 e5 ldi r25, 0x58 ; 88 e7ae: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 e7b2: ac 01 movw r20, r24 e7b4: 61 e0 ldi r22, 0x01 ; 1 e7b6: 80 e0 ldi r24, 0x00 ; 0 e7b8: 0e 94 a9 6f call 0xdf52 ; 0xdf52 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e7bc: 80 e2 ldi r24, 0x20 ; 32 e7be: 0e 94 44 70 call 0xe088 ; 0xe088 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); e7c2: 0f 94 dd 76 call 0x2edba ; 0x2edba e7c6: 68 2f mov r22, r24 e7c8: 70 e0 ldi r23, 0x00 ; 0 e7ca: 6f 5f subi r22, 0xFF ; 255 e7cc: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); e7ce: 07 2e mov r0, r23 e7d0: 00 0c add r0, r0 e7d2: 88 0b sbc r24, r24 e7d4: 99 0b sbc r25, r25 e7d6: 0e 94 4e 71 call 0xe29c ; 0xe29c // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); e7da: 0f 94 6d a0 call 0x340da ; 0x340da lcd_update_enable(true); e7de: 81 e0 ldi r24, 0x01 ; 1 e7e0: 0c 94 da 6f jmp 0xdfb4 ; 0xdfb4 } e7e4: 08 95 ret 0000e7e6 : } #ifdef TMC2130 bool calibrate_z_auto() { e7e6: 4f 92 push r4 e7e8: 5f 92 push r5 e7ea: 6f 92 push r6 e7ec: 7f 92 push r7 e7ee: 8f 92 push r8 e7f0: 9f 92 push r9 e7f2: af 92 push r10 e7f4: bf 92 push r11 e7f6: ef 92 push r14 e7f8: ff 92 push r15 e7fa: 0f 93 push r16 e7fc: 1f 93 push r17 e7fe: cf 93 push r28 e800: df 93 push r29 //lcd_display_message_fullscreen_P(_T(MSG_CALIBRATE_Z_AUTO)); lcd_clear(); e802: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 1, _T(MSG_CALIBRATE_Z_AUTO)); e806: 85 ea ldi r24, 0xA5 ; 165 e808: 99 e4 ldi r25, 0x49 ; 73 e80a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 e80e: ac 01 movw r20, r24 e810: 61 e0 ldi r22, 0x01 ; 1 e812: 80 e0 ldi r24, 0x00 ; 0 e814: 0e 94 a9 6f call 0xdf52 ; 0xdf52 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; e818: d0 91 8f 02 lds r29, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; e81c: 81 e0 ldi r24, 0x01 ; 1 e81e: 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); e822: e8 ed ldi r30, 0xD8 ; 216 e824: fc e7 ldi r31, 0x7C ; 124 e826: 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); e828: 84 e0 ldi r24, 0x04 ; 4 e82a: 0f 94 93 3b call 0x27726 ; 0x27726 current_position[Z_AXIS] = 0; e82e: 83 e4 ldi r24, 0x43 ; 67 e830: e8 2e mov r14, r24 e832: 87 e0 ldi r24, 0x07 ; 7 e834: f8 2e mov r15, r24 e836: f7 01 movw r30, r14 e838: 10 86 std Z+8, r1 ; 0x08 e83a: 11 86 std Z+9, r1 ; 0x09 e83c: 12 86 std Z+10, r1 ; 0x0a e83e: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e840: 0f 94 53 b9 call 0x372a6 ; 0x372a6 set_destination_to_current(); e844: 0e 94 ef 68 call 0xd1de ; 0xd1de #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); e848: e2 ed ldi r30, 0xD2 ; 210 e84a: fc e7 ldi r31, 0x7C ; 124 e84c: 85 90 lpm r8, Z+ e84e: 95 90 lpm r9, Z+ e850: a5 90 lpm r10, Z+ e852: 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); e854: 04 e5 ldi r16, 0x54 ; 84 e856: 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); e858: 8c 2f mov r24, r28 e85a: 99 27 eor r25, r25 e85c: 81 95 neg r24 e85e: 0c f4 brge .+2 ; 0xe862 e860: 90 95 com r25 e862: 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); e864: 07 2e mov r0, r23 e866: 00 0c add r0, r0 e868: 88 0b sbc r24, r24 e86a: 99 0b sbc r25, r25 e86c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> e870: 2b 01 movw r4, r22 e872: 3c 01 movw r6, r24 e874: 2d ec ldi r18, 0xCD ; 205 e876: 3c ec ldi r19, 0xCC ; 204 e878: 4c e8 ldi r20, 0x8C ; 140 e87a: 5f e3 ldi r21, 0x3F ; 63 e87c: c5 01 movw r24, r10 e87e: b4 01 movw r22, r8 e880: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> e884: 9b 01 movw r18, r22 e886: ac 01 movw r20, r24 e888: c3 01 movw r24, r6 e88a: b2 01 movw r22, r4 e88c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> e890: f8 01 movw r30, r16 e892: 20 85 ldd r18, Z+8 ; 0x08 e894: 31 85 ldd r19, Z+9 ; 0x09 e896: 42 85 ldd r20, Z+10 ; 0x0a e898: 53 85 ldd r21, Z+11 ; 0x0b e89a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> e89e: f8 01 movw r30, r16 e8a0: 60 87 std Z+8, r22 ; 0x08 e8a2: 71 87 std Z+9, r23 ; 0x09 e8a4: 82 87 std Z+10, r24 ; 0x0a e8a6: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS]; e8a8: 80 e0 ldi r24, 0x00 ; 0 e8aa: 90 e0 ldi r25, 0x00 ; 0 e8ac: a8 e4 ldi r26, 0x48 ; 72 e8ae: b4 e4 ldi r27, 0x44 ; 68 e8b0: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e8b4: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e8b8: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e8bc: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e8c0: 65 e5 ldi r22, 0x55 ; 85 e8c2: 75 e5 ldi r23, 0x55 ; 85 e8c4: 85 e5 ldi r24, 0x55 ; 85 e8c6: 91 e4 ldi r25, 0x41 ; 65 e8c8: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); e8cc: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // current_position[axis] = 0; // plan_set_position_curposXYZE(); tmc2130_home_exit(); e8d0: 0f 94 64 3b call 0x276c8 ; 0x276c8 e8d4: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[Z_AXIS] = 0; e8d8: f7 01 movw r30, r14 e8da: 10 86 std Z+8, r1 ; 0x08 e8dc: 11 86 std Z+9, r1 ; 0x09 e8de: 12 86 std Z+10, r1 ; 0x0a e8e0: 13 86 std Z+11, r1 ; 0x0b plan_set_position_curposXYZE(); e8e2: 0f 94 53 b9 call 0x372a6 ; 0x372a6 set_destination_to_current(); e8e6: 0e 94 ef 68 call 0xd1de ; 0xd1de destination[Z_AXIS] += 10 * axis_up_dir; //10mm up e8ea: f6 ef ldi r31, 0xF6 ; 246 e8ec: cf 02 muls r28, r31 e8ee: b0 01 movw r22, r0 e8f0: 11 24 eor r1, r1 e8f2: 07 2e mov r0, r23 e8f4: 00 0c add r0, r0 e8f6: 88 0b sbc r24, r24 e8f8: 99 0b sbc r25, r25 e8fa: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> e8fe: 9b 01 movw r18, r22 e900: ac 01 movw r20, r24 e902: f8 01 movw r30, r16 e904: 60 85 ldd r22, Z+8 ; 0x08 e906: 71 85 ldd r23, Z+9 ; 0x09 e908: 82 85 ldd r24, Z+10 ; 0x0a e90a: 93 85 ldd r25, Z+11 ; 0x0b e90c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> e910: f8 01 movw r30, r16 e912: 60 87 std Z+8, r22 ; 0x08 e914: 71 87 std Z+9, r23 ; 0x09 e916: 82 87 std Z+10, r24 ; 0x0a e918: 93 87 std Z+11, r25 ; 0x0b feedrate = homing_feedrate[Z_AXIS] / 2; e91a: 80 e0 ldi r24, 0x00 ; 0 e91c: 90 e0 ldi r25, 0x00 ; 0 e91e: a8 ec ldi r26, 0xC8 ; 200 e920: b3 e4 ldi r27, 0x43 ; 67 e922: 80 93 90 02 sts 0x0290, r24 ; 0x800290 e926: 90 93 91 02 sts 0x0291, r25 ; 0x800291 e92a: a0 93 92 02 sts 0x0292, r26 ; 0x800292 e92e: b0 93 93 02 sts 0x0293, r27 ; 0x800293 plan_buffer_line_destinationXYZE(feedrate / 60); e932: 65 e5 ldi r22, 0x55 ; 85 e934: 75 e5 ldi r23, 0x55 ; 85 e936: 85 ed ldi r24, 0xD5 ; 213 e938: 90 e4 ldi r25, 0x40 ; 64 e93a: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); e93e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 e942: 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; e946: 80 e0 ldi r24, 0x00 ; 0 e948: 90 e0 ldi r25, 0x00 ; 0 e94a: ab e5 ldi r26, 0x5B ; 91 e94c: b3 e4 ldi r27, 0x43 ; 67 e94e: f7 01 movw r30, r14 e950: 80 87 std Z+8, r24 ; 0x08 e952: 91 87 std Z+9, r25 ; 0x09 e954: a2 87 std Z+10, r26 ; 0x0a e956: b3 87 std Z+11, r27 ; 0x0b plan_set_position_curposXYZE(); e958: 0f 94 53 b9 call 0x372a6 ; 0x372a6 return true; } e95c: 81 e0 ldi r24, 0x01 ; 1 e95e: df 91 pop r29 e960: cf 91 pop r28 e962: 1f 91 pop r17 e964: 0f 91 pop r16 e966: ff 90 pop r15 e968: ef 90 pop r14 e96a: bf 90 pop r11 e96c: af 90 pop r10 e96e: 9f 90 pop r9 e970: 8f 90 pop r8 e972: 7f 90 pop r7 e974: 6f 90 pop r6 e976: 5f 90 pop r5 e978: 4f 90 pop r4 e97a: 08 95 ret 0000e97c : restore_print_from_ram_and_continue(default_retraction); //XYZ = orig, E +1mm unretract //babystep_apply(); } void crashdet_fmt_error(char* buf, uint8_t mask) { e97c: cf 93 push r28 e97e: df 93 push r29 e980: ec 01 movw r28, r24 if(mask & X_AXIS_MASK) *buf++ = axis_codes[X_AXIS]; e982: 60 ff sbrs r22, 0 e984: 03 c0 rjmp .+6 ; 0xe98c e986: 28 e5 ldi r18, 0x58 ; 88 e988: 28 83 st Y, r18 e98a: 21 96 adiw r28, 0x01 ; 1 if(mask & Y_AXIS_MASK) *buf++ = axis_codes[Y_AXIS]; e98c: 61 ff sbrs r22, 1 e98e: 03 c0 rjmp .+6 ; 0xe996 e990: 29 e5 ldi r18, 0x59 ; 89 e992: 28 83 st Y, r18 e994: 21 96 adiw r28, 0x01 ; 1 *buf++ = ' '; e996: 80 e2 ldi r24, 0x20 ; 32 e998: 89 93 st Y+, r24 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); e99a: 80 e0 ldi r24, 0x00 ; 0 e99c: 96 e3 ldi r25, 0x36 ; 54 e99e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 e9a2: bc 01 movw r22, r24 e9a4: ce 01 movw r24, r28 } e9a6: df 91 pop r29 e9a8: 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)); e9aa: 0d 94 48 db jmp 0x3b690 ; 0x3b690 0000e9ae <__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 { e9ae: 1f 92 push r1 e9b0: 0f 92 push r0 e9b2: 0f b6 in r0, 0x3f ; 63 e9b4: 0f 92 push r0 e9b6: 11 24 eor r1, r1 e9b8: 0b b6 in r0, 0x3b ; 59 e9ba: 0f 92 push r0 e9bc: 2f 93 push r18 e9be: 8f 93 push r24 e9c0: 9f 93 push r25 e9c2: ef 93 push r30 e9c4: ff 93 push r31 switch(state){ e9c6: e0 91 55 03 lds r30, 0x0355 ; 0x800355 e9ca: e8 30 cpi r30, 0x08 ; 8 e9cc: e8 f4 brcc .+58 ; 0xea08 <__vector_23+0x5a> e9ce: f0 e0 ldi r31, 0x00 ; 0 e9d0: 88 27 eor r24, r24 e9d2: e2 51 subi r30, 0x12 ; 18 e9d4: fb 48 sbci r31, 0x8B ; 139 e9d6: 8f 4f sbci r24, 0xFF ; 255 e9d8: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> e9dc: f6 74 andi r31, 0x46 ; 70 e9de: 10 75 andi r17, 0x50 ; 80 e9e0: 1b 75 andi r17, 0x5B ; 91 e9e2: 29 75 andi r18, 0x59 ; 89 e9e4: 3f 75 andi r19, 0x5F ; 95 e9e6: 48 75 andi r20, 0x58 ; 88 e9e8: 6b 75 andi r22, 0x5B ; 91 e9ea: 7d 75 andi r23, 0x5D ; 93 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin e9ec: 80 91 6d 06 lds r24, 0x066D ; 0x80066d e9f0: 81 11 cpse r24, r1 e9f2: 0a c0 rjmp .+20 ; 0xea08 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! e9f4: 80 91 1a 06 lds r24, 0x061A ; 0x80061a e9f8: 88 0f add r24, r24 e9fa: 80 93 54 03 sts 0x0354, r24 ; 0x800354 if( pwm != 0 ){ e9fe: 88 23 and r24, r24 ea00: 19 f0 breq .+6 ; 0xea08 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period ea02: 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 ea04: 80 93 55 03 sts 0x0355, r24 ; 0x800355 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } ea08: ff 91 pop r31 ea0a: ef 91 pop r30 ea0c: 9f 91 pop r25 ea0e: 8f 91 pop r24 ea10: 2f 91 pop r18 ea12: 0f 90 pop r0 ea14: 0b be out 0x3b, r0 ; 59 ea16: 0f 90 pop r0 ea18: 0f be out 0x3f, r0 ; 63 ea1a: 0f 90 pop r0 ea1c: 1f 90 pop r1 ea1e: 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) ea20: 80 91 53 03 lds r24, 0x0353 ; 0x800353 ea24: 8f 5f subi r24, 0xFF ; 255 ea26: 80 93 53 03 sts 0x0353, r24 ; 0x800353 if( slowCounter > pwm ){ ea2a: 90 91 54 03 lds r25, 0x0354 ; 0x800354 ea2e: 98 17 cp r25, r24 ea30: 58 f3 brcs .-42 ; 0xea08 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 ea32: 82 e0 ldi r24, 0x02 ; 2 ea34: e7 cf rjmp .-50 ; 0xea04 <__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 ea36: 83 e0 ldi r24, 0x03 ; 3 ea38: 80 93 55 03 sts 0x0355, r24 ; 0x800355 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ea3c: 8f e0 ldi r24, 0x0F ; 15 ea3e: 80 93 52 03 sts 0x0352, r24 ; 0x800352 TCNT0 = 255; // force overflow on the next clock cycle ea42: 8f ef ldi r24, 0xFF ; 255 ea44: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ea46: 81 e0 ldi r24, 0x01 ; 1 ea48: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) ea4a: 84 b5 in r24, 0x24 ; 36 ea4c: 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 ea4e: 84 bd out 0x24, r24 ; 36 ea50: db cf rjmp .-74 ; 0xea08 <__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; ea52: 80 91 52 03 lds r24, 0x0352 ; 0x800352 ea56: 82 95 swap r24 ea58: 80 7f andi r24, 0xF0 ; 240 ea5a: 81 95 neg r24 ea5c: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ ea5e: 80 91 52 03 lds r24, 0x0352 ; 0x800352 ea62: 88 23 and r24, r24 ea64: 21 f0 breq .+8 ; 0xea6e <__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; ea66: 81 50 subi r24, 0x01 ; 1 ea68: 80 93 52 03 sts 0x0352, r24 ; 0x800352 ea6c: cd cf rjmp .-102 ; 0xea08 <__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; ea6e: 84 e0 ldi r24, 0x04 ; 4 ea70: 80 93 55 03 sts 0x0355, r24 ; 0x800355 OCR0B = 255; // full duty ea74: 8f ef ldi r24, 0xFF ; 255 ea76: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle ea78: 8e ef ldi r24, 0xFE ; 254 ea7a: 86 bd out 0x26, r24 ; 38 ea7c: c5 cf rjmp .-118 ; 0xea08 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; ea7e: 85 e0 ldi r24, 0x05 ; 5 ea80: 80 93 55 03 sts 0x0355, r24 ; 0x800355 OCR0B = 255; // full duty ea84: 8f ef ldi r24, 0xFF ; 255 ea86: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle ea88: 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 ea8a: 82 e0 ldi r24, 0x02 ; 2 ea8c: 85 bd out 0x25, r24 ; 37 ea8e: bc cf rjmp .-136 ; 0xea08 <__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; ea90: 2f ef ldi r18, 0xFF ; 255 ea92: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin ea94: 80 91 6d 06 lds r24, 0x066D ; 0x80066d ea98: 81 11 cpse r24, r1 ea9a: b6 cf rjmp .-148 ; 0xea08 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less ea9c: 80 91 53 03 lds r24, 0x0353 ; 0x800353 eaa0: 8f 5f subi r24, 0xFF ; 255 eaa2: 80 93 53 03 sts 0x0353, r24 ; 0x800353 if( slowCounter < pwm ){ eaa6: 90 91 54 03 lds r25, 0x0354 ; 0x800354 eaaa: 89 17 cp r24, r25 eaac: 08 f4 brcc .+2 ; 0xeab0 <__vector_23+0x102> eaae: ac cf rjmp .-168 ; 0xea08 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain eab0: 80 91 1a 06 lds r24, 0x061A ; 0x80061a eab4: 90 e0 ldi r25, 0x00 ; 0 eab6: 8f 37 cpi r24, 0x7F ; 127 eab8: 91 05 cpc r25, r1 eaba: 0c f0 brlt .+2 ; 0xeabe <__vector_23+0x110> eabc: a5 cf rjmp .-182 ; 0xea08 <__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; eabe: 86 e0 ldi r24, 0x06 ; 6 eac0: 80 93 55 03 sts 0x0355, r24 ; 0x800355 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE eac4: 8f e0 ldi r24, 0x0F ; 15 eac6: 80 93 52 03 sts 0x0352, r24 ; 0x800352 TCNT0 = 255; // force overflow on the next clock cycle eaca: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz eacc: 81 e0 ldi r24, 0x01 ; 1 eace: 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 ead0: 84 b5 in r24, 0x24 ; 36 ead2: 80 61 ori r24, 0x10 ; 16 ead4: bc cf rjmp .-136 ; 0xea4e <__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 ead6: 80 91 52 03 lds r24, 0x0352 ; 0x800352 eada: 82 95 swap r24 eadc: 80 7f andi r24, 0xF0 ; 240 eade: 81 95 neg r24 eae0: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ eae2: 80 91 52 03 lds r24, 0x0352 ; 0x800352 eae6: 81 11 cpse r24, r1 eae8: be cf rjmp .-132 ; 0xea66 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; eaea: 87 e0 ldi r24, 0x07 ; 7 eaec: 80 93 55 03 sts 0x0355, r24 ; 0x800355 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes eaf0: 80 e8 ldi r24, 0x80 ; 128 eaf2: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eaf4: 8f ef ldi r24, 0xFF ; 255 eaf6: 88 bd out 0x28, r24 ; 40 eaf8: 87 cf rjmp .-242 ; 0xea08 <__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 eafa: 10 92 55 03 sts 0x0355, r1 ; 0x800355 TCNT0 = 128; eafe: 80 e8 ldi r24, 0x80 ; 128 eb00: 86 bd out 0x26, r24 ; 38 OCR0B = 255; eb02: 8f ef ldi r24, 0xFF ; 255 eb04: 88 bd out 0x28, r24 ; 40 eb06: c1 cf rjmp .-126 ; 0xea8a <__vector_23+0xdc> 0000eb08 : if (updateEEPROM) { eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR_ACTION_NA, (uint8_t)state); } } void Filament_sensor::settings_init_common() { eb08: cf 93 push r28 eb0a: df 93 push r29 eb0c: ec 01 movw r28, r24 bool enabled = eeprom_read_byte((uint8_t *)EEPROM_FSENSOR); eb0e: 87 e6 ldi r24, 0x67 ; 103 eb10: 9f e0 ldi r25, 0x0F ; 15 eb12: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 eb16: 91 e0 ldi r25, 0x01 ; 1 eb18: 81 11 cpse r24, r1 eb1a: 01 c0 rjmp .+2 ; 0xeb1e eb1c: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { eb1e: 81 e0 ldi r24, 0x01 ; 1 eb20: 28 81 ld r18, Y eb22: 21 11 cpse r18, r1 eb24: 01 c0 rjmp .+2 ; 0xeb28 eb26: 80 e0 ldi r24, 0x00 ; 0 eb28: 89 13 cpse r24, r25 state = enabled ? State::initializing : State::disabled; eb2a: 98 83 st Y, r25 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); eb2c: 87 e0 ldi r24, 0x07 ; 7 eb2e: 9f e0 ldi r25, 0x0F ; 15 eb30: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 eb34: 91 e0 ldi r25, 0x01 ; 1 eb36: 81 11 cpse r24, r1 eb38: 01 c0 rjmp .+2 ; 0xeb3c eb3a: 90 e0 ldi r25, 0x00 ; 0 eb3c: 99 83 std Y+1, r25 ; 0x01 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); eb3e: 85 ed ldi r24, 0xD5 ; 213 eb40: 9e e0 ldi r25, 0x0E ; 14 eb42: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 eb46: 91 e0 ldi r25, 0x01 ; 1 eb48: 81 11 cpse r24, r1 eb4a: 01 c0 rjmp .+2 ; 0xeb4e eb4c: 90 e0 ldi r25, 0x00 ; 0 eb4e: 9a 83 std Y+2, r25 ; 0x02 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); eb50: 87 e4 ldi r24, 0x47 ; 71 eb52: 9d e0 ldi r25, 0x0D ; 13 eb54: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (sensorActionOnError == SensorActionOnError::_Undef) { eb58: 8f 3f cpi r24, 0xFF ; 255 eb5a: 21 f0 breq .+8 ; 0xeb64 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); eb5c: 88 87 std Y+8, r24 ; 0x08 if (sensorActionOnError == SensorActionOnError::_Undef) { sensorActionOnError = SensorActionOnError::_Continue; } } eb5e: df 91 pop r29 eb60: cf 91 pop r28 eb62: 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; eb64: 18 86 std Y+8, r1 ; 0x08 eb66: fb cf rjmp .-10 ; 0xeb5e 0000eb68 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { eb68: cf 93 push r28 eb6a: c8 2f mov r28, r24 eb6c: 68 2f mov r22, r24 eb6e: 87 e6 ldi r24, 0x67 ; 103 eb70: 9f e0 ldi r25, 0x0F ; 15 eb72: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { eb76: cc 23 and r28, r28 eb78: 19 f0 breq .+6 ; 0xeb80 fsensor.init(); } else { fsensor.deinit(); } } eb7a: 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(); eb7c: 0d 94 74 87 jmp 0x30ee8 ; 0x30ee8 } else { fsensor.deinit(); } } eb80: 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(); eb82: 0d 94 64 87 jmp 0x30ec8 ; 0x30ec8 0000eb86 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; eb86: 10 92 36 05 sts 0x0536, r1 ; 0x800536 extruder_autofan_last_check = _millis(); eb8a: 0f 94 8b 3f call 0x27f16 ; 0x27f16 eb8e: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c eb92: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d eb96: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e eb9a: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f } eb9e: 08 95 ret 0000eba0 <__vector_7>: EICRB ^= (1 << 6); //change edge } #endif //(defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) #ifdef EXTRUDER_ALTFAN_DETECT ISR(INT6_vect) { eba0: 1f 92 push r1 eba2: 0f 92 push r0 eba4: 0f b6 in r0, 0x3f ; 63 eba6: 0f 92 push r0 eba8: 11 24 eor r1, r1 ebaa: 0b b6 in r0, 0x3b ; 59 ebac: 0f 92 push r0 ebae: 8f 93 push r24 ebb0: 9f 93 push r25 ebb2: ef 93 push r30 ebb4: ff 93 push r31 fan_edge_counter[0]++; ebb6: e5 eb ldi r30, 0xB5 ; 181 ebb8: f4 e0 ldi r31, 0x04 ; 4 ebba: 80 81 ld r24, Z ebbc: 91 81 ldd r25, Z+1 ; 0x01 ebbe: 01 96 adiw r24, 0x01 ; 1 ebc0: 91 83 std Z+1, r25 ; 0x01 ebc2: 80 83 st Z, r24 } ebc4: ff 91 pop r31 ebc6: ef 91 pop r30 ebc8: 9f 91 pop r25 ebca: 8f 91 pop r24 ebcc: 0f 90 pop r0 ebce: 0b be out 0x3b, r0 ; 59 ebd0: 0f 90 pop r0 ebd2: 0f be out 0x3f, r0 ; 63 ebd4: 0f 90 pop r0 ebd6: 1f 90 pop r1 ebd8: 18 95 reti 0000ebda <__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) { ebda: 1f 92 push r1 ebdc: 0f 92 push r0 ebde: 0f b6 in r0, 0x3f ; 63 ebe0: 0f 92 push r0 ebe2: 11 24 eor r1, r1 ebe4: 2f 93 push r18 ebe6: 4f 93 push r20 ebe8: 5f 93 push r21 ebea: 6f 93 push r22 ebec: 7f 93 push r23 ebee: 8f 93 push r24 ebf0: 9f 93 push r25 ebf2: af 93 push r26 ebf4: 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; ebf6: 80 91 36 05 lds r24, 0x0536 ; 0x800536 ebfa: 88 23 and r24, r24 ebfc: f1 f0 breq .+60 ; 0xec3a <__vector_8+0x60> ebfe: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 ec02: 8b 34 cpi r24, 0x4B ; 75 ec04: d0 f0 brcs .+52 ; 0xec3a <__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 ec06: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ec0a: 86 ff sbrs r24, 6 ec0c: 24 c0 rjmp .+72 ; 0xec56 <__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; ec0e: 80 91 38 06 lds r24, 0x0638 ; 0x800638 ec12: 90 91 39 06 lds r25, 0x0639 ; 0x800639 ec16: a0 91 3a 06 lds r26, 0x063A ; 0x80063a ec1a: b0 91 3b 06 lds r27, 0x063B ; 0x80063b t_fan_rising_edge = millis_nc(); ec1e: 80 93 4b 03 sts 0x034B, r24 ; 0x80034b ec22: 90 93 4c 03 sts 0x034C, r25 ; 0x80034c ec26: a0 93 4d 03 sts 0x034D, r26 ; 0x80034d ec2a: b0 93 4e 03 sts 0x034E, r27 ; 0x80034e else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse } } EICRB ^= (1 << 6); //change edge ec2e: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> ec32: 90 e4 ldi r25, 0x40 ; 64 ec34: 89 27 eor r24, r25 ec36: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> } ec3a: bf 91 pop r27 ec3c: af 91 pop r26 ec3e: 9f 91 pop r25 ec40: 8f 91 pop r24 ec42: 7f 91 pop r23 ec44: 6f 91 pop r22 ec46: 5f 91 pop r21 ec48: 4f 91 pop r20 ec4a: 2f 91 pop r18 ec4c: 0f 90 pop r0 ec4e: 0f be out 0x3f, r0 ; 63 ec50: 0f 90 pop r0 ec52: 1f 90 pop r1 ec54: 18 95 reti ec56: 80 91 38 06 lds r24, 0x0638 ; 0x800638 ec5a: 90 91 39 06 lds r25, 0x0639 ; 0x800639 ec5e: a0 91 3a 06 lds r26, 0x063A ; 0x80063a ec62: b0 91 3b 06 lds r27, 0x063B ; 0x80063b if ((1 << 6) & EICRB) { //interrupt was triggered by rising edge t_fan_rising_edge = millis_nc(); } else { //interrupt was triggered by falling edge if ((millis_nc() - t_fan_rising_edge) >= FAN_PULSE_WIDTH_LIMIT) {//this pulse was from sensor and not from pwm ec66: 40 91 4b 03 lds r20, 0x034B ; 0x80034b ec6a: 50 91 4c 03 lds r21, 0x034C ; 0x80034c ec6e: 60 91 4d 03 lds r22, 0x034D ; 0x80034d ec72: 70 91 4e 03 lds r23, 0x034E ; 0x80034e ec76: 84 1b sub r24, r20 ec78: 95 0b sbc r25, r21 ec7a: a6 0b sbc r26, r22 ec7c: b7 0b sbc r27, r23 ec7e: 20 91 e3 03 lds r18, 0x03E3 ; 0x8003e3 ec82: 44 e0 ldi r20, 0x04 ; 4 ec84: 50 e0 ldi r21, 0x00 ; 0 ec86: 60 e0 ldi r22, 0x00 ; 0 ec88: 70 e0 ldi r23, 0x00 ; 0 ec8a: 25 36 cpi r18, 0x65 ; 101 ec8c: 20 f0 brcs .+8 ; 0xec96 <__vector_8+0xbc> ec8e: 43 e0 ldi r20, 0x03 ; 3 ec90: 50 e0 ldi r21, 0x00 ; 0 ec92: 60 e0 ldi r22, 0x00 ; 0 ec94: 70 e0 ldi r23, 0x00 ; 0 ec96: 84 17 cp r24, r20 ec98: 95 07 cpc r25, r21 ec9a: a6 07 cpc r26, r22 ec9c: b7 07 cpc r27, r23 ec9e: 38 f2 brcs .-114 ; 0xec2e <__vector_8+0x54> fan_edge_counter[1] += 2; //we are currently counting all edges so lets count two edges for one pulse eca0: 80 91 b7 04 lds r24, 0x04B7 ; 0x8004b7 eca4: 90 91 b8 04 lds r25, 0x04B8 ; 0x8004b8 eca8: 02 96 adiw r24, 0x02 ; 2 ecaa: 90 93 b8 04 sts 0x04B8, r25 ; 0x8004b8 ecae: 80 93 b7 04 sts 0x04B7, r24 ; 0x8004b7 ecb2: bd cf rjmp .-134 ; 0xec2e <__vector_8+0x54> 0000ecb4 : } #if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) void countFanSpeed() { ecb4: 8f 92 push r8 ecb6: 9f 92 push r9 ecb8: af 92 push r10 ecba: bf 92 push r11 ecbc: cf 92 push r12 ecbe: df 92 push r13 ecc0: ef 92 push r14 ecc2: ff 92 push r15 ecc4: 0f 93 push r16 ecc6: 1f 93 push r17 ecc8: cf 93 push r28 ecca: 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))); eccc: c5 eb ldi r28, 0xB5 ; 181 ecce: d4 e0 ldi r29, 0x04 ; 4 ecd0: 68 81 ld r22, Y ecd2: 79 81 ldd r23, Y+1 ; 0x01 ecd4: 07 2e mov r0, r23 ecd6: 00 0c add r0, r0 ecd8: 88 0b sbc r24, r24 ecda: 99 0b sbc r25, r25 ecdc: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> ece0: 6b 01 movw r12, r22 ece2: 7c 01 movw r14, r24 ece4: 0f 94 8b 3f call 0x27f16 ; 0x27f16 ece8: 01 eb ldi r16, 0xB1 ; 177 ecea: 14 e0 ldi r17, 0x04 ; 4 ecec: 80 90 9c 17 lds r8, 0x179C ; 0x80179c ecf0: 90 90 9d 17 lds r9, 0x179D ; 0x80179d ecf4: a0 90 9e 17 lds r10, 0x179E ; 0x80179e ecf8: b0 90 9f 17 lds r11, 0x179F ; 0x80179f ecfc: 68 19 sub r22, r8 ecfe: 79 09 sbc r23, r9 ed00: 8a 09 sbc r24, r10 ed02: 9b 09 sbc r25, r11 ed04: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> ed08: 9b 01 movw r18, r22 ed0a: ac 01 movw r20, r24 ed0c: 60 e0 ldi r22, 0x00 ; 0 ed0e: 70 e0 ldi r23, 0x00 ; 0 ed10: 8a e7 ldi r24, 0x7A ; 122 ed12: 93 e4 ldi r25, 0x43 ; 67 ed14: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> ed18: a7 01 movw r20, r14 ed1a: 96 01 movw r18, r12 ed1c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> ed20: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> ed24: f8 01 movw r30, r16 ed26: 71 83 std Z+1, r23 ; 0x01 ed28: 60 83 st Z, r22 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); ed2a: 6a 81 ldd r22, Y+2 ; 0x02 ed2c: 7b 81 ldd r23, Y+3 ; 0x03 ed2e: 07 2e mov r0, r23 ed30: 00 0c add r0, r0 ed32: 88 0b sbc r24, r24 ed34: 99 0b sbc r25, r25 ed36: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> ed3a: 6b 01 movw r12, r22 ed3c: 7c 01 movw r14, r24 ed3e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 ed42: 80 90 9c 17 lds r8, 0x179C ; 0x80179c ed46: 90 90 9d 17 lds r9, 0x179D ; 0x80179d ed4a: a0 90 9e 17 lds r10, 0x179E ; 0x80179e ed4e: b0 90 9f 17 lds r11, 0x179F ; 0x80179f ed52: 68 19 sub r22, r8 ed54: 79 09 sbc r23, r9 ed56: 8a 09 sbc r24, r10 ed58: 9b 09 sbc r25, r11 ed5a: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> ed5e: 9b 01 movw r18, r22 ed60: ac 01 movw r20, r24 ed62: 60 e0 ldi r22, 0x00 ; 0 ed64: 70 e0 ldi r23, 0x00 ; 0 ed66: 8a e7 ldi r24, 0x7A ; 122 ed68: 93 e4 ldi r25, 0x43 ; 67 ed6a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> ed6e: a7 01 movw r20, r14 ed70: 96 01 movw r18, r12 ed72: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> ed76: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> ed7a: f8 01 movw r30, r16 ed7c: 73 83 std Z+3, r23 ; 0x03 ed7e: 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; ed80: 19 82 std Y+1, r1 ; 0x01 ed82: 18 82 st Y, r1 fan_edge_counter[1] = 0; ed84: 1b 82 std Y+3, r1 ; 0x03 ed86: 1a 82 std Y+2, r1 ; 0x02 } ed88: df 91 pop r29 ed8a: cf 91 pop r28 ed8c: 1f 91 pop r17 ed8e: 0f 91 pop r16 ed90: ff 90 pop r15 ed92: ef 90 pop r14 ed94: df 90 pop r13 ed96: cf 90 pop r12 ed98: bf 90 pop r11 ed9a: af 90 pop r10 ed9c: 9f 90 pop r9 ed9e: 8f 90 pop r8 eda0: 08 95 ret 0000eda2 : 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; eda2: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f newFanSpeed = 0; eda6: 10 92 6d 03 sts 0x036D, r1 ; 0x80036d if (fanState & 0x01) edaa: 80 ff sbrs r24, 0 edac: 08 c0 rjmp .+16 ; 0xedbe { #ifdef EXTRUDER_ALTFAN_DETECT if (altfanStatus.isAltfan && !altfanStatus.altfanOverride) newFanSpeed = EXTRUDER_ALTFAN_SPEED_SILENT; edae: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> edb2: 83 70 andi r24, 0x03 ; 3 edb4: 81 30 cpi r24, 0x01 ; 1 edb6: e9 f4 brne .+58 ; 0xedf2 edb8: 80 e8 ldi r24, 0x80 ; 128 else newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; edba: 80 93 6d 03 sts 0x036D, r24 ; 0x80036d #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); edbe: 20 91 6d 03 lds r18, 0x036D ; 0x80036d } #ifdef EXTRUDER_0_AUTO_FAN_PIN void timer4_set_fan0(uint8_t duty) { if (duty == 0 || duty == 255) edc2: 8f ef ldi r24, 0xFF ; 255 edc4: 82 0f add r24, r18 edc6: 8e 3f cpi r24, 0xFE ; 254 edc8: d8 f0 brcs .+54 ; 0xee00 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); edca: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> edce: 87 7f andi r24, 0xF7 ; 247 edd0: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; edd4: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> edd8: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); eddc: 9f b7 in r25, 0x3f ; 63 edde: 22 23 and r18, r18 ede0: 51 f0 breq .+20 ; 0xedf6 ede2: f8 94 cli ede4: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> ede8: 80 62 ori r24, 0x20 ; 32 edea: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> edee: 9f bf out 0x3f, r25 ; 63 edf0: 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; edf2: 8f ef ldi r24, 0xFF ; 255 edf4: e2 cf rjmp .-60 ; 0xedba edf6: f8 94 cli edf8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> edfc: 8f 7d andi r24, 0xDF ; 223 edfe: f5 cf rjmp .-22 ; 0xedea 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; ee00: ef b7 in r30, 0x3f ; 63 ee02: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); ee04: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> ee08: 88 60 ori r24, 0x08 ; 8 ee0a: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; ee0e: 30 e0 ldi r19, 0x00 ; 0 ee10: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> ee14: 4f ef ldi r20, 0xFF ; 255 ee16: 50 e0 ldi r21, 0x00 ; 0 ee18: 81 ff sbrs r24, 1 ee1a: 04 c0 rjmp .+8 ; 0xee24 ee1c: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> ee20: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> ee24: 24 9f mul r18, r20 ee26: c0 01 movw r24, r0 ee28: 25 9f mul r18, r21 ee2a: 90 0d add r25, r0 ee2c: 34 9f mul r19, r20 ee2e: 90 0d add r25, r0 ee30: 11 24 eor r1, r1 ee32: 6f ef ldi r22, 0xFF ; 255 ee34: 70 e0 ldi r23, 0x00 ; 0 ee36: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> ee3a: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> ee3e: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; ee42: ef bf out 0x3f, r30 ; 63 #else //EXTRUDER_ALTFAN_DETECT newFanSpeed = EXTRUDER_AUTO_FAN_SPEED; #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } ee44: 08 95 ret 0000ee46 : 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); ee46: 8b e2 ldi r24, 0x2B ; 43 ee48: 9d e0 ldi r25, 0x0D ; 13 ee4a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 ee4e: 90 91 b9 04 lds r25, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> ee52: 80 fb bst r24, 0 ee54: 91 f9 bld r25, 1 ee56: 90 93 b9 04 sts 0x04B9, r25 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> #endif resetFanCheck(); ee5a: 0e 94 c3 75 call 0xeb86 ; 0xeb86 setExtruderAutoFanState(1); ee5e: 81 e0 ldi r24, 0x01 ; 1 ee60: 0c 94 d1 76 jmp 0xeda2 ; 0xeda2 0000ee64 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { ee64: 1f 93 push r17 ee66: cf 93 push r28 ee68: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) ee6a: d0 91 4f 03 lds r29, 0x034F ; 0x80034f ee6e: d1 fd sbrc r29, 1 ee70: 1d c0 rjmp .+58 ; 0xeeac temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; ee72: 10 91 1e 05 lds r17, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ee76: c1 e0 ldi r28, 0x01 ; 1 ee78: 20 e0 ldi r18, 0x00 ; 0 ee7a: 30 e0 ldi r19, 0x00 ; 0 ee7c: 48 e4 ldi r20, 0x48 ; 72 ee7e: 52 e4 ldi r21, 0x42 ; 66 ee80: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 ee84: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 ee88: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 ee8c: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 ee90: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> ee94: 18 16 cp r1, r24 ee96: 0c f0 brlt .+2 ; 0xee9a ee98: 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; ee9a: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; ee9c: cd 2b or r28, r29 ee9e: 81 e0 ldi r24, 0x01 ; 1 eea0: 11 11 cpse r17, r1 eea2: 01 c0 rjmp .+2 ; 0xeea6 eea4: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); eea6: c8 2b or r28, r24 eea8: c0 93 4f 03 sts 0x034F, r28 ; 0x80034f } setExtruderAutoFanState(fanState); eeac: 80 91 4f 03 lds r24, 0x034F ; 0x80034f #endif } eeb0: df 91 pop r29 eeb2: cf 91 pop r28 eeb4: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); eeb6: 0c 94 d1 76 jmp 0xeda2 ; 0xeda2 0000eeba : 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) { eeba: ef 92 push r14 eebc: ff 92 push r15 eebe: 0f 93 push r16 eec0: 1f 93 push r17 eec2: cf 93 push r28 eec4: df 93 push r29 eec6: ec 01 movw r28, r24 eec8: 8b 01 movw r16, r22 eeca: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) eecc: 0e 94 61 5c call 0xb8c2 ; 0xb8c2 eed0: 81 11 cpse r24, r1 eed2: 0b c0 rjmp .+22 ; 0xeeea #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); eed4: a8 01 movw r20, r16 eed6: be 01 movw r22, r28 eed8: 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); } eeda: df 91 pop r29 eedc: cf 91 pop r28 eede: 1f 91 pop r17 eee0: 0f 91 pop r16 eee2: ff 90 pop r15 eee4: ef 90 pop r14 #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); eee6: 0d 94 a5 dd jmp 0x3bb4a ; 0x3bb4a } 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); } eeea: df 91 pop r29 eeec: cf 91 pop r28 eeee: 1f 91 pop r17 eef0: 0f 91 pop r16 eef2: ff 90 pop r15 eef4: ef 90 pop r14 eef6: 08 95 ret 0000eef8 : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { eef8: 0f 93 push r16 eefa: 1f 93 push r17 eefc: cf 93 push r28 eefe: df 93 push r29 ef00: 8c 01 movw r16, r24 ef02: d6 2f mov r29, r22 ef04: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); ef06: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e if (val == EEPROM_EMPTY_VALUE16) { ef0a: 8f 3f cpi r24, 0xFF ; 255 ef0c: 98 07 cpc r25, r24 ef0e: 39 f4 brne .+14 ; 0xef1e 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); ef10: 6d 2f mov r22, r29 ef12: 7c 2f mov r23, r28 ef14: c8 01 movw r24, r16 ef16: 0f 94 ef dd call 0x3bbde ; 0x3bbde 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; ef1a: 8d 2f mov r24, r29 ef1c: 9c 2f mov r25, r28 } return val; } ef1e: df 91 pop r29 ef20: cf 91 pop r28 ef22: 1f 91 pop r17 ef24: 0f 91 pop r16 ef26: 08 95 ret 0000ef28 : 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) { ef28: 0f 93 push r16 ef2a: 1f 93 push r17 ef2c: cf 93 push r28 ef2e: 8c 01 movw r16, r24 ef30: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); ef32: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (val == EEPROM_EMPTY_VALUE) { ef36: 8f 3f cpi r24, 0xFF ; 255 ef38: 29 f4 brne .+10 ; 0xef44 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); ef3a: 6c 2f mov r22, r28 ef3c: c8 01 movw r24, r16 ef3e: 0f 94 d9 dd call 0x3bbb2 ; 0x3bbb2 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; ef42: 8c 2f mov r24, r28 } return val; } ef44: cf 91 pop r28 ef46: 1f 91 pop r17 ef48: 0f 91 pop r16 ef4a: 08 95 ret 0000ef4c : 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) { ef4c: cf 93 push r28 ef4e: df 93 push r29 ef50: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); ef52: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e ef56: bc 01 movw r22, r24 ef58: 6f 5f subi r22, 0xFF ; 255 ef5a: 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); ef5c: 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); } ef5e: df 91 pop r29 ef60: 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); ef62: 0d 94 ef dd jmp 0x3bbde ; 0x3bbde 0000ef66 : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { ef66: cf 93 push r28 ef68: df 93 push r29 ef6a: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); ef6c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 ef70: 61 e0 ldi r22, 0x01 ; 1 ef72: 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); ef74: 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); } ef76: df 91 pop r29 ef78: 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); ef7a: 0d 94 d9 dd jmp 0x3bbb2 ; 0x3bbb2 0000ef7e : while (__n--) { eeprom_update_byte_notify(dst++, pgm_read_byte(src++)); } } void eeprom_toggle(uint8_t *__p) { ef7e: cf 93 push r28 ef80: df 93 push r29 ef82: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); ef84: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 ef88: 61 e0 ldi r22, 0x01 ; 1 ef8a: 81 11 cpse r24, r1 ef8c: 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); ef8e: ce 01 movw r24, r28 } } void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } ef90: df 91 pop r29 ef92: 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); ef94: 0d 94 d9 dd jmp 0x3bbb2 ; 0x3bbb2 0000ef98 : 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); ef98: 2b e0 ldi r18, 0x0B ; 11 ef9a: 82 9f mul r24, r18 ef9c: c0 01 movw r24, r0 ef9e: 11 24 eor r1, r1 efa0: 80 5b subi r24, 0xB0 ; 176 efa2: 92 4f sbci r25, 0xF2 ; 242 efa4: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e efa8: 21 e0 ldi r18, 0x01 ; 1 efaa: 01 96 adiw r24, 0x01 ; 1 efac: 09 f4 brne .+2 ; 0xefb0 efae: 20 e0 ldi r18, 0x00 ; 0 } efb0: 82 2f mov r24, r18 efb2: 08 95 ret 0000efb4 : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { efb4: cf 93 push r28 efb6: df 93 push r29 efb8: c8 2f mov r28, r24 efba: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; efbc: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; efbe: c8 30 cpi r28, 0x08 ; 8 efc0: 0c f0 brlt .+2 ; 0xefc4 efc2: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; efc4: 8c 2f mov r24, r28 efc6: 0e 94 cc 77 call 0xef98 ; 0xef98 efca: 81 11 cpse r24, r1 efcc: 03 c0 rjmp .+6 ; 0xefd4 efce: 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) efd0: a9 f7 brne .-22 ; 0xefbc { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; efd2: cf ef ldi r28, 0xFF ; 255 } efd4: 8c 2f mov r24, r28 efd6: df 91 pop r29 efd8: cf 91 pop r28 efda: 08 95 ret 0000efdc : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); efdc: 81 ea ldi r24, 0xA1 ; 161 efde: 9d e0 ldi r25, 0x0D ; 13 efe0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 sheet = eeprom_next_initialized_sheet(sheet); efe4: 0e 94 da 77 call 0xefb4 ; 0xefb4 if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); efe8: 87 fd sbrc r24, 7 efea: 05 c0 rjmp .+10 ; 0xeff6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); efec: 68 2f mov r22, r24 efee: 81 ea ldi r24, 0xA1 ; 161 eff0: 9d e0 ldi r25, 0x0D ; 13 eff2: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a { 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); } eff6: 08 95 ret 0000eff8 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { eff8: 0f 93 push r16 effa: 1f 93 push r17 effc: cf 93 push r28 effe: c8 2f mov r28, r24 f000: 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")); f002: 6e ea ldi r22, 0xAE ; 174 f004: 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) f006: 82 30 cpi r24, 0x02 ; 2 f008: 70 f0 brcs .+28 ; 0xf026 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); f00a: 67 ea ldi r22, 0xA7 ; 167 f00c: 79 e7 ldi r23, 0x79 ; 121 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) f00e: 84 30 cpi r24, 0x04 ; 4 f010: 50 f0 brcs .+20 ; 0xf026 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f012: 6f e9 ldi r22, 0x9F ; 159 f014: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f016: 84 30 cpi r24, 0x04 ; 4 f018: 31 f0 breq .+12 ; 0xf026 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f01a: 67 e9 ldi r22, 0x97 ; 151 f01c: 79 e7 ldi r23, 0x79 ; 121 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f01e: 85 30 cpi r24, 0x05 ; 5 f020: 11 f0 breq .+4 ; 0xf026 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f022: 60 e9 ldi r22, 0x90 ; 144 f024: 79 e7 ldi r23, 0x79 ; 121 f026: c8 01 movw r24, r16 f028: 0f 94 48 db call 0x3b690 ; 0x3b690 } if (index <4 || index >5) f02c: 8c ef ldi r24, 0xFC ; 252 f02e: 8c 0f add r24, r28 f030: 82 30 cpi r24, 0x02 ; 2 f032: 28 f0 brcs .+10 ; 0xf03e { sheetName.c[6] = '0' + ((index % 2)+1); f034: c1 70 andi r28, 0x01 ; 1 f036: cf 5c subi r28, 0xCF ; 207 f038: f8 01 movw r30, r16 f03a: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f03c: 17 82 std Z+7, r1 ; 0x07 } } f03e: cf 91 pop r28 f040: 1f 91 pop r17 f042: 0f 91 pop r16 f044: 08 95 ret 0000f046 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f046: 61 e0 ldi r22, 0x01 ; 1 f048: 80 ec ldi r24, 0xC0 ; 192 f04a: 9f e0 ldi r25, 0x0F ; 15 f04c: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a f050: 60 e0 ldi r22, 0x00 ; 0 f052: 8f eb ldi r24, 0xBF ; 191 f054: 9f e0 ldi r25, 0x0F ; 15 f056: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a f05a: 60 e0 ldi r22, 0x00 ; 0 f05c: 8e eb ldi r24, 0xBE ; 190 f05e: 9f e0 ldi r25, 0x0F ; 15 f060: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a f064: 60 e0 ldi r22, 0x00 ; 0 f066: 8d eb ldi r24, 0xBD ; 189 f068: 9f e0 ldi r25, 0x0F ; 15 f06a: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a f06e: 60 e0 ldi r22, 0x00 ; 0 f070: 8c eb ldi r24, 0xBC ; 188 f072: 9f e0 ldi r25, 0x0F ; 15 f074: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0000f078 : } void print_hex_byte(uint8_t val) { f078: cf 93 push r28 f07a: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f07c: 82 95 swap r24 f07e: 8f 70 andi r24, 0x0F ; 15 f080: 0e 94 8a 64 call 0xc914 ; 0xc914 print_hex_nibble(val & 15); f084: 8c 2f mov r24, r28 f086: 8f 70 andi r24, 0x0F ; 15 } f088: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f08a: 0c 94 8a 64 jmp 0xc914 ; 0xc914 0000f08e : // 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) { f08e: 80 91 81 10 lds r24, 0x1081 ; 0x801081 f092: 90 91 82 10 lds r25, 0x1082 ; 0x801082 f096: 18 16 cp r1, r24 f098: 19 06 cpc r1, r25 f09a: 0c f0 brlt .+2 ; 0xf09e f09c: 43 c0 rjmp .+134 ; 0xf124 SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f09e: 01 97 sbiw r24, 0x01 ; 1 f0a0: 90 93 82 10 sts 0x1082, r25 ; 0x801082 f0a4: 80 93 81 10 sts 0x1081, r24 ; 0x801081 f0a8: 89 2b or r24, r25 f0aa: a1 f4 brne .+40 ; 0xf0d4 // Empty buffer. if (serial_count == 0) f0ac: 80 91 7c 10 lds r24, 0x107C ; 0x80107c f0b0: 90 91 7d 10 lds r25, 0x107D ; 0x80107d f0b4: 89 2b or r24, r25 f0b6: 21 f4 brne .+8 ; 0xf0c0 // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f0b8: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> f0bc: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.571> bufindr = bufindw; f0c0: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> f0c4: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> f0c8: 90 93 71 12 sts 0x1271, r25 ; 0x801271 f0cc: 80 93 70 12 sts 0x1270, r24 ; 0x801270 SERIAL_ECHOPGM(" new command on the top: "); SERIAL_ECHO(cmdbuffer+bufindr+CMDHDRSIZE); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; f0d0: 81 e0 ldi r24, 0x01 ; 1 f0d2: 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) ; f0d4: 80 91 70 12 lds r24, 0x1270 ; 0x801270 f0d8: 90 91 71 12 lds r25, 0x1271 ; 0x801271 f0dc: 03 96 adiw r24, 0x03 ; 3 f0de: fc 01 movw r30, r24 f0e0: ed 57 subi r30, 0x7D ; 125 f0e2: ff 4e sbci r31, 0xEF ; 239 f0e4: 20 81 ld r18, Z f0e6: 01 96 adiw r24, 0x01 ; 1 f0e8: 21 11 cpse r18, r1 f0ea: f9 cf rjmp .-14 ; 0xf0de f0ec: fc 01 movw r30, r24 f0ee: ed 57 subi r30, 0x7D ; 125 f0f0: 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) ; f0f2: 8d 3e cpi r24, 0xED ; 237 f0f4: 21 e0 ldi r18, 0x01 ; 1 f0f6: 92 07 cpc r25, r18 f0f8: 40 f4 brcc .+16 ; 0xf10a f0fa: 41 91 ld r20, Z+ f0fc: 9c 01 movw r18, r24 f0fe: 2f 5f subi r18, 0xFF ; 255 f100: 3f 4f sbci r19, 0xFF ; 255 f102: 41 11 cpse r20, r1 f104: e1 cf rjmp .-62 ; 0xf0c8 f106: c9 01 movw r24, r18 f108: f4 cf rjmp .-24 ; 0xf0f2 // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f10a: e3 e8 ldi r30, 0x83 ; 131 f10c: f0 e1 ldi r31, 0x10 ; 16 f10e: 8d 3e cpi r24, 0xED ; 237 f110: 21 e0 ldi r18, 0x01 ; 1 f112: 92 07 cpc r25, r18 f114: c9 f6 brne .-78 ; 0xf0c8 f116: cf 01 movw r24, r30 f118: 83 58 subi r24, 0x83 ; 131 f11a: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f11c: 21 91 ld r18, Z+ f11e: 22 23 and r18, r18 f120: d1 f3 breq .-12 ; 0xf116 f122: d2 cf rjmp .-92 ; 0xf0c8 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f124: 80 e0 ldi r24, 0x00 ; 0 } f126: 08 95 ret 0000f128 : 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; f128: 80 91 93 04 lds r24, 0x0493 ; 0x800493 f12c: 90 91 94 04 lds r25, 0x0494 ; 0x800494 f130: 20 91 95 04 lds r18, 0x0495 ; 0x800495 f134: 30 91 96 04 lds r19, 0x0496 ; 0x800496 f138: 82 1b sub r24, r18 f13a: 93 0b sbc r25, r19 } f13c: 8f 77 andi r24, 0x7F ; 127 f13e: 99 27 eor r25, r25 f140: 08 95 ret 0000f142 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f142: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f144: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f146: 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; f148: db 01 movw r26, r22 f14a: 4d 91 ld r20, X+ f14c: bd 01 movw r22, r26 f14e: 40 32 cpi r20, 0x20 ; 32 f150: 49 f0 breq .+18 ; 0xf164 if (i == 8) f152: 28 30 cpi r18, 0x08 ; 8 f154: 11 f4 brne .+4 ; 0xf15a { *pos++='.'; f156: 30 83 st Z, r19 f158: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f15a: db 01 movw r26, r22 f15c: 11 97 sbiw r26, 0x01 ; 1 f15e: 4c 91 ld r20, X f160: 40 83 st Z, r20 f162: 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++) f164: 2f 5f subi r18, 0xFF ; 255 f166: 2b 30 cpi r18, 0x0B ; 11 f168: 79 f7 brne .-34 ; 0xf148 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f16a: 10 82 st Z, r1 return buffer; } f16c: 08 95 ret 0000f16e : 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);} f16e: 40 e0 ldi r20, 0x00 ; 0 f170: 50 e0 ldi r21, 0x00 ; 0 f172: ba 01 movw r22, r20 f174: 0d 94 b1 6e jmp 0x2dd62 ; 0x2dd62 0000f178 : 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();} f178: fc 01 movw r30, r24 f17a: 23 81 ldd r18, Z+3 ; 0x03 f17c: 21 11 cpse r18, r1 f17e: 0d 94 74 a4 jmp 0x348e8 ; 0x348e8 f182: 08 95 ret 0000f184 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f184: 90 91 21 05 lds r25, 0x0521 ; 0x800521 f188: 91 11 cpse r25, r1 f18a: 07 c0 rjmp .+14 ; 0xf19a { while (!((M_UCSRxA) & (1 << M_UDREx))); f18c: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f190: 95 ff sbrs r25, 5 f192: fc cf rjmp .-8 ; 0xf18c M_UDRx = c; f194: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f198: 08 95 ret } else if (selectedSerialPort == 1) f19a: 91 30 cpi r25, 0x01 ; 1 f19c: 31 f4 brne .+12 ; 0xf1aa { while (!((UCSR1A) & (1 << UDRE1))); f19e: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f1a2: 95 ff sbrs r25, 5 f1a4: fc cf rjmp .-8 ; 0xf19e UDR1 = c; f1a6: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f1aa: 08 95 ret 0000f1ac : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f1ac: 0e 94 c2 78 call 0xf184 ; 0xf184 return 0; } f1b0: 90 e0 ldi r25, 0x00 ; 0 f1b2: 80 e0 ldi r24, 0x00 ; 0 f1b4: 08 95 ret 0000f1b6 : 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) { f1b6: cf 93 push r28 f1b8: df 93 push r29 f1ba: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f1bc: fe 01 movw r30, r28 f1be: 84 91 lpm r24, Z f1c0: 88 23 and r24, r24 f1c2: 21 f0 breq .+8 ; 0xf1cc MYSERIAL.write((char)ch); f1c4: 0e 94 c2 78 call 0xf184 ; 0xf184 ++str; f1c8: 21 96 adiw r28, 0x01 ; 1 f1ca: f8 cf rjmp .-16 ; 0xf1bc } } f1cc: df 91 pop r29 f1ce: cf 91 pop r28 f1d0: 08 95 ret 0000f1d2 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f1d2: cf 92 push r12 f1d4: df 92 push r13 f1d6: ef 92 push r14 f1d8: 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]; f1da: c0 90 61 0e lds r12, 0x0E61 ; 0x800e61 f1de: d0 90 62 0e lds r13, 0x0E62 ; 0x800e62 f1e2: e0 90 63 0e lds r14, 0x0E63 ; 0x800e63 f1e6: f0 90 64 0e lds r15, 0x0E64 ; 0x800e64 float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f1ea: 87 e2 ldi r24, 0x27 ; 39 f1ec: 9f e7 ldi r25, 0x7F ; 127 f1ee: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f1f2: 42 e0 ldi r20, 0x02 ; 2 f1f4: c7 01 movw r24, r14 f1f6: b6 01 movw r22, r12 f1f8: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f1fc: 8f e1 ldi r24, 0x1F ; 31 f1fe: 9f e7 ldi r25, 0x7F ; 127 f200: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f204: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 f208: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 f20c: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 f210: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 f214: 41 e0 ldi r20, 0x01 ; 1 f216: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f21a: ff 90 pop r15 f21c: ef 90 pop r14 f21e: df 90 pop r13 f220: 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(); f222: 0d 94 93 d6 jmp 0x3ad26 ; 0x3ad26 0000f226 : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f226: 4f 92 push r4 f228: 5f 92 push r5 f22a: 6f 92 push r6 f22c: 7f 92 push r7 f22e: 8f 92 push r8 f230: 9f 92 push r9 f232: af 92 push r10 f234: bf 92 push r11 f236: cf 92 push r12 f238: df 92 push r13 f23a: ef 92 push r14 f23c: ff 92 push r15 f23e: 0f 93 push r16 f240: 1f 93 push r17 f242: cf 93 push r28 f244: df 93 push r29 f246: cc 24 eor r12, r12 f248: ca 94 dec r12 f24a: dc 2c mov r13, r12 f24c: 76 01 movw r14, r12 f24e: 0e ea ldi r16, 0xAE ; 174 f250: 1f e0 ldi r17, 0x0F ; 15 f252: 93 e2 ldi r25, 0x23 ; 35 f254: 89 2e mov r8, r25 f256: 91 2c mov r9, r1 f258: a1 2c mov r10, r1 f25a: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f25c: 41 2c mov r4, r1 f25e: 51 2c mov r5, r1 f260: 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; f262: d0 e0 ldi r29, 0x00 ; 0 f264: 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) { f266: 8f ef ldi r24, 0xFF ; 255 f268: c8 16 cp r12, r24 f26a: 09 f4 brne .+2 ; 0xf26e f26c: 5d c0 rjmp .+186 ; 0xf328 usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f26e: c8 01 movw r24, r16 f270: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e f274: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f276: bc 01 movw r22, r24 f278: 99 0f add r25, r25 f27a: 88 0b sbc r24, r24 f27c: 99 0b sbc r25, r25 f27e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f282: 20 91 7a 06 lds r18, 0x067A ; 0x80067a f286: 30 91 7b 06 lds r19, 0x067B ; 0x80067b f28a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c f28e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d f292: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> f296: 2b 01 movw r4, r22 f298: 3c 01 movw r6, r24 f29a: c7 01 movw r24, r14 f29c: b6 01 movw r22, r12 f29e: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f2a2: 89 e1 ldi r24, 0x19 ; 25 f2a4: 9e e7 ldi r25, 0x7E ; 126 f2a6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f2aa: c5 01 movw r24, r10 f2ac: b4 01 movw r22, r8 f2ae: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f2b2: 89 e1 ldi r24, 0x19 ; 25 f2b4: 9e e7 ldi r25, 0x7E ; 126 f2b6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f2ba: be 01 movw r22, r28 f2bc: 0d 2e mov r0, r29 f2be: 00 0c add r0, r0 f2c0: 88 0b sbc r24, r24 f2c2: 99 0b sbc r25, r25 f2c4: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f2c8: 89 e1 ldi r24, 0x19 ; 25 f2ca: 9e e7 ldi r25, 0x7E ; 126 f2cc: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLLN(mm * 1000); f2d0: 20 e0 ldi r18, 0x00 ; 0 f2d2: 30 e0 ldi r19, 0x00 ; 0 f2d4: 4a e7 ldi r20, 0x7A ; 122 f2d6: 54 e4 ldi r21, 0x44 ; 68 f2d8: c3 01 movw r24, r6 f2da: b2 01 movw r22, r4 f2dc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> f2e0: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 f2e4: 85 e0 ldi r24, 0x05 ; 5 f2e6: 88 0e add r8, r24 f2e8: 91 1c adc r9, r1 f2ea: a1 1c adc r10, r1 f2ec: b1 1c adc r11, r1 f2ee: 0e 5f subi r16, 0xFE ; 254 f2f0: 1f 4f sbci r17, 0xFF ; 255 f2f2: 8f ef ldi r24, 0xFF ; 255 f2f4: c8 1a sub r12, r24 f2f6: d8 0a sbc r13, r24 f2f8: e8 0a sbc r14, r24 f2fa: 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++) { f2fc: 0a 3b cpi r16, 0xBA ; 186 f2fe: 8f e0 ldi r24, 0x0F ; 15 f300: 18 07 cpc r17, r24 f302: 09 f0 breq .+2 ; 0xf306 f304: b0 cf rjmp .-160 ; 0xf266 SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f306: df 91 pop r29 f308: cf 91 pop r28 f30a: 1f 91 pop r17 f30c: 0f 91 pop r16 f30e: ff 90 pop r15 f310: ef 90 pop r14 f312: df 90 pop r13 f314: cf 90 pop r12 f316: bf 90 pop r11 f318: af 90 pop r10 f31a: 9f 90 pop r9 f31c: 8f 90 pop r8 f31e: 7f 90 pop r7 f320: 6f 90 pop r6 f322: 5f 90 pop r5 f324: 4f 90 pop r4 f326: 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); f328: 87 e0 ldi r24, 0x07 ; 7 f32a: 9d e3 ldi r25, 0x3D ; 61 f32c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f330: b8 cf rjmp .-144 ; 0xf2a2 0000f332 : /// @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) { f332: 88 23 and r24, r24 f334: 71 f1 breq .+92 ; 0xf392 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f336: 8d e0 ldi r24, 0x0D ; 13 f338: 9e e7 ldi r25, 0x7E ; 126 f33a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f33e: 60 91 27 13 lds r22, 0x1327 ; 0x801327 f342: 70 e0 ldi r23, 0x00 ; 0 f344: 90 e0 ldi r25, 0x00 ; 0 f346: 80 e0 ldi r24, 0x00 ; 0 f348: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; f34c: 80 91 27 13 lds r24, 0x1327 ; 0x801327 f350: 84 30 cpi r24, 0x04 ; 4 f352: d8 f0 brcs .+54 ; 0xf38a f354: 10 92 27 13 sts 0x1327, r1 ; 0x801327 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f358: 88 e0 ldi r24, 0x08 ; 8 f35a: 9e e7 ldi r25, 0x7E ; 126 f35c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN((int)currentMMUSlot); f360: 80 91 27 13 lds r24, 0x1327 ; 0x801327 f364: 90 e0 ldi r25, 0x00 ; 0 f366: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 return currentMMUSlot; f36a: 80 91 27 13 lds r24, 0x1327 ; 0x801327 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; f36e: 20 91 ad 05 lds r18, 0x05AD ; 0x8005ad f372: 30 91 ae 05 lds r19, 0x05AE ; 0x8005ae f376: 30 93 6e 0e sts 0x0E6E, r19 ; 0x800e6e f37a: 20 93 6d 0e sts 0x0E6D, r18 ; 0x800e6d slot = choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT); } setTargetHotend(saved_extruder_temperature); MMU2::mmu2.load_filament_to_nozzle(slot); f37e: 0f 94 38 1d call 0x23a70 ; 0x23a70 load_filament_final_feed(); // @@TODO verify f382: 0e 94 48 65 call 0xca90 ; 0xca90 st_synchronize(); f386: 0d 94 2c 59 jmp 0x2b258 ; 0x2b258 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= MMU_FILAMENT_COUNT-1) currentMMUSlot = 0; else currentMMUSlot++; f38a: 8f 5f subi r24, 0xFF ; 255 f38c: 80 93 27 13 sts 0x1327, r24 ; 0x801327 f390: e3 cf rjmp .-58 ; 0xf358 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); f392: 8e e1 ldi r24, 0x1E ; 30 f394: 9f e3 ldi r25, 0x3F ; 63 f396: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 f39a: 70 e0 ldi r23, 0x00 ; 0 f39c: 60 e0 ldi r22, 0x00 ; 0 f39e: 0e 94 ba d9 call 0x1b374 ; 0x1b374 f3a2: e5 cf rjmp .-54 ; 0xf36e 0000f3a4 : return final_result; } void gcode_M114() { f3a4: cf 93 push r28 f3a6: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f3a8: 85 e0 ldi r24, 0x05 ; 5 f3aa: 9e e7 ldi r25, 0x7E ; 126 f3ac: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOL(current_position[X_AXIS]); f3b0: c3 e4 ldi r28, 0x43 ; 67 f3b2: d7 e0 ldi r29, 0x07 ; 7 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f3b4: 68 81 ld r22, Y f3b6: 79 81 ldd r23, Y+1 ; 0x01 f3b8: 8a 81 ldd r24, Y+2 ; 0x02 f3ba: 9b 81 ldd r25, Y+3 ; 0x03 f3bc: 42 e0 ldi r20, 0x02 ; 2 f3be: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOLPGM(" Y:"); f3c2: 81 e0 ldi r24, 0x01 ; 1 f3c4: 9e e7 ldi r25, 0x7E ; 126 f3c6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f3ca: 6c 81 ldd r22, Y+4 ; 0x04 f3cc: 7d 81 ldd r23, Y+5 ; 0x05 f3ce: 8e 81 ldd r24, Y+6 ; 0x06 f3d0: 9f 81 ldd r25, Y+7 ; 0x07 f3d2: 42 e0 ldi r20, 0x02 ; 2 f3d4: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f3d8: 8d ef ldi r24, 0xFD ; 253 f3da: 9d e7 ldi r25, 0x7D ; 125 f3dc: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f3e0: 68 85 ldd r22, Y+8 ; 0x08 f3e2: 79 85 ldd r23, Y+9 ; 0x09 f3e4: 8a 85 ldd r24, Y+10 ; 0x0a f3e6: 9b 85 ldd r25, Y+11 ; 0x0b f3e8: 42 e0 ldi r20, 0x02 ; 2 f3ea: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f3ee: 89 ef ldi r24, 0xF9 ; 249 f3f0: 9d e7 ldi r25, 0x7D ; 125 f3f2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f3f6: 6c 85 ldd r22, Y+12 ; 0x0c f3f8: 7d 85 ldd r23, Y+13 ; 0x0d f3fa: 8e 85 ldd r24, Y+14 ; 0x0e f3fc: 9f 85 ldd r25, Y+15 ; 0x0f f3fe: 42 e0 ldi r20, 0x02 ; 2 f400: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f404: 87 eb ldi r24, 0xB7 ; 183 f406: 96 e6 ldi r25, 0x66 ; 102 f408: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f40c: 80 e0 ldi r24, 0x00 ; 0 f40e: 0f 94 0a 59 call 0x2b214 ; 0x2b214 f412: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f416: ce e6 ldi r28, 0x6E ; 110 f418: d6 e0 ldi r29, 0x06 ; 6 f41a: 2c 81 ldd r18, Y+4 ; 0x04 f41c: 3d 81 ldd r19, Y+5 ; 0x05 f41e: 4e 81 ldd r20, Y+6 ; 0x06 f420: 5f 81 ldd r21, Y+7 ; 0x07 f422: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> f426: 42 e0 ldi r20, 0x02 ; 2 f428: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOLPGM(" Y:"); f42c: 85 ef ldi r24, 0xF5 ; 245 f42e: 9d e7 ldi r25, 0x7D ; 125 f430: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f434: 81 e0 ldi r24, 0x01 ; 1 f436: 0f 94 0a 59 call 0x2b214 ; 0x2b214 f43a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f43e: 28 85 ldd r18, Y+8 ; 0x08 f440: 39 85 ldd r19, Y+9 ; 0x09 f442: 4a 85 ldd r20, Y+10 ; 0x0a f444: 5b 85 ldd r21, Y+11 ; 0x0b f446: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> f44a: 42 e0 ldi r20, 0x02 ; 2 f44c: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOLPGM(" Z:"); f450: 81 ef ldi r24, 0xF1 ; 241 f452: 9d e7 ldi r25, 0x7D ; 125 f454: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f458: 82 e0 ldi r24, 0x02 ; 2 f45a: 0f 94 0a 59 call 0x2b214 ; 0x2b214 f45e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f462: 2c 85 ldd r18, Y+12 ; 0x0c f464: 3d 85 ldd r19, Y+13 ; 0x0d f466: 4e 85 ldd r20, Y+14 ; 0x0e f468: 5f 85 ldd r21, Y+15 ; 0x0f f46a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> f46e: 42 e0 ldi r20, 0x02 ; 2 f470: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOLPGM(" E:"); f474: 8d ee ldi r24, 0xED ; 237 f476: 9d e7 ldi r25, 0x7D ; 125 f478: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f47c: 83 e0 ldi r24, 0x03 ; 3 f47e: 0f 94 0a 59 call 0x2b214 ; 0x2b214 f482: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f486: 28 89 ldd r18, Y+16 ; 0x10 f488: 39 89 ldd r19, Y+17 ; 0x11 f48a: 4a 89 ldd r20, Y+18 ; 0x12 f48c: 5b 89 ldd r21, Y+19 ; 0x13 f48e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> } f492: df 91 pop r29 f494: 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]); f496: 0d 94 d8 76 jmp 0x2edb0 ; 0x2edb0 0000f49a : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f49a: 8c ef ldi r24, 0xFC ; 252 f49c: 9c e7 ldi r25, 0x7C ; 124 f49e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f4a2: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 f4a6: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 f4aa: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 f4ae: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 f4b2: 41 e0 ldi r20, 0x01 ; 1 f4b4: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f4b8: 89 ef ldi r24, 0xF9 ; 249 f4ba: 9c e7 ldi r25, 0x7C ; 124 f4bc: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f4c0: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d f4c4: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e f4c8: 07 2e mov r0, r23 f4ca: 00 0c add r0, r0 f4cc: 88 0b sbc r24, r24 f4ce: 99 0b sbc r25, r25 f4d0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f4d4: 41 e0 ldi r20, 0x01 ; 1 f4d6: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f4da: 85 ef ldi r24, 0xF5 ; 245 f4dc: 9c e7 ldi r25, 0x7C ; 124 f4de: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f4e2: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 f4e6: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 f4ea: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 f4ee: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 f4f2: 41 e0 ldi r20, 0x01 ; 1 f4f4: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f4f8: 82 ef ldi r24, 0xF2 ; 242 f4fa: 9c e7 ldi r25, 0x7C ; 124 f4fc: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f500: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b f504: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c f508: 07 2e mov r0, r23 f50a: 00 0c add r0, r0 f50c: 88 0b sbc r24, r24 f50e: 99 0b sbc r25, r25 f510: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f514: 41 e0 ldi r20, 0x01 ; 1 f516: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f51a: 8d ee ldi r24, 0xED ; 237 f51c: 9c e7 ldi r25, 0x7C ; 124 f51e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f522: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 f526: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 f52a: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 f52e: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 f532: 41 e0 ldi r20, 0x01 ; 1 f534: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f538: 8a ee ldi r24, 0xEA ; 234 f53a: 9c e7 ldi r25, 0x7C ; 124 f53c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f540: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d f544: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e f548: 07 2e mov r0, r23 f54a: 00 0c add r0, r0 f54c: 88 0b sbc r24, r24 f54e: 99 0b sbc r25, r25 f550: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f554: 41 e0 ldi r20, 0x01 ; 1 f556: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f55a: 86 ee ldi r24, 0xE6 ; 230 f55c: 9c e7 ldi r25, 0x7C ; 124 f55e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f562: 60 91 19 05 lds r22, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> f566: 70 e0 ldi r23, 0x00 ; 0 f568: 90 e0 ldi r25, 0x00 ; 0 f56a: 80 e0 ldi r24, 0x00 ; 0 f56c: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f570: 81 ee ldi r24, 0xE1 ; 225 f572: 9c e7 ldi r25, 0x7C ; 124 f574: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f578: 60 91 1a 06 lds r22, 0x061A ; 0x80061a f57c: 70 e0 ldi r23, 0x00 ; 0 f57e: 90 e0 ldi r25, 0x00 ; 0 f580: 80 e0 ldi r24, 0x00 ; 0 f582: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f586: 8d ed ldi r24, 0xDD ; 221 f588: 9c e7 ldi r25, 0x7C ; 124 f58a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f58e: 60 91 99 03 lds r22, 0x0399 ; 0x800399 f592: 70 91 9a 03 lds r23, 0x039A ; 0x80039a f596: 80 91 9b 03 lds r24, 0x039B ; 0x80039b f59a: 90 91 9c 03 lds r25, 0x039C ; 0x80039c f59e: 41 e0 ldi r20, 0x01 ; 1 f5a0: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(current_temperature_pinda,1); #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR SERIAL_PROTOCOLPGM(" A:"); f5a4: 89 ed ldi r24, 0xD9 ; 217 f5a6: 9c e7 ldi r25, 0x7C ; 124 f5a8: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 f5ac: 60 91 53 06 lds r22, 0x0653 ; 0x800653 f5b0: 70 91 54 06 lds r23, 0x0654 ; 0x800654 f5b4: 80 91 55 06 lds r24, 0x0655 ; 0x800655 f5b8: 90 91 56 06 lds r25, 0x0656 ; 0x800656 f5bc: 41 e0 ldi r20, 0x01 ; 1 f5be: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); f5c2: 0d 94 93 d6 jmp 0x3ad26 ; 0x3ad26 0000f5c6 : } } 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); } f5c6: 20 91 66 14 lds r18, 0x1466 ; 0x801466 f5ca: 30 e0 ldi r19, 0x00 ; 0 f5cc: a8 ee ldi r26, 0xE8 ; 232 f5ce: b3 e0 ldi r27, 0x03 ; 3 f5d0: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> f5d4: ab 01 movw r20, r22 f5d6: bc 01 movw r22, r24 f5d8: 87 e6 ldi r24, 0x67 ; 103 f5da: 94 e1 ldi r25, 0x14 ; 20 f5dc: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) f5e0: 88 23 and r24, r24 f5e2: 99 f0 breq .+38 ; 0xf60a f5e4: 80 91 65 14 lds r24, 0x1465 ; 0x801465 { if(autoReportFeatures.Temp()){ f5e8: 80 fd sbrc r24, 0 gcode_M105(); f5ea: 0e 94 4d 7a call 0xf49a ; 0xf49a f5ee: 80 91 65 14 lds r24, 0x1465 ; 0x801465 } if(autoReportFeatures.Pos()){ f5f2: 82 fd sbrc r24, 2 gcode_M114(); f5f4: 0e 94 d2 79 call 0xf3a4 ; 0xf3a4 f5f8: 80 91 65 14 lds r24, 0x1465 ; 0x801465 } #if defined(AUTO_REPORT) && (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1))))) if(autoReportFeatures.Fans()){ f5fc: 81 fd sbrc r24, 1 gcode_M123(); f5fe: 0e 94 39 67 call 0xce72 ; 0xce72 } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } f602: 87 e6 ldi r24, 0x67 ; 103 f604: 94 e1 ldi r25, 0x14 ; 20 f606: 0d 94 2e 42 jmp 0x2845c ; 0x2845c ::start()> gcode_M123(); } #endif //AUTO_REPORT and (FANCHECK and TACH_0 or TACH_1) autoReportFeatures.TimerStart(); } } f60a: 08 95 ret 0000f60c : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); f60c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 MYSERIAL.println(); f610: 0d 94 93 d6 jmp 0x3ad26 ; 0x3ad26 0000f614 : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { f614: 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))); f616: 81 ea ldi r24, 0xA1 ; 161 f618: 9d e0 ldi r25, 0x0D ; 13 f61a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> f61e: cb e0 ldi r28, 0x0B ; 11 f620: 8c 9f mul r24, r28 f622: c0 01 movw r24, r0 f624: 11 24 eor r1, r1 f626: 80 5b subi r24, 0xB0 ; 176 f628: 92 4f sbci r25, 0xF2 ; 242 f62a: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { f62e: 81 56 subi r24, 0x61 ; 97 f630: 90 4f sbci r25, 0xF0 ; 240 f632: 80 3a cpi r24, 0xA0 ; 160 f634: 9f 40 sbci r25, 0x0F ; 15 f636: c8 f0 brcs .+50 ; 0xf66a 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"); f638: 86 ef ldi r24, 0xF6 ; 246 f63a: 9e e7 ldi r25, 0x7E ; 126 f63c: 0e 94 06 7b call 0xf60c ; 0xf60c eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), f640: 81 ea ldi r24, 0xA1 ; 161 f642: 9d e0 ldi r25, 0x0D ; 13 f644: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 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-> f648: 8c 9f mul r24, r28 f64a: c0 01 movw r24, r0 f64c: 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); f64e: 70 e0 ldi r23, 0x00 ; 0 f650: 60 e0 ldi r22, 0x00 ; 0 f652: 80 5b subi r24, 0xB0 ; 176 f654: 92 4f sbci r25, 0xF2 ; 242 f656: 0f 94 ef dd call 0x3bbde ; 0x3bbde 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.")); f65a: 89 eb ldi r24, 0xB9 ; 185 f65c: 9e e7 ldi r25, 0x7E ; 126 f65e: 0f 94 0c 36 call 0x26c18 ; 0x26c18 lcd_update_enable(true); f662: 81 e0 ldi r24, 0x01 ; 1 } } f664: 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); f666: 0c 94 da 6f jmp 0xdfb4 ; 0xdfb4 } } f66a: cf 91 pop r28 f66c: 08 95 ret 0000f66e : // 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) { f66e: ff 92 push r15 f670: 0f 93 push r16 f672: 1f 93 push r17 f674: cf 93 push r28 f676: df 93 push r29 if(Stopped == false) { f678: 90 91 14 05 lds r25, 0x0514 ; 0x800514 f67c: 91 11 cpse r25, r1 f67e: 4f c0 rjmp .+158 ; 0xf71e f680: c8 2f mov r28, r24 Stopped = true; f682: 81 e0 ldi r24, 0x01 ; 1 f684: 80 93 14 05 sts 0x0514, r24 ; 0x800514 // Either pause or stop the print if(allow_recovery && printJobOngoing()) { f688: cc 23 and r28, r28 f68a: 11 f1 breq .+68 ; 0xf6d0 f68c: 0e 94 45 68 call 0xd08a ; 0xd08a f690: 88 23 and r24, r24 f692: f1 f0 breq .+60 ; 0xf6d0 if (!printingIsPaused()) { f694: 0e 94 3a 68 call 0xd074 ; 0xd074 f698: 81 11 cpse r24, r1 f69a: 22 c0 rjmp .+68 ; 0xf6e0 lcd_setalertstatuspgm(_T(MSG_PAUSED_THERMAL_ERROR), LCD_STATUS_CRITICAL); f69c: 81 ea ldi r24, 0xA1 ; 161 f69e: 96 e3 ldi r25, 0x36 ; 54 f6a0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 f6a4: 63 e0 ldi r22, 0x03 ; 3 f6a6: 0f 94 c7 06 call 0x20d8e ; 0x20d8e // 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; f6aa: f0 90 af 05 lds r15, 0x05AF ; 0x8005af uint16_t ext_temp = saved_extruder_temperature; f6ae: 00 91 ad 05 lds r16, 0x05AD ; 0x8005ad f6b2: 10 91 ae 05 lds r17, 0x05AE ; 0x8005ae uint8_t fan_speed = saved_fan_speed; f6b6: d0 91 ac 05 lds r29, 0x05AC ; 0x8005ac lcd_pause_print(); f6ba: 0f 94 97 3f call 0x27f2e ; 0x27f2e saved_bed_temperature = bed_temp; f6be: f0 92 af 05 sts 0x05AF, r15 ; 0x8005af saved_extruder_temperature = ext_temp; f6c2: 10 93 ae 05 sts 0x05AE, r17 ; 0x8005ae f6c6: 00 93 ad 05 sts 0x05AD, r16 ; 0x8005ad saved_fan_speed = fan_speed; f6ca: d0 93 ac 05 sts 0x05AC, r29 ; 0x8005ac f6ce: 08 c0 rjmp .+16 ; 0xf6e0 } } else { // We got a hard thermal error and/or there is no print going on. Just stop. print_stop(false, true); f6d0: 61 e0 ldi r22, 0x01 ; 1 f6d2: 80 e0 ldi r24, 0x00 ; 0 f6d4: 0f 94 17 16 call 0x22c2e ; 0x22c2e } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); f6d8: 8a ec ldi r24, 0xCA ; 202 f6da: 99 ea ldi r25, 0xA9 ; 169 f6dc: cc 23 and r28, r28 f6de: 11 f0 breq .+4 ; 0xf6e4 f6e0: 82 ef ldi r24, 0xF2 ; 242 f6e2: 99 ea ldi r25, 0xA9 ; 169 f6e4: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); f6e8: 80 e3 ldi r24, 0x30 ; 48 f6ea: 97 e6 ldi r25, 0x67 ; 103 f6ec: 0e 94 06 7b call 0xf60c ; 0xf60c // 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)); f6f0: 86 e9 ldi r24, 0x96 ; 150 f6f2: 96 e3 ldi r25, 0x36 ; 54 f6f4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 f6f8: 0f 94 ea 0b call 0x217d4 ; 0x217d4 // 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); f6fc: 9f b7 in r25, 0x3f ; 63 f6fe: f8 94 cli f700: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f704: 84 60 ori r24, 0x04 ; 4 f706: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f70a: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); f70c: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 if(!allow_recovery) { f710: c1 11 cpse r28, r1 f712: 05 c0 rjmp .+10 ; 0xf71e // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); f714: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 f718: 81 60 ori r24, 0x01 ; 1 f71a: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 } } } f71e: df 91 pop r29 f720: cf 91 pop r28 f722: 1f 91 pop r17 f724: 0f 91 pop r16 f726: ff 90 pop r15 f728: 08 95 ret 0000f72a : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { f72a: ec 01 movw r28, r24 cli(); // Stop interrupts f72c: f8 94 cli disable_heater(); f72e: 0f 94 57 45 call 0x28aae ; 0x28aae disable_x(); f732: 17 9a sbi 0x02, 7 ; 2 f734: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); f738: 16 9a sbi 0x02, 6 ; 2 f73a: 10 92 41 07 sts 0x0741, r1 ; 0x800741 poweroff_z(); disable_e0(); f73e: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; f740: 8a ec ldi r24, 0xCA ; 202 f742: 99 ea ldi r25, 0xA9 ; 169 f744: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); f748: 8a e9 ldi r24, 0x9A ; 154 f74a: 9e e7 ldi r25, 0x7E ; 126 f74c: 0e 94 06 7b call 0xf60c ; 0xf60c if (full_screen_message != NULL) { f750: 20 97 sbiw r28, 0x00 ; 0 f752: 79 f0 breq .+30 ; 0xf772 SERIAL_ERRORLNRPGM(full_screen_message); f754: ce 01 movw r24, r28 f756: 0e 94 06 7b call 0xf60c ; 0xf60c f75a: be 01 movw r22, r28 f75c: 85 e9 ldi r24, 0x95 ; 149 f75e: 9c e0 ldi r25, 0x0C ; 12 f760: 0f 94 ef dd call 0x3bbde ; 0x3bbde 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); f764: 62 e4 ldi r22, 0x42 ; 66 f766: 84 e9 ldi r24, 0x94 ; 148 f768: 9c e0 ldi r25, 0x0C ; 12 f76a: 0f 94 d9 dd call 0x3bbb2 ; 0x3bbb2 // 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(); f76e: 0e 94 01 68 call 0xd002 ; 0xd002 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); f772: c2 e9 ldi r28, 0x92 ; 146 f774: de e7 ldi r29, 0x7E ; 126 f776: f1 cf rjmp .-30 ; 0xf75a 0000f778 : #endif //TMC2130 #ifdef TMC2130 void check_Z_crash(void) { if (!READ(Z_TMC2130_DIAG)) { //Z crash f778: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> f77c: 86 fd sbrc r24, 6 f77e: 35 c0 rjmp .+106 ; 0xf7ea FORCE_HIGH_POWER_END; f780: 80 e0 ldi r24, 0x00 ; 0 f782: 0e 94 65 67 call 0xceca ; 0xceca current_position[Z_AXIS] = 0; f786: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b f78a: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c f78e: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d f792: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e plan_set_position_curposXYZE(); f796: 0f 94 53 b9 call 0x372a6 ; 0x372a6 current_position[Z_AXIS] += MESH_HOME_Z_SEARCH; f79a: 20 e0 ldi r18, 0x00 ; 0 f79c: 30 e0 ldi r19, 0x00 ; 0 f79e: 40 ea ldi r20, 0xA0 ; 160 f7a0: 50 e4 ldi r21, 0x40 ; 64 f7a2: 60 91 4b 07 lds r22, 0x074B ; 0x80074b f7a6: 70 91 4c 07 lds r23, 0x074C ; 0x80074c f7aa: 80 91 4d 07 lds r24, 0x074D ; 0x80074d f7ae: 90 91 4e 07 lds r25, 0x074E ; 0x80074e f7b2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> f7b6: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b f7ba: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c f7be: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d f7c2: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); f7c6: e0 91 99 02 lds r30, 0x0299 ; 0x800299 f7ca: f0 91 9a 02 lds r31, 0x029A ; 0x80029a f7ce: 60 85 ldd r22, Z+8 ; 0x08 f7d0: 71 85 ldd r23, Z+9 ; 0x09 f7d2: 82 85 ldd r24, Z+10 ; 0x0a f7d4: 93 85 ldd r25, Z+11 ; 0x0b f7d6: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); f7da: 0f 94 2c 59 call 0x2b258 ; 0x2b258 kill(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); f7de: 80 ec ldi r24, 0xC0 ; 192 f7e0: 94 e6 ldi r25, 0x64 ; 100 f7e2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 f7e6: 0e 94 95 7b call 0xf72a ; 0xf72a } } f7ea: 08 95 ret 0000f7ec : #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) #endif //TMC2130 { f7ec: 2f 92 push r2 f7ee: 3f 92 push r3 f7f0: 4f 92 push r4 f7f2: 5f 92 push r5 f7f4: 6f 92 push r6 f7f6: 7f 92 push r7 f7f8: 8f 92 push r8 f7fa: 9f 92 push r9 f7fc: af 92 push r10 f7fe: bf 92 push r11 f800: cf 92 push r12 f802: df 92 push r13 f804: ef 92 push r14 f806: ff 92 push r15 f808: 0f 93 push r16 f80a: 1f 93 push r17 f80c: cf 93 push r28 f80e: df 93 push r29 f810: cd b7 in r28, 0x3d ; 61 f812: de b7 in r29, 0x3e ; 62 f814: 60 97 sbiw r28, 0x10 ; 16 f816: 0f b6 in r0, 0x3f ; 63 f818: f8 94 cli f81a: de bf out 0x3e, r29 ; 62 f81c: 0f be out 0x3f, r0 ; 63 f81e: cd bf out 0x3d, r28 ; 61 f820: 28 2e mov r2, r24 f822: 6e 87 std Y+14, r22 ; 0x0e f824: 5a 87 std Y+10, r21 ; 0x0a f826: 49 87 std Y+9, r20 ; 0x09 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; f828: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> f82c: 2d 87 std Y+13, r18 ; 0x0d check_endstops = check; f82e: 77 24 eor r7, r7 f830: 73 94 inc r7 f832: 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) f836: 42 e0 ldi r20, 0x02 ; 2 f838: 84 17 cp r24, r20 f83a: 09 f4 brne .+2 ; 0xf83e f83c: d4 c1 rjmp .+936 ; 0xfbe6 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); f83e: 08 2f mov r16, r24 f840: 10 e0 ldi r17, 0x00 ; 0 f842: f8 01 movw r30, r16 f844: ea 52 subi r30, 0x2A ; 42 f846: f3 48 sbci r31, 0x83 ; 131 #define DEFINE_PGM_READ_ANY(type, reader) \ static inline type pgm_read_any(const type *p) \ { return pgm_read_##reader##_near(p); } DEFINE_PGM_READ_ANY(float, float); DEFINE_PGM_READ_ANY(signed char, byte); f848: 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); f84a: 83 2d mov r24, r3 f84c: 03 2c mov r0, r3 f84e: 00 0c add r0, r0 f850: 99 0b sbc r25, r25 f852: 9c 87 std Y+12, r25 ; 0x0c f854: 8b 87 std Y+11, r24 ; 0x0b feedrate = homing_feedrate[axis]; f856: d8 01 movw r26, r16 f858: aa 0f add r26, r26 f85a: bb 1f adc r27, r27 f85c: aa 0f add r26, r26 f85e: bb 1f adc r27, r27 f860: ba 83 std Y+2, r27 ; 0x02 f862: a9 83 std Y+1, r26 ; 0x01 f864: fd 01 movw r30, r26 f866: e3 53 subi r30, 0x33 ; 51 f868: fd 4f sbci r31, 0xFD ; 253 f86a: 80 81 ld r24, Z f86c: 91 81 ldd r25, Z+1 ; 0x01 f86e: a2 81 ldd r26, Z+2 ; 0x02 f870: b3 81 ldd r27, Z+3 ; 0x03 f872: 8b 83 std Y+3, r24 ; 0x03 f874: 9c 83 std Y+4, r25 ; 0x04 f876: ad 83 std Y+5, r26 ; 0x05 f878: be 83 std Y+6, r27 ; 0x06 f87a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 f87e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 f882: a0 93 92 02 sts 0x0292, r26 ; 0x800292 f886: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); f88a: bc 01 movw r22, r24 f88c: cd 01 movw r24, r26 f88e: 0e 94 7c 67 call 0xcef8 ; 0xcef8 f892: 6b 01 movw r12, r22 f894: 7c 01 movw r14, r24 #ifdef TMC2130 tmc2130_home_enter(X_AXIS_MASK << axis); f896: 81 e0 ldi r24, 0x01 ; 1 f898: 02 2c mov r0, r2 f89a: 01 c0 rjmp .+2 ; 0xf89e f89c: 88 0f add r24, r24 f89e: 0a 94 dec r0 f8a0: ea f7 brpl .-6 ; 0xf89c f8a2: 0f 94 93 3b call 0x27726 ; 0x27726 // 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; f8a6: a9 81 ldd r26, Y+1 ; 0x01 f8a8: ba 81 ldd r27, Y+2 ; 0x02 f8aa: ad 5b subi r26, 0xBD ; 189 f8ac: b8 4f sbci r27, 0xF8 ; 248 f8ae: b8 87 std Y+8, r27 ; 0x08 f8b0: af 83 std Y+7, r26 ; 0x07 f8b2: fd 01 movw r30, r26 f8b4: 10 82 st Z, r1 f8b6: 11 82 std Z+1, r1 ; 0x01 f8b8: 12 82 std Z+2, r1 ; 0x02 f8ba: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f8bc: 0f 94 53 b9 call 0x372a6 ; 0x372a6 set_destination_to_current(); f8c0: 0e 94 ef 68 call 0xd1de ; 0xd1de // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; f8c4: 63 2d mov r22, r3 f8c6: 03 2c mov r0, r3 f8c8: 00 0c add r0, r0 f8ca: 77 0b sbc r23, r23 f8cc: 88 0b sbc r24, r24 f8ce: 99 0b sbc r25, r25 f8d0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> f8d4: 4b 01 movw r8, r22 f8d6: 5c 01 movw r10, r24 f8d8: 49 81 ldd r20, Y+1 ; 0x01 f8da: 5a 81 ldd r21, Y+2 ; 0x02 f8dc: 4c 5a subi r20, 0xAC ; 172 f8de: 5a 4f sbci r21, 0xFA ; 250 f8e0: 58 8b std Y+16, r21 ; 0x10 f8e2: 4f 87 std Y+15, r20 ; 0x0f f8e4: 20 e0 ldi r18, 0x00 ; 0 f8e6: 30 e0 ldi r19, 0x00 ; 0 f8e8: 40 e4 ldi r20, 0x40 ; 64 f8ea: 50 ec ldi r21, 0xC0 ; 192 f8ec: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> f8f0: af 85 ldd r26, Y+15 ; 0x0f f8f2: b8 89 ldd r27, Y+16 ; 0x10 f8f4: 6d 93 st X+, r22 f8f6: 7d 93 st X+, r23 f8f8: 8d 93 st X+, r24 f8fa: 9c 93 st X, r25 f8fc: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f8fe: c7 01 movw r24, r14 f900: b6 01 movw r22, r12 f902: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); f906: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); f90a: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec f90e: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; f912: ef 81 ldd r30, Y+7 ; 0x07 f914: f8 85 ldd r31, Y+8 ; 0x08 f916: 10 82 st Z, r1 f918: 11 82 std Z+1, r1 ; 0x01 f91a: 12 82 std Z+2, r1 ; 0x02 f91c: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); f91e: 0f 94 53 b9 call 0x372a6 ; 0x372a6 destination[axis] = 1. * axis_home_dir; f922: af 85 ldd r26, Y+15 ; 0x0f f924: b8 89 ldd r27, Y+16 ; 0x10 f926: 8d 92 st X+, r8 f928: 9d 92 st X+, r9 f92a: ad 92 st X+, r10 f92c: bc 92 st X, r11 f92e: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); f930: c7 01 movw r24, r14 f932: b6 01 movw r22, r12 f934: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); f938: 0f 94 2c 59 call 0x2b258 ; 0x2b258 f93c: 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); f940: e9 81 ldd r30, Y+1 ; 0x01 f942: fa 81 ldd r31, Y+2 ; 0x02 f944: e6 53 subi r30, 0x36 ; 54 f946: 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); f948: 45 90 lpm r4, Z+ f94a: 55 90 lpm r5, Z+ f94c: 65 90 lpm r6, Z+ f94e: 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); f950: 2d ec ldi r18, 0xCD ; 205 f952: 3c ec ldi r19, 0xCC ; 204 f954: 4c e8 ldi r20, 0x8C ; 140 f956: 5f e3 ldi r21, 0x3F ; 63 f958: c5 01 movw r24, r10 f95a: b4 01 movw r22, r8 f95c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> f960: a3 01 movw r20, r6 f962: 92 01 movw r18, r4 f964: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> f968: ef 85 ldd r30, Y+15 ; 0x0f f96a: f8 89 ldd r31, Y+16 ; 0x10 f96c: 60 83 st Z, r22 f96e: 71 83 std Z+1, r23 ; 0x01 f970: 82 83 std Z+2, r24 ; 0x02 f972: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f974: c7 01 movw r24, r14 f976: b6 01 movw r22, r12 f978: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); f97c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 f980: 71 2c mov r7, r1 f982: 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; f984: 4f 80 ldd r4, Y+7 ; 0x07 f986: 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(); f988: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec f98c: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(false); current_position[axis] = 0; f990: d2 01 movw r26, r4 f992: 1d 92 st X+, r1 f994: 1d 92 st X+, r1 f996: 1d 92 st X+, r1 f998: 1c 92 st X, r1 f99a: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); f99c: 0f 94 53 b9 call 0x372a6 ; 0x372a6 destination[axis] = -10.f * axis_home_dir; f9a0: 20 e0 ldi r18, 0x00 ; 0 f9a2: 30 e0 ldi r19, 0x00 ; 0 f9a4: 40 e2 ldi r20, 0x20 ; 32 f9a6: 51 ec ldi r21, 0xC1 ; 193 f9a8: c5 01 movw r24, r10 f9aa: b4 01 movw r22, r8 f9ac: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> f9b0: ef 85 ldd r30, Y+15 ; 0x0f f9b2: f8 89 ldd r31, Y+16 ; 0x10 f9b4: 60 83 st Z, r22 f9b6: 71 83 std Z+1, r23 ; 0x01 f9b8: 82 83 std Z+2, r24 ; 0x02 f9ba: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(feedrate_mm_s); f9bc: c7 01 movw r24, r14 f9be: b6 01 movw r22, r12 f9c0: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); f9c4: 0f 94 2c 59 call 0x2b258 ; 0x2b258 endstops_hit_on_purpose(); f9c8: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec f9cc: f1 e0 ldi r31, 0x01 ; 1 f9ce: 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; f9d2: 20 e0 ldi r18, 0x00 ; 0 f9d4: 30 e0 ldi r19, 0x00 ; 0 f9d6: 40 e3 ldi r20, 0x30 ; 48 f9d8: 51 e4 ldi r21, 0x41 ; 65 f9da: c5 01 movw r24, r10 f9dc: b4 01 movw r22, r8 f9de: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> f9e2: af 85 ldd r26, Y+15 ; 0x0f f9e4: b8 89 ldd r27, Y+16 ; 0x10 f9e6: 6d 93 st X+, r22 f9e8: 7d 93 st X+, r23 f9ea: 8d 93 st X+, r24 f9ec: 9c 93 st X, r25 f9ee: 13 97 sbiw r26, 0x03 ; 3 #ifdef TMC2130 feedrate = homing_feedrate[axis]; f9f0: 8b 81 ldd r24, Y+3 ; 0x03 f9f2: 9c 81 ldd r25, Y+4 ; 0x04 f9f4: ad 81 ldd r26, Y+5 ; 0x05 f9f6: be 81 ldd r27, Y+6 ; 0x06 f9f8: 80 93 90 02 sts 0x0290, r24 ; 0x800290 f9fc: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fa00: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fa04: 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); fa08: c7 01 movw r24, r14 fa0a: b6 01 movw r22, r12 fa0c: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); fa10: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #ifdef TMC2130 uint16_t mscnt = tmc2130_rd_MSCNT(axis); fa14: 82 2d mov r24, r2 fa16: 0f 94 30 3a call 0x27460 ; 0x27460 fa1a: 9c 01 movw r18, r24 fa1c: 44 e0 ldi r20, 0x04 ; 4 fa1e: 36 95 lsr r19 fa20: 27 95 ror r18 fa22: 4a 95 dec r20 fa24: e1 f7 brne .-8 ; 0xfa1e if (pstep) pstep[i] = mscnt >> 4; fa26: a9 85 ldd r26, Y+9 ; 0x09 fa28: ba 85 ldd r27, Y+10 ; 0x0a fa2a: 10 97 sbiw r26, 0x00 ; 0 fa2c: 21 f0 breq .+8 ; 0xfa36 fa2e: fd 01 movw r30, r26 fa30: e6 0d add r30, r6 fa32: f7 1d adc r31, r7 fa34: 20 83 st Z, r18 printf_P(PSTR("%3d step=%2d mscnt=%4d\n"), i, mscnt >> 4, mscnt); fa36: 9f 93 push r25 fa38: 8f 93 push r24 fa3a: 3f 93 push r19 fa3c: 2f 93 push r18 fa3e: 7f 92 push r7 fa40: 6f 92 push r6 fa42: e2 eb ldi r30, 0xB2 ; 178 fa44: fc e7 ldi r31, 0x7C ; 124 fa46: ff 93 push r31 fa48: ef 93 push r30 fa4a: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 fa4e: 4f ef ldi r20, 0xFF ; 255 fa50: 64 1a sub r6, r20 fa52: 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++) fa54: 0f b6 in r0, 0x3f ; 63 fa56: f8 94 cli fa58: de bf out 0x3e, r29 ; 62 fa5a: 0f be out 0x3f, r0 ; 63 fa5c: cd bf out 0x3d, r28 ; 61 fa5e: 9e 85 ldd r25, Y+14 ; 0x0e fa60: 69 16 cp r6, r25 fa62: 08 f4 brcc .+2 ; 0xfa66 fa64: 91 cf rjmp .-222 ; 0xf988 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(); fa66: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec fa6a: 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)) fa6e: 80 91 f5 04 lds r24, 0x04F5 ; 0x8004f5 fa72: 88 23 and r24, r24 fa74: 09 f4 brne .+2 ; 0xfa78 fa76: b2 c0 rjmp .+356 ; 0xfbdc } endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; fa78: f8 01 movw r30, r16 fa7a: ea 50 subi r30, 0x0A ; 10 fa7c: fb 4f sbci r31, 0xFB ; 251 fa7e: 60 81 ld r22, Z uint8_t back = tmc2130_home_bsteps[axis]; if (tmc2130_home_enabled && (orig <= 63)) fa80: 60 34 cpi r22, 0x40 ; 64 fa82: 08 f0 brcs .+2 ; 0xfa86 fa84: ab c0 rjmp .+342 ; 0xfbdc endstops_hit_on_purpose(); enable_endstops(false); #ifdef TMC2130 uint8_t orig = tmc2130_home_origin[axis]; uint8_t back = tmc2130_home_bsteps[axis]; fa86: f8 01 movw r30, r16 fa88: e6 5a subi r30, 0xA6 ; 166 fa8a: fd 4f sbci r31, 0xFD ; 253 fa8c: a0 81 ld r26, Z fa8e: ab 83 std Y+3, r26 ; 0x03 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); fa90: f8 01 movw r30, r16 fa92: e8 50 subi r30, 0x08 ; 8 fa94: fb 4f sbci r31, 0xFB ; 251 fa96: 80 81 ld r24, Z fa98: 40 e0 ldi r20, 0x00 ; 0 fa9a: 51 e0 ldi r21, 0x01 ; 1 fa9c: 02 c0 rjmp .+4 ; 0xfaa2 fa9e: 56 95 lsr r21 faa0: 47 95 ror r20 faa2: 8a 95 dec r24 faa4: e2 f7 brpl .-8 ; 0xfa9e if (tmc2130_home_enabled && (orig <= 63)) { tmc2130_goto_step(axis, orig, 2, 1000, tmc2130_get_res(axis)); faa6: 82 2d mov r24, r2 faa8: 0f 94 75 8b call 0x316ea ; 0x316ea if (back > 0) faac: bb 81 ldd r27, Y+3 ; 0x03 faae: bb 23 and r27, r27 fab0: 39 f0 breq .+14 ; 0xfac0 tmc2130_do_steps(axis, back, -axis_home_dir, 1000); fab2: 43 2d mov r20, r3 fab4: 41 95 neg r20 fab6: 6b 2f mov r22, r27 fab8: 70 e0 ldi r23, 0x00 ; 0 } else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); faba: 82 2d mov r24, r2 fabc: 0f 94 46 8b call 0x3168c ; 0x3168c tmc2130_home_exit(); fac0: 0f 94 64 3b call 0x276c8 ; 0x276c8 #endif //TMC2130 axis_is_at_home(axis); fac4: 82 2d mov r24, r2 fac6: 0e 94 50 5b call 0xb6a0 ; 0xb6a0 axis_known_position[axis] = true; faca: f8 01 movw r30, r16 facc: e0 5c subi r30, 0xC0 ; 192 face: f8 4f sbci r31, 0xF8 ; 248 fad0: 81 e0 ldi r24, 0x01 ; 1 fad2: 80 83 st Z, r24 // Move from minimum #ifdef TMC2130 float dist = - axis_home_dir * 0.01f * tmc2130_home_fsteps[axis]; fad4: 6b 85 ldd r22, Y+11 ; 0x0b fad6: 7c 85 ldd r23, Y+12 ; 0x0c fad8: 71 95 neg r23 fada: 61 95 neg r22 fadc: 71 09 sbc r23, r1 fade: 07 2e mov r0, r23 fae0: 00 0c add r0, r0 fae2: 88 0b sbc r24, r24 fae4: 99 0b sbc r25, r25 fae6: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> faea: 2a e0 ldi r18, 0x0A ; 10 faec: 37 ed ldi r19, 0xD7 ; 215 faee: 43 e2 ldi r20, 0x23 ; 35 faf0: 5c e3 ldi r21, 0x3C ; 60 faf2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> faf6: 4b 01 movw r8, r22 faf8: 5c 01 movw r10, r24 fafa: f8 01 movw r30, r16 fafc: e8 5a subi r30, 0xA8 ; 168 fafe: fd 4f sbci r31, 0xFD ; 253 fb00: 60 81 ld r22, Z fb02: 70 e0 ldi r23, 0x00 ; 0 fb04: 90 e0 ldi r25, 0x00 ; 0 fb06: 80 e0 ldi r24, 0x00 ; 0 fb08: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> fb0c: 9b 01 movw r18, r22 fb0e: ac 01 movw r20, r24 fb10: c5 01 movw r24, r10 fb12: b4 01 movw r22, r8 fb14: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> fb18: 4b 01 movw r8, r22 fb1a: 5c 01 movw r10, r24 #else //TMC2130 float dist = - axis_home_dir * 0.01f * 64; #endif //TMC2130 current_position[axis] -= dist; fb1c: e9 81 ldd r30, Y+1 ; 0x01 fb1e: fa 81 ldd r31, Y+2 ; 0x02 fb20: ed 5b subi r30, 0xBD ; 189 fb22: f8 4f sbci r31, 0xF8 ; 248 fb24: fc 83 std Y+4, r31 ; 0x04 fb26: eb 83 std Y+3, r30 ; 0x03 fb28: ac 01 movw r20, r24 fb2a: 9b 01 movw r18, r22 fb2c: 60 81 ld r22, Z fb2e: 71 81 ldd r23, Z+1 ; 0x01 fb30: 82 81 ldd r24, Z+2 ; 0x02 fb32: 93 81 ldd r25, Z+3 ; 0x03 fb34: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> fb38: ab 81 ldd r26, Y+3 ; 0x03 fb3a: bc 81 ldd r27, Y+4 ; 0x04 fb3c: 6d 93 st X+, r22 fb3e: 7d 93 st X+, r23 fb40: 8d 93 st X+, r24 fb42: 9c 93 st X, r25 fb44: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); fb46: 0f 94 53 b9 call 0x372a6 ; 0x372a6 current_position[axis] += dist; fb4a: eb 81 ldd r30, Y+3 ; 0x03 fb4c: fc 81 ldd r31, Y+4 ; 0x04 fb4e: 20 81 ld r18, Z fb50: 31 81 ldd r19, Z+1 ; 0x01 fb52: 42 81 ldd r20, Z+2 ; 0x02 fb54: 53 81 ldd r21, Z+3 ; 0x03 fb56: c5 01 movw r24, r10 fb58: b4 01 movw r22, r8 fb5a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> fb5e: ab 81 ldd r26, Y+3 ; 0x03 fb60: bc 81 ldd r27, Y+4 ; 0x04 fb62: 6d 93 st X+, r22 fb64: 7d 93 st X+, r23 fb66: 8d 93 st X+, r24 fb68: 9c 93 st X, r25 fb6a: 13 97 sbiw r26, 0x03 ; 3 destination[axis] = current_position[axis]; fb6c: e9 81 ldd r30, Y+1 ; 0x01 fb6e: fa 81 ldd r31, Y+2 ; 0x02 fb70: ec 5a subi r30, 0xAC ; 172 fb72: fa 4f sbci r31, 0xFA ; 250 fb74: 60 83 st Z, r22 fb76: 71 83 std Z+1, r23 ; 0x01 fb78: 82 83 std Z+2, r24 ; 0x02 fb7a: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); fb7c: 20 e0 ldi r18, 0x00 ; 0 fb7e: 30 e0 ldi r19, 0x00 ; 0 fb80: 40 e0 ldi r20, 0x00 ; 0 fb82: 5f e3 ldi r21, 0x3F ; 63 fb84: c7 01 movw r24, r14 fb86: b6 01 movw r22, r12 fb88: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> fb8c: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); fb90: 0f 94 2c 59 call 0x2b258 ; 0x2b258 feedrate = 0.0; fb94: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fb98: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fb9c: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fba0: 10 92 93 02 sts 0x0293, r1 ; 0x800293 fba4: fd 85 ldd r31, Y+13 ; 0x0d fba6: f0 93 8f 02 sts 0x028F, r31 ; 0x80028f <_ZL14check_endstops.lto_priv.389> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } fbaa: 60 96 adiw r28, 0x10 ; 16 fbac: 0f b6 in r0, 0x3f ; 63 fbae: f8 94 cli fbb0: de bf out 0x3e, r29 ; 62 fbb2: 0f be out 0x3f, r0 ; 63 fbb4: cd bf out 0x3d, r28 ; 61 fbb6: df 91 pop r29 fbb8: cf 91 pop r28 fbba: 1f 91 pop r17 fbbc: 0f 91 pop r16 fbbe: ff 90 pop r15 fbc0: ef 90 pop r14 fbc2: df 90 pop r13 fbc4: cf 90 pop r12 fbc6: bf 90 pop r11 fbc8: af 90 pop r10 fbca: 9f 90 pop r9 fbcc: 8f 90 pop r8 fbce: 7f 90 pop r7 fbd0: 6f 90 pop r6 fbd2: 5f 90 pop r5 fbd4: 4f 90 pop r4 fbd6: 3f 90 pop r3 fbd8: 2f 90 pop r2 fbda: 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); fbdc: 43 2d mov r20, r3 fbde: 41 95 neg r20 fbe0: 68 e0 ldi r22, 0x08 ; 8 fbe2: 70 e0 ldi r23, 0x00 ; 0 fbe4: 6a cf rjmp .-300 ; 0xfaba feedrate = 0.0; } else if ((axis==Z_AXIS)?HOMEAXIS_DO(Z):0) { #ifdef TMC2130 FORCE_HIGH_POWER_START; fbe6: 81 e0 ldi r24, 0x01 ; 1 fbe8: 0e 94 65 67 call 0xceca ; 0xceca #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); fbec: e8 ed ldi r30, 0xD8 ; 216 fbee: fc e7 ldi r31, 0x7C ; 124 fbf0: b4 91 lpm r27, Z fbf2: 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; fbf4: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b fbf8: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c fbfc: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d fc00: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e plan_set_position_curposXYZE(); fc04: 0f 94 53 b9 call 0x372a6 ; 0x372a6 #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); fc08: e2 ed ldi r30, 0xD2 ; 210 fc0a: fc e7 ldi r31, 0x7C ; 124 fc0c: 85 90 lpm r8, Z+ fc0e: 95 90 lpm r9, Z+ fc10: a5 90 lpm r10, Z+ fc12: 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; fc14: e9 81 ldd r30, Y+1 ; 0x01 fc16: 6e 2f mov r22, r30 fc18: ee 0f add r30, r30 fc1a: 77 0b sbc r23, r23 fc1c: 88 0b sbc r24, r24 fc1e: 99 0b sbc r25, r25 fc20: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> fc24: 6b 01 movw r12, r22 fc26: 7c 01 movw r14, r24 fc28: 20 e0 ldi r18, 0x00 ; 0 fc2a: 30 e0 ldi r19, 0x00 ; 0 fc2c: 40 ec ldi r20, 0xC0 ; 192 fc2e: 5f e3 ldi r21, 0x3F ; 63 fc30: c5 01 movw r24, r10 fc32: b4 01 movw r22, r8 fc34: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> fc38: a7 01 movw r20, r14 fc3a: 96 01 movw r18, r12 fc3c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> fc40: 60 93 5c 05 sts 0x055C, r22 ; 0x80055c fc44: 70 93 5d 05 sts 0x055D, r23 ; 0x80055d fc48: 80 93 5e 05 sts 0x055E, r24 ; 0x80055e fc4c: 90 93 5f 05 sts 0x055F, r25 ; 0x80055f feedrate = homing_feedrate[axis]; fc50: 80 e0 ldi r24, 0x00 ; 0 fc52: 90 e0 ldi r25, 0x00 ; 0 fc54: a8 e4 ldi r26, 0x48 ; 72 fc56: b4 e4 ldi r27, 0x44 ; 68 fc58: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fc5c: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fc60: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fc64: b0 93 93 02 sts 0x0293, r27 ; 0x800293 float feedrate_mm_s = get_feedrate_mm_s(feedrate); fc68: bc 01 movw r22, r24 fc6a: cd 01 movw r24, r26 fc6c: 0e 94 7c 67 call 0xcef8 ; 0xcef8 fc70: 4b 01 movw r8, r22 fc72: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); fc74: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); fc78: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #ifdef TMC2130 check_Z_crash(); fc7c: 0e 94 bc 7b call 0xf778 ; 0xf778 #endif //TMC2130 current_position[axis] = 0; fc80: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b fc84: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c fc88: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d fc8c: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e plan_set_position_curposXYZE(); fc90: 0f 94 53 b9 call 0x372a6 ; 0x372a6 #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); fc94: ee ea ldi r30, 0xAE ; 174 fc96: fc e7 ldi r31, 0x7C ; 124 fc98: 65 91 lpm r22, Z+ fc9a: 75 91 lpm r23, Z+ fc9c: 85 91 lpm r24, Z+ fc9e: 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; fca0: 90 58 subi r25, 0x80 ; 128 fca2: a7 01 movw r20, r14 fca4: 96 01 movw r18, r12 fca6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> fcaa: 60 93 5c 05 sts 0x055C, r22 ; 0x80055c fcae: 70 93 5d 05 sts 0x055D, r23 ; 0x80055d fcb2: 80 93 5e 05 sts 0x055E, r24 ; 0x80055e fcb6: 90 93 5f 05 sts 0x055F, r25 ; 0x80055f plan_buffer_line_destinationXYZE(feedrate_mm_s); fcba: c5 01 movw r24, r10 fcbc: b4 01 movw r22, r8 fcbe: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); fcc2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #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); fcc6: ee ea ldi r30, 0xAE ; 174 fcc8: fc e7 ldi r31, 0x7C ; 124 fcca: 65 91 lpm r22, Z+ fccc: 75 91 lpm r23, Z+ fcce: 85 91 lpm r24, Z+ fcd0: 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; fcd2: 9b 01 movw r18, r22 fcd4: ac 01 movw r20, r24 fcd6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> fcda: a7 01 movw r20, r14 fcdc: 96 01 movw r18, r12 fcde: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> fce2: 60 93 5c 05 sts 0x055C, r22 ; 0x80055c fce6: 70 93 5d 05 sts 0x055D, r23 ; 0x80055d fcea: 80 93 5e 05 sts 0x055E, r24 ; 0x80055e fcee: 90 93 5f 05 sts 0x055F, r25 ; 0x80055f feedrate = homing_feedrate[axis] / 2; fcf2: 80 e0 ldi r24, 0x00 ; 0 fcf4: 90 e0 ldi r25, 0x00 ; 0 fcf6: a8 ec ldi r26, 0xC8 ; 200 fcf8: b3 e4 ldi r27, 0x43 ; 67 fcfa: 80 93 90 02 sts 0x0290, r24 ; 0x800290 fcfe: 90 93 91 02 sts 0x0291, r25 ; 0x800291 fd02: a0 93 92 02 sts 0x0292, r26 ; 0x800292 fd06: b0 93 93 02 sts 0x0293, r27 ; 0x800293 feedrate_mm_s = get_feedrate_mm_s(feedrate); fd0a: bc 01 movw r22, r24 fd0c: cd 01 movw r24, r26 fd0e: 0e 94 7c 67 call 0xcef8 ; 0xcef8 plan_buffer_line_destinationXYZE(feedrate_mm_s); fd12: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); fd16: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #ifdef TMC2130 check_Z_crash(); fd1a: 0e 94 bc 7b call 0xf778 ; 0xf778 #endif //TMC2130 axis_is_at_home(axis); fd1e: 82 e0 ldi r24, 0x02 ; 2 fd20: 0e 94 50 5b call 0xb6a0 ; 0xb6a0 destination[axis] = current_position[axis]; fd24: 80 91 4b 07 lds r24, 0x074B ; 0x80074b fd28: 90 91 4c 07 lds r25, 0x074C ; 0x80074c fd2c: a0 91 4d 07 lds r26, 0x074D ; 0x80074d fd30: b0 91 4e 07 lds r27, 0x074E ; 0x80074e fd34: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c fd38: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d fd3c: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e fd40: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f feedrate = 0.0; fd44: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fd48: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fd4c: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fd50: 10 92 93 02 sts 0x0293, r1 ; 0x800293 endstops_hit_on_purpose(); fd54: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec axis_known_position[axis] = true; fd58: 70 92 42 07 sts 0x0742, r7 ; 0x800742 #ifdef TMC2130 FORCE_HIGH_POWER_END; fd5c: 80 e0 ldi r24, 0x00 ; 0 fd5e: 0e 94 65 67 call 0xceca ; 0xceca fd62: 20 cf rjmp .-448 ; 0xfba4 0000fd64 : #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 { fd64: 2f 92 push r2 fd66: 3f 92 push r3 fd68: 4f 92 push r4 fd6a: 5f 92 push r5 fd6c: 6f 92 push r6 fd6e: 7f 92 push r7 fd70: 8f 92 push r8 fd72: 9f 92 push r9 fd74: af 92 push r10 fd76: bf 92 push r11 fd78: cf 92 push r12 fd7a: df 92 push r13 fd7c: ef 92 push r14 fd7e: ff 92 push r15 fd80: 0f 93 push r16 fd82: 1f 93 push r17 fd84: cf 93 push r28 fd86: df 93 push r29 fd88: 00 d0 rcall .+0 ; 0xfd8a fd8a: 1f 92 push r1 fd8c: 1f 92 push r1 fd8e: cd b7 in r28, 0x3d ; 61 fd90: de b7 in r29, 0x3e ; 62 fd92: d8 2e mov r13, r24 fd94: 2a 01 movw r4, r20 fd96: 3b 01 movw r6, r22 fd98: 32 2e mov r3, r18 fd9a: e9 82 std Y+1, r14 ; 0x01 fd9c: fa 82 std Y+2, r15 ; 0x02 fd9e: 0b 83 std Y+3, r16 ; 0x03 fda0: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); fda2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 homing_flag = true; fda6: 81 e0 ldi r24, 0x01 ; 1 fda8: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 bool home_x = home_x_axis; bool home_y = home_y_axis; bool home_z = home_z_axis; // Either all X,Y,Z codes are present, or none of them. bool home_all_axes = home_x == home_y && home_x == home_z; fdac: fc 2c mov r15, r12 fdae: e3 2c mov r14, r3 fdb0: d3 10 cpse r13, r3 fdb2: 10 c0 rjmp .+32 ; 0xfdd4 fdb4: ed 2c mov r14, r13 fdb6: dc 10 cpse r13, r12 fdb8: 0d c0 rjmp .+26 ; 0xfdd4 // 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); fdba: 60 e0 ldi r22, 0x00 ; 0 fdbc: 70 e0 ldi r23, 0x00 ; 0 fdbe: 80 ea ldi r24, 0xA0 ; 160 fdc0: 90 e4 ldi r25, 0x40 ; 64 fdc2: 0e 94 15 6f call 0xde2a ; 0xde2a // 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; fdc6: ff 24 eor r15, r15 fdc8: f3 94 inc r15 fdca: ee 24 eor r14, r14 fdcc: e3 94 inc r14 fdce: 22 24 eor r2, r2 fdd0: 23 94 inc r2 fdd2: 01 c0 rjmp .+2 ; 0xfdd6 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; fdd4: 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(); fdd6: 0f 94 b0 cb call 0x39760 ; 0x39760 // 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; fdda: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 fdde: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; fde0: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); fde4: 82 e0 ldi r24, 0x02 ; 2 fde6: 0f 94 18 59 call 0x2b230 ; 0x2b230 fdea: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b fdee: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c fdf2: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d fdf6: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e #endif // Reset baby stepping to zero, if the babystepping has already been loaded before. if (home_z) fdfa: f1 10 cpse r15, r1 babystep_undo(); fdfc: 0f 94 55 c7 call 0x38eaa ; 0x38eaa int l_feedmultiply = setup_for_endstop_move(); fe00: 81 e0 ldi r24, 0x01 ; 1 fe02: 0e 94 9d 67 call 0xcf3a ; 0xcf3a fe06: 8c 01 movw r16, r24 set_destination_to_current(); fe08: 0e 94 ef 68 call 0xd1de ; 0xd1de feedrate = 0.0; fe0c: 10 92 90 02 sts 0x0290, r1 ; 0x800290 fe10: 10 92 91 02 sts 0x0291, r1 ; 0x800291 fe14: 10 92 92 02 sts 0x0292, r1 ; 0x800292 fe18: 10 92 93 02 sts 0x0293, r1 ; 0x800293 current_position[Z_AXIS] = destination[Z_AXIS]; } #endif /* QUICK_HOME */ #ifdef TMC2130 if(home_x) fe1c: 22 20 and r2, r2 fe1e: 09 f4 brne .+2 ; 0xfe22 fe20: 77 c1 rjmp .+750 ; 0x10110 { if (!calib) fe22: 9b 8d ldd r25, Y+27 ; 0x1b fe24: 91 11 cpse r25, r1 fe26: 6a c1 rjmp .+724 ; 0x100fc homeaxis(X_AXIS); fe28: 50 e0 ldi r21, 0x00 ; 0 fe2a: 40 e0 ldi r20, 0x00 ; 0 fe2c: 61 e0 ldi r22, 0x01 ; 1 fe2e: 80 e0 ldi r24, 0x00 ; 0 fe30: 0e 94 f6 7b call 0xf7ec ; 0xf7ec else tmc2130_home_calibrate(X_AXIS); } if(home_y) fe34: ee 20 and r14, r14 fe36: 31 f0 breq .+12 ; 0xfe44 { if (!calib) homeaxis(Y_AXIS); fe38: 50 e0 ldi r21, 0x00 ; 0 fe3a: 40 e0 ldi r20, 0x00 ; 0 fe3c: 61 e0 ldi r22, 0x01 ; 1 fe3e: 81 e0 ldi r24, 0x01 ; 1 fe40: 0e 94 f6 7b call 0xf7ec ; 0xf7ec if(home_x) homeaxis(X_AXIS); if(home_y) homeaxis(Y_AXIS); #endif //TMC2130 if(home_x_axis && home_x_value != 0) fe44: dd 20 and r13, r13 fe46: e9 f0 breq .+58 ; 0xfe82 fe48: 41 14 cp r4, r1 fe4a: 51 04 cpc r5, r1 fe4c: 61 04 cpc r6, r1 fe4e: 71 04 cpc r7, r1 fe50: c1 f0 breq .+48 ; 0xfe82 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; fe52: c3 01 movw r24, r6 fe54: b2 01 movw r22, r4 fe56: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> fe5a: 9b 01 movw r18, r22 fe5c: ac 01 movw r20, r24 fe5e: 60 91 c6 06 lds r22, 0x06C6 ; 0x8006c6 fe62: 70 91 c7 06 lds r23, 0x06C7 ; 0x8006c7 fe66: 80 91 c8 06 lds r24, 0x06C8 ; 0x8006c8 fe6a: 90 91 c9 06 lds r25, 0x06C9 ; 0x8006c9 fe6e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> fe72: 60 93 43 07 sts 0x0743, r22 ; 0x800743 fe76: 70 93 44 07 sts 0x0744, r23 ; 0x800744 fe7a: 80 93 45 07 sts 0x0745, r24 ; 0x800745 fe7e: 90 93 46 07 sts 0x0746, r25 ; 0x800746 if(home_y_axis && home_y_value != 0) fe82: 33 20 and r3, r3 fe84: 01 f1 breq .+64 ; 0xfec6 fe86: 89 81 ldd r24, Y+1 ; 0x01 fe88: 9a 81 ldd r25, Y+2 ; 0x02 fe8a: ab 81 ldd r26, Y+3 ; 0x03 fe8c: bc 81 ldd r27, Y+4 ; 0x04 fe8e: 00 97 sbiw r24, 0x00 ; 0 fe90: a1 05 cpc r26, r1 fe92: b1 05 cpc r27, r1 fe94: c1 f0 breq .+48 ; 0xfec6 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; fe96: bc 01 movw r22, r24 fe98: cd 01 movw r24, r26 fe9a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> fe9e: 9b 01 movw r18, r22 fea0: ac 01 movw r20, r24 fea2: 60 91 ca 06 lds r22, 0x06CA ; 0x8006ca fea6: 70 91 cb 06 lds r23, 0x06CB ; 0x8006cb feaa: 80 91 cc 06 lds r24, 0x06CC ; 0x8006cc feae: 90 91 cd 06 lds r25, 0x06CD ; 0x8006cd feb2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> feb6: 60 93 47 07 sts 0x0747, r22 ; 0x800747 feba: 70 93 48 07 sts 0x0748, r23 ; 0x800748 febe: 80 93 49 07 sts 0x0749, r24 ; 0x800749 fec2: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { fec6: ff 20 and r15, r15 fec8: 09 f4 brne .+2 ; 0xfecc feca: a2 c0 rjmp .+324 ; 0x10010 #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); fecc: 60 e0 ldi r22, 0x00 ; 0 fece: 70 e0 ldi r23, 0x00 ; 0 fed0: 80 ea ldi r24, 0xA0 ; 160 fed2: 90 e4 ldi r25, 0x40 ; 64 fed4: 0e 94 15 6f call 0xde2a ; 0xde2a if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); fed8: 80 91 40 07 lds r24, 0x0740 ; 0x800740 fedc: 81 11 cpse r24, r1 fede: 05 c0 rjmp .+10 ; 0xfeea fee0: 50 e0 ldi r21, 0x00 ; 0 fee2: 40 e0 ldi r20, 0x00 ; 0 fee4: 61 e0 ldi r22, 0x01 ; 1 fee6: 0e 94 f6 7b call 0xf7ec ; 0xf7ec if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); feea: 80 91 41 07 lds r24, 0x0741 ; 0x800741 feee: 81 11 cpse r24, r1 fef0: 06 c0 rjmp .+12 ; 0xfefe fef2: 50 e0 ldi r21, 0x00 ; 0 fef4: 40 e0 ldi r20, 0x00 ; 0 fef6: 61 e0 ldi r22, 0x01 ; 1 fef8: 81 e0 ldi r24, 0x01 ; 1 fefa: 0e 94 f6 7b call 0xf7ec ; 0xf7ec // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); fefe: 0f 94 15 cc call 0x3982a ; 0x3982a world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); ff02: e3 e2 ldi r30, 0x23 ; 35 ff04: f2 e9 ldi r31, 0x92 ; 146 ff06: 85 91 lpm r24, Z+ ff08: 95 91 lpm r25, Z+ ff0a: a5 91 lpm r26, Z+ ff0c: b4 91 lpm r27, Z ff0e: ef e1 ldi r30, 0x1F ; 31 ff10: f2 e9 ldi r31, 0x92 ; 146 ff12: 45 91 lpm r20, Z+ ff14: 55 91 lpm r21, Z+ ff16: 65 91 lpm r22, Z+ ff18: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; ff1a: 40 93 54 05 sts 0x0554, r20 ; 0x800554 ff1e: 50 93 55 05 sts 0x0555, r21 ; 0x800555 ff22: 60 93 56 05 sts 0x0556, r22 ; 0x800556 ff26: 70 93 57 05 sts 0x0557, r23 ; 0x800557 out_y = y; ff2a: 80 93 58 05 sts 0x0558, r24 ; 0x800558 ff2e: 90 93 59 05 sts 0x0559, r25 ; 0x800559 ff32: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a ff36: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b world2machine(out_x, out_y); ff3a: 68 e5 ldi r22, 0x58 ; 88 ff3c: 75 e0 ldi r23, 0x05 ; 5 ff3e: 84 e5 ldi r24, 0x54 ; 84 ff40: 95 e0 ldi r25, 0x05 ; 5 ff42: 0e 94 b7 6a call 0xd56e ; 0xd56e world2machine_reset(); ff46: 0f 94 77 cb call 0x396ee ; 0x396ee if (destination[Y_AXIS] < Y_MIN_POS) ff4a: 20 e0 ldi r18, 0x00 ; 0 ff4c: 30 e0 ldi r19, 0x00 ; 0 ff4e: 40 e8 ldi r20, 0x80 ; 128 ff50: 50 ec ldi r21, 0xC0 ; 192 ff52: 60 91 58 05 lds r22, 0x0558 ; 0x800558 ff56: 70 91 59 05 lds r23, 0x0559 ; 0x800559 ff5a: 80 91 5a 05 lds r24, 0x055A ; 0x80055a ff5e: 90 91 5b 05 lds r25, 0x055B ; 0x80055b ff62: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> ff66: 87 ff sbrs r24, 7 ff68: 0c c0 rjmp .+24 ; 0xff82 destination[Y_AXIS] = Y_MIN_POS; ff6a: 80 e0 ldi r24, 0x00 ; 0 ff6c: 90 e0 ldi r25, 0x00 ; 0 ff6e: a0 e8 ldi r26, 0x80 ; 128 ff70: b0 ec ldi r27, 0xC0 ; 192 ff72: 80 93 58 05 sts 0x0558, r24 ; 0x800558 ff76: 90 93 59 05 sts 0x0559, r25 ; 0x800559 ff7a: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a ff7e: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b feedrate = homing_feedrate[X_AXIS] / 20; ff82: 80 e0 ldi r24, 0x00 ; 0 ff84: 90 e0 ldi r25, 0x00 ; 0 ff86: a6 e1 ldi r26, 0x16 ; 22 ff88: b3 e4 ldi r27, 0x43 ; 67 ff8a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 ff8e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 ff92: a0 93 92 02 sts 0x0292, r26 ; 0x800292 ff96: b0 93 93 02 sts 0x0293, r27 ; 0x800293 ff9a: 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(); ff9e: 0f 94 53 b9 call 0x372a6 ; 0x372a6 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); ffa2: 60 91 90 02 lds r22, 0x0290 ; 0x800290 ffa6: 70 91 91 02 lds r23, 0x0291 ; 0x800291 ffaa: 80 91 92 02 lds r24, 0x0292 ; 0x800292 ffae: 90 91 93 02 lds r25, 0x0293 ; 0x800293 ffb2: 0f 94 60 ba call 0x374c0 ; 0x374c0 st_synchronize(); ffb6: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[X_AXIS] = destination[X_AXIS]; ffba: 80 91 54 05 lds r24, 0x0554 ; 0x800554 ffbe: 90 91 55 05 lds r25, 0x0555 ; 0x800555 ffc2: a0 91 56 05 lds r26, 0x0556 ; 0x800556 ffc6: b0 91 57 05 lds r27, 0x0557 ; 0x800557 ffca: 80 93 43 07 sts 0x0743, r24 ; 0x800743 ffce: 90 93 44 07 sts 0x0744, r25 ; 0x800744 ffd2: a0 93 45 07 sts 0x0745, r26 ; 0x800745 ffd6: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = destination[Y_AXIS]; ffda: 80 91 58 05 lds r24, 0x0558 ; 0x800558 ffde: 90 91 59 05 lds r25, 0x0559 ; 0x800559 ffe2: a0 91 5a 05 lds r26, 0x055A ; 0x80055a ffe6: b0 91 5b 05 lds r27, 0x055B ; 0x80055b ffea: 80 93 47 07 sts 0x0747, r24 ; 0x800747 ffee: 90 93 48 07 sts 0x0748, r25 ; 0x800748 fff2: a0 93 49 07 sts 0x0749, r26 ; 0x800749 fff6: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a fffa: 81 e0 ldi r24, 0x01 ; 1 fffc: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); endstops_hit_on_purpose(); 10000: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec homeaxis(Z_AXIS); 10004: 50 e0 ldi r21, 0x00 ; 0 10006: 40 e0 ldi r20, 0x00 ; 0 10008: 61 e0 ldi r22, 0x01 ; 1 1000a: 82 e0 ldi r24, 0x02 ; 2 1000c: 0e 94 f6 7b call 0xf7ec ; 0xf7ec homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) 10010: cc 20 and r12, r12 10012: e9 f0 breq .+58 ; 0x1004e 10014: 81 14 cp r8, r1 10016: 91 04 cpc r9, r1 10018: a1 04 cpc r10, r1 1001a: b1 04 cpc r11, r1 1001c: c1 f0 breq .+48 ; 0x1004e current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; 1001e: c5 01 movw r24, r10 10020: b4 01 movw r22, r8 10022: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 10026: 9b 01 movw r18, r22 10028: ac 01 movw r20, r24 1002a: 60 91 ce 06 lds r22, 0x06CE ; 0x8006ce 1002e: 70 91 cf 06 lds r23, 0x06CF ; 0x8006cf 10032: 80 91 d0 06 lds r24, 0x06D0 ; 0x8006d0 10036: 90 91 d1 06 lds r25, 0x06D1 ; 0x8006d1 1003a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1003e: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 10042: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 10046: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 1004a: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e // Set the planner and stepper routine positions. // At this point the mesh bed leveling and world2machine corrections are disabled and current_position // contains the machine coordinates. plan_set_position_curposXYZE(); 1004e: 0f 94 53 b9 call 0x372a6 ; 0x372a6 clean_up_after_endstop_move(l_feedmultiply); 10052: c8 01 movw r24, r16 10054: 0e 94 83 67 call 0xcf06 ; 0xcf06 endstops_hit_on_purpose(); 10058: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec // Load the machine correction matrix world2machine_initialize(); 1005c: 0f 94 15 cc call 0x3982a ; 0x3982a // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); 10060: 0f 94 b3 c9 call 0x39366 ; 0x39366 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) 10064: d1 10 cpse r13, r1 10066: 07 c0 rjmp .+14 ; 0x10076 10068: 31 10 cpse r3, r1 1006a: 05 c0 rjmp .+10 ; 0x10076 1006c: 8c 8d ldd r24, Y+28 ; 0x1c 1006e: 81 11 cpse r24, r1 10070: 02 c0 rjmp .+4 ; 0x10076 10072: cc 20 and r12, r12 10074: 39 f1 breq .+78 ; 0x100c4 { if (! home_z && mbl_was_active) { 10076: f1 10 cpse r15, r1 10078: 25 c0 rjmp .+74 ; 0x100c4 1007a: 9d 81 ldd r25, Y+5 ; 0x05 1007c: 99 23 and r25, r25 1007e: 11 f1 breq .+68 ; 0x100c4 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; 10080: 81 e0 ldi r24, 0x01 ; 1 10082: 80 93 a0 13 sts 0x13A0, r24 ; 0x8013a0 // and re-adjust the current logical Z axis with the bed leveling offset applicable at the current XY position. current_position[Z_AXIS] -= mbl.get_z(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS)); 10086: 0f 94 18 59 call 0x2b230 ; 0x2b230 1008a: 6b 01 movw r12, r22 1008c: 7c 01 movw r14, r24 1008e: 80 e0 ldi r24, 0x00 ; 0 10090: 0f 94 18 59 call 0x2b230 ; 0x2b230 10094: a7 01 movw r20, r14 10096: 96 01 movw r18, r12 10098: 0f 94 53 96 call 0x32ca6 ; 0x32ca6 1009c: 9b 01 movw r18, r22 1009e: ac 01 movw r20, r24 100a0: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 100a4: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 100a8: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 100ac: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 100b0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 100b4: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 100b8: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 100bc: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 100c0: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } #endif prusa_statistics(20); st_synchronize(); 100c4: 0f 94 2c 59 call 0x2b258 ; 0x2b258 homing_flag = false; 100c8: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 #if 0 SERIAL_ECHOPGM("G28, final "); print_world_coordinates(); SERIAL_ECHOPGM("G28, final "); print_physical_coordinates(); SERIAL_ECHOPGM("G28, final "); print_mesh_bed_leveling_table(); #endif } 100cc: 0f 90 pop r0 100ce: 0f 90 pop r0 100d0: 0f 90 pop r0 100d2: 0f 90 pop r0 100d4: 0f 90 pop r0 100d6: df 91 pop r29 100d8: cf 91 pop r28 100da: 1f 91 pop r17 100dc: 0f 91 pop r16 100de: ff 90 pop r15 100e0: ef 90 pop r14 100e2: df 90 pop r13 100e4: cf 90 pop r12 100e6: bf 90 pop r11 100e8: af 90 pop r10 100ea: 9f 90 pop r9 100ec: 8f 90 pop r8 100ee: 7f 90 pop r7 100f0: 6f 90 pop r6 100f2: 5f 90 pop r5 100f4: 4f 90 pop r4 100f6: 3f 90 pop r3 100f8: 2f 90 pop r2 100fa: 08 95 ret if(home_x) { if (!calib) homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); 100fc: 80 e0 ldi r24, 0x00 ; 0 100fe: 0f 94 56 38 call 0x270ac ; 0x270ac } if(home_y) 10102: ee 20 and r14, r14 10104: 09 f4 brne .+2 ; 0x10108 10106: 9e ce rjmp .-708 ; 0xfe44 { if (!calib) homeaxis(Y_AXIS); else tmc2130_home_calibrate(Y_AXIS); 10108: 81 e0 ldi r24, 0x01 ; 1 1010a: 0f 94 56 38 call 0x270ac ; 0x270ac 1010e: 9a ce rjmp .-716 ; 0xfe44 homeaxis(X_AXIS); else tmc2130_home_calibrate(X_AXIS); } if(home_y) 10110: ee 20 and r14, r14 10112: 09 f4 brne .+2 ; 0x10116 10114: 97 ce rjmp .-722 ; 0xfe44 { if (!calib) 10116: ab 8d ldd r26, Y+27 ; 0x1b 10118: aa 23 and r26, r26 1011a: 09 f4 brne .+2 ; 0x1011e 1011c: 8d ce rjmp .-742 ; 0xfe38 1011e: f4 cf rjmp .-24 ; 0x10108 00010120 : 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) { 10120: 8f 92 push r8 10122: 9f 92 push r9 10124: af 92 push r10 10126: bf 92 push r11 10128: cf 92 push r12 1012a: ef 92 push r14 1012c: ff 92 push r15 1012e: 0f 93 push r16 10130: 1f 93 push r17 10132: 26 2f mov r18, r22 #ifdef TMC2130 gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, false, true); 10134: 91 e0 ldi r25, 0x01 ; 1 10136: 9f 93 push r25 10138: 1f 92 push r1 1013a: 81 2c mov r8, r1 1013c: 91 2c mov r9, r1 1013e: 54 01 movw r10, r8 10140: c4 2e mov r12, r20 10142: e1 2c mov r14, r1 10144: f1 2c mov r15, r1 10146: 87 01 movw r16, r14 10148: 40 e0 ldi r20, 0x00 ; 0 1014a: 50 e0 ldi r21, 0x00 ; 0 1014c: ba 01 movw r22, r20 1014e: 0e 94 b2 7e call 0xfd64 ; 0xfd64 10152: 0f 90 pop r0 10154: 0f 90 pop r0 #else gcode_G28(home_x_axis, 0, home_y_axis, 0, home_z_axis, 0, true); #endif //TMC2130 } 10156: 1f 91 pop r17 10158: 0f 91 pop r16 1015a: ff 90 pop r15 1015c: ef 90 pop r14 1015e: cf 90 pop r12 10160: bf 90 pop r11 10162: af 90 pop r10 10164: 9f 90 pop r9 10166: 8f 90 pop r8 10168: 08 95 ret 0001016a : // 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(); 1016a: 88 e8 ldi r24, 0x88 ; 136 1016c: 93 e0 ldi r25, 0x03 ; 3 1016e: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 10172: 80 91 81 10 lds r24, 0x1081 ; 0x801081 10176: 90 91 82 10 lds r25, 0x1082 ; 0x801082 1017a: 89 2b or r24, r25 1017c: 79 f0 breq .+30 ; 0x1019c 1017e: e0 91 70 12 lds r30, 0x1270 ; 0x801270 10182: f0 91 71 12 lds r31, 0x1271 ; 0x801271 10186: ed 57 subi r30, 0x7D ; 125 10188: ff 4e sbci r31, 0xEF ; 239 1018a: 80 81 ld r24, Z 1018c: 81 30 cpi r24, 0x01 ; 1 1018e: 11 f0 breq .+4 ; 0x10194 10190: 86 30 cpi r24, 0x06 ; 6 10192: 21 f4 brne .+8 ; 0x1019c SERIAL_PROTOCOLLNRPGM(MSG_OK); 10194: 8a e0 ldi r24, 0x0A ; 10 10196: 9e e6 ldi r25, 0x6E ; 110 10198: 0c 94 06 7b jmp 0xf60c ; 0xf60c } 1019c: 08 95 ret 0001019e : void cmdqueue_reset() { while (buflen) 1019e: 80 91 81 10 lds r24, 0x1081 ; 0x801081 101a2: 90 91 82 10 lds r25, 0x1082 ; 0x801082 101a6: 89 2b or r24, r25 101a8: 29 f0 breq .+10 ; 0x101b4 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 101aa: 0e 94 b5 80 call 0x1016a ; 0x1016a cmdqueue_pop_front(); 101ae: 0e 94 47 78 call 0xf08e ; 0xf08e 101b2: f5 cf rjmp .-22 ; 0x1019e } bufindr = 0; 101b4: 10 92 71 12 sts 0x1271, r1 ; 0x801271 101b8: 10 92 70 12 sts 0x1270, r1 ; 0x801270 bufindw = 0; 101bc: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 101c0: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.571> //commands are removed from command queue after process_command() function is finished //reseting command queue and enqueing new commands during some (usually long running) command processing would cause that new commands are immediately removed from queue (or damaged) //this will ensure that all new commands which are enqueued after cmdqueue reset, will be always executed cmdbuffer_front_already_processed = true; 101c4: 81 e0 ldi r24, 0x01 ; 1 101c6: 80 93 80 10 sts 0x1080, r24 ; 0x801080 } 101ca: 08 95 ret 000101cc : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 101cc: ef 92 push r14 101ce: ff 92 push r15 101d0: 0f 93 push r16 101d2: 1f 93 push r17 101d4: cf 93 push r28 101d6: df 93 push r29 if (mbl.active) { 101d8: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 101dc: 88 23 and r24, r24 101de: 89 f1 breq .+98 ; 0x10242 } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 101e0: 82 ec ldi r24, 0xC2 ; 194 101e2: 9d e7 ldi r25, 0x7D ; 125 101e4: 0e 94 06 7b call 0xf60c ; 0xf60c SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 101e8: 8c ea ldi r24, 0xAC ; 172 101ea: 9d e7 ldi r25, 0x7D ; 125 101ec: 0e 94 06 7b call 0xf60c ; 0xf60c SERIAL_PROTOCOLLNPGM("Measured points:"); 101f0: 8b e9 ldi r24, 0x9B ; 155 101f2: 9d e7 ldi r25, 0x7D ; 125 101f4: 0e 94 06 7b call 0xf60c ; 0xf60c for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 101f8: c7 e0 ldi r28, 0x07 ; 7 101fa: dc e1 ldi r29, 0x1C ; 28 101fc: c1 50 subi r28, 0x01 ; 1 101fe: 58 f1 brcs .+86 ; 0x10256 10200: cd 9f mul r28, r29 10202: 70 01 movw r14, r0 10204: 11 24 eor r1, r1 10206: 01 e0 ldi r16, 0x01 ; 1 10208: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 1020a: 88 e9 ldi r24, 0x98 ; 152 1020c: 9d e7 ldi r25, 0x7D ; 125 1020e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOL_F(z_values[y][x], 5); 10212: f8 01 movw r30, r16 10214: ee 0f add r30, r30 10216: ff 1f adc r31, r31 10218: ee 0f add r30, r30 1021a: ff 1f adc r31, r31 1021c: ee 0d add r30, r14 1021e: ff 1d adc r31, r15 10220: e3 56 subi r30, 0x63 ; 99 10222: fc 4e sbci r31, 0xEC ; 236 10224: 60 81 ld r22, Z 10226: 71 81 ldd r23, Z+1 ; 0x01 10228: 82 81 ldd r24, Z+2 ; 0x02 1022a: 93 81 ldd r25, Z+3 ; 0x03 1022c: 45 e0 ldi r20, 0x05 ; 5 1022e: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a 10232: 0f 5f subi r16, 0xFF ; 255 10234: 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++) { 10236: 08 30 cpi r16, 0x08 ; 8 10238: 11 05 cpc r17, r1 1023a: 39 f7 brne .-50 ; 0x1020a SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 1023c: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 10240: dd cf rjmp .-70 ; 0x101fc mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10242: 8f ec ldi r24, 0xCF ; 207 10244: 9d e7 ldi r25, 0x7D ; 125 return; } 10246: df 91 pop r29 10248: cf 91 pop r28 1024a: 1f 91 pop r17 1024c: 0f 91 pop r16 1024e: ff 90 pop r15 10250: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 10252: 0c 94 06 7b jmp 0xf60c ; 0xf60c return; } 10256: df 91 pop r29 10258: cf 91 pop r28 1025a: 1f 91 pop r17 1025c: 0f 91 pop r16 1025e: ff 90 pop r15 10260: ef 90 pop r14 10262: 08 95 ret 00010264 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { 10264: 8f 92 push r8 10266: 9f 92 push r9 10268: af 92 push r10 1026a: bf 92 push r11 1026c: cf 92 push r12 1026e: df 92 push r13 10270: ef 92 push r14 10272: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); 10274: 0f 94 8b 3f call 0x27f16 ; 0x27f16 10278: 6b 01 movw r12, r22 1027a: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { 1027c: 20 91 2f 02 lds r18, 0x022F ; 0x80022f 10280: 22 23 and r18, r18 10282: 09 f1 breq .+66 ; 0x102c6 10284: 40 91 96 02 lds r20, 0x0296 ; 0x800296 10288: 41 30 cpi r20, 0x01 ; 1 1028a: e9 f0 breq .+58 ; 0x102c6 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; 1028c: 80 91 10 02 lds r24, 0x0210 ; 0x800210 10290: 90 91 11 02 lds r25, 0x0211 ; 0x800211 10294: a0 91 12 02 lds r26, 0x0212 ; 0x800212 10298: b0 91 13 02 lds r27, 0x0213 ; 0x800213 1029c: 46 01 movw r8, r12 1029e: 57 01 movw r10, r14 102a0: 88 1a sub r8, r24 102a2: 99 0a sbc r9, r25 102a4: aa 0a sbc r10, r26 102a6: bb 0a sbc r11, r27 102a8: 30 e0 ldi r19, 0x00 ; 0 102aa: a8 ee ldi r26, 0xE8 ; 232 102ac: b3 e0 ldi r27, 0x03 ; 3 102ae: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 102b2: 86 16 cp r8, r22 102b4: 97 06 cpc r9, r23 102b6: a8 06 cpc r10, r24 102b8: b9 06 cpc r11, r25 102ba: 6c f0 brlt .+26 ; 0x102d6 switch (busy_state) { 102bc: 44 30 cpi r20, 0x04 ; 4 102be: 31 f1 breq .+76 ; 0x1030c 102c0: 9c f4 brge .+38 ; 0x102e8 102c2: 42 30 cpi r20, 0x02 ; 2 102c4: d4 f4 brge .+52 ; 0x102fa break; default: break; } } prev_busy_signal_ms = ms; 102c6: c0 92 10 02 sts 0x0210, r12 ; 0x800210 102ca: d0 92 11 02 sts 0x0211, r13 ; 0x800211 102ce: e0 92 12 02 sts 0x0212, r14 ; 0x800212 102d2: f0 92 13 02 sts 0x0213, r15 ; 0x800213 } 102d6: ff 90 pop r15 102d8: ef 90 pop r14 102da: df 90 pop r13 102dc: cf 90 pop r12 102de: bf 90 pop r11 102e0: af 90 pop r10 102e2: 9f 90 pop r9 102e4: 8f 90 pop r8 102e6: 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) { 102e8: 45 30 cpi r20, 0x05 ; 5 102ea: 69 f7 brne .-38 ; 0x102c6 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; 102ec: 82 ef ldi r24, 0xF2 ; 242 102ee: 99 ea ldi r25, 0xA9 ; 169 102f0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM("busy: paused for input"); 102f4: 84 e4 ldi r24, 0x44 ; 68 102f6: 9c e7 ldi r25, 0x7C ; 124 102f8: 06 c0 rjmp .+12 ; 0x10306 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; 102fa: 82 ef ldi r24, 0xF2 ; 242 102fc: 99 ea ldi r25, 0xA9 ; 169 102fe: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM("busy: processing"); 10302: 81 e7 ldi r24, 0x71 ; 113 10304: 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"); 10306: 0e 94 06 7b call 0xf60c ; 0xf60c 1030a: dd cf rjmp .-70 ; 0x102c6 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; 1030c: 82 ef ldi r24, 0xF2 ; 242 1030e: 99 ea ldi r25, 0xA9 ; 169 10310: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM("busy: paused for user"); 10314: 8b e5 ldi r24, 0x5B ; 91 10316: 9c e7 ldi r25, 0x7C ; 124 10318: f6 cf rjmp .-20 ; 0x10306 0001031a : //} } #endif //TACH_0 void checkFans() { 1031a: cf 92 push r12 1031c: df 92 push r13 1031e: ef 92 push r14 10320: ff 92 push r15 10322: 0f 93 push r16 10324: 1f 93 push r17 10326: cf 93 push r28 10328: df 93 push r29 1032a: 1f 92 push r1 1032c: 1f 92 push r1 1032e: cd b7 in r28, 0x3d ; 61 10330: 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)) { 10332: 0f 94 8b 3f call 0x27f16 ; 0x27f16 10336: 00 91 9c 17 lds r16, 0x179C ; 0x80179c 1033a: 10 91 9d 17 lds r17, 0x179D ; 0x80179d 1033e: 20 91 9e 17 lds r18, 0x179E ; 0x80179e 10342: 30 91 9f 17 lds r19, 0x179F ; 0x80179f 10346: 60 1b sub r22, r16 10348: 71 0b sbc r23, r17 1034a: 82 0b sbc r24, r18 1034c: 93 0b sbc r25, r19 1034e: 69 38 cpi r22, 0x89 ; 137 10350: 73 41 sbci r23, 0x13 ; 19 10352: 81 05 cpc r24, r1 10354: 91 05 cpc r25, r1 10356: d0 f0 brcs .+52 ; 0x1038c 10358: 80 91 36 05 lds r24, 0x0536 ; 0x800536 1035c: 81 11 cpse r24, r1 1035e: 16 c0 rjmp .+44 ; 0x1038c extruder_autofan_last_check = _millis(); 10360: 0f 94 8b 3f call 0x27f16 ; 0x27f16 10364: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 10368: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 1036c: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 10370: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f fanSpeedBckp = fanSpeedSoftPwm; 10374: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 10378: 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 1037c: 8b 34 cpi r24, 0x4B ; 75 1037e: 18 f0 brcs .+6 ; 0x10386 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 10380: 8f ef ldi r24, 0xFF ; 255 10382: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 } fan_measuring = true; 10386: 81 e0 ldi r24, 0x01 ; 1 10388: 80 93 36 05 sts 0x0536, r24 ; 0x800536 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 1038c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 10390: 00 91 9c 17 lds r16, 0x179C ; 0x80179c 10394: 10 91 9d 17 lds r17, 0x179D ; 0x80179d 10398: 20 91 9e 17 lds r18, 0x179E ; 0x80179e 1039c: 30 91 9f 17 lds r19, 0x179F ; 0x80179f 103a0: 60 1b sub r22, r16 103a2: 71 0b sbc r23, r17 103a4: 82 0b sbc r24, r18 103a6: 93 0b sbc r25, r19 103a8: 65 36 cpi r22, 0x65 ; 101 103aa: 71 05 cpc r23, r1 103ac: 81 05 cpc r24, r1 103ae: 91 05 cpc r25, r1 103b0: 08 f4 brcc .+2 ; 0x103b4 103b2: f7 c0 rjmp .+494 ; 0x105a2 103b4: 80 91 36 05 lds r24, 0x0536 ; 0x800536 103b8: 88 23 and r24, r24 103ba: 09 f4 brne .+2 ; 0x103be 103bc: f2 c0 rjmp .+484 ; 0x105a2 countFanSpeed(); 103be: 0e 94 5a 76 call 0xecb4 ; 0xecb4 void checkFanSpeed() { uint8_t max_fan_errors[2]; #ifdef FAN_SOFT_PWM max_fan_errors[1] = 3; // 15 seconds (Print fan) 103c2: 83 e0 ldi r24, 0x03 ; 3 103c4: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 103c6: 82 e0 ldi r24, 0x02 ; 2 103c8: 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) 103ca: 80 91 38 02 lds r24, 0x0238 ; 0x800238 103ce: 88 23 and r24, r24 103d0: 51 f0 breq .+20 ; 0x103e6 fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 103d2: 87 e8 ldi r24, 0x87 ; 135 103d4: 9f e0 ldi r25, 0x0F ; 15 103d6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 103da: 91 e0 ldi r25, 0x01 ; 1 103dc: 81 11 cpse r24, r1 103de: 01 c0 rjmp .+2 ; 0x103e2 103e0: 90 e0 ldi r25, 0x00 ; 0 103e2: 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]++;} 103e6: 80 91 b1 04 lds r24, 0x04B1 ; 0x8004b1 103ea: 90 91 b2 04 lds r25, 0x04B2 ; 0x8004b2 103ee: 44 97 sbiw r24, 0x14 ; 20 103f0: 0c f0 brlt .+2 ; 0x103f4 103f2: a0 c0 rjmp .+320 ; 0x10534 103f4: 20 e0 ldi r18, 0x00 ; 0 103f6: 30 e0 ldi r19, 0x00 ; 0 103f8: 48 e4 ldi r20, 0x48 ; 72 103fa: 52 e4 ldi r21, 0x42 ; 66 103fc: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 10400: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 10404: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 10408: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 1040c: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 10410: 18 16 cp r1, r24 10412: 0c f0 brlt .+2 ; 0x10416 10414: 8f c0 rjmp .+286 ; 0x10534 10416: 80 91 50 03 lds r24, 0x0350 ; 0x800350 1041a: 8f 5f subi r24, 0xFF ; 255 1041c: 80 93 50 03 sts 0x0350, r24 ; 0x800350 else fan_speed_errors[0] = 0; #endif #if (defined(FANCHECK) && defined(TACH_1) && (TACH_1 >-1)) if ((fan_speed[1] < 5) && ((blocks_queued() ? block_buffer[block_buffer_tail].fan_speed : fanSpeed) > MIN_PRINT_FAN_SPEED)) fan_speed_errors[1]++; 10420: 80 91 b3 04 lds r24, 0x04B3 ; 0x8004b3 10424: 90 91 b4 04 lds r25, 0x04B4 ; 0x8004b4 10428: 05 97 sbiw r24, 0x05 ; 5 1042a: 0c f0 brlt .+2 ; 0x1042e 1042c: 89 c0 rjmp .+274 ; 0x10540 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); 1042e: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 10432: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 10436: 98 17 cp r25, r24 10438: 09 f4 brne .+2 ; 0x1043c 1043a: 7f c0 rjmp .+254 ; 0x1053a 1043c: e0 91 57 0e lds r30, 0x0E57 ; 0x800e57 10440: 8e e6 ldi r24, 0x6E ; 110 10442: e8 9f mul r30, r24 10444: f0 01 movw r30, r0 10446: 11 24 eor r1, r1 10448: e4 54 subi r30, 0x44 ; 68 1044a: f8 4f sbci r31, 0xF8 ; 248 1044c: 80 81 ld r24, Z 1044e: 8c 34 cpi r24, 0x4C ; 76 10450: 08 f4 brcc .+2 ; 0x10454 10452: 76 c0 rjmp .+236 ; 0x10540 10454: 80 91 51 03 lds r24, 0x0351 ; 0x800351 10458: 8f 5f subi r24, 0xFF ; 255 1045a: 80 93 51 03 sts 0x0351, r24 ; 0x800351 else fan_speed_errors[1] = 0; #endif // drop the fan_check_error flag when both fans are ok if( fan_speed_errors[0] == 0 && fan_speed_errors[1] == 0 && fan_check_error == EFCE_REPORTED){ 1045e: 80 91 50 03 lds r24, 0x0350 ; 0x800350 10462: 81 11 cpse r24, r1 10464: 0b c0 rjmp .+22 ; 0x1047c 10466: 80 91 51 03 lds r24, 0x0351 ; 0x800351 1046a: 81 11 cpse r24, r1 1046c: 07 c0 rjmp .+14 ; 0x1047c 1046e: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 10472: 82 30 cpi r24, 0x02 ; 2 10474: 19 f4 brne .+6 ; 0x1047c // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 10476: 81 e0 ldi r24, 0x01 ; 1 10478: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 1047c: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 10480: 81 30 cpi r24, 0x01 ; 1 10482: 61 f4 brne .+24 ; 0x1049c 10484: 0e 94 96 68 call 0xd12c ; 0xd12c 10488: 81 11 cpse r24, r1 1048a: 08 c0 rjmp .+16 ; 0x1049c fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 1048c: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 10490: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> lcd_reset_alert_level(); //for another fan speed error lcd_setstatuspgm(MSG_WELCOME); // Reset the status line message to visually show the error is gone 10494: 8a e6 ldi r24, 0x6A ; 106 10496: 90 e7 ldi r25, 0x70 ; 112 10498: 0f 94 ea 0b call 0x217d4 ; 0x217d4 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 1049c: 80 91 38 02 lds r24, 0x0238 ; 0x800238 104a0: 88 23 and r24, r24 104a2: 09 f4 brne .+2 ; 0x104a6 104a4: 6e c0 rjmp .+220 ; 0x10582 104a6: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 104aa: 82 30 cpi r24, 0x02 ; 2 104ac: 09 f4 brne .+2 ; 0x104b0 104ae: 69 c0 rjmp .+210 ; 0x10582 104b0: 80 e5 ldi r24, 0x50 ; 80 104b2: e8 2e mov r14, r24 104b4: 83 e0 ldi r24, 0x03 ; 3 104b6: f8 2e mov r15, r24 104b8: fe 01 movw r30, r28 104ba: 31 96 adiw r30, 0x01 ; 1 104bc: 6f 01 movw r12, r30 { for (uint8_t fan = 0; fan < 2; fan++) 104be: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 104c0: 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]) 104c2: f7 01 movw r30, r14 104c4: 91 91 ld r25, Z+ 104c6: 7f 01 movw r14, r30 104c8: f6 01 movw r30, r12 104ca: 81 91 ld r24, Z+ 104cc: 6f 01 movw r12, r30 104ce: 89 17 cp r24, r25 104d0: 68 f5 brcc .+90 ; 0x1052c { fan_speed_errors[fan] = 0; 104d2: f7 01 movw r30, r14 104d4: 31 97 sbiw r30, 0x01 ; 1 104d6: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 104d8: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 104dc: 82 30 cpi r24, 0x02 ; 2 104de: 31 f1 breq .+76 ; 0x1052c fan_check_error = EFCE_REPORTED; 104e0: 00 93 e2 03 sts 0x03E2, r16 ; 0x8003e2 if (printJobOngoing()) { 104e4: 0e 94 45 68 call 0xd08a ; 0xd08a 104e8: 88 23 and r24, r24 104ea: 81 f1 breq .+96 ; 0x1054c // A print is ongoing, pause the print normally if(!printingIsPaused()) { 104ec: 0e 94 3a 68 call 0xd074 ; 0xd074 104f0: 81 11 cpse r24, r1 104f2: 06 c0 rjmp .+12 ; 0x10500 if (usb_timer.running()) 104f4: 80 91 11 05 lds r24, 0x0511 ; 0x800511 104f8: 88 23 and r24, r24 104fa: 29 f1 breq .+74 ; 0x10546 lcd_pause_usb_print(); 104fc: 0f 94 88 2c call 0x25910 ; 0x25910 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 10500: 11 30 cpi r17, 0x01 ; 1 10502: 59 f1 breq .+86 ; 0x1055a //! 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); 10504: 85 eb ldi r24, 0xB5 ; 181 10506: 99 e7 ldi r25, 0x79 ; 121 10508: 0e 94 06 7b call 0xf60c ; 0xf60c if (get_message_level() == 0) { 1050c: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> 10510: 81 11 cpse r24, r1 10512: 0c c0 rjmp .+24 ; 0x1052c Sound_MakeCustom(200,0,true); 10514: 41 e0 ldi r20, 0x01 ; 1 10516: 70 e0 ldi r23, 0x00 ; 0 10518: 60 e0 ldi r22, 0x00 ; 0 1051a: 88 ec ldi r24, 0xC8 ; 200 1051c: 90 e0 ldi r25, 0x00 ; 0 1051e: 0f 94 a1 6a call 0x2d542 ; 0x2d542 LCD_ALERTMESSAGERPGM(lcdMsg); 10522: 62 e0 ldi r22, 0x02 ; 2 10524: 8f e0 ldi r24, 0x0F ; 15 10526: 9b e6 ldi r25, 0x6B ; 107 10528: 0f 94 c7 06 call 0x20d8e ; 0x20d8e 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++) 1052c: 11 30 cpi r17, 0x01 ; 1 1052e: 49 f1 breq .+82 ; 0x10582 10530: 11 e0 ldi r17, 0x01 ; 1 10532: c7 cf rjmp .-114 ; 0x104c2 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; 10534: 10 92 50 03 sts 0x0350, r1 ; 0x800350 10538: 73 cf rjmp .-282 ; 0x10420 #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]++; 1053a: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 1053e: 87 cf rjmp .-242 ; 0x1044e else fan_speed_errors[1] = 0; 10540: 10 92 51 03 sts 0x0351, r1 ; 0x800351 10544: 8c cf rjmp .-232 ; 0x1045e // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 10546: 0f 94 97 3f call 0x27f2e ; 0x27f2e 1054a: da cf rjmp .-76 ; 0x10500 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1054c: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 10550: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d } } else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; 10554: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df 10558: d3 cf rjmp .-90 ; 0x10500 //! 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); 1055a: 8d ed ldi r24, 0xDD ; 221 1055c: 99 e7 ldi r25, 0x79 ; 121 1055e: 0e 94 06 7b call 0xf60c ; 0xf60c if (get_message_level() == 0) { 10562: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> 10566: 81 11 cpse r24, r1 10568: 0c c0 rjmp .+24 ; 0x10582 Sound_MakeCustom(200,0,true); 1056a: 41 e0 ldi r20, 0x01 ; 1 1056c: 70 e0 ldi r23, 0x00 ; 0 1056e: 60 e0 ldi r22, 0x00 ; 0 10570: 88 ec ldi r24, 0xC8 ; 200 10572: 90 e0 ldi r25, 0x00 ; 0 10574: 0f 94 a1 6a call 0x2d542 ; 0x2d542 LCD_ALERTMESSAGERPGM(lcdMsg); 10578: 62 e0 ldi r22, 0x02 ; 2 1057a: 8b ef ldi r24, 0xFB ; 251 1057c: 9a e6 ldi r25, 0x6A ; 106 1057e: 0f 94 c7 06 call 0x20d8e ; 0x20d8e } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 10582: 80 91 14 02 lds r24, 0x0214 ; 0x800214 10586: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 //printf_P(PSTR("fan PWM: %d; extr fanSpeed measured: %d; print fan speed measured: %d \n"), fanSpeedBckp, fan_speed[0], fan_speed[1]); extruder_autofan_last_check = _millis(); 1058a: 0f 94 8b 3f call 0x27f16 ; 0x27f16 1058e: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 10592: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 10596: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 1059a: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f fan_measuring = false; 1059e: 10 92 36 05 sts 0x0536, r1 ; 0x800536 } #endif //FAN_SOFT_PWM #endif #endif //DEBUG_DISABLE_FANCHECK } 105a2: 0f 90 pop r0 105a4: 0f 90 pop r0 105a6: df 91 pop r29 105a8: cf 91 pop r28 105aa: 1f 91 pop r17 105ac: 0f 91 pop r16 105ae: ff 90 pop r15 105b0: ef 90 pop r14 105b2: df 90 pop r13 105b4: 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(); 105b6: 0c 94 32 77 jmp 0xee64 ; 0xee64 000105ba : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 105ba: cf 92 push r12 105bc: df 92 push r13 105be: ef 92 push r14 105c0: ff 92 push r15 105c2: 6b 01 movw r12, r22 105c4: 7c 01 movw r14, r24 la10c_orig_jerk = j; 105c6: c0 92 56 03 sts 0x0356, r12 ; 0x800356 105ca: d0 92 57 03 sts 0x0357, r13 ; 0x800357 105ce: e0 92 58 03 sts 0x0358, r14 ; 0x800358 105d2: f0 92 59 03 sts 0x0359, r15 ; 0x800359 if(la10c_mode != LA10C_LA10) 105d6: 80 91 72 03 lds r24, 0x0372 ; 0x800372 105da: 82 30 cpi r24, 0x02 ; 2 105dc: b1 f4 brne .+44 ; 0x1060a 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) 105de: 20 e0 ldi r18, 0x00 ; 0 105e0: 30 e0 ldi r19, 0x00 ; 0 105e2: 40 e9 ldi r20, 0x90 ; 144 105e4: 50 e4 ldi r21, 0x40 ; 64 105e6: c7 01 movw r24, r14 105e8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 105ec: 87 ff sbrs r24, 7 105ee: 14 c0 rjmp .+40 ; 0x10618 105f0: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 105f4: 90 91 9f 06 lds r25, 0x069F ; 0x80069f 105f8: a0 91 a0 06 lds r26, 0x06A0 ; 0x8006a0 105fc: b0 91 a1 06 lds r27, 0x06A1 ; 0x8006a1 10600: 80 3d cpi r24, 0xD0 ; 208 10602: 97 40 sbci r25, 0x07 ; 7 10604: a1 05 cpc r26, r1 10606: b1 05 cpc r27, r1 10608: 20 f5 brcc .+72 ; 0x10652 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 1060a: c7 01 movw r24, r14 1060c: b6 01 movw r22, r12 1060e: ff 90 pop r15 10610: ef 90 pop r14 10612: df 90 pop r13 10614: cf 90 pop r12 10616: 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: 10618: 2a e9 ldi r18, 0x9A ; 154 1061a: 39 e9 ldi r19, 0x99 ; 153 1061c: 49 e9 ldi r20, 0x99 ; 153 1061e: 5e e3 ldi r21, 0x3E ; 62 10620: c7 01 movw r24, r14 10622: b6 01 movw r22, r12 10624: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 10628: 87 ff sbrs r24, 7 1062a: 0a c0 rjmp .+20 ; 0x10640 1062c: 20 e0 ldi r18, 0x00 ; 0 1062e: 30 e0 ldi r19, 0x00 ; 0 10630: 48 e3 ldi r20, 0x38 ; 56 10632: 51 e4 ldi r21, 0x41 ; 65 10634: c7 01 movw r24, r14 10636: b6 01 movw r22, r12 10638: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1063c: 6b 01 movw r12, r22 1063e: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 10640: 81 e3 ldi r24, 0x31 ; 49 10642: 9a e7 ldi r25, 0x7A ; 122 10644: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(j); 10648: c7 01 movw r24, r14 1064a: b6 01 movw r22, r12 1064c: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 10650: dc cf rjmp .-72 ; 0x1060a // 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: 10652: 2a e9 ldi r18, 0x9A ; 154 10654: 39 e9 ldi r19, 0x99 ; 153 10656: 49 e9 ldi r20, 0x99 ; 153 10658: 5e e3 ldi r21, 0x3E ; 62 1065a: c7 01 movw r24, r14 1065c: b6 01 movw r22, r12 1065e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 10662: 87 fd sbrc r24, 7 10664: e3 cf rjmp .-58 ; 0x1062c j < 4.5? j * 0.25 + 3.375: 10666: 20 e0 ldi r18, 0x00 ; 0 10668: 30 e0 ldi r19, 0x00 ; 0 1066a: 40 e8 ldi r20, 0x80 ; 128 1066c: 5e e3 ldi r21, 0x3E ; 62 1066e: c7 01 movw r24, r14 10670: b6 01 movw r22, r12 10672: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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: 10676: 20 e0 ldi r18, 0x00 ; 0 10678: 30 e0 ldi r19, 0x00 ; 0 1067a: 48 e5 ldi r20, 0x58 ; 88 1067c: 50 e4 ldi r21, 0x40 ; 64 1067e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 10682: dc cf rjmp .-72 ; 0x1063c 00010684 : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 10684: cf 92 push r12 10686: df 92 push r13 10688: ef 92 push r14 1068a: ff 92 push r15 1068c: cf 93 push r28 if(mode == la10c_mode) return; 1068e: 90 91 72 03 lds r25, 0x0372 ; 0x800372 10692: 98 17 cp r25, r24 10694: b9 f1 breq .+110 ; 0x10704 10696: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 10698: c0 90 56 03 lds r12, 0x0356 ; 0x800356 1069c: d0 90 57 03 lds r13, 0x0357 ; 0x800357 106a0: e0 90 58 03 lds r14, 0x0358 ; 0x800358 106a4: f0 90 59 03 lds r15, 0x0359 ; 0x800359 106a8: 20 e0 ldi r18, 0x00 ; 0 106aa: 30 e0 ldi r19, 0x00 ; 0 106ac: a9 01 movw r20, r18 106ae: c7 01 movw r24, r14 106b0: b6 01 movw r22, r12 106b2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 106b6: 88 23 and r24, r24 106b8: 41 f0 breq .+16 ; 0x106ca cs.max_jerk[E_AXIS] = la10c_orig_jerk; 106ba: c0 92 c2 06 sts 0x06C2, r12 ; 0x8006c2 106be: d0 92 c3 06 sts 0x06C3, r13 ; 0x8006c3 106c2: e0 92 c4 06 sts 0x06C4, r14 ; 0x8006c4 106c6: f0 92 c5 06 sts 0x06C5, r15 ; 0x8006c5 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 106ca: 84 e1 ldi r24, 0x14 ; 20 106cc: 9a e7 ldi r25, 0x7A ; 122 106ce: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 switch(mode) 106d2: c1 30 cpi r28, 0x01 ; 1 106d4: 11 f1 breq .+68 ; 0x1071a 106d6: e0 f0 brcs .+56 ; 0x10710 106d8: c2 30 cpi r28, 0x02 ; 2 106da: 11 f1 breq .+68 ; 0x10720 { 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; 106dc: c0 93 72 03 sts 0x0372, r28 ; 0x800372 // adjust the E-jerk if needed cs.max_jerk[E_AXIS] = la10c_jerk(cs.max_jerk[E_AXIS]); 106e0: 60 91 c2 06 lds r22, 0x06C2 ; 0x8006c2 106e4: 70 91 c3 06 lds r23, 0x06C3 ; 0x8006c3 106e8: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 106ec: 90 91 c5 06 lds r25, 0x06C5 ; 0x8006c5 106f0: 0e 94 dd 82 call 0x105ba ; 0x105ba 106f4: 60 93 c2 06 sts 0x06C2, r22 ; 0x8006c2 106f8: 70 93 c3 06 sts 0x06C3, r23 ; 0x8006c3 106fc: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 10700: 90 93 c5 06 sts 0x06C5, r25 ; 0x8006c5 } 10704: cf 91 pop r28 10706: ff 90 pop r15 10708: ef 90 pop r14 1070a: df 90 pop r13 1070c: cf 90 pop r12 1070e: 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; 10710: 8c e0 ldi r24, 0x0C ; 12 10712: 9a e7 ldi r25, 0x7A ; 122 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10714: 0e 94 06 7b call 0xf60c ; 0xf60c 10718: e1 cf rjmp .-62 ; 0x106dc SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 1071a: 88 e0 ldi r24, 0x08 ; 8 1071c: 9a e7 ldi r25, 0x7A ; 122 1071e: fa cf rjmp .-12 ; 0x10714 case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10720: 84 e0 ldi r24, 0x04 ; 4 10722: 9a e7 ldi r25, 0x7A ; 122 10724: f7 cf rjmp .-18 ; 0x10714 00010726 : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 10726: 0f 94 2c 59 call 0x2b258 ; 0x2b258 disable_x(); 1072a: 17 9a sbi 0x02, 7 ; 2 1072c: e0 e4 ldi r30, 0x40 ; 64 1072e: f7 e0 ldi r31, 0x07 ; 7 10730: 10 82 st Z, r1 disable_y(); 10732: 16 9a sbi 0x02, 6 ; 2 10734: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 10736: 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); } 10738: 80 e0 ldi r24, 0x00 ; 0 1073a: 0e 94 42 83 call 0x10684 ; 0x10684 return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 1073e: 8f ef ldi r24, 0xFF ; 255 10740: 9f ef ldi r25, 0xFF ; 255 10742: 90 93 8a 02 sts 0x028A, r25 ; 0x80028a 10746: 80 93 89 02 sts 0x0289, r24 ; 0x800289 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 1074a: 2f ef ldi r18, 0xFF ; 255 1074c: 20 93 86 02 sts 0x0286, r18 ; 0x800286 print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 10750: 90 93 8e 02 sts 0x028E, r25 ; 0x80028e 10754: 80 93 8d 02 sts 0x028D, r24 ; 0x80028d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 10758: 20 93 85 02 sts 0x0285, r18 ; 0x800285 print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 1075c: 90 93 88 02 sts 0x0288, r25 ; 0x800288 10760: 80 93 87 02 sts 0x0287, r24 ; 0x800287 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 10764: 90 93 8c 02 sts 0x028C, r25 ; 0x80028c 10768: 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(); } 1076c: 08 95 ret 0001076e : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 1076e: 41 ed ldi r20, 0xD1 ; 209 10770: 50 e0 ldi r21, 0x00 ; 0 10772: 6f eb ldi r22, 0xBF ; 191 10774: 78 e7 ldi r23, 0x78 ; 120 10776: 8e e6 ldi r24, 0x6E ; 110 10778: 96 e0 ldi r25, 0x06 ; 6 1077a: 0f 94 2b db call 0x3b656 ; 0x3b656 // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 1077e: 0f 94 85 aa call 0x3550a ; 0x3550a #ifdef PIDTEMP updatePID(); 10782: 0f 94 17 51 call 0x2a22e ; 0x2a22e #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); 10786: 0f 94 ec 47 call 0x28fd8 ; 0x28fd8 #endif calculate_extruder_multipliers(); 1078a: 0e 94 6e 66 call 0xccdc ; 0xccdc SERIAL_ECHO_START; 1078e: 82 ef ldi r24, 0xF2 ; 242 10790: 99 ea ldi r25, 0xA9 ; 169 10792: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10796: 8d e9 ldi r24, 0x9D ; 157 10798: 98 e7 ldi r25, 0x78 ; 120 1079a: 0c 94 06 7b jmp 0xf60c ; 0xf60c 0001079e : DEFAULT_ARC_SEGMENTS_PER_SEC }; void Config_StoreSettings() { 1079e: cf 93 push r28 107a0: df 93 push r29 strcpy_P(cs.version, default_conf.version); 107a2: 6f eb ldi r22, 0xBF ; 191 107a4: 78 e7 ldi r23, 0x78 ; 120 107a6: 8e e6 ldi r24, 0x6E ; 110 107a8: 96 e0 ldi r25, 0x06 ; 6 107aa: 0f 94 48 db call 0x3b690 ; 0x3b690 #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); 107ae: 41 ed ldi r20, 0xD1 ; 209 107b0: 50 e0 ldi r21, 0x00 ; 0 107b2: 64 e1 ldi r22, 0x14 ; 20 107b4: 70 e0 ldi r23, 0x00 ; 0 107b6: 8e e6 ldi r24, 0x6E ; 110 107b8: 96 e0 ldi r25, 0x06 ; 6 107ba: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 107be: 60 91 20 05 lds r22, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> 107c2: 82 e0 ldi r24, 0x02 ; 2 107c4: 9d e0 ldi r25, 0x0D ; 13 107c6: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } 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); 107ca: ce e8 ldi r28, 0x8E ; 142 107cc: 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); 107ce: 4a a5 ldd r20, Y+42 ; 0x2a 107d0: 5b a5 ldd r21, Y+43 ; 0x2b 107d2: 6c a5 ldd r22, Y+44 ; 0x2c 107d4: 7d a5 ldd r23, Y+45 ; 0x2d 107d6: 8e ef ldi r24, 0xFE ; 254 107d8: 9c e0 ldi r25, 0x0C ; 12 107da: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 107de: 4e a5 ldd r20, Y+46 ; 0x2e 107e0: 5f a5 ldd r21, Y+47 ; 0x2f 107e2: 68 a9 ldd r22, Y+48 ; 0x30 107e4: 79 a9 ldd r23, Y+49 ; 0x31 107e6: 82 ea ldi r24, 0xA2 ; 162 107e8: 9c e0 ldi r25, 0x0C ; 12 107ea: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 107ee: 4a a9 ldd r20, Y+50 ; 0x32 107f0: 5b a9 ldd r21, Y+51 ; 0x33 107f2: 6c a9 ldd r22, Y+52 ; 0x34 107f4: 7d a9 ldd r23, Y+53 ; 0x35 107f6: 8e e9 ldi r24, 0x9E ; 158 107f8: 9c e0 ldi r25, 0x0C ; 12 107fa: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 107fe: 4e a9 ldd r20, Y+54 ; 0x36 10800: 5f a9 ldd r21, Y+55 ; 0x37 10802: 68 ad ldd r22, Y+56 ; 0x38 10804: 79 ad ldd r23, Y+57 ; 0x39 10806: 8a ef ldi r24, 0xFA ; 250 10808: 9c e0 ldi r25, 0x0C ; 12 1080a: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 1080e: 4a ad ldd r20, Y+58 ; 0x3a 10810: 5b ad ldd r21, Y+59 ; 0x3b 10812: 6c ad ldd r22, Y+60 ; 0x3c 10814: 7d ad ldd r23, Y+61 ; 0x3d 10816: 8a e9 ldi r24, 0x9A ; 154 10818: 9c e0 ldi r25, 0x0C ; 12 1081a: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 1081e: 6e ad ldd r22, Y+62 ; 0x3e 10820: 7f ad ldd r23, Y+63 ; 0x3f 10822: 88 e9 ldi r24, 0x98 ; 152 10824: 9c e0 ldi r25, 0x0C ; 12 10826: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 #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); 1082a: 40 e4 ldi r20, 0x40 ; 64 1082c: 50 e0 ldi r21, 0x00 ; 0 1082e: 6a eb ldi r22, 0xBA ; 186 10830: 7c e0 ldi r23, 0x0C ; 12 10832: 8e ec ldi r24, 0xCE ; 206 10834: 92 e1 ldi r25, 0x12 ; 18 10836: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1083a: 40 91 0e 13 lds r20, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1083e: 50 91 0f 13 lds r21, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 10842: 60 91 10 13 lds r22, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 10846: 70 91 11 13 lds r23, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1084a: 86 eb ldi r24, 0xB6 ; 182 1084c: 9c e0 ldi r25, 0x0C ; 12 1084e: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 10852: 40 91 12 13 lds r20, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 10856: 50 91 13 13 lds r21, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 1085a: 60 91 14 13 lds r22, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 1085e: 70 91 15 13 lds r23, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 10862: 82 eb ldi r24, 0xB2 ; 178 10864: 9c e0 ldi r25, 0x0C ; 12 10866: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 1086a: 40 91 16 13 lds r20, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 1086e: 50 91 17 13 lds r21, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 10872: 60 91 18 13 lds r22, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 10876: 70 91 19 13 lds r23, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 1087a: 8e ea ldi r24, 0xAE ; 174 1087c: 9c e0 ldi r25, 0x0C ; 12 1087e: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 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; 10882: 82 ef ldi r24, 0xF2 ; 242 10884: 99 ea ldi r25, 0xA9 ; 169 10886: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM("Settings Stored"); 1088a: 89 e4 ldi r24, 0x49 ; 73 1088c: 98 e7 ldi r25, 0x78 ; 120 } 1088e: df 91 pop r29 10890: cf 91 pop r28 #ifdef THERMAL_MODEL thermal_model_save_settings(); #endif SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Settings Stored"); 10892: 0c 94 06 7b jmp 0xf60c ; 0xf60c 00010896 : { cmdbuffer_front_already_processed = true; } void get_command() { 10896: 2f 92 push r2 10898: 3f 92 push r3 1089a: 4f 92 push r4 1089c: 5f 92 push r5 1089e: 6f 92 push r6 108a0: 7f 92 push r7 108a2: 8f 92 push r8 108a4: 9f 92 push r9 108a6: af 92 push r10 108a8: bf 92 push r11 108aa: cf 92 push r12 108ac: df 92 push r13 108ae: ef 92 push r14 108b0: ff 92 push r15 108b2: 0f 93 push r16 108b4: 1f 93 push r17 108b6: cf 93 push r28 108b8: df 93 push r29 108ba: cd b7 in r28, 0x3d ; 61 108bc: de b7 in r29, 0x3e ; 62 108be: a2 97 sbiw r28, 0x22 ; 34 108c0: 0f b6 in r0, 0x3f ; 63 108c2: f8 94 cli 108c4: de bf out 0x3e, r29 ; 62 108c6: 0f be out 0x3f, r0 ; 63 108c8: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 108ca: 8f e5 ldi r24, 0x5F ; 95 108cc: 90 e0 ldi r25, 0x00 ; 0 108ce: 0e 94 f7 5c call 0xb9ee ; 0xb9ee 108d2: 88 23 and r24, r24 108d4: 09 f4 brne .+2 ; 0x108d8 108d6: 91 c0 rjmp .+290 ; 0x109fa return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 108d8: 0e 94 94 78 call 0xf128 ; 0xf128 108dc: 8f 37 cpi r24, 0x7F ; 127 108de: 91 05 cpc r25, r1 108e0: 61 f4 brne .+24 ; 0x108fa // 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; 108e2: 80 91 95 04 lds r24, 0x0495 ; 0x800495 108e6: 90 91 96 04 lds r25, 0x0496 ; 0x800496 108ea: 90 93 94 04 sts 0x0494, r25 ; 0x800494 108ee: 80 93 93 04 sts 0x0493, r24 ; 0x800493 MYSERIAL.flush(); SERIAL_ECHOLNPGM("Full RX Buffer"); //if buffer was full, there is danger that reading of last gcode will not be completed 108f2: 8a e3 ldi r24, 0x3A ; 58 108f4: 98 e7 ldi r25, 0x78 ; 120 108f6: 0e 94 06 7b call 0xf60c ; 0xf60c 108fa: 1e 01 movw r2, r28 108fc: 2f e1 ldi r18, 0x1F ; 31 108fe: 22 0e add r2, r18 10900: 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; 10902: dd 24 eor r13, r13 10904: 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 10906: 0e 94 94 78 call 0xf128 ; 0xf128 1090a: 18 16 cp r1, r24 1090c: 19 06 cpc r1, r25 1090e: 0c f0 brlt .+2 ; 0x10912 10910: 68 c0 rjmp .+208 ; 0x109e2 10912: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 10916: 88 23 and r24, r24 10918: 29 f0 breq .+10 ; 0x10924 1091a: 0e 94 3a 68 call 0xd074 ; 0xd074 1091e: 88 23 and r24, r24 10920: 09 f4 brne .+2 ; 0x10924 10922: 5f c0 rjmp .+190 ; 0x109e2 10924: 80 91 a6 03 lds r24, 0x03A6 ; 0x8003a6 10928: 81 11 cpse r24, r1 1092a: 5b c0 rjmp .+182 ; 0x109e2 #ifdef ENABLE_MEATPACK // MeatPack Changes // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - const int rec = MYSERIAL.read(); 1092c: 0f 94 9a d6 call 0x3ad34 ; 0x3ad34 if (rec < 0) continue; 10930: 97 fd sbrc r25, 7 10932: e9 cf rjmp .-46 ; 0x10906 mp_handle_rx_char((uint8_t)rec); 10934: 28 2f mov r18, r24 //========================================================================== void mp_handle_rx_char(const uint8_t c) { // Check for commit complete // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (c == (uint8_t)(MeatPack_CommandByte)) { 10936: 8f 3f cpi r24, 0xFF ; 255 10938: 09 f0 breq .+2 ; 0x1093c 1093a: 7b c0 rjmp .+246 ; 0x10a32 if (mp_cmd_count > 0) { 1093c: 80 91 42 03 lds r24, 0x0342 ; 0x800342 10940: 88 23 and r24, r24 10942: 09 f4 brne .+2 ; 0x10946 10944: 73 c0 rjmp .+230 ; 0x10a2c mp_cmd_active = 1; 10946: d0 92 41 03 sts 0x0341, r13 ; 0x800341 mp_cmd_count = 0; 1094a: 10 92 42 03 sts 0x0342, r1 ; 0x800342 char c_res[2] = {0, 0}; 1094e: 1f 8e std Y+31, r1 ; 0x1f 10950: 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) { 10952: c0 90 45 03 lds r12, 0x0345 ; 0x800345 10956: cc 20 and r12, r12 10958: b1 f2 breq .-84 ; 0x10906 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]; 1095a: 80 91 43 03 lds r24, 0x0343 ; 0x800343 1095e: 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) 10960: 91 e0 ldi r25, 0x01 ; 1 10962: 9c 15 cp r25, r12 10964: 18 f4 brcc .+6 ; 0x1096c out[i] = (char)mp_char_out_buf[i]; 10966: 80 91 44 03 lds r24, 0x0344 ; 0x800344 1096a: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 1096c: 10 92 45 03 sts 0x0345, r1 ; 0x800345 10970: 3a a2 std Y+34, r3 ; 0x22 10972: 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]; 10974: 89 a1 ldd r24, Y+33 ; 0x21 10976: 82 19 sub r24, r2 10978: 8c 15 cp r24, r12 1097a: 28 f6 brcc .-118 ; 0x10906 1097c: e9 a1 ldd r30, Y+33 ; 0x21 1097e: fa a1 ldd r31, Y+34 ; 0x22 10980: 11 91 ld r17, Z+ 10982: fa a3 std Y+34, r31 ; 0x22 10984: e9 a3 std Y+33, r30 ; 0x21 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10986: 88 e4 ldi r24, 0x48 ; 72 10988: 93 e0 ldi r25, 0x03 ; 3 1098a: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> if (serial_char < 0) 1098e: 17 fd sbrc r17, 7 10990: f1 cf rjmp .-30 ; 0x10974 10992: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 10996: 90 91 7d 10 lds r25, 0x107D ; 0x80107d // Ignore extended ASCII characters. These characters have no meaning in the G-code apart from the file names // and Marlin does not support such file names anyway. // Serial characters with a highest bit set to 1 are generated when the USB cable is unplugged, leading // to a hang-up of the print process from an SD card. continue; if(serial_char == '\n' || 1099a: 1a 30 cpi r17, 0x0A ; 10 1099c: 09 f4 brne .+2 ; 0x109a0 1099e: 4a c1 rjmp .+660 ; 0x10c34 109a0: 1d 30 cpi r17, 0x0D ; 13 109a2: 09 f4 brne .+2 ; 0x109a6 109a4: 47 c1 rjmp .+654 ; 0x10c34 serial_char == '\r' || 109a6: 8f 35 cpi r24, 0x5F ; 95 109a8: 91 05 cpc r25, r1 109aa: 0c f0 brlt .+2 ; 0x109ae 109ac: 48 c1 rjmp .+656 ; 0x10c3e 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; 109ae: 1b 33 cpi r17, 0x3B ; 59 109b0: 11 f4 brne .+4 ; 0x109b6 109b2: d0 92 47 03 sts 0x0347, r13 ; 0x800347 if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 109b6: 20 91 47 03 lds r18, 0x0347 ; 0x800347 109ba: 21 11 cpse r18, r1 109bc: db cf rjmp .-74 ; 0x10974 109be: 9c 01 movw r18, r24 109c0: 2f 5f subi r18, 0xFF ; 255 109c2: 3f 4f sbci r19, 0xFF ; 255 109c4: 30 93 7d 10 sts 0x107D, r19 ; 0x80107d 109c8: 20 93 7c 10 sts 0x107C, r18 ; 0x80107c 109cc: 20 91 7e 10 lds r18, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 109d0: 30 91 7f 10 lds r19, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 109d4: 2d 57 subi r18, 0x7D ; 125 109d6: 3f 4e sbci r19, 0xEF ; 239 109d8: 82 0f add r24, r18 109da: 93 1f adc r25, r19 109dc: fc 01 movw r30, r24 109de: 13 83 std Z+3, r17 ; 0x03 109e0: c9 cf rjmp .-110 ; 0x10974 #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 109e2: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 109e6: 90 91 7d 10 lds r25, 0x107D ; 0x80107d 109ea: 18 16 cp r1, r24 109ec: 19 06 cpc r1, r25 109ee: 0c f4 brge .+2 ; 0x109f2 109f0: 56 c2 rjmp .+1196 ; 0x10e9e SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 109f2: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 109f6: 81 11 cpse r24, r1 109f8: 66 c2 rjmp .+1228 ; 0x10ec6 prusa_statistics(6); } } #endif //SDSUPPORT } 109fa: a2 96 adiw r28, 0x22 ; 34 109fc: 0f b6 in r0, 0x3f ; 63 109fe: f8 94 cli 10a00: de bf out 0x3e, r29 ; 62 10a02: 0f be out 0x3f, r0 ; 63 10a04: cd bf out 0x3d, r28 ; 61 10a06: df 91 pop r29 10a08: cf 91 pop r28 10a0a: 1f 91 pop r17 10a0c: 0f 91 pop r16 10a0e: ff 90 pop r15 10a10: ef 90 pop r14 10a12: df 90 pop r13 10a14: cf 90 pop r12 10a16: bf 90 pop r11 10a18: af 90 pop r10 10a1a: 9f 90 pop r9 10a1c: 8f 90 pop r8 10a1e: 7f 90 pop r7 10a20: 6f 90 pop r6 10a22: 5f 90 pop r5 10a24: 4f 90 pop r4 10a26: 3f 90 pop r3 10a28: 2f 90 pop r2 10a2a: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10a2c: d0 92 42 03 sts 0x0342, r13 ; 0x800342 10a30: 8e cf rjmp .-228 ; 0x1094e return; } if (mp_cmd_active > 0) { 10a32: 30 91 41 03 lds r19, 0x0341 ; 0x800341 10a36: 33 23 and r19, r19 10a38: 09 f4 brne .+2 ; 0x10a3c 10a3a: 57 c0 rjmp .+174 ; 0x10aea } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a3c: 89 3f cpi r24, 0xF9 ; 249 10a3e: 09 f4 brne .+2 ; 0x10a42 10a40: 3f c0 rjmp .+126 ; 0x10ac0 10a42: 80 f5 brcc .+96 ; 0x10aa4 10a44: 86 3f cpi r24, 0xF6 ; 246 10a46: 09 f4 brne .+2 ; 0x10a4a 10a48: 48 c0 rjmp .+144 ; 0x10ada #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10a4a: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10a4e: 82 60 ori r24, 0x02 ; 2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10a50: 27 3f cpi r18, 0xF7 ; 247 10a52: 79 f1 breq .+94 ; 0x10ab2 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. 10a54: 85 e0 ldi r24, 0x05 ; 5 10a56: 98 e7 ldi r25, 0x78 ; 120 10a58: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 // 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); 10a5c: 80 e0 ldi r24, 0x00 ; 0 10a5e: 98 e7 ldi r25, 0x78 ; 120 10a60: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 // Echo current state if (mp_config & MPConfig_Active) 10a64: 10 91 40 03 lds r17, 0x0340 ; 0x800340 SERIAL_ECHOPGM(" ON"); 10a68: 8c ef ldi r24, 0xFC ; 252 10a6a: 97 e7 ldi r25, 0x77 ; 119 // NOTE: if any configuration vars are added below, the outgoing sync text for host plugin // should not contain the "PV' substring, as this is used to indicate protocol version SERIAL_ECHOPGM(MeatPack_ProtocolVersion); // Echo current state if (mp_config & MPConfig_Active) 10a6c: 10 fd sbrc r17, 0 10a6e: 02 c0 rjmp .+4 ; 0x10a74 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10a70: 87 ef ldi r24, 0xF7 ; 247 10a72: 97 e7 ldi r25, 0x77 ; 119 10a74: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (mp_config & MPConfig_NoSpaces) 10a78: 01 2f mov r16, r17 10a7a: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10a7c: 82 ef ldi r24, 0xF2 ; 242 10a7e: 97 e7 ldi r25, 0x77 ; 119 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10a80: 11 fd sbrc r17, 1 10a82: 02 c0 rjmp .+4 ; 0x10a88 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10a84: 8d ee ldi r24, 0xED ; 237 10a86: 97 e7 ldi r25, 0x77 ; 119 10a88: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM(""); 10a8c: 8c ee ldi r24, 0xEC ; 236 10a8e: 97 e7 ldi r25, 0x77 ; 119 10a90: 0e 94 06 7b call 0xf60c ; 0xf60c // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10a94: 00 23 and r16, r16 10a96: 29 f1 breq .+74 ; 0x10ae2 MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10a98: 45 e4 ldi r20, 0x45 ; 69 10a9a: 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; 10a9e: 10 92 41 03 sts 0x0341, r1 ; 0x800341 10aa2: 55 cf rjmp .-342 ; 0x1094e } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10aa4: 8a 3f cpi r24, 0xFA ; 250 10aa6: 41 f0 breq .+16 ; 0x10ab8 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10aa8: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10aac: 81 60 ori r24, 0x01 ; 1 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10aae: 2b 3f cpi r18, 0xFB ; 251 10ab0: 89 f6 brne .-94 ; 0x10a54 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10ab2: 80 93 40 03 sts 0x0340, r24 ; 0x800340 10ab6: ce cf rjmp .-100 ; 0x10a54 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10ab8: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10abc: 8e 7f andi r24, 0xFE ; 254 10abe: f9 cf rjmp .-14 ; 0x10ab2 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10ac0: 10 92 45 03 sts 0x0345, r1 ; 0x800345 mp_cmd_active = MPCommand_None; 10ac4: 10 92 41 03 sts 0x0341, r1 ; 0x800341 mp_config = MPConfig_None; 10ac8: 10 92 40 03 sts 0x0340, r1 ; 0x800340 mp_char_buf = 0; 10acc: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f mp_cmd_count = 0; 10ad0: 10 92 42 03 sts 0x0342, r1 ; 0x800342 mp_cmd_active = 0; mp_full_char_queue = 0; 10ad4: 10 92 3e 03 sts 0x033E, r1 ; 0x80033e 10ad8: bd cf rjmp .-134 ; 0x10a54 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10ada: 80 91 40 03 lds r24, 0x0340 ; 0x800340 10ade: 8d 7f andi r24, 0xFD ; 253 10ae0: e8 cf rjmp .-48 ; 0x10ab2 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10ae2: 50 e2 ldi r21, 0x20 ; 32 10ae4: 50 93 0b 02 sts 0x020B, r21 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10ae8: da cf rjmp .-76 ; 0x10a9e mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10aea: 20 91 42 03 lds r18, 0x0342 ; 0x800342 10aee: 40 91 40 03 lds r20, 0x0340 ; 0x800340 10af2: 22 23 and r18, r18 10af4: 31 f1 breq .+76 ; 0x10b42 10af6: e0 91 45 03 lds r30, 0x0345 ; 0x800345 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10afa: 40 ff sbrs r20, 0 10afc: 49 c0 rjmp .+146 ; 0x10b90 if (mp_full_char_queue > 0) { 10afe: 30 91 3e 03 lds r19, 0x033E ; 0x80033e 10b02: 33 23 and r19, r19 10b04: 09 f4 brne .+2 ; 0x10b08 10b06: 40 c0 rjmp .+128 ; 0x10b88 #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; 10b08: 21 e0 ldi r18, 0x01 ; 1 10b0a: 2e 0f add r18, r30 10b0c: 20 93 45 03 sts 0x0345, r18 ; 0x800345 10b10: ae 2f mov r26, r30 10b12: b0 e0 ldi r27, 0x00 ; 0 10b14: ad 5b subi r26, 0xBD ; 189 10b16: bc 4f sbci r27, 0xFC ; 252 10b18: ff ef ldi r31, 0xFF ; 255 10b1a: 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) { 10b1c: 50 91 3f 03 lds r21, 0x033F ; 0x80033f 10b20: 55 23 and r21, r21 10b22: 51 f0 breq .+20 ; 0x10b38 #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; 10b24: ee 5f subi r30, 0xFE ; 254 10b26: e0 93 45 03 sts 0x0345, r30 ; 0x800345 10b2a: e2 2f mov r30, r18 10b2c: f0 e0 ldi r31, 0x00 ; 0 10b2e: ed 5b subi r30, 0xBD ; 189 10b30: fc 4f sbci r31, 0xFC ; 252 10b32: 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; 10b34: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f } --mp_full_char_queue; 10b38: 31 50 subi r19, 0x01 ; 1 10b3a: 30 93 3e 03 sts 0x033E, r19 ; 0x80033e return; } if (mp_cmd_count > 0) { mp_handle_rx_char_inner((uint8_t)(MeatPack_CommandByte)); mp_cmd_count = 0; 10b3e: 10 92 42 03 sts 0x0342, r1 ; 0x800342 10b42: e0 91 45 03 lds r30, 0x0345 ; 0x800345 //========================================================================== void FORCE_INLINE mp_handle_rx_char_inner(const uint8_t c) { // Packing enabled, handle character and re-arrange them appropriately. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (mp_config & MPConfig_Active) { 10b46: 40 ff sbrs r20, 0 10b48: 6c c0 rjmp .+216 ; 0x10c22 if (mp_full_char_queue > 0) { 10b4a: 20 91 3e 03 lds r18, 0x033E ; 0x80033e 10b4e: 22 23 and r18, r18 10b50: 49 f1 breq .+82 ; 0x10ba4 #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; 10b52: 91 e0 ldi r25, 0x01 ; 1 10b54: 9e 0f add r25, r30 10b56: 90 93 45 03 sts 0x0345, r25 ; 0x800345 10b5a: ae 2f mov r26, r30 10b5c: b0 e0 ldi r27, 0x00 ; 0 10b5e: ad 5b subi r26, 0xBD ; 189 10b60: bc 4f sbci r27, 0xFC ; 252 10b62: 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) { 10b64: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 10b68: 88 23 and r24, r24 10b6a: 51 f0 breq .+20 ; 0x10b80 #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; 10b6c: ee 5f subi r30, 0xFE ; 254 10b6e: e0 93 45 03 sts 0x0345, r30 ; 0x800345 10b72: e9 2f mov r30, r25 10b74: f0 e0 ldi r31, 0x00 ; 0 10b76: ed 5b subi r30, 0xBD ; 189 10b78: fc 4f sbci r31, 0xFC ; 252 10b7a: 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; 10b7c: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f } --mp_full_char_queue; 10b80: 21 50 subi r18, 0x01 ; 1 10b82: 20 93 3e 03 sts 0x033E, r18 ; 0x80033e 10b86: e3 ce rjmp .-570 ; 0x1094e 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; 10b88: 22 e0 ldi r18, 0x02 ; 2 10b8a: 20 93 3e 03 sts 0x033E, r18 ; 0x80033e 10b8e: d7 cf rjmp .-82 ; 0x10b3e #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; 10b90: 21 e0 ldi r18, 0x01 ; 1 10b92: 2e 0f add r18, r30 10b94: 20 93 45 03 sts 0x0345, r18 ; 0x800345 10b98: f0 e0 ldi r31, 0x00 ; 0 10b9a: ed 5b subi r30, 0xBD ; 189 10b9c: fc 4f sbci r31, 0xFC ; 252 10b9e: 5f ef ldi r21, 0xFF ; 255 10ba0: 50 83 st Z, r21 10ba2: cd cf rjmp .-102 ; 0x10b3e 10ba4: a8 2f mov r26, r24 10ba6: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10ba8: 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; 10baa: 31 e0 ldi r19, 0x01 ; 1 10bac: af 30 cpi r26, 0x0F ; 15 10bae: 29 f0 breq .+10 ; 0x10bba 10bb0: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10bb2: a0 50 subi r26, 0x00 ; 0 10bb4: be 4f sbci r27, 0xFE ; 254 10bb6: 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; 10bb8: 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; 10bba: 58 2f mov r21, r24 10bbc: 50 7f andi r21, 0xF0 ; 240 10bbe: 50 3f cpi r21, 0xF0 ; 240 10bc0: 59 f4 brne .+22 ; 0x10bd8 10bc2: 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) { 10bc4: 30 ff sbrs r19, 0 10bc6: 13 c0 rjmp .+38 ; 0x10bee ++mp_full_char_queue; 10bc8: d0 92 3e 03 sts 0x033E, r13 ; 0x80033e if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10bcc: 31 ff sbrs r19, 1 10bce: 0c c0 rjmp .+24 ; 0x10be8 10bd0: 82 e0 ldi r24, 0x02 ; 2 10bd2: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e 10bd6: bb ce rjmp .-650 ; 0x1094e 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 10bd8: 82 95 swap r24 10bda: 8f 70 andi r24, 0x0F ; 15 10bdc: a8 2f mov r26, r24 10bde: b0 e0 ldi r27, 0x00 ; 0 10be0: a0 50 subi r26, 0x00 ; 0 10be2: be 4f sbci r27, 0xFE ; 254 10be4: 2c 91 ld r18, X 10be6: ee cf rjmp .-36 ; 0x10bc4 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]; 10be8: 20 93 3f 03 sts 0x033F, r18 ; 0x80033f 10bec: b0 ce rjmp .-672 ; 0x1094e #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; 10bee: 81 e0 ldi r24, 0x01 ; 1 10bf0: 8e 0f add r24, r30 10bf2: 80 93 45 03 sts 0x0345, r24 ; 0x800345 10bf6: ae 2f mov r26, r30 10bf8: b0 e0 ldi r27, 0x00 ; 0 10bfa: ad 5b subi r26, 0xBD ; 189 10bfc: bc 4f sbci r27, 0xFC ; 252 10bfe: 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') { 10c00: 4a 30 cpi r20, 0x0A ; 10 10c02: 09 f4 brne .+2 ; 0x10c06 10c04: a4 ce rjmp .-696 ; 0x1094e if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10c06: 31 ff sbrs r19, 1 10c08: 03 c0 rjmp .+6 ; 0x10c10 10c0a: d0 92 3e 03 sts 0x033E, r13 ; 0x80033e 10c0e: 9f ce rjmp .-706 ; 0x1094e #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: ee 5f subi r30, 0xFE ; 254 10c12: e0 93 45 03 sts 0x0345, r30 ; 0x800345 10c16: e8 2f mov r30, r24 10c18: f0 e0 ldi r31, 0x00 ; 0 10c1a: ed 5b subi r30, 0xBD ; 189 10c1c: fc 4f sbci r31, 0xFC ; 252 10c1e: 20 83 st Z, r18 10c20: 96 ce rjmp .-724 ; 0x1094e 10c22: 91 e0 ldi r25, 0x01 ; 1 10c24: 9e 0f add r25, r30 10c26: 90 93 45 03 sts 0x0345, r25 ; 0x800345 10c2a: f0 e0 ldi r31, 0x00 ; 0 10c2c: ed 5b subi r30, 0xBD ; 189 10c2e: fc 4f sbci r31, 0xFC ; 252 10c30: 80 83 st Z, r24 10c32: 8d ce rjmp .-742 ; 0x1094e continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10c34: 00 97 sbiw r24, 0x00 ; 0 10c36: 19 f4 brne .+6 ; 0x10c3e comment_mode = false; //for new command 10c38: 10 92 47 03 sts 0x0347, r1 ; 0x800347 10c3c: de ce rjmp .-580 ; 0x109fa 10c3e: 00 91 7e 10 lds r16, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 10c42: 10 91 7f 10 lds r17, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 10c46: 0a 57 subi r16, 0x7A ; 122 10c48: 1f 4e sbci r17, 0xEF ; 239 10c4a: 80 0f add r24, r16 10c4c: 91 1f adc r25, r17 10c4e: fc 01 movw r30, r24 10c50: 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) 10c52: 1a 83 std Y+2, r17 ; 0x02 10c54: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 10c56: 80 91 47 03 lds r24, 0x0347 ; 0x800347 10c5a: 81 11 cpse r24, r1 10c5c: 03 c1 rjmp .+518 ; 0x10e64 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 10c5e: f8 01 movw r30, r16 10c60: 80 81 ld r24, Z 10c62: 8e 34 cpi r24, 0x4E ; 78 10c64: 09 f0 breq .+2 ; 0x10c68 10c66: 8a c0 rjmp .+276 ; 0x10d7c // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 10c68: 4a e0 ldi r20, 0x0A ; 10 10c6a: 50 e0 ldi r21, 0x00 ; 0 10c6c: be 01 movw r22, r28 10c6e: 6f 5f subi r22, 0xFF ; 255 10c70: 7f 4f sbci r23, 0xFF ; 255 10c72: c8 01 movw r24, r16 10c74: 01 96 adiw r24, 0x01 ; 1 10c76: 0f 94 1c d9 call 0x3b238 ; 0x3b238 10c7a: 2b 01 movw r4, r22 10c7c: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 10c7e: e9 80 ldd r14, Y+1 ; 0x01 10c80: fa 80 ldd r15, Y+2 ; 0x02 10c82: f7 01 movw r30, r14 10c84: 80 81 ld r24, Z 10c86: 80 32 cpi r24, 0x20 ; 32 10c88: 31 f4 brne .+12 ; 0x10c96 10c8a: ff ef ldi r31, 0xFF ; 255 10c8c: ef 1a sub r14, r31 10c8e: ff 0a sbc r15, r31 10c90: fa 82 std Y+2, r15 ; 0x02 10c92: e9 82 std Y+1, r14 ; 0x01 10c94: f4 cf rjmp .-24 ; 0x10c7e // 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)) { 10c96: 80 90 7c 03 lds r8, 0x037C ; 0x80037c 10c9a: 90 90 7d 03 lds r9, 0x037D ; 0x80037d 10c9e: a0 90 7e 03 lds r10, 0x037E ; 0x80037e 10ca2: b0 90 7f 03 lds r11, 0x037F ; 0x80037f 10ca6: d5 01 movw r26, r10 10ca8: c4 01 movw r24, r8 10caa: 01 96 adiw r24, 0x01 ; 1 10cac: a1 1d adc r26, r1 10cae: b1 1d adc r27, r1 10cb0: 84 15 cp r24, r4 10cb2: 95 05 cpc r25, r5 10cb4: a6 05 cpc r26, r6 10cb6: b7 05 cpc r27, r7 10cb8: 49 f0 breq .+18 ; 0x10ccc 10cba: 44 e0 ldi r20, 0x04 ; 4 10cbc: 50 e0 ldi r21, 0x00 ; 0 10cbe: 65 e3 ldi r22, 0x35 ; 53 10cc0: 78 e7 ldi r23, 0x78 ; 120 10cc2: c7 01 movw r24, r14 10cc4: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 10cc8: 89 2b or r24, r25 10cca: a1 f4 brne .+40 ; 0x10cf4 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 10ccc: 6a e2 ldi r22, 0x2A ; 42 10cce: 70 e0 ldi r23, 0x00 ; 0 10cd0: c7 01 movw r24, r14 10cd2: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 10cd6: 90 93 98 03 sts 0x0398, r25 ; 0x800398 10cda: 80 93 97 03 sts 0x0397, r24 ; 0x800397 10cde: 00 97 sbiw r24, 0x00 ; 0 10ce0: 09 f4 brne .+2 ; 0x10ce4 10ce2: 45 c0 rjmp .+138 ; 0x10d6e 10ce4: f8 01 movw r30, r16 { byte checksum = 0; 10ce6: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 10ce8: e8 17 cp r30, r24 10cea: f9 07 cpc r31, r25 10cec: 71 f0 breq .+28 ; 0x10d0a checksum = checksum^(*p++); 10cee: 21 91 ld r18, Z+ 10cf0: f2 26 eor r15, r18 10cf2: fa cf rjmp .-12 ; 0x10ce8 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; 10cf4: 8a ec ldi r24, 0xCA ; 202 10cf6: 99 ea ldi r25, 0xA9 ; 169 10cf8: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 10cfc: 8c ec ldi r24, 0xCC ; 204 10cfe: 95 e6 ldi r25, 0x65 ; 101 *strchr_pointer = 0; } else { SERIAL_ERROR_START; SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10d00: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 10d04: c5 01 movw r24, r10 10d06: b4 01 movw r22, r8 10d08: 15 c0 rjmp .+42 ; 0x10d34 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 10d0a: 0e 94 1b 5c call 0xb836 ; 0xb836 10d0e: f8 16 cp r15, r24 10d10: 19 06 cpc r1, r25 10d12: d9 f0 breq .+54 ; 0x10d4a SERIAL_ERROR_START; 10d14: 8a ec ldi r24, 0xCA ; 202 10d16: 99 ea ldi r25, 0xA9 ; 169 10d18: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 10d1c: 8d ea ldi r24, 0xAD ; 173 10d1e: 95 e6 ldi r25, 0x65 ; 101 10d20: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 10d24: 60 91 7c 03 lds r22, 0x037C ; 0x80037c 10d28: 70 91 7d 03 lds r23, 0x037D ; 0x80037d 10d2c: 80 91 7e 03 lds r24, 0x037E ; 0x80037e 10d30: 90 91 7f 03 lds r25, 0x037F ; 0x80037f 10d34: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca } void MarlinSerial::println(long n, int base) { print(n, base); println(); 10d38: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 10d3c: 0e 94 33 5c call 0xb866 ; 0xb866 serial_count = 0; 10d40: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 10d44: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c 10d48: 58 ce rjmp .-848 ; 0x109fa return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 10d4a: e0 91 97 03 lds r30, 0x0397 ; 0x800397 10d4e: f0 91 98 03 lds r31, 0x0398 ; 0x800398 10d52: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 10d54: e9 80 ldd r14, Y+1 ; 0x01 10d56: fa 80 ldd r15, Y+2 ; 0x02 10d58: 60 e3 ldi r22, 0x30 ; 48 10d5a: 78 e7 ldi r23, 0x78 ; 120 10d5c: c7 01 movw r24, r14 10d5e: 0f 94 3f db call 0x3b67e ; 0x3b67e 10d62: 89 2b or r24, r25 10d64: 39 f5 brne .+78 ; 0x10db4 kill(MSG_M112_KILL); 10d66: 87 ee ldi r24, 0xE7 ; 231 10d68: 98 e6 ldi r25, 0x68 ; 104 10d6a: 0e 94 95 7b call 0xf72a ; 0xf72a // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 10d6e: 8a ec ldi r24, 0xCA ; 202 10d70: 99 ea ldi r25, 0xA9 ; 169 10d72: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 10d76: 83 e8 ldi r24, 0x83 ; 131 10d78: 95 e6 ldi r25, 0x65 ; 101 10d7a: c2 cf rjmp .-124 ; 0x10d00 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 10d7c: 89 81 ldd r24, Y+1 ; 0x01 10d7e: 9a 81 ldd r25, Y+2 ; 0x02 10d80: fc 01 movw r30, r24 10d82: 20 81 ld r18, Z 10d84: 20 32 cpi r18, 0x20 ; 32 10d86: 21 f4 brne .+8 ; 0x10d90 10d88: 01 96 adiw r24, 0x01 ; 1 10d8a: 9a 83 std Y+2, r25 ; 0x02 10d8c: 89 83 std Y+1, r24 ; 0x01 10d8e: f6 cf rjmp .-20 ; 0x10d7c // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 10d90: 6a e2 ldi r22, 0x2A ; 42 10d92: 70 e0 ldi r23, 0x00 ; 0 10d94: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 10d98: 89 2b or r24, r25 10d9a: 39 f0 breq .+14 ; 0x10daa { SERIAL_ERROR_START; 10d9c: 8a ec ldi r24, 0xCA ; 202 10d9e: 99 ea ldi r25, 0xA9 ; 169 10da0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 10da4: 89 e5 ldi r24, 0x59 ; 89 10da6: 95 e6 ldi r25, 0x65 ; 101 10da8: bb cf rjmp .-138 ; 0x10d20 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 10daa: 44 24 eor r4, r4 10dac: 4a 94 dec r4 10dae: 54 2c mov r5, r4 10db0: 32 01 movw r6, r4 10db2: d0 cf rjmp .-96 ; 0x10d54 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) 10db4: 44 e0 ldi r20, 0x04 ; 4 10db6: 50 e0 ldi r21, 0x00 ; 0 10db8: 6b e2 ldi r22, 0x2B ; 43 10dba: 78 e7 ldi r23, 0x78 ; 120 10dbc: c7 01 movw r24, r14 10dbe: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 10dc2: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 10dc4: f7 01 movw r30, r14 10dc6: 80 81 ld r24, Z 10dc8: 87 34 cpi r24, 0x47 ; 71 10dca: 81 f4 brne .+32 ; 0x10dec 10dcc: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 10dd0: 85 30 cpi r24, 0x05 ; 5 10dd2: 61 f0 breq .+24 ; 0x10dec usb_timer.start(); 10dd4: 81 e1 ldi r24, 0x11 ; 17 10dd6: 95 e0 ldi r25, 0x05 ; 5 10dd8: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 10ddc: f6 e0 ldi r31, 0x06 ; 6 10dde: f0 93 67 0e sts 0x0E67, r31 ; 0x800e67 <_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); 10de2: 60 e0 ldi r22, 0x00 ; 0 10de4: 85 ea ldi r24, 0xA5 ; 165 10de6: 9f e0 ldi r25, 0x0F ; 15 10de8: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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) { 10dec: ab 28 or r10, r11 10dee: 21 f0 breq .+8 ; 0x10df8 10df0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 10df4: 81 11 cpse r24, r1 10df6: a4 cf rjmp .-184 ; 0x10d40 } // 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; 10df8: 26 e0 ldi r18, 0x06 ; 6 10dfa: 77 fc sbrc r7, 7 10dfc: 21 e0 ldi r18, 0x01 ; 1 10dfe: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 10e02: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 10e06: fc 01 movw r30, r24 10e08: ed 57 subi r30, 0x7D ; 125 10e0a: ff 4e sbci r31, 0xEF ; 239 10e0c: 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) 10e0e: 49 81 ldd r20, Y+1 ; 0x01 10e10: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 10e12: 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) 10e14: da 01 movw r26, r20 10e16: 40 17 cp r20, r16 10e18: 51 07 cpc r21, r17 10e1a: a1 f5 brne .+104 ; 0x10e84 cmd_len = strlen(cmd_start) + 1; 10e1c: 01 90 ld r0, Z+ 10e1e: 00 20 and r0, r0 10e20: e9 f7 brne .-6 ; 0x10e1c 10e22: 9f 01 movw r18, r30 10e24: 20 1b sub r18, r16 10e26: 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; 10e28: 03 96 adiw r24, 0x03 ; 3 10e2a: 28 0f add r18, r24 10e2c: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 10e2e: 2d 3e cpi r18, 0xED ; 237 10e30: f1 e0 ldi r31, 0x01 ; 1 10e32: 3f 07 cpc r19, r31 10e34: 79 f1 breq .+94 ; 0x10e94 // 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; 10e36: 30 93 7f 10 sts 0x107F, r19 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 10e3a: 20 93 7e 10 sts 0x107E, r18 ; 0x80107e <_ZL7bufindw.lto_priv.571> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 10e3e: 80 91 81 10 lds r24, 0x1081 ; 0x801081 10e42: 90 91 82 10 lds r25, 0x1082 ; 0x801082 10e46: 01 96 adiw r24, 0x01 ; 1 10e48: 90 93 82 10 sts 0x1082, r25 ; 0x801082 10e4c: 80 93 81 10 sts 0x1081, r24 ; 0x801081 // Update the processed gcode line if (gcode_N >= 0) 10e50: 77 fc sbrc r7, 7 10e52: 08 c0 rjmp .+16 ; 0x10e64 gcode_LastN = gcode_N; 10e54: 40 92 7c 03 sts 0x037C, r4 ; 0x80037c 10e58: 50 92 7d 03 sts 0x037D, r5 ; 0x80037d 10e5c: 60 92 7e 03 sts 0x037E, r6 ; 0x80037e 10e60: 70 92 7f 03 sts 0x037F, r7 ; 0x80037f SERIAL_ECHOPGM("Number of commands in the buffer: "); SERIAL_ECHO(buflen); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } // end of 'not comment mode' serial_count = 0; //clear buffer 10e64: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 10e68: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c // Don't call cmdqueue_could_enqueue_back if there are no characters waiting // in the queue, as this function will reserve the memory. if (MYSERIAL.available() == 0 || ! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 10e6c: 0e 94 94 78 call 0xf128 ; 0xf128 10e70: 89 2b or r24, r25 10e72: 09 f4 brne .+2 ; 0x10e76 10e74: c2 cd rjmp .-1148 ; 0x109fa 10e76: 8f e5 ldi r24, 0x5F ; 95 10e78: 90 e0 ldi r25, 0x00 ; 0 10e7a: 0e 94 f7 5c call 0xb9ee ; 0xb9ee 10e7e: 81 11 cpse r24, r1 10e80: 79 cd rjmp .-1294 ; 0x10974 10e82: bb cd rjmp .-1162 ; 0x109fa 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]; } 10e84: 6d 91 ld r22, X+ 10e86: 61 93 st Z+, r22 10e88: 9d 01 movw r18, r26 10e8a: 24 1b sub r18, r20 10e8c: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 10e8e: 61 11 cpse r22, r1 10e90: f9 cf rjmp .-14 ; 0x10e84 10e92: ca cf rjmp .-108 ; 0x10e28 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 10e94: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 10e98: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.571> 10e9c: d0 cf rjmp .-96 ; 0x10e3e #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10e9e: 60 ed ldi r22, 0xD0 ; 208 10ea0: 77 e0 ldi r23, 0x07 ; 7 10ea2: 88 e4 ldi r24, 0x48 ; 72 10ea4: 93 e0 ldi r25, 0x03 ; 3 10ea6: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 10eaa: 88 23 and r24, r24 10eac: 09 f4 brne .+2 ; 0x10eb0 10eae: a1 cd rjmp .-1214 ; 0x109f2 comment_mode = false; 10eb0: 10 92 47 03 sts 0x0347, r1 ; 0x800347 serial_count = 0; 10eb4: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 10eb8: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c SERIAL_ECHOLNPGM("RX timeout"); 10ebc: 80 e2 ldi r24, 0x20 ; 32 10ebe: 98 e7 ldi r25, 0x78 ; 120 10ec0: 0e 94 06 7b call 0xf60c ; 0xf60c 10ec4: 9a cd rjmp .-1228 ; 0x109fa return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10ec6: 80 91 01 17 lds r24, 0x1701 ; 0x801701 10eca: 88 23 and r24, r24 10ecc: 09 f4 brne .+2 ; 0x10ed0 10ece: 95 cd rjmp .-1238 ; 0x109fa 10ed0: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 10ed4: 90 91 7d 10 lds r25, 0x107D ; 0x80107d 10ed8: 89 2b or r24, r25 10eda: 09 f0 breq .+2 ; 0x10ede 10edc: 8e cd rjmp .-1252 ; 0x109fa //'#' 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; 10ede: 80 91 81 10 lds r24, 0x1081 ; 0x801081 10ee2: 90 91 82 10 lds r25, 0x1082 ; 0x801082 10ee6: 89 2b or r24, r25 10ee8: 11 f4 brne .+4 ; 0x10eee 10eea: 10 92 46 03 sts 0x0346, r1 ; 0x800346 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10eee: 2b e7 ldi r18, 0x7B ; 123 10ef0: e2 2e mov r14, r18 10ef2: 20 e1 ldi r18, 0x10 ; 16 10ef4: 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; 10ef6: 32 e0 ldi r19, 0x02 ; 2 10ef8: d3 2e mov r13, r19 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 10efa: cc 24 eor r12, r12 10efc: 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) { 10efe: 40 91 82 17 lds r20, 0x1782 ; 0x801782 10f02: 50 91 83 17 lds r21, 0x1783 ; 0x801783 10f06: 60 91 84 17 lds r22, 0x1784 ; 0x801784 10f0a: 70 91 85 17 lds r23, 0x1785 ; 0x801785 10f0e: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 10f12: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 10f16: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 10f1a: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 10f1e: 48 17 cp r20, r24 10f20: 59 07 cpc r21, r25 10f22: 6a 07 cpc r22, r26 10f24: 7b 07 cpc r23, r27 10f26: 08 f0 brcs .+2 ; 0x10f2a 10f28: 2f c1 rjmp .+606 ; 0x11188 10f2a: 80 91 46 03 lds r24, 0x0346 ; 0x800346 10f2e: 81 11 cpse r24, r1 10f30: 2b c1 rjmp .+598 ; 0x11188 : "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() ){ 10f32: 0f 94 a7 7c call 0x2f94e ; 0x2f94e 10f36: 88 23 and r24, r24 10f38: 49 f1 breq .+82 ; 0x10f8c 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; 10f3a: 20 91 19 17 lds r18, 0x1719 ; 0x801719 10f3e: 30 91 1a 17 lds r19, 0x171A ; 0x80171a // to gfReadPtr within this method, because it is a class member variable. // The compiler cannot see, if omitting read/write won't have any incorrect side-effects to the rest of the whole FW. // So this trick explicitly states, that rdPtr is a local variable limited to the scope of this method, // therefore the compiler can omit read/write to it (keep it in registers!) as it sees fit. // And it does! Codesize dropped by 68B! const uint8_t *rdPtr = gfReadPtr; 10f42: 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; 10f44: 9b ef ldi r25, 0xFB ; 251 10f46: 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 == ';' ){ 10f48: f8 01 movw r30, r16 10f4a: 80 81 ld r24, Z 10f4c: 8b 33 cpi r24, 0x3B ; 59 10f4e: 51 f5 brne .+84 ; 0x10fa4 // 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); 10f50: f8 01 movw r30, r16 00010f52 : 10f52: 61 91 ld r22, Z+ 10f54: 6a 30 cpi r22, 0x0A ; 10 10f56: e9 f7 brne .-6 ; 0x10f52 10f58: 8f 01 movw r16, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 10f5a: cf 01 movw r24, r30 10f5c: 8b 57 subi r24, 0x7B ; 123 10f5e: 9e 40 sbci r25, 0x0E ; 14 10f60: 81 30 cpi r24, 0x01 ; 1 10f62: 92 40 sbci r25, 0x02 ; 2 10f64: d4 f0 brlt .+52 ; 0x10f9a // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 10f66: c8 01 movw r24, r16 10f68: 82 1b sub r24, r18 10f6a: 93 0b sbc r25, r19 10f6c: 01 97 sbiw r24, 0x01 ; 1 10f6e: 0f 94 98 7c call 0x2f930 ; 0x2f930 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10f72: 8e ef ldi r24, 0xFE ; 254 10f74: 96 e1 ldi r25, 0x16 ; 22 10f76: 0f 94 9b 6d call 0x2db36 ; 0x2db36 10f7a: 88 23 and r24, r24 10f7c: 39 f0 breq .+14 ; 0x10f8c if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 10f7e: 0f 94 a7 7c call 0x2f94e ; 0x2f94e rdPtr = start = blockBuffBegin; 10f82: 2b e7 ldi r18, 0x7B ; 123 10f84: 3e e0 ldi r19, 0x0E ; 14 10f86: 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 10f88: 81 11 cpse r24, r1 10f8a: e2 cf rjmp .-60 ; 0x10f50 } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 10f8c: f0 92 1a 17 sts 0x171A, r15 ; 0x80171a 10f90: e0 92 19 17 sts 0x1719, r14 ; 0x801719 return -1; 10f94: 0f ef ldi r16, 0xFF ; 255 10f96: 1f ef ldi r17, 0xFF ; 255 10f98: 37 c0 rjmp .+110 ; 0x11008 10f9a: 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){ 10f9c: b1 10 cpse r11, r1 10f9e: d5 c0 rjmp .+426 ; 0x1114a // 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 10fa0: 01 50 subi r16, 0x01 ; 1 10fa2: 11 09 sbc r17, r1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 10fa4: c8 01 movw r24, r16 10fa6: 82 1b sub r24, r18 10fa8: 93 0b sbc r25, r19 10faa: 01 96 adiw r24, 0x01 ; 1 10fac: 0f 94 98 7c call 0x2f930 ; 0x2f930 int16_t rv = *rdPtr++; 10fb0: c8 01 movw r24, r16 10fb2: 01 96 adiw r24, 0x01 ; 1 10fb4: f8 01 movw r30, r16 10fb6: 00 81 ld r16, Z 10fb8: 10 e0 ldi r17, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 10fba: 80 90 06 17 lds r8, 0x1706 ; 0x801706 10fbe: 90 90 07 17 lds r9, 0x1707 ; 0x801707 10fc2: a0 90 08 17 lds r10, 0x1708 ; 0x801708 10fc6: b0 90 09 17 lds r11, 0x1709 ; 0x801709 10fca: 40 91 0f 17 lds r20, 0x170F ; 0x80170f 10fce: 50 91 10 17 lds r21, 0x1710 ; 0x801710 10fd2: 60 91 11 17 lds r22, 0x1711 ; 0x801711 10fd6: 70 91 12 17 lds r23, 0x1712 ; 0x801712 10fda: 84 16 cp r8, r20 10fdc: 95 06 cpc r9, r21 10fde: a6 06 cpc r10, r22 10fe0: b7 06 cpc r11, r23 10fe2: a0 f6 brcc .-88 ; 0x10f8c // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 10fe4: 9c 01 movw r18, r24 10fe6: 2b 57 subi r18, 0x7B ; 123 10fe8: 3e 40 sbci r19, 0x0E ; 14 10fea: 21 15 cp r18, r1 10fec: 32 40 sbci r19, 0x02 ; 2 10fee: 44 f0 brlt .+16 ; 0x11000 // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 10ff0: 8e ef ldi r24, 0xFE ; 254 10ff2: 96 e1 ldi r25, 0x16 ; 22 10ff4: 0f 94 9b 6d call 0x2db36 ; 0x2db36 10ff8: 88 23 and r24, r24 10ffa: 41 f2 breq .-112 ; 0x10f8c // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 10ffc: 8b e7 ldi r24, 0x7B ; 123 10ffe: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 11000: 90 93 1a 17 sts 0x171A, r25 ; 0x80171a 11004: 80 93 19 17 sts 0x1719, r24 ; 0x801719 bool createContiguous(SdBaseFile* dirFile, const char* path, uint32_t size); /** \return The current cluster number for a file or directory. */ uint32_t curCluster() const {return curCluster_;} /** \return The current position for a file or directory. */ uint32_t curPosition() const {return curPosition_;} 11008: 40 91 06 17 lds r20, 0x1706 ; 0x801706 1100c: 50 91 07 17 lds r21, 0x1707 ; 0x801707 11010: 60 91 08 17 lds r22, 0x1708 ; 0x801708 11014: 70 91 09 17 lds r23, 0x1709 ; 0x801709 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); 11018: 40 93 82 17 sts 0x1782, r20 ; 0x801782 1101c: 50 93 83 17 sts 0x1783, r21 ; 0x801783 11020: 60 93 84 17 sts 0x1784, r22 ; 0x801784 11024: 70 93 85 17 sts 0x1785, r23 ; 0x801785 11028: 80 91 7c 10 lds r24, 0x107C ; 0x80107c 1102c: 90 91 7d 10 lds r25, 0x107D ; 0x80107d int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 11030: 0a 30 cpi r16, 0x0A ; 10 11032: 61 f0 breq .+24 ; 0x1104c || serial_char == '\r' 11034: 0d 30 cpi r16, 0x0D ; 13 11036: 51 f0 breq .+20 ; 0x1104c || serial_char == '#' 11038: 03 32 cpi r16, 0x23 ; 35 1103a: 09 f4 brne .+2 ; 0x1103e 1103c: 8c c0 rjmp .+280 ; 0x11156 || serial_count >= (MAX_CMD_SIZE - 1) 1103e: 8f 35 cpi r24, 0x5F ; 95 11040: 91 05 cpc r25, r1 11042: 3c f4 brge .+14 ; 0x11052 || n==-1 11044: 0f 3f cpi r16, 0xFF ; 255 11046: 10 07 cpc r17, r16 11048: 09 f0 breq .+2 ; 0x1104c 1104a: 8c c0 rjmp .+280 ; 0x11164 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 1104c: 00 97 sbiw r24, 0x00 ; 0 1104e: 09 f4 brne .+2 ; 0x11052 11050: d4 cc rjmp .-1624 ; 0x109fa 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); }; 11052: 20 91 01 17 lds r18, 0x1701 ; 0x801701 11056: 21 11 cpse r18, r1 11058: 03 c0 rjmp .+6 ; 0x11060 1105a: 40 e0 ldi r20, 0x00 ; 0 1105c: 50 e0 ldi r21, 0x00 ; 0 1105e: 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; 11060: 20 91 84 03 lds r18, 0x0384 ; 0x800384 11064: 30 91 85 03 lds r19, 0x0385 ; 0x800385 11068: 42 1b sub r20, r18 1106a: 53 0b sbc r21, r19 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 1106c: a0 91 7e 10 lds r26, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 11070: b0 91 7f 10 lds r27, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 11074: fd 01 movw r30, r26 11076: ed 57 subi r30, 0x7D ; 125 11078: ff 4e sbci r31, 0xEF ; 239 1107a: d0 82 st Z, r13 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 1107c: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 1107e: 52 83 std Z+2, r21 ; 0x02 11080: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 11082: 8d 57 subi r24, 0x7D ; 125 11084: 9f 4e sbci r25, 0xEF ; 239 11086: fc 01 movw r30, r24 11088: ea 0f add r30, r26 1108a: fb 1f adc r31, r27 1108c: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 1108e: ad 57 subi r26, 0x7D ; 125 11090: bf 4e sbci r27, 0xEF ; 239 11092: fd 01 movw r30, r26 11094: 01 90 ld r0, Z+ 11096: 00 20 and r0, r0 11098: e9 f7 brne .-6 ; 0x11094 1109a: 31 97 sbiw r30, 0x01 ; 1 1109c: ea 1b sub r30, r26 1109e: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 110a0: 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; 110a2: 80 91 81 10 lds r24, 0x1081 ; 0x801081 110a6: 90 91 82 10 lds r25, 0x1082 ; 0x801082 110aa: 01 96 adiw r24, 0x01 ; 1 110ac: 90 93 82 10 sts 0x1082, r25 ; 0x801082 110b0: 80 93 81 10 sts 0x1081, r24 ; 0x801081 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; cmdbuffer[bufindw+1] = sd_count.lohi.lo; cmdbuffer[bufindw+2] = sd_count.lohi.hi; cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 110b4: 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; 110b6: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 110ba: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 110be: e8 0f add r30, r24 110c0: f9 2f mov r31, r25 110c2: f1 1d adc r31, r1 110c4: f0 93 7f 10 sts 0x107F, r31 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 110c8: e0 93 7e 10 sts 0x107E, r30 ; 0x80107e <_ZL7bufindw.lto_priv.571> 110cc: 80 91 01 17 lds r24, 0x1701 ; 0x801701 110d0: 88 23 and r24, r24 110d2: 09 f4 brne .+2 ; 0x110d6 110d4: 43 c0 rjmp .+134 ; 0x1115c 110d6: 80 91 82 17 lds r24, 0x1782 ; 0x801782 110da: 90 91 83 17 lds r25, 0x1783 ; 0x801783 110de: a0 91 84 17 lds r26, 0x1784 ; 0x801784 110e2: b0 91 85 17 lds r27, 0x1785 ; 0x801785 sdpos_atomic = card.get_sdpos(); 110e6: 80 93 84 03 sts 0x0384, r24 ; 0x800384 110ea: 90 93 85 03 sts 0x0385, r25 ; 0x800385 110ee: a0 93 86 03 sts 0x0386, r26 ; 0x800386 110f2: b0 93 87 03 sts 0x0387, r27 ; 0x800387 if (bufindw == sizeof(cmdbuffer)) 110f6: ed 3e cpi r30, 0xED ; 237 110f8: f1 40 sbci r31, 0x01 ; 1 110fa: 21 f4 brne .+8 ; 0x11104 bufindw = 0; 110fc: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 11100: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.571> sei(); 11104: 78 94 sei comment_mode = false; //for new command 11106: 10 92 47 03 sts 0x0347, r1 ; 0x800347 serial_count = 0; //clear buffer 1110a: 10 92 7d 10 sts 0x107D, r1 ; 0x80107d 1110e: 10 92 7c 10 sts 0x107C, r1 ; 0x80107c if(card.eof()) break; 11112: 40 91 82 17 lds r20, 0x1782 ; 0x801782 11116: 50 91 83 17 lds r21, 0x1783 ; 0x801783 1111a: 60 91 84 17 lds r22, 0x1784 ; 0x801784 1111e: 70 91 85 17 lds r23, 0x1785 ; 0x801785 11122: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 11126: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 1112a: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 1112e: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 11132: 48 17 cp r20, r24 11134: 59 07 cpc r21, r25 11136: 6a 07 cpc r22, r26 11138: 7b 07 cpc r23, r27 1113a: 30 f5 brcc .+76 ; 0x11188 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 1113c: 8f e5 ldi r24, 0x5F ; 95 1113e: 90 e0 ldi r25, 0x00 ; 0 11140: 0e 94 f7 5c call 0xb9ee ; 0xb9ee 11144: 81 11 cpse r24, r1 11146: db ce rjmp .-586 ; 0x10efe 11148: 58 cc rjmp .-1872 ; 0x109fa 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 == ';' ){ 1114a: f8 01 movw r30, r16 1114c: 80 81 ld r24, Z 1114e: 8b 33 cpi r24, 0x3B ; 59 11150: 09 f4 brne .+2 ; 0x11154 11152: fa ce rjmp .-524 ; 0x10f48 11154: 25 cf rjmp .-438 ; 0x10fa0 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 11156: c0 92 46 03 sts 0x0346, r12 ; 0x800346 1115a: 78 cf rjmp .-272 ; 0x1104c 1115c: 80 e0 ldi r24, 0x00 ; 0 1115e: 90 e0 ldi r25, 0x00 ; 0 11160: dc 01 movw r26, r24 11162: c1 cf rjmp .-126 ; 0x110e6 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 11164: 9c 01 movw r18, r24 11166: 2f 5f subi r18, 0xFF ; 255 11168: 3f 4f sbci r19, 0xFF ; 255 1116a: 30 93 7d 10 sts 0x107D, r19 ; 0x80107d 1116e: 20 93 7c 10 sts 0x107C, r18 ; 0x80107c 11172: 20 91 7e 10 lds r18, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 11176: 30 91 7f 10 lds r19, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 1117a: 2d 57 subi r18, 0x7D ; 125 1117c: 3f 4e sbci r19, 0xEF ; 239 1117e: 82 0f add r24, r18 11180: 93 1f adc r25, r19 11182: fc 01 movw r30, r24 11184: 03 83 std Z+3, r16 ; 0x03 11186: bb ce rjmp .-650 ; 0x10efe } } if(card.eof()) 11188: 40 91 82 17 lds r20, 0x1782 ; 0x801782 1118c: 50 91 83 17 lds r21, 0x1783 ; 0x801783 11190: 60 91 84 17 lds r22, 0x1784 ; 0x801784 11194: 70 91 85 17 lds r23, 0x1785 ; 0x801785 11198: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 1119c: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 111a0: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 111a4: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 111a8: 48 17 cp r20, r24 111aa: 59 07 cpc r21, r25 111ac: 6a 07 cpc r22, r26 111ae: 7b 07 cpc r23, r27 111b0: 08 f4 brcc .+2 ; 0x111b4 111b2: 23 cc rjmp .-1978 ; 0x109fa { // 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()) 111b4: 0e 94 b9 5b call 0xb772 ; 0xb772 111b8: 89 2b or r24, r25 111ba: 09 f0 breq .+2 ; 0x111be 111bc: 1e cc rjmp .-1988 ; 0x109fa lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 111be: 8e ef ldi r24, 0xFE ; 254 111c0: 96 e1 ldi r25, 0x16 ; 22 111c2: 0f 94 7c 6e call 0x2dcf8 ; 0x2dcf8 file.close(); 111c6: 8e ef ldi r24, 0xFE ; 254 111c8: 96 e1 ldi r25, 0x16 ; 22 111ca: 0f 94 74 a4 call 0x348e8 ; 0x348e8 saving = false; 111ce: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 111d2: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED 111d6: 86 e4 ldi r24, 0x46 ; 70 111d8: 95 e6 ldi r25, 0x65 ; 101 111da: 0e 94 06 7b call 0xf60c ; 0xf60c char time[30]; uint32_t t = print_job_timer.duration() / 60; 111de: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce 111e2: 6b 01 movw r12, r22 111e4: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 111e6: 0e 94 d4 66 call 0xcda8 ; 0xcda8 // 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; 111ea: 8c e3 ldi r24, 0x3C ; 60 111ec: 88 2e mov r8, r24 111ee: 91 2c mov r9, r1 111f0: a1 2c mov r10, r1 111f2: b1 2c mov r11, r1 111f4: c7 01 movw r24, r14 111f6: b6 01 movw r22, r12 111f8: a5 01 movw r20, r10 111fa: 94 01 movw r18, r8 111fc: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> int hours, minutes; minutes = t % 60; 11200: ca 01 movw r24, r20 11202: b9 01 movw r22, r18 11204: a5 01 movw r20, r10 11206: 94 01 movw r18, r8 11208: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 1120c: 7f 93 push r23 1120e: 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; 11210: c7 01 movw r24, r14 11212: b6 01 movw r22, r12 11214: 20 e1 ldi r18, 0x10 ; 16 11216: 3e e0 ldi r19, 0x0E ; 14 11218: 40 e0 ldi r20, 0x00 ; 0 1121a: 50 e0 ldi r21, 0x00 ; 0 1121c: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 11220: 3f 93 push r19 11222: 2f 93 push r18 11224: 8c e0 ldi r24, 0x0C ; 12 11226: 98 e7 ldi r25, 0x78 ; 120 11228: 9f 93 push r25 1122a: 8f 93 push r24 1122c: 8e 01 movw r16, r28 1122e: 0f 5f subi r16, 0xFF ; 255 11230: 1f 4f sbci r17, 0xFF ; 255 11232: 1f 93 push r17 11234: 0f 93 push r16 11236: 0f 94 a8 dc call 0x3b950 ; 0x3b950 SERIAL_ECHO_START; 1123a: 82 ef ldi r24, 0xF2 ; 242 1123c: 99 ea ldi r25, 0xA9 ; 169 1123e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(time); 11242: c8 01 movw r24, r16 11244: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c #ifndef SHOW_FILENAME_AFTER_FINISH lcd_setstatus(time); 11248: c8 01 movw r24, r16 1124a: 0f 94 56 15 call 0x22aac ; 0x22aac #endif //SHOW_FILENAME_AFTER_FINISH card.printingHasFinished(); 1124e: 0f 94 39 81 call 0x30272 ; 0x30272 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 11252: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.572> if(!mounted) 11256: 0f b6 in r0, 0x3f ; 63 11258: f8 94 cli 1125a: de bf out 0x3e, r29 ; 62 1125c: 0f be out 0x3f, r0 ; 63 1125e: cd bf out 0x3d, r28 ; 61 11260: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 11264: 88 23 and r24, r24 11266: 19 f0 breq .+6 ; 0x1126e 11268: 0f 94 db 77 call 0x2efb6 ; 0x2efb6 1126c: c6 cb rjmp .-2164 ; 0x109fa { mount(); 1126e: 81 e0 ldi r24, 0x01 ; 1 11270: 0f 94 78 81 call 0x302f0 ; 0x302f0 if(!mounted) //fail 11274: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 11278: 81 11 cpse r24, r1 1127a: f6 cf rjmp .-20 ; 0x11268 1127c: be cb rjmp .-2180 ; 0x109fa 0001127e : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 1127e: cf 93 push r28 11280: df 93 push r29 11282: ec 01 movw r28, r24 { while (*str) 11284: 89 91 ld r24, Y+ 11286: 88 23 and r24, r24 11288: 19 f0 breq .+6 ; 0x11290 write(*str++); 1128a: 0e 94 c2 78 call 0xf184 ; 0xf184 1128e: fa cf rjmp .-12 ; 0x11284 } 11290: df 91 pop r29 11292: cf 91 pop r28 11294: 08 95 ret 00011296 : //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) { 11296: ff 92 push r15 11298: 0f 93 push r16 1129a: 1f 93 push r17 1129c: cf 93 push r28 1129e: df 93 push r29 112a0: ec 01 movw r28, r24 112a2: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 112a4: 66 23 and r22, r22 112a6: 09 f4 brne .+2 ; 0x112aa 112a8: 4b c0 rjmp .+150 ; 0x11340 #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); 112aa: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> 112ae: 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)) { 112b0: c8 01 movw r24, r16 112b2: 0e 94 f7 5c call 0xb9ee ; 0xb9ee 112b6: 88 23 and r24, r24 112b8: 09 f4 brne .+2 ; 0x112bc 112ba: 53 c0 rjmp .+166 ; 0x11362 // 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; 112bc: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 112c0: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 112c4: fc 01 movw r30, r24 112c6: ed 57 subi r30, 0x7D ; 125 112c8: ff 4e sbci r31, 0xEF ; 239 112ca: 23 e0 ldi r18, 0x03 ; 3 112cc: 20 83 st Z, r18 112ce: 8a 57 subi r24, 0x7A ; 122 112d0: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 112d2: 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) 112d4: ff 20 and r15, r15 112d6: e9 f1 breq .+122 ; 0x11352 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 112d8: 0f 94 48 db call 0x3b690 ; 0x3b690 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 112dc: 82 ef ldi r24, 0xF2 ; 242 112de: 99 ea ldi r25, 0xA9 ; 169 112e0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(MSG_Enqueing); 112e4: 8b e3 ldi r24, 0x3B ; 59 112e6: 95 e6 ldi r25, 0x65 ; 101 112e8: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 112ec: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 112f0: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> } }*/ static FORCE_INLINE void print(const char *str) { write(str); 112f4: 8a 57 subi r24, 0x7A ; 122 112f6: 9f 4e sbci r25, 0xEF ; 239 112f8: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_ECHOLNPGM("\""); 112fc: 8a ee ldi r24, 0xEA ; 234 112fe: 97 e7 ldi r25, 0x77 ; 119 11300: 0e 94 06 7b call 0xf60c ; 0xf60c bufindw += len + (CMDHDRSIZE + 1); 11304: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 11308: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 1130c: 04 96 adiw r24, 0x04 ; 4 1130e: 08 0f add r16, r24 11310: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11312: 0d 3e cpi r16, 0xED ; 237 11314: 81 e0 ldi r24, 0x01 ; 1 11316: 18 07 cpc r17, r24 11318: f9 f0 breq .+62 ; 0x11358 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 1131a: 10 93 7f 10 sts 0x107F, r17 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 1131e: 00 93 7e 10 sts 0x107E, r16 ; 0x80107e <_ZL7bufindw.lto_priv.571> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11322: 80 91 81 10 lds r24, 0x1081 ; 0x801081 11326: 90 91 82 10 lds r25, 0x1082 ; 0x801082 1132a: 01 96 adiw r24, 0x01 ; 1 1132c: 90 93 82 10 sts 0x1082, r25 ; 0x801082 11330: 80 93 81 10 sts 0x1081, r24 ; 0x801081 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11334: df 91 pop r29 11336: cf 91 pop r28 11338: 1f 91 pop r17 1133a: 0f 91 pop r16 1133c: ff 90 pop r15 1133e: 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); 11340: fc 01 movw r30, r24 11342: 01 90 ld r0, Z+ 11344: 00 20 and r0, r0 11346: e9 f7 brne .-6 ; 0x11342 11348: 31 97 sbiw r30, 0x01 ; 1 1134a: 8f 01 movw r16, r30 1134c: 08 1b sub r16, r24 1134e: 19 0b sbc r17, r25 11350: af cf rjmp .-162 ; 0x112b0 // 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); 11352: 0f 94 fc e3 call 0x3c7f8 ; 0x3c7f8 11356: c2 cf rjmp .-124 ; 0x112dc SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11358: 10 92 7f 10 sts 0x107F, r1 ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 1135c: 10 92 7e 10 sts 0x107E, r1 ; 0x80107e <_ZL7bufindw.lto_priv.571> 11360: e0 cf rjmp .-64 ; 0x11322 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11362: 8a ec ldi r24, 0xCA ; 202 11364: 99 ea ldi r25, 0xA9 ; 169 11366: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(MSG_Enqueing); 1136a: 8b e3 ldi r24, 0x3B ; 59 1136c: 95 e6 ldi r25, 0x65 ; 101 1136e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11372: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11374: ff 20 and r15, r15 11376: 59 f0 breq .+22 ; 0x1138e SERIAL_PROTOCOLRPGM(cmd); 11378: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1137c: 83 eb ldi r24, 0xB3 ; 179 1137e: 99 ea ldi r25, 0xA9 ; 169 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11380: df 91 pop r29 11382: cf 91 pop r28 11384: 1f 91 pop r17 11386: 0f 91 pop r16 11388: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 1138a: 0c 94 06 7b jmp 0xf60c ; 0xf60c 1138e: 0e 94 3f 89 call 0x1127e ; 0x1127e 11392: f4 cf rjmp .-24 ; 0x1137c 00011394 : { 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) { 11394: 0f 93 push r16 11396: 1f 93 push r17 11398: cf 93 push r28 1139a: df 93 push r29 1139c: d6 2f mov r29, r22 1139e: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 113a0: c0 e0 ldi r28, 0x00 ; 0 { void * const pgm_ptr = pgm_read_ptr(cmd_sequence + i); 113a2: f8 01 movw r30, r16 113a4: 85 91 lpm r24, Z+ 113a6: 94 91 lpm r25, Z // M702 is currently only used with MMU enabled if (pgm_ptr == MSG_M702 && !MMU2::mmu2.Enabled()) { 113a8: 2c e6 ldi r18, 0x6C ; 108 113aa: 88 31 cpi r24, 0x18 ; 24 113ac: 92 07 cpc r25, r18 113ae: 21 f4 brne .+8 ; 0x113b8 113b0: 20 91 98 13 lds r18, 0x1398 ; 0x801398 113b4: 21 30 cpi r18, 0x01 ; 1 113b6: 19 f4 brne .+6 ; 0x113be continue; } enquecommand_P(static_cast(pgm_ptr)); 113b8: 61 e0 ldi r22, 0x01 ; 1 113ba: 0e 94 4b 89 call 0x11296 ; 0x11296 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) 113be: cf 5f subi r28, 0xFF ; 255 113c0: 0e 5f subi r16, 0xFE ; 254 113c2: 1f 4f sbci r17, 0xFF ; 255 113c4: dc 13 cpse r29, r28 113c6: ed cf rjmp .-38 ; 0x113a2 continue; } enquecommand_P(static_cast(pgm_ptr)); } } 113c8: df 91 pop r29 113ca: cf 91 pop r28 113cc: 1f 91 pop r17 113ce: 0f 91 pop r16 113d0: 08 95 ret 000113d2 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 113d2: cf 93 push r28 113d4: df 93 push r29 113d6: cd b7 in r28, 0x3d ; 61 113d8: de b7 in r29, 0x3e ; 62 113da: 6e 97 sbiw r28, 0x1e ; 30 113dc: 0f b6 in r0, 0x3f ; 63 113de: f8 94 cli 113e0: de bf out 0x3e, r29 ; 62 113e2: 0f be out 0x3f, r0 ; 63 113e4: cd bf out 0x3d, r28 ; 61 113e6: 9e 01 movw r18, r28 113e8: 2c 5d subi r18, 0xDC ; 220 113ea: 3f 4f sbci r19, 0xFF ; 255 113ec: f9 01 movw r30, r18 113ee: 41 91 ld r20, Z+ 113f0: 51 91 ld r21, Z+ 113f2: 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); 113f4: 6e e1 ldi r22, 0x1E ; 30 113f6: 70 e0 ldi r23, 0x00 ; 0 113f8: ce 01 movw r24, r28 113fa: 01 96 adiw r24, 0x01 ; 1 113fc: 0f 94 e7 dc call 0x3b9ce ; 0x3b9ce va_end(ap); enquecommand(cmd_buffer, false); 11400: 60 e0 ldi r22, 0x00 ; 0 11402: ce 01 movw r24, r28 11404: 01 96 adiw r24, 0x01 ; 1 11406: 0e 94 4b 89 call 0x11296 ; 0x11296 } 1140a: 6e 96 adiw r28, 0x1e ; 30 1140c: 0f b6 in r0, 0x3f ; 63 1140e: f8 94 cli 11410: de bf out 0x3e, r29 ; 62 11412: 0f be out 0x3f, r0 ; 63 11414: cd bf out 0x3d, r28 ; 61 11416: df 91 pop r29 11418: cf 91 pop r28 1141a: 08 95 ret 0001141c : } } /// @brief Read saved filename from EEPROM and send g-code command: M23 void restore_file_from_sd() { 1141c: ef 92 push r14 1141e: ff 92 push r15 11420: 0f 93 push r16 11422: 1f 93 push r17 11424: cf 93 push r28 11426: df 93 push r29 11428: cd b7 in r28, 0x3d ; 61 1142a: de b7 in r29, 0x3e ; 62 1142c: 6b 97 sbiw r28, 0x1b ; 27 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 char filename[FILENAME_LENGTH]; char dir_name[9]; char extension_ptr[5]; uint8_t depth = eeprom_read_byte((uint8_t*)EEPROM_DIR_DEPTH); 11438: 8a e5 ldi r24, 0x5A ; 90 1143a: 9f e0 ldi r25, 0x0F ; 15 1143c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 11440: e8 2e mov r14, r24 11442: 0a e0 ldi r16, 0x0A ; 10 11444: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 11446: 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); 11448: 48 e0 ldi r20, 0x08 ; 8 1144a: 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++) { 1144c: fe 14 cp r15, r14 1144e: 79 f0 breq .+30 ; 0x1146e eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 11450: b8 01 movw r22, r16 11452: ce 01 movw r24, r28 11454: 0e 96 adiw r24, 0x0e ; 14 11456: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 dir_name[8] = '\0'; 1145a: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 1145c: 60 e0 ldi r22, 0x00 ; 0 1145e: ce 01 movw r24, r28 11460: 0e 96 adiw r24, 0x0e ; 14 11462: 0f 94 ca 7e call 0x2fd94 ; 0x2fd94 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++) { 11466: f3 94 inc r15 11468: 08 5f subi r16, 0xF8 ; 248 1146a: 1f 4f sbci r17, 0xFF ; 255 1146c: ed cf rjmp .-38 ; 0x11448 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); 1146e: 65 e9 ldi r22, 0x95 ; 149 11470: 7f e0 ldi r23, 0x0F ; 15 11472: 8e 01 movw r16, r28 11474: 0f 5f subi r16, 0xFF ; 255 11476: 1f 4f sbci r17, 0xFF ; 255 11478: c8 01 movw r24, r16 1147a: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 1147e: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 11480: 8e e2 ldi r24, 0x2E ; 46 11482: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 11484: 43 e0 ldi r20, 0x03 ; 3 11486: 50 e0 ldi r21, 0x00 ; 0 11488: 61 e9 ldi r22, 0x91 ; 145 1148a: 7c e0 ldi r23, 0x0C ; 12 1148c: ce 01 movw r24, r28 1148e: 48 96 adiw r24, 0x18 ; 24 11490: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 extension_ptr[4] = '\0'; 11494: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 11496: be 01 movw r22, r28 11498: 69 5e subi r22, 0xE9 ; 233 1149a: 7f 4f sbci r23, 0xFF ; 255 1149c: c8 01 movw r24, r16 1149e: 0f 94 dd e3 call 0x3c7ba ; 0x3c7ba enquecommandf_P(MSG_M23, filename); 114a2: 1f 93 push r17 114a4: 0f 93 push r16 114a6: 8d ee ldi r24, 0xED ; 237 114a8: 90 e7 ldi r25, 0x70 ; 112 114aa: 9f 93 push r25 114ac: 8f 93 push r24 114ae: 0e 94 e9 89 call 0x113d2 ; 0x113d2 114b2: 0f 90 pop r0 114b4: 0f 90 pop r0 114b6: 0f 90 pop r0 114b8: 0f 90 pop r0 } 114ba: 6b 96 adiw r28, 0x1b ; 27 114bc: 0f b6 in r0, 0x3f ; 63 114be: f8 94 cli 114c0: de bf out 0x3e, r29 ; 62 114c2: 0f be out 0x3f, r0 ; 63 114c4: cd bf out 0x3d, r28 ; 61 114c6: df 91 pop r29 114c8: cf 91 pop r28 114ca: 1f 91 pop r17 114cc: 0f 91 pop r16 114ce: ff 90 pop r15 114d0: ef 90 pop r14 114d2: 08 95 ret 000114d4 : //! 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) { 114d4: bf 92 push r11 114d6: cf 92 push r12 114d8: df 92 push r13 114da: ef 92 push r14 114dc: ff 92 push r15 114de: 0f 93 push r16 114e0: 1f 93 push r17 114e2: cf 93 push r28 114e4: df 93 push r29 if (saved_printing) return; 114e6: e0 91 5a 0e lds r30, 0x0E5A ; 0x800e5a 114ea: e1 11 cpse r30, r1 114ec: b1 c0 rjmp .+354 ; 0x11650 114ee: 05 2f mov r16, r21 114f0: 14 2f mov r17, r20 114f2: e9 01 movw r28, r18 114f4: 6b 01 movw r12, r22 114f6: 7c 01 movw r14, r24 cli(); 114f8: f8 94 cli save_print_file_state(); 114fa: 0e 94 ef 65 call 0xcbde ; 0xcbde // save the global state at planning time const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 114fe: b0 90 59 0e lds r11, 0x0E59 ; 0x800e59 11502: b1 10 cpse r11, r1 11504: 02 c0 rjmp .+4 ; 0x1150a 11506: b0 90 58 0e lds r11, 0x0E58 ; 0x800e58 save_planner_global_state(); 1150a: 0e 94 a5 65 call 0xcb4a ; 0xcb4a planner_abort_hard(); //abort printing 1150e: 0f 94 0d bc call 0x3781a ; 0x3781a memcpy(saved_pos, current_position, sizeof(saved_pos)); 11512: 80 e1 ldi r24, 0x10 ; 16 11514: e3 e4 ldi r30, 0x43 ; 67 11516: f7 e0 ldi r31, 0x07 ; 7 11518: ab e9 ldi r26, 0x9B ; 155 1151a: b2 e0 ldi r27, 0x02 ; 2 1151c: 01 90 ld r0, Z+ 1151e: 0d 92 st X+, r0 11520: 8a 95 dec r24 11522: e1 f7 brne .-8 ; 0x1151c if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 11524: bb 20 and r11, r11 11526: 61 f0 breq .+24 ; 0x11540 11528: 80 e0 ldi r24, 0x00 ; 0 1152a: 90 e0 ldi r25, 0x00 ; 0 1152c: a0 e8 ldi r26, 0x80 ; 128 1152e: bf eb ldi r27, 0xBF ; 191 11530: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 11534: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 11538: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 1153c: b0 93 9e 02 sts 0x029E, r27 ; 0x80029e saved_feedmultiply2 = feedmultiply; //save feedmultiply 11540: 80 91 39 02 lds r24, 0x0239 ; 0x800239 11544: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 11548: 90 93 74 03 sts 0x0374, r25 ; 0x800374 1154c: 80 93 73 03 sts 0x0373, r24 ; 0x800373 saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 11550: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 11554: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 11558: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae 1155c: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_bed_temperature = (uint8_t)degTargetBed(); 11560: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 11564: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 11568: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1156c: 83 fb bst r24, 3 1156e: 88 27 eor r24, r24 11570: 80 f9 bld r24, 0 11572: 80 93 06 18 sts 0x1806, r24 ; 0x801806 saved_fan_speed = fanSpeed; 11576: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 1157a: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac cmdqueue_reset(); //empty cmdqueue 1157e: 0e 94 cf 80 call 0x1019e ; 0x1019e card.sdprinting = false; 11582: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e // card.closefile(); saved_printing = true; 11586: 81 e0 ldi r24, 0x01 ; 1 11588: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a // We may have missed a stepper timer interrupt. Be safe than sorry, reset the stepper timer before re-enabling interrupts. st_reset_timer(); 1158c: 0f 94 86 59 call 0x2b30c ; 0x2b30c sei(); 11590: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 11592: 20 e0 ldi r18, 0x00 ; 0 11594: 30 e0 ldi r19, 0x00 ; 0 11596: a9 01 movw r20, r18 11598: c7 01 movw r24, r14 1159a: b6 01 movw r22, r12 1159c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__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) 115a0: 20 e0 ldi r18, 0x00 ; 0 115a2: 30 e0 ldi r19, 0x00 ; 0 115a4: a9 01 movw r20, r18 115a6: f8 01 movw r30, r16 115a8: 6c 2f mov r22, r28 115aa: 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 115ac: 81 11 cpse r24, r1 115ae: 5a c0 rjmp .+180 ; 0x11664 115b0: 8f 2f mov r24, r31 115b2: 90 2f mov r25, r16 115b4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 115b8: 88 23 and r24, r24 115ba: 09 f4 brne .+2 ; 0x115be 115bc: 49 c0 rjmp .+146 ; 0x11650 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 115be: 80 91 06 18 lds r24, 0x1806 ; 0x801806 115c2: 81 11 cpse r24, r1 115c4: 05 c0 rjmp .+10 ; 0x115d0 enquecommand_P(MSG_M83); 115c6: 61 e0 ldi r22, 0x01 ; 1 115c8: 8d e1 ldi r24, 0x1D ; 29 115ca: 9c e6 ldi r25, 0x6C ; 108 115cc: 0e 94 4b 89 call 0x11296 ; 0x11296 // 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); 115d0: 0f 93 push r16 115d2: 1f 93 push r17 115d4: df 93 push r29 115d6: cf 93 push r28 115d8: 82 ed ldi r24, 0xD2 ; 210 115da: 91 e7 ldi r25, 0x71 ; 113 115dc: 9f 93 push r25 115de: 8f 93 push r24 115e0: 0e 94 e9 89 call 0x113d2 ; 0x113d2 } if(z_move) 115e4: 0f 90 pop r0 115e6: 0f 90 pop r0 115e8: 0f 90 pop r0 115ea: 0f 90 pop r0 115ec: 0f 90 pop r0 115ee: 0f 90 pop r0 115f0: 20 e0 ldi r18, 0x00 ; 0 115f2: 30 e0 ldi r19, 0x00 ; 0 115f4: a9 01 movw r20, r18 115f6: c7 01 movw r24, r14 115f8: b6 01 movw r22, r12 115fa: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 115fe: 88 23 and r24, r24 11600: 21 f1 breq .+72 ; 0x1164a { // Then lift Z axis enquecommandf_P(PSTR("G1 Z%-.3f F%-.3f"), saved_pos[Z_AXIS] + z_move, homing_feedrate[Z_AXIS]); 11602: 84 e4 ldi r24, 0x44 ; 68 11604: 8f 93 push r24 11606: 88 e4 ldi r24, 0x48 ; 72 11608: 8f 93 push r24 1160a: 1f 92 push r1 1160c: 1f 92 push r1 1160e: 20 91 a3 02 lds r18, 0x02A3 ; 0x8002a3 11612: 30 91 a4 02 lds r19, 0x02A4 ; 0x8002a4 11616: 40 91 a5 02 lds r20, 0x02A5 ; 0x8002a5 1161a: 50 91 a6 02 lds r21, 0x02A6 ; 0x8002a6 1161e: c7 01 movw r24, r14 11620: b6 01 movw r22, r12 11622: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 11626: 9f 93 push r25 11628: 8f 93 push r24 1162a: 7f 93 push r23 1162c: 6f 93 push r22 1162e: 8a e2 ldi r24, 0x2A ; 42 11630: 9f e7 ldi r25, 0x7F ; 127 11632: 9f 93 push r25 11634: 8f 93 push r24 11636: 0e 94 e9 89 call 0x113d2 ; 0x113d2 1163a: 8d b7 in r24, 0x3d ; 61 1163c: 9e b7 in r25, 0x3e ; 62 1163e: 0a 96 adiw r24, 0x0a ; 10 11640: 0f b6 in r0, 0x3f ; 63 11642: f8 94 cli 11644: 9e bf out 0x3e, r25 ; 62 11646: 0f be out 0x3f, r0 ; 63 11648: 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; 1164a: 81 e0 ldi r24, 0x01 ; 1 1164c: 80 93 80 10 sts 0x1080, r24 ; 0x801080 // If this call is invoked from the main Arduino loop() function, let the caller know that the command // in the command queue is not the original command, but a new one, so it should not be removed from the queue. repeatcommand_front(); } } 11650: df 91 pop r29 11652: cf 91 pop r28 11654: 1f 91 pop r17 11656: 0f 91 pop r16 11658: ff 90 pop r15 1165a: ef 90 pop r14 1165c: df 90 pop r13 1165e: cf 90 pop r12 11660: bf 90 pop r11 11662: 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) 11664: 8f 2f mov r24, r31 11666: 90 2f mov r25, r16 11668: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1166c: 88 23 and r24, r24 1166e: 49 f2 breq .-110 ; 0x11602 11670: a6 cf rjmp .-180 ; 0x115be 00011672 : eeprom_update_word_notify((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, backlightTimer_period); } void backlight_update() { if (!backlightSupport) return; 11672: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 11676: 88 23 and r24, r24 11678: 21 f1 breq .+72 ; 0x116c2 if (backlightMode == BACKLIGHT_MODE_AUTO) 1167a: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1167e: 82 30 cpi r24, 0x02 ; 2 11680: e9 f4 brne .+58 ; 0x116bc { if (backlightTimer.expired((uint32_t)backlightTimer_period * 1000ul)) analogWrite(LCD_BL_PIN, backlightLevel_LOW); 11682: a0 91 4d 02 lds r26, 0x024D ; 0x80024d 11686: b0 91 4e 02 lds r27, 0x024E ; 0x80024e 1168a: 28 ee ldi r18, 0xE8 ; 232 1168c: 33 e0 ldi r19, 0x03 ; 3 1168e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__usmulhisi3> 11692: ab 01 movw r20, r22 11694: bc 01 movw r22, r24 11696: 89 e3 ldi r24, 0x39 ; 57 11698: 93 e0 ldi r25, 0x03 ; 3 1169a: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 1169e: 88 23 and r24, r24 116a0: 31 f0 breq .+12 ; 0x116ae 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); 116a2: 60 91 fc 03 lds r22, 0x03FC ; 0x8003fc else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); 116a6: 70 e0 ldi r23, 0x00 ; 0 116a8: 85 e0 ldi r24, 0x05 ; 5 116aa: 0c 94 95 df jmp 0x1bf2a ; 0x1bf2a 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); 116ae: 80 91 39 03 lds r24, 0x0339 ; 0x800339 116b2: 88 23 and r24, r24 116b4: 31 f0 breq .+12 ; 0x116c2 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); 116b6: 60 91 fd 03 lds r22, 0x03FD ; 0x8003fd 116ba: f5 cf rjmp .-22 ; 0x116a6 { 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); 116bc: 81 11 cpse r24, r1 116be: fb cf rjmp .-10 ; 0x116b6 116c0: f0 cf rjmp .-32 ; 0x116a2 else analogWrite(LCD_BL_PIN, backlightLevel_HIGH); } 116c2: 08 95 ret 000116c4 : 116c4: 60 91 fd 03 lds r22, 0x03FD ; 0x8003fd 116c8: 84 e3 ldi r24, 0x34 ; 52 116ca: 9d e0 ldi r25, 0x0D ; 13 116cc: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 116d0: 60 91 fc 03 lds r22, 0x03FC ; 0x8003fc 116d4: 83 e3 ldi r24, 0x33 ; 51 116d6: 9d e0 ldi r25, 0x0D ; 13 116d8: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 116dc: 60 91 4f 02 lds r22, 0x024F ; 0x80024f 116e0: 82 e3 ldi r24, 0x32 ; 50 116e2: 9d e0 ldi r25, 0x0D ; 13 116e4: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 116e8: 60 91 4d 02 lds r22, 0x024D ; 0x80024d 116ec: 70 91 4e 02 lds r23, 0x024E ; 0x80024e 116f0: 80 e3 ldi r24, 0x30 ; 48 116f2: 9d e0 ldi r25, 0x0D ; 13 116f4: 0d 94 d3 dd jmp 0x3bba6 ; 0x3bba6 000116f8 : backlight_update(); } void force_bl_on(bool section_start) { if (section_start) 116f8: 88 23 and r24, r24 116fa: 61 f0 breq .+24 ; 0x11714 { backlightMode = BACKLIGHT_MODE_BRIGHT; 116fc: 81 e0 ldi r24, 0x01 ; 1 116fe: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f if (backlightLevel_HIGH < LCD_BACKLIGHT_FORCE_ON) backlightLevel_HIGH = LCD_BACKLIGHT_FORCE_ON; 11702: 80 91 fd 03 lds r24, 0x03FD ; 0x8003fd 11706: 8e 31 cpi r24, 0x1E ; 30 11708: 18 f4 brcc .+6 ; 0x11710 1170a: 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); 1170c: 80 93 fd 03 sts 0x03FD, r24 ; 0x8003fd } backlight_update(); 11710: 0c 94 39 8b jmp 0x11672 ; 0x11672 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); 11714: 82 e3 ldi r24, 0x32 ; 50 11716: 9d e0 ldi r25, 0x0D ; 13 11718: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1171c: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_read_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH); 11720: 84 e3 ldi r24, 0x34 ; 52 11722: 9d e0 ldi r25, 0x0D ; 13 11724: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 11728: f1 cf rjmp .-30 ; 0x1170c 0001172a : 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; 1172a: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 1172e: 88 23 and r24, r24 11730: 31 f0 breq .+12 ; 0x1173e backlightTimer.start(); 11732: 89 e3 ldi r24, 0x39 ; 57 11734: 93 e0 ldi r25, 0x03 ; 3 11736: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> backlight_update(); 1173a: 0c 94 39 8b jmp 0x11672 ; 0x11672 } 1173e: 08 95 ret 00011740 : } backlight_update(); } void backlight_wake(const uint8_t flashNo) { 11740: ff 92 push r15 11742: 0f 93 push r16 11744: 1f 93 push r17 11746: cf 93 push r28 11748: df 93 push r29 if (!backlightSupport) return; 1174a: 90 91 fe 03 lds r25, 0x03FE ; 0x8003fe 1174e: 99 23 and r25, r25 11750: 99 f1 breq .+102 ; 0x117b8 if (flashNo) 11752: 88 23 and r24, r24 11754: 51 f1 breq .+84 ; 0x117aa { uint8_t backlightMode_bck = backlightMode; 11756: 00 91 4f 02 lds r16, 0x024F ; 0x80024f for (uint8_t i = 0; i < (((backlightMode_bck == BACKLIGHT_MODE_AUTO) && !backlightTimer.running()) + (flashNo * 2)); i++) 1175a: c8 2f mov r28, r24 1175c: d0 e0 ldi r29, 0x00 ; 0 1175e: cc 0f add r28, r28 11760: dd 1f adc r29, r29 11762: 10 e0 ldi r17, 0x00 ; 0 11764: ff 24 eor r15, r15 11766: f3 94 inc r15 11768: 21 2f mov r18, r17 1176a: 30 e0 ldi r19, 0x00 ; 0 1176c: 80 91 39 03 lds r24, 0x0339 ; 0x800339 11770: 8f 25 eor r24, r15 11772: 02 30 cpi r16, 0x02 ; 2 11774: 09 f0 breq .+2 ; 0x11778 11776: 80 e0 ldi r24, 0x00 ; 0 11778: 8c 0f add r24, r28 1177a: 9d 2f mov r25, r29 1177c: 91 1d adc r25, r1 1177e: 28 17 cp r18, r24 11780: 39 07 cpc r19, r25 11782: 8c f4 brge .+34 ; 0x117a6 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM 11784: 81 e0 ldi r24, 0x01 ; 1 11786: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 1178a: 91 11 cpse r25, r1 1178c: 80 e0 ldi r24, 0x00 ; 0 1178e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlight_update(); 11792: 0e 94 39 8b call 0x11672 ; 0x11672 _delay(BL_FLASH_DELAY_MS); 11796: 69 e1 ldi r22, 0x19 ; 25 11798: 70 e0 ldi r23, 0x00 ; 0 1179a: 80 e0 ldi r24, 0x00 ; 0 1179c: 90 e0 ldi r25, 0x00 ; 0 1179e: 0f 94 92 3d call 0x27b24 ; 0x27b24 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++) 117a2: 1f 5f subi r17, 0xFF ; 255 117a4: e1 cf rjmp .-62 ; 0x11768 { backlightMode = !backlightMode; //toggles between BACKLIGHT_MODE_BRIGHT and BACKLIGHT_MODE_DIM backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; 117a6: 00 93 4f 02 sts 0x024F, r16 ; 0x80024f } backlightTimer_reset(); } 117aa: df 91 pop r29 117ac: cf 91 pop r28 117ae: 1f 91 pop r17 117b0: 0f 91 pop r16 117b2: ff 90 pop r15 backlight_update(); _delay(BL_FLASH_DELAY_MS); } backlightMode = backlightMode_bck; } backlightTimer_reset(); 117b4: 0c 94 95 8b jmp 0x1172a ; 0x1172a } 117b8: df 91 pop r29 117ba: cf 91 pop r28 117bc: 1f 91 pop r17 117be: 0f 91 pop r16 117c0: ff 90 pop r15 117c2: 08 95 ret 000117c4 : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 117c4: 0f 93 push r16 117c6: 1f 93 push r17 117c8: cf 93 push r28 117ca: df 93 push r29 117cc: d8 2f mov r29, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup state = State::disabled; } bool IR_sensor::update() { switch (state) { 117ce: 80 91 88 17 lds r24, 0x1788 ; 0x801788 117d2: 81 30 cpi r24, 0x01 ; 1 117d4: 21 f0 breq .+8 ; 0x117de 117d6: 82 30 cpi r24, 0x02 ; 2 117d8: 49 f0 breq .+18 ; 0x117ec return checkFilamentEvents(); } break; case State::disabled: case State::error: default: return false; 117da: c0 e0 ldi r28, 0x00 ; 0 117dc: 4b c0 rjmp .+150 ; 0x11874 } 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. 117de: 82 e0 ldi r24, 0x02 ; 2 117e0: 80 93 88 17 sts 0x1788, r24 ; 0x801788 // initialize the current filament state so that we don't create a switching event right after the sensor is ready. oldFilamentPresent = fsensor.getFilamentPresent(); 117e4: 0e 94 bc e4 call 0x1c978 ; 0x1c978 117e8: 80 93 8b 17 sts 0x178B, r24 ; 0x80178b [[fallthrough]]; case State::ready: { postponedLoadEvent = false; 117ec: 10 92 8c 17 sts 0x178C, r1 ; 0x80178c sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 117f0: 80 91 88 17 lds r24, 0x1788 ; 0x801788 117f4: 82 30 cpi r24, 0x02 ; 2 117f6: 09 f0 breq .+2 ; 0x117fa 117f8: 92 c0 rjmp .+292 ; 0x1191e return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 117fa: 80 91 8d 17 lds r24, 0x178D ; 0x80178d 117fe: 81 11 cpse r24, r1 11800: cc c0 rjmp .+408 ; 0x1199a return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); 11802: 0e 94 bc e4 call 0x1c978 ; 0x1c978 11806: c8 2f mov r28, r24 if (oldFilamentPresent != newFilamentPresent) { 11808: 80 91 8b 17 lds r24, 0x178B ; 0x80178b 1180c: c8 17 cp r28, r24 1180e: 29 f3 breq .-54 ; 0x117da oldFilamentPresent = newFilamentPresent; 11810: c0 93 8b 17 sts 0x178B, r28 ; 0x80178b eventBlankingTimer.start(); 11814: 8d e8 ldi r24, 0x8D ; 141 11816: 97 e1 ldi r25, 0x17 ; 23 11818: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> if (newFilamentPresent) { // filament insertion 1181c: cc 23 and r28, r28 1181e: 09 f4 brne .+2 ; 0x11822 11820: c5 c0 rjmp .+394 ; 0x119ac } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11822: 80 91 89 17 lds r24, 0x1789 ; 0x801789 11826: 88 23 and r24, r24 11828: 11 f1 breq .+68 ; 0x1186e return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1182a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1182e: 81 11 cpse r24, r1 11830: 1e c0 rjmp .+60 ; 0x1186e && !( 11832: 80 91 98 13 lds r24, 0x1398 ; 0x801398 11836: 81 30 cpi r24, 0x01 ; 1 11838: d1 f0 breq .+52 ; 0x1186e } //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); 1183a: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1183e: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 11842: 89 1b sub r24, r25 11844: 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 11846: 99 f4 brne .+38 ; 0x1186e || printJobOngoing() 11848: 0e 94 45 68 call 0xd08a ; 0xd08a 1184c: 81 11 cpse r24, r1 1184e: 0f c0 rjmp .+30 ; 0x1186e || (lcd_commands_type == LcdCommands::Layer1Cal) 11850: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 11854: 84 30 cpi r24, 0x04 ; 4 11856: 59 f0 breq .+22 ; 0x1186e || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 11858: 8f e5 ldi r24, 0x5F ; 95 1185a: 9f e0 ldi r25, 0x0F ; 15 1185c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11860: 81 11 cpse r24, r1 11862: 05 c0 rjmp .+10 ; 0x1186e || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 11864: 61 e0 ldi r22, 0x01 ; 1 11866: 8a e3 ldi r24, 0x3A ; 58 11868: 9a e3 ldi r25, 0x3A ; 58 1186a: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 1186e: 81 e0 ldi r24, 0x01 ; 1 11870: 80 93 8c 17 sts 0x178C, r24 ; 0x80178c sensorRevision = (SensorRevision)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_PCB); } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { 11874: 80 91 88 17 lds r24, 0x1788 ; 0x801788 11878: 82 30 cpi r24, 0x02 ; 2 1187a: 09 f0 breq .+2 ; 0x1187e 1187c: 4b c0 rjmp .+150 ; 0x11914 return true; } bool IR_sensor_analog::getVoltReady() const { bool ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } 1187e: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11880: f8 94 cli 11882: 80 91 92 17 lds r24, 0x1792 ; 0x801792 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11886: 9f bf out 0x3f, r25 ; 63 } bool IR_sensor_analog::update() { bool event = IR_sensor::update(); if (state == State::ready) { if (getVoltReady()) { 11888: 88 23 and r24, r24 1188a: 09 f4 brne .+2 ; 0x1188e 1188c: 43 c0 rjmp .+134 ; 0x11914 ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; } return ret; } void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } 1188e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11890: f8 94 cli 11892: 10 92 92 17 sts 0x1792, r1 ; 0x801792 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11896: 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(); 11898: 0f 94 e7 7c call 0x2f9ce ; 0x2f9ce 1189c: 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) { 1189e: 80 91 97 17 lds r24, 0x1797 ; 0x801797 118a2: 90 91 98 17 lds r25, 0x1798 ; 0x801798 118a6: 80 17 cp r24, r16 118a8: 91 07 cpc r25, r17 118aa: 08 f0 brcs .+2 ; 0x118ae 118ac: d7 c0 rjmp .+430 ; 0x11a5c maxVolt = volt; 118ae: 10 93 98 17 sts 0x1798, r17 ; 0x801798 118b2: 00 93 97 17 sts 0x1797, r16 ; 0x801797 //! what we want to detect: //! if minvolt gets below ~0.3V, it means there is an old fsensor //! if maxvolt gets above 4.6V, it means we either have an old fsensor or broken cables/fsensor //! So I'm waiting for a situation, when minVolt gets to range <0, 1.5> and maxVolt gets into range <3.0, 5> //! If and only if minVolt is in range <0.3, 1.5> and maxVolt is in range <3.0, 4.6>, I'm considering a situation with the new fsensor if (minVolt >= IRsensor_Ldiode_TRESHOLD && minVolt <= IRsensor_Lmax_TRESHOLD && maxVolt >= IRsensor_Hmin_TRESHOLD && 118b6: 80 91 95 17 lds r24, 0x1795 ; 0x801795 118ba: 90 91 96 17 lds r25, 0x1796 ; 0x801796 118be: 9c 01 movw r18, r24 118c0: 26 5d subi r18, 0xD6 ; 214 118c2: 33 40 sbci r19, 0x03 ; 3 118c4: 29 35 cpi r18, 0x59 ; 89 118c6: 3f 40 sbci r19, 0x0F ; 15 118c8: 08 f0 brcs .+2 ; 0x118cc 118ca: d5 c0 rjmp .+426 ; 0x11a76 118cc: 80 91 97 17 lds r24, 0x1797 ; 0x801797 118d0: 90 91 98 17 lds r25, 0x1798 ; 0x801798 118d4: 8d 55 subi r24, 0x5D ; 93 118d6: 96 42 sbci r25, 0x26 ; 38 118d8: 87 37 cpi r24, 0x77 ; 119 118da: 94 41 sbci r25, 0x14 ; 20 118dc: 20 f4 brcc .+8 ; 0x118e6 maxVolt <= IRsensor_Hopen_TRESHOLD) { IR_ANALOG_Check(SensorRevision::_Old, SensorRevision::_Rev04); 118de: 61 e0 ldi r22, 0x01 ; 1 118e0: 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); 118e2: 0f 94 ff 7c call 0x2f9fe ; 0x2f9fe 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) { 118e6: c8 01 movw r24, r16 118e8: 8e 52 subi r24, 0x2E ; 46 118ea: 93 41 sbci r25, 0x13 ; 19 118ec: 80 33 cpi r24, 0x30 ; 48 118ee: 93 41 sbci r25, 0x13 ; 19 118f0: 08 f0 brcs .+2 ; 0x118f4 118f2: d2 c0 rjmp .+420 ; 0x11a98 /// 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) { 118f4: 80 91 9b 17 lds r24, 0x179B ; 0x80179b 118f8: 91 e0 ldi r25, 0x01 ; 1 118fa: 98 0f add r25, r24 118fc: 90 93 9b 17 sts 0x179B, r25 ; 0x80179b 11900: 85 30 cpi r24, 0x05 ; 5 11902: 08 f4 brcc .+2 ; 0x11906 11904: cb c0 rjmp .+406 ; 0x11a9c puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); 11906: 8d e4 ldi r24, 0x4D ; 77 11908: 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")); 1190a: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); enquecommand_front_P(MSG_M600); } void Filament_sensor::triggerError() { state = State::error; 1190e: 83 e0 ldi r24, 0x03 ; 3 11910: 80 93 88 17 sts 0x1788, r24 ; 0x801788 #ifdef FILAMENT_SENSOR if (fsensor.update()) { 11914: cc 23 and r28, r28 11916: 19 f0 breq .+6 ; 0x1191e lcd_draw_update = 1; //cause lcd update so that fsensor event polling can be done from the lcd draw routine. 11918: 81 e0 ldi r24, 0x01 ; 1 1191a: 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) 1191e: 0e 94 96 68 call 0xd12c ; 0xd12c 11922: 81 11 cpse r24, r1 11924: c9 c0 rjmp .+402 ; 0x11ab8 11926: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 1192a: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 1192e: 00 97 sbiw r24, 0x00 ; 0 11930: 39 f4 brne .+14 ; 0x11940 11932: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 11936: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 1193a: 23 2b or r18, r19 1193c: 09 f4 brne .+2 ; 0x11940 1193e: bc c0 rjmp .+376 ; 0x11ab8 11940: 40 91 30 02 lds r20, 0x0230 ; 0x800230 11944: 50 91 31 02 lds r21, 0x0231 ; 0x800231 11948: 60 91 32 02 lds r22, 0x0232 ; 0x800232 1194c: 70 91 33 02 lds r23, 0x0233 ; 0x800233 11950: 41 15 cp r20, r1 11952: 51 05 cpc r21, r1 11954: 61 05 cpc r22, r1 11956: 71 05 cpc r23, r1 11958: 09 f4 brne .+2 ; 0x1195c 1195a: ae c0 rjmp .+348 ; 0x11ab8 { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 1195c: 89 2b or r24, r25 1195e: 31 f4 brne .+12 ; 0x1196c 11960: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 11964: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 11968: 89 2b or r24, r25 1196a: 29 f0 breq .+10 ; 0x11976 1196c: 80 91 db 05 lds r24, 0x05DB ; 0x8005db 11970: 88 23 and r24, r24 11972: 09 f4 brne .+2 ; 0x11976 11974: 09 c1 rjmp .+530 ; 0x11b88 { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 11976: 8b ed ldi r24, 0xDB ; 219 11978: 95 e0 ldi r25, 0x05 ; 5 1197a: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 1197e: 88 23 and r24, r24 11980: 09 f4 brne .+2 ; 0x11984 11982: 9c c0 rjmp .+312 ; 0x11abc { disable_heater(); 11984: 0f 94 57 45 call 0x28aae ; 0x28aae lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 11988: 82 e7 ldi r24, 0x72 ; 114 1198a: 96 e3 ldi r25, 0x36 ; 54 1198c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 11990: 0f 94 0c 36 call 0x26c18 ; 0x26c18 lcd_return_to_status(); 11994: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 11998: 91 c0 rjmp .+290 ; 0x11abc } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 1199a: 64 e6 ldi r22, 0x64 ; 100 1199c: 70 e0 ldi r23, 0x00 ; 0 1199e: 8d e8 ldi r24, 0x8D ; 141 119a0: 97 e1 ldi r25, 0x17 ; 23 119a2: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 119a6: 81 11 cpse r24, r1 119a8: 2c cf rjmp .-424 ; 0x11802 119aa: 17 cf rjmp .-466 ; 0x117da } } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled 119ac: c0 91 8a 17 lds r28, 0x178A ; 0x80178a && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119b0: cc 23 and r28, r28 119b2: 09 f4 brne .+2 ; 0x119b6 119b4: 4f c0 rjmp .+158 ; 0x11a54 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 119b6: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 119ba: 81 11 cpse r24, r1 119bc: 5b cf rjmp .-330 ; 0x11874 119be: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 119c2: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 119c6: 89 1b sub r24, r25 119c8: 8f 70 andi r24, 0x0F ; 15 && ( 119ca: 29 f4 brne .+10 ; 0x119d6 moves_planned() != 0 || printJobOngoing() 119cc: 0e 94 45 68 call 0xd08a ; 0xd08a 119d0: 88 23 and r24, r24 119d2: 09 f4 brne .+2 ; 0x119d6 119d4: 4f cf rjmp .-354 ; 0x11874 ) && !( saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 119d6: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119da: 81 11 cpse r24, r1 119dc: 3d c0 rjmp .+122 ; 0x11a58 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 119de: 80 91 98 13 lds r24, 0x1398 ; 0x801398 119e2: 81 30 cpi r24, 0x01 ; 1 119e4: 09 f4 brne .+2 ; 0x119e8 119e6: 46 cf rjmp .-372 ; 0x11874 || (lcd_commands_type == LcdCommands::Layer1Cal) 119e8: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 119ec: 84 30 cpi r24, 0x04 ; 4 119ee: 09 f4 brne .+2 ; 0x119f2 119f0: 41 cf rjmp .-382 ; 0x11874 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 119f2: 8f e5 ldi r24, 0x5F ; 95 119f4: 9f e0 ldi r25, 0x0F ; 15 119f6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 119fa: 81 11 cpse r24, r1 119fc: 3b cf rjmp .-394 ; 0x11874 } //! @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); 119fe: 86 e1 ldi r24, 0x16 ; 22 11a00: 97 e6 ldi r25, 0x67 ; 103 11a02: 9f 93 push r25 11a04: 8f 93 push r24 11a06: 8c ef ldi r24, 0xFC ; 252 11a08: 96 e6 ldi r25, 0x66 ; 102 11a0a: 9f 93 push r25 11a0c: 8f 93 push r24 11a0e: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 11a12: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a autoLoadEnabled = false; 11a16: 10 92 89 17 sts 0x1789, r1 ; 0x801789 stop_and_save_print_to_ram(0, 0); 11a1a: 20 e0 ldi r18, 0x00 ; 0 11a1c: 30 e0 ldi r19, 0x00 ; 0 11a1e: a9 01 movw r20, r18 11a20: ca 01 movw r24, r20 11a22: b9 01 movw r22, r18 11a24: 0e 94 6a 8a call 0x114d4 ; 0x114d4 restore_print_from_ram_and_continue(0); 11a28: 60 e0 ldi r22, 0x00 ; 0 11a2a: 70 e0 ldi r23, 0x00 ; 0 11a2c: cb 01 movw r24, r22 11a2e: 0e 94 f9 68 call 0xd1f2 ; 0xd1f2 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11a32: 85 e6 ldi r24, 0x65 ; 101 11a34: 9f e0 ldi r25, 0x0F ; 15 11a36: 0e 94 b3 77 call 0xef66 ; 0xef66 eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11a3a: 81 e0 ldi r24, 0x01 ; 1 11a3c: 9f e0 ldi r25, 0x0F ; 15 11a3e: 0e 94 a6 77 call 0xef4c ; 0xef4c enquecommand_front_P(MSG_M600); 11a42: 8f e7 ldi r24, 0x7F ; 127 11a44: 90 e7 ldi r25, 0x70 ; 112 11a46: 0f 94 21 77 call 0x2ee42 ; 0x2ee42 11a4a: 0f 90 pop r0 11a4c: 0f 90 pop r0 11a4e: 0f 90 pop r0 11a50: 0f 90 pop r0 11a52: 10 cf rjmp .-480 ; 0x11874 postponedLoadEvent = true; } else { // filament removal // puts_P(PSTR("filament removed")); triggerFilamentRemoved(); } return true; 11a54: c1 e0 ldi r28, 0x01 ; 1 11a56: 0e cf rjmp .-484 ; 0x11874 11a58: c8 2f mov r28, r24 11a5a: 0c cf rjmp .-488 ; 0x11874 // 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) { 11a5c: 80 91 95 17 lds r24, 0x1795 ; 0x801795 11a60: 90 91 96 17 lds r25, 0x1796 ; 0x801796 11a64: 08 17 cp r16, r24 11a66: 19 07 cpc r17, r25 11a68: 08 f0 brcs .+2 ; 0x11a6c 11a6a: 25 cf rjmp .-438 ; 0x118b6 minVolt = volt; 11a6c: 10 93 96 17 sts 0x1796, r17 ; 0x801796 11a70: 00 93 95 17 sts 0x1795, r16 ; 0x801795 11a74: 20 cf rjmp .-448 ; 0x118b6 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) { 11a76: 86 3d cpi r24, 0xD6 ; 214 11a78: 93 40 sbci r25, 0x03 ; 3 11a7a: 08 f0 brcs .+2 ; 0x11a7e 11a7c: 34 cf rjmp .-408 ; 0x118e6 11a7e: 80 91 97 17 lds r24, 0x1797 ; 0x801797 11a82: 90 91 98 17 lds r25, 0x1798 ; 0x801798 11a86: 84 5d subi r24, 0xD4 ; 212 11a88: 9a 43 sbci r25, 0x3A ; 58 11a8a: 8d 31 cpi r24, 0x1D ; 29 11a8c: 95 40 sbci r25, 0x05 ; 5 11a8e: 08 f0 brcs .+2 ; 0x11a92 11a90: 2a cf rjmp .-428 ; 0x118e6 IR_ANALOG_Check(SensorRevision::_Rev04, SensorRevision::_Old); 11a92: 60 e0 ldi r22, 0x00 ; 0 11a94: 81 e0 ldi r24, 0x01 ; 1 11a96: 25 cf rjmp .-438 ; 0x118e2 if (voltageErrorCnt++ > 4) { puts_P(PSTR("fsensor in forbidden range 1.5-3V - check sensor")); return false; } } else { voltageErrorCnt = 0; 11a98: 10 92 9b 17 sts 0x179B, r1 ; 0x80179b } if (sensorRevision == SensorRevision::_Rev04) { 11a9c: 80 91 91 17 lds r24, 0x1791 ; 0x801791 11aa0: 81 30 cpi r24, 0x01 ; 1 11aa2: 09 f0 breq .+2 ; 0x11aa6 11aa4: 37 cf rjmp .-402 ; 0x11914 /// 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) { 11aa6: 03 5d subi r16, 0xD3 ; 211 11aa8: 1a 43 sbci r17, 0x3A ; 58 11aaa: 0e 31 cpi r16, 0x1E ; 30 11aac: 15 40 sbci r17, 0x05 ; 5 11aae: 08 f0 brcs .+2 ; 0x11ab2 11ab0: 31 cf rjmp .-414 ; 0x11914 puts_P(PSTR("fsensor v0.4 in fault range 4.6-5V - unconnected")); 11ab2: 8c e1 ldi r24, 0x1C ; 28 11ab4: 9e e7 ldi r25, 0x7E ; 126 11ab6: 29 cf rjmp .-430 ; 0x1190a inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 11ab8: 10 92 db 05 sts 0x05DB, r1 ; 0x8005db #if defined(KILL_PIN) && KILL_PIN > -1 static int killCount = 0; // make the inactivity button a bit less responsive const int KILL_DELAY = 10000; #endif if(buflen < (BUFSIZE-1)){ 11abc: 80 91 81 10 lds r24, 0x1081 ; 0x801081 11ac0: 90 91 82 10 lds r25, 0x1082 ; 0x801082 11ac4: 03 97 sbiw r24, 0x03 ; 3 11ac6: 14 f4 brge .+4 ; 0x11acc get_command(); 11ac8: 0e 94 4b 84 call 0x10896 ; 0x10896 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); 11acc: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 11ad0: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 11ad4: 98 17 cp r25, r24 11ad6: 81 f0 breq .+32 ; 0x11af8 11ad8: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 11adc: 86 30 cpi r24, 0x06 ; 6 11ade: 61 f4 brne .+24 ; 0x11af8 11ae0: 68 e8 ldi r22, 0x88 ; 136 11ae2: 73 e1 ldi r23, 0x13 ; 19 11ae4: 81 e1 ldi r24, 0x11 ; 17 11ae6: 95 e0 ldi r25, 0x05 ; 5 11ae8: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 11aec: 88 23 and r24, r24 11aee: 21 f0 breq .+8 ; 0x11af8 { // 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(); 11af0: 81 e1 ldi r24, 0x11 ; 17 11af2: 95 e0 ldi r25, 0x05 ; 5 11af4: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 11af8: 40 91 80 03 lds r20, 0x0380 ; 0x800380 11afc: 50 91 81 03 lds r21, 0x0381 ; 0x800381 11b00: 60 91 82 03 lds r22, 0x0382 ; 0x800382 11b04: 70 91 83 03 lds r23, 0x0383 ; 0x800383 11b08: 41 15 cp r20, r1 11b0a: 51 05 cpc r21, r1 11b0c: 61 05 cpc r22, r1 11b0e: 71 05 cpc r23, r1 11b10: 09 f0 breq .+2 ; 0x11b14 11b12: 3f c0 rjmp .+126 ; 0x11b92 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 11b14: 40 91 34 02 lds r20, 0x0234 ; 0x800234 11b18: 50 91 35 02 lds r21, 0x0235 ; 0x800235 11b1c: 60 91 36 02 lds r22, 0x0236 ; 0x800236 11b20: 70 91 37 02 lds r23, 0x0237 ; 0x800237 11b24: 41 15 cp r20, r1 11b26: 51 05 cpc r21, r1 11b28: 61 05 cpc r22, r1 11b2a: 71 05 cpc r23, r1 11b2c: a9 f0 breq .+42 ; 0x11b58 11b2e: 88 e8 ldi r24, 0x88 ; 136 11b30: 93 e0 ldi r25, 0x03 ; 3 11b32: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 11b36: 88 23 and r24, r24 11b38: 79 f0 breq .+30 ; 0x11b58 11b3a: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 11b3e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 if(blocks_queued() == false && ignore_stepper_queue == false) { 11b42: 98 13 cpse r25, r24 11b44: 09 c0 rjmp .+18 ; 0x11b58 11b46: d1 11 cpse r29, r1 11b48: 07 c0 rjmp .+14 ; 0x11b58 disable_x(); 11b4a: 17 9a sbi 0x02, 7 ; 2 11b4c: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 11b50: 16 9a sbi 0x02, 6 ; 2 11b52: 10 92 41 07 sts 0x0741, r1 ; 0x800741 disable_z(); disable_e0(); 11b56: 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; 11b58: c0 91 e3 03 lds r28, 0x03E3 ; 0x8003e3 block_t *block; if(block_buffer_tail != block_buffer_head) 11b5c: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 11b60: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 11b64: 98 17 cp r25, r24 11b66: 01 f1 breq .+64 ; 0x11ba8 { uint8_t block_index = block_buffer_tail; 11b68: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 tail_fan_speed = block_buffer[block_index].fan_speed; 11b6c: 9e e6 ldi r25, 0x6E ; 110 11b6e: 89 9f mul r24, r25 11b70: f0 01 movw r30, r0 11b72: 11 24 eor r1, r1 11b74: e4 54 subi r30, 0x44 ; 68 11b76: f8 4f sbci r31, 0xF8 ; 248 11b78: c0 81 ld r28, Z while(block_index != block_buffer_head) 11b7a: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 11b7e: 98 17 cp r25, r24 11b80: 99 f0 breq .+38 ; 0x11ba8 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); 11b82: 8f 5f subi r24, 0xFF ; 255 11b84: 8f 70 andi r24, 0x0F ; 15 11b86: f9 cf rjmp .-14 ; 0x11b7a { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 11b88: 8b ed ldi r24, 0xDB ; 219 11b8a: 95 e0 ldi r25, 0x05 ; 5 11b8c: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> 11b90: 95 cf rjmp .-214 ; 0x11abc // 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)) 11b92: 88 e8 ldi r24, 0x88 ; 136 11b94: 93 e0 ldi r25, 0x03 ; 3 11b96: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 11b9a: 88 23 and r24, r24 11b9c: 09 f4 brne .+2 ; 0x11ba0 11b9e: ba cf rjmp .-140 ; 0x11b14 kill(PSTR("Inactivity Shutdown")); 11ba0: 8e e7 ldi r24, 0x7E ; 126 11ba2: 9e e7 ldi r25, 0x7E ; 126 11ba4: 0e 94 95 7b call 0xf72a ; 0xf72a 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) { 11ba8: cc 23 and r28, r28 11baa: 09 f4 brne .+2 ; 0x11bae 11bac: 9f c0 rjmp .+318 ; 0x11cec if (fan_kick_end == 0) { 11bae: 80 91 6e 03 lds r24, 0x036E ; 0x80036e 11bb2: 90 91 6f 03 lds r25, 0x036F ; 0x80036f 11bb6: a0 91 70 03 lds r26, 0x0370 ; 0x800370 11bba: b0 91 71 03 lds r27, 0x0371 ; 0x800371 11bbe: 89 2b or r24, r25 11bc0: 8a 2b or r24, r26 11bc2: 8b 2b or r24, r27 11bc4: 81 f4 brne .+32 ; 0x11be6 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11bc6: 0f 94 8b 3f call 0x27f16 ; 0x27f16 11bca: 60 5e subi r22, 0xE0 ; 224 11bcc: 7c 4f sbci r23, 0xFC ; 252 11bce: 8f 4f sbci r24, 0xFF ; 255 11bd0: 9f 4f sbci r25, 0xFF ; 255 11bd2: 60 93 6e 03 sts 0x036E, r22 ; 0x80036e 11bd6: 70 93 6f 03 sts 0x036F, r23 ; 0x80036f 11bda: 80 93 70 03 sts 0x0370, r24 ; 0x800370 11bde: 90 93 71 03 sts 0x0371, r25 ; 0x800371 tail_fan_speed = 255; } else if (fan_kick_end > _millis()) // Fan still spinning up. tail_fan_speed = 255; 11be2: cf ef ldi r28, 0xFF ; 255 11be4: 0f c0 rjmp .+30 ; 0x11c04 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()) 11be6: 0f 94 8b 3f call 0x27f16 ; 0x27f16 11bea: 00 91 6e 03 lds r16, 0x036E ; 0x80036e 11bee: 10 91 6f 03 lds r17, 0x036F ; 0x80036f 11bf2: 20 91 70 03 lds r18, 0x0370 ; 0x800370 11bf6: 30 91 71 03 lds r19, 0x0371 ; 0x800371 11bfa: 60 17 cp r22, r16 11bfc: 71 07 cpc r23, r17 11bfe: 82 07 cpc r24, r18 11c00: 93 07 cpc r25, r19 11c02: 78 f3 brcs .-34 ; 0x11be2 } 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 11c04: 80 91 36 05 lds r24, 0x0536 ; 0x800536 11c08: 88 23 and r24, r24 11c0a: 09 f4 brne .+2 ; 0x11c0e 11c0c: 78 c0 rjmp .+240 ; 0x11cfe fanSpeedBckp = tail_fan_speed; 11c0e: 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) { 11c12: 80 91 0f 05 lds r24, 0x050F ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> 11c16: 81 11 cpse r24, r1 11c18: 07 c0 rjmp .+14 ; 0x11c28 return; } avoidRecursion = true; 11c1a: 81 e0 ldi r24, 0x01 ; 1 11c1c: 80 93 0f 05 sts 0x050F, r24 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> mmu_loop_inner(true); 11c20: 0f 94 2e 9a call 0x3345c ; 0x3345c avoidRecursion = false; 11c24: 10 92 0f 05 sts 0x050F, r1 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 11c28: 80 91 d4 05 lds r24, 0x05D4 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> 11c2c: 88 23 and r24, r24 11c2e: e1 f1 breq .+120 ; 0x11ca8 lcd_backlight_wake_trigger = false; 11c30: 10 92 d4 05 sts 0x05D4, r1 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> backlight_wake(); 11c34: 80 e0 ldi r24, 0x00 ; 0 11c36: 0e 94 a0 8b call 0x11740 ; 0x11740 bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 11c3a: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 11c3c: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 11c3e: 80 91 d2 05 lds r24, 0x05D2 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.560> 11c42: 28 2f mov r18, r24 11c44: 08 2e mov r0, r24 11c46: 00 0c add r0, r0 11c48: 33 0b sbc r19, r19 11c4a: 37 ff sbrs r19, 7 11c4c: 03 c0 rjmp .+6 ; 0x11c54 11c4e: 31 95 neg r19 11c50: 21 95 neg r18 11c52: 31 09 sbc r19, r1 11c54: 24 30 cpi r18, 0x04 ; 4 11c56: 31 05 cpc r19, r1 11c58: 0c f4 brge .+2 ; 0x11c5c 11c5a: 54 c0 rjmp .+168 ; 0x11d04 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11c5c: 98 2f mov r25, r24 11c5e: 87 ff sbrs r24, 7 11c60: 02 c0 rjmp .+4 ; 0x11c66 11c62: 93 e0 ldi r25, 0x03 ; 3 11c64: 98 0f add r25, r24 11c66: 95 95 asr r25 11c68: 95 95 asr r25 11c6a: 20 91 37 05 lds r18, 0x0537 ; 0x800537 11c6e: 30 91 38 05 lds r19, 0x0538 ; 0x800538 11c72: 29 0f add r18, r25 11c74: 31 1d adc r19, r1 11c76: 97 fd sbrc r25, 7 11c78: 3a 95 dec r19 11c7a: 30 93 38 05 sts 0x0538, r19 ; 0x800538 11c7e: 20 93 37 05 sts 0x0537, r18 ; 0x800537 lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 11c82: 83 78 andi r24, 0x83 ; 131 11c84: 87 ff sbrs r24, 7 11c86: 03 c0 rjmp .+6 ; 0x11c8e 11c88: 81 50 subi r24, 0x01 ; 1 11c8a: 8c 6f ori r24, 0xFC ; 252 11c8c: 8f 5f subi r24, 0xFF ; 255 11c8e: 80 93 d2 05 sts 0x05D2, r24 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.560> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 11c92: 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); 11c94: 86 e0 ldi r24, 0x06 ; 6 11c96: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe if (lcd_draw_update == 0) { 11c9a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 11c9e: 81 11 cpse r24, r1 11ca0: 03 c0 rjmp .+6 ; 0x11ca8 // Update LCD rendering at minimum lcd_draw_update = 1; 11ca2: 81 e0 ldi r24, 0x01 ; 1 11ca4: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d #endif check_axes_activity(); MMU2::mmu2.mmu_loop(); lcd_knob_update(); backlight_update(); 11ca8: 0e 94 39 8b call 0x11672 ; 0x11672 // handle longpress if(lcd_longpress_trigger) 11cac: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 11cb0: 88 23 and r24, r24 11cb2: 61 f0 breq .+24 ; 0x11ccc { lcd_consume_click(); // Reset trigger to prevent recursion 11cb4: 0e 94 ad 71 call 0xe35a ; 0xe35a // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11cb8: e0 91 11 04 lds r30, 0x0411 ; 0x800411 11cbc: f0 91 12 04 lds r31, 0x0412 ; 0x800412 11cc0: 30 97 sbiw r30, 0x00 ; 0 11cc2: 21 f0 breq .+8 ; 0x11ccc 11cc4: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 11cc8: 81 11 cpse r24, r1 { lcd_longpress_func(); 11cca: 19 95 eicall } } #if defined(AUTO_REPORT) host_autoreport(); 11ccc: 0e 94 e3 7a call 0xf5c6 ; 0xf5c6 #endif //AUTO_REPORT host_keepalive(); 11cd0: 0e 94 32 81 call 0x10264 ; 0x10264 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 11cd4: 40 e3 ldi r20, 0x30 ; 48 11cd6: 55 e7 ldi r21, 0x75 ; 117 11cd8: 60 e0 ldi r22, 0x00 ; 0 11cda: 70 e0 ldi r23, 0x00 ; 0 11cdc: 8e e9 ldi r24, 0x9E ; 158 11cde: 93 e0 ldi r25, 0x03 ; 3 M79_timer_update_status(); } 11ce0: df 91 pop r29 11ce2: cf 91 pop r28 11ce4: 1f 91 pop r17 11ce6: 0f 91 pop r16 11ce8: 0d 94 6f 40 jmp 0x280de ; 0x280de ::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; 11cec: 10 92 6e 03 sts 0x036E, r1 ; 0x80036e 11cf0: 10 92 6f 03 sts 0x036F, r1 ; 0x80036f 11cf4: 10 92 70 03 sts 0x0370, r1 ; 0x800370 11cf8: 10 92 71 03 sts 0x0371, r1 ; 0x800371 11cfc: 83 cf rjmp .-250 ; 0x11c04 #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; 11cfe: c0 93 a0 04 sts 0x04A0, r28 ; 0x8004a0 11d02: 87 cf rjmp .-242 ; 0x11c12 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; 11d04: 10 92 d2 05 sts 0x05D2, r1 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.560> 11d08: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 11d0a: 80 e0 ldi r24, 0x00 ; 0 11d0c: c4 cf rjmp .-120 ; 0x11c96 00011d0e : #endif #endif } void delay_keep_alive(unsigned int ms) { 11d0e: cf 93 push r28 11d10: df 93 push r29 11d12: ec 01 movw r28, r24 for (;;) { manage_heater(); 11d14: 0f 94 a0 4e call 0x29d40 ; 0x29d40 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11d18: 81 e0 ldi r24, 0x01 ; 1 11d1a: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_update(0); 11d1e: 80 e0 ldi r24, 0x00 ; 0 11d20: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 if (ms == 0) 11d24: 20 97 sbiw r28, 0x00 ; 0 11d26: 99 f0 breq .+38 ; 0x11d4e break; else if (ms >= 50) { 11d28: c2 33 cpi r28, 0x32 ; 50 11d2a: d1 05 cpc r29, r1 11d2c: 40 f0 brcs .+16 ; 0x11d3e _delay(50); 11d2e: 62 e3 ldi r22, 0x32 ; 50 11d30: 70 e0 ldi r23, 0x00 ; 0 11d32: 80 e0 ldi r24, 0x00 ; 0 11d34: 90 e0 ldi r25, 0x00 ; 0 11d36: 0f 94 92 3d call 0x27b24 ; 0x27b24 ms -= 50; 11d3a: e2 97 sbiw r28, 0x32 ; 50 11d3c: eb cf rjmp .-42 ; 0x11d14 } else { _delay(ms); 11d3e: be 01 movw r22, r28 11d40: 90 e0 ldi r25, 0x00 ; 0 11d42: 80 e0 ldi r24, 0x00 ; 0 11d44: 0f 94 92 3d call 0x27b24 ; 0x27b24 ms = 0; 11d48: d0 e0 ldi r29, 0x00 ; 0 11d4a: c0 e0 ldi r28, 0x00 ; 0 11d4c: e3 cf rjmp .-58 ; 0x11d14 } } } 11d4e: df 91 pop r29 11d50: cf 91 pop r28 11d52: 08 95 ret 00011d54 : /// @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) { 11d54: cf 93 push r28 11d56: df 93 push r29 11d58: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11d5a: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11d5c: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 11d60: 81 e0 ldi r24, 0x01 ; 1 11d62: 0e 94 e2 8b call 0x117c4 ; 0x117c4 11d66: 80 91 96 13 lds r24, 0x1396 ; 0x801396 btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11d6a: 8f 3f cpi r24, 0xFF ; 255 11d6c: d9 f4 brne .+54 ; 0x11da4 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11d6e: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 11d72: 84 30 cpi r24, 0x04 ; 4 11d74: 21 f4 brne .+8 ; 0x11d7e }; 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 11d76: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 11d7a: 81 11 cpse r24, r1 11d7c: ef cf rjmp .-34 ; 0x11d5c 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 11d7e: 80 91 69 13 lds r24, 0x1369 ; 0x801369 11d82: 90 91 6a 13 lds r25, 0x136A ; 0x80136a 11d86: 01 97 sbiw r24, 0x01 ; 1 11d88: 49 f7 brne .-46 ; 0x11d5c && lastErrorCode != ec) // The error code is not a duplicate 11d8a: 80 91 90 13 lds r24, 0x1390 ; 0x801390 11d8e: 90 91 91 13 lds r25, 0x1391 ; 0x801391 11d92: 89 32 cpi r24, 0x29 ; 41 11d94: 90 48 sbci r25, 0x80 ; 128 11d96: 11 f3 breq .-60 ; 0x11d5c { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11d98: 60 e0 ldi r22, 0x00 ; 0 11d9a: 89 e2 ldi r24, 0x29 ; 41 11d9c: 90 e8 ldi r25, 0x80 ; 128 11d9e: 0f 94 a4 83 call 0x30748 ; 0x30748 11da2: dc cf rjmp .-72 ; 0x11d5c inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11da4: d0 93 96 13 sts 0x1396, r29 ; 0x801396 { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11da8: 85 30 cpi r24, 0x05 ; 5 11daa: 39 f4 brne .+14 ; 0x11dba if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11dac: cf 3f cpi r28, 0xFF ; 255 11dae: f9 f2 breq .-66 ; 0x11d6e MMU2::mmu2.eject_filament(eject_slot, true); 11db0: 61 e0 ldi r22, 0x01 ; 1 11db2: 8c 2f mov r24, r28 11db4: 0f 94 c8 a0 call 0x34190 ; 0x34190 11db8: d1 cf rjmp .-94 ; 0x11d5c // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11dba: 84 30 cpi r24, 0x04 ; 4 11dbc: c1 f6 brne .-80 ; 0x11d6e } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11dbe: df 91 pop r29 11dc0: cf 91 pop r28 11dc2: 08 95 ret 00011dc4 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 11dc4: 1f 92 push r1 11dc6: 0f 92 push r0 11dc8: 0f b6 in r0, 0x3f ; 63 11dca: 0f 92 push r0 11dcc: 11 24 eor r1, r1 11dce: 0b b6 in r0, 0x3b ; 59 11dd0: 0f 92 push r0 11dd2: 2f 93 push r18 11dd4: 3f 93 push r19 11dd6: 4f 93 push r20 11dd8: 5f 93 push r21 11dda: 6f 93 push r22 11ddc: 7f 93 push r23 11dde: 8f 93 push r24 11de0: 9f 93 push r25 11de2: af 93 push r26 11de4: bf 93 push r27 11de6: ef 93 push r30 11de8: ff 93 push r31 adc_values[adc_channel] += ADC; 11dea: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 11dee: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 11df2: e0 91 38 03 lds r30, 0x0338 ; 0x800338 11df6: f0 e0 ldi r31, 0x00 ; 0 11df8: ee 0f add r30, r30 11dfa: ff 1f adc r31, r31 11dfc: e8 5d subi r30, 0xD8 ; 216 11dfe: fc 4f sbci r31, 0xFC ; 252 11e00: 80 81 ld r24, Z 11e02: 91 81 ldd r25, Z+1 ; 0x01 11e04: 82 0f add r24, r18 11e06: 93 1f adc r25, r19 11e08: 91 83 std Z+1, r25 ; 0x01 11e0a: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 11e0c: 80 91 27 03 lds r24, 0x0327 ; 0x800327 11e10: 8f 5f subi r24, 0xFF ; 255 11e12: 80 93 27 03 sts 0x0327, r24 ; 0x800327 11e16: 80 31 cpi r24, 0x10 ; 16 11e18: 09 f0 breq .+2 ; 0x11e1c <__vector_29+0x58> 11e1a: 60 c0 rjmp .+192 ; 0x11edc <__vector_29+0x118> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 11e1c: 80 91 38 03 lds r24, 0x0338 ; 0x800338 11e20: 8f 5f subi r24, 0xFF ; 255 11e22: 80 93 38 03 sts 0x0338, r24 ; 0x800338 11e26: 88 30 cpi r24, 0x08 ; 8 11e28: 09 f0 breq .+2 ; 0x11e2c <__vector_29+0x68> 11e2a: 50 c0 rjmp .+160 ; 0x11ecc <__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 11e2c: 80 91 28 03 lds r24, 0x0328 ; 0x800328 11e30: 90 91 29 03 lds r25, 0x0329 ; 0x800329 11e34: 90 93 09 06 sts 0x0609, r25 ; 0x800609 11e38: 80 93 08 06 sts 0x0608, r24 ; 0x800608 current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 11e3c: 80 91 2c 03 lds r24, 0x032C ; 0x80032c 11e40: 90 91 2d 03 lds r25, 0x032D ; 0x80032d 11e44: 90 93 07 06 sts 0x0607, r25 ; 0x800607 11e48: 80 93 06 06 sts 0x0606, r24 ; 0x800606 #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 11e4c: 80 91 2e 03 lds r24, 0x032E ; 0x80032e 11e50: 90 91 2f 03 lds r25, 0x032F ; 0x80032f 11e54: 90 93 05 06 sts 0x0605, r25 ; 0x800605 11e58: 80 93 04 06 sts 0x0604, r24 ; 0x800604 #endif //PINDA_THERMISTOR #ifdef AMBIENT_THERMISTOR current_temperature_raw_ambient = adc_values[ADC_PIN_IDX(TEMP_AMBIENT_PIN)]; // 5->6 11e5c: 80 91 32 03 lds r24, 0x0332 ; 0x800332 11e60: 90 91 33 03 lds r25, 0x0333 ; 0x800333 11e64: 90 93 13 06 sts 0x0613, r25 ; 0x800613 11e68: 80 93 12 06 sts 0x0612, r24 ; 0x800612 #endif //AMBIENT_THERMISTOR #ifdef VOLT_PWR_PIN current_voltage_raw_pwr = adc_values[ADC_PIN_IDX(VOLT_PWR_PIN)]; 11e6c: 80 91 30 03 lds r24, 0x0330 ; 0x800330 11e70: 90 91 31 03 lds r25, 0x0331 ; 0x800331 11e74: 90 93 5a 06 sts 0x065A, r25 ; 0x80065a 11e78: 80 93 59 06 sts 0x0659, r24 ; 0x800659 #endif #ifdef VOLT_BED_PIN current_voltage_raw_bed = adc_values[ADC_PIN_IDX(VOLT_BED_PIN)]; // 6->9 11e7c: 80 91 36 03 lds r24, 0x0336 ; 0x800336 11e80: 90 91 37 03 lds r25, 0x0337 ; 0x800337 11e84: 90 93 58 06 sts 0x0658, r25 ; 0x800658 11e88: 80 93 57 06 sts 0x0657, r24 ; 0x800657 #endif #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) fsensor.voltUpdate(adc_values[ADC_PIN_IDX(VOLT_IR_PIN)]); 11e8c: 80 91 34 03 lds r24, 0x0334 ; 0x800334 11e90: 90 91 35 03 lds r25, 0x0335 ; 0x800335 return event; } void IR_sensor_analog::voltUpdate(uint16_t raw) { // to be called from the ADC ISR when a cycle is finished voltRaw = raw; 11e94: 90 93 94 17 sts 0x1794, r25 ; 0x801794 11e98: 80 93 93 17 sts 0x1793, r24 ; 0x801793 voltReady = true; 11e9c: 81 e0 ldi r24, 0x01 ; 1 11e9e: 80 93 92 17 sts 0x1792, r24 ; 0x801792 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) adc_values_ready = true; 11ea2: 80 93 1f 05 sts 0x051F, r24 ; 0x80051f <_ZL16adc_values_ready.lto_priv.472> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 11ea6: ff 91 pop r31 11ea8: ef 91 pop r30 11eaa: bf 91 pop r27 11eac: af 91 pop r26 11eae: 9f 91 pop r25 11eb0: 8f 91 pop r24 11eb2: 7f 91 pop r23 11eb4: 6f 91 pop r22 11eb6: 5f 91 pop r21 11eb8: 4f 91 pop r20 11eba: 3f 91 pop r19 11ebc: 2f 91 pop r18 11ebe: 0f 90 pop r0 11ec0: 0b be out 0x3b, r0 ; 59 11ec2: 0f 90 pop r0 11ec4: 0f be out 0x3f, r0 ; 63 11ec6: 0f 90 pop r0 11ec8: 1f 90 pop r1 11eca: 18 95 reti 11ecc: 80 91 26 03 lds r24, 0x0326 ; 0x800326 <__data_end> return; // do not start the next measurement since there are no channels remaining } // find the next channel while (++adc_channel_idx) { if (ADC_CHAN_MSK & (1 << adc_channel_idx)) { 11ed0: 4f e5 ldi r20, 0x5F ; 95 11ed2: 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) { 11ed4: 8f 5f subi r24, 0xFF ; 255 11ed6: 41 f4 brne .+16 ; 0x11ee8 <__vector_29+0x124> 11ed8: 10 92 26 03 sts 0x0326, r1 ; 0x800326 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 11edc: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11ee0: 80 64 ori r24, 0x40 ; 64 11ee2: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 11ee6: df cf rjmp .-66 ; 0x11ea6 <__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)) { 11ee8: 9a 01 movw r18, r20 11eea: 08 2e mov r0, r24 11eec: 02 c0 rjmp .+4 ; 0x11ef2 <__vector_29+0x12e> 11eee: 35 95 asr r19 11ef0: 27 95 ror r18 11ef2: 0a 94 dec r0 11ef4: e2 f7 brpl .-8 ; 0x11eee <__vector_29+0x12a> 11ef6: 20 ff sbrs r18, 0 11ef8: ed cf rjmp .-38 ; 0x11ed4 <__vector_29+0x110> 11efa: 80 93 26 03 sts 0x0326, r24 ; 0x800326 <__data_end> adc_setmux(adc_channel_idx); 11efe: 0e 94 f9 5b call 0xb7f2 ; 0xb7f2 adc_count = 0; 11f02: 10 92 27 03 sts 0x0327, r1 ; 0x800327 11f06: ea cf rjmp .-44 ; 0x11edc <__vector_29+0x118> 00011f08 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 11f08: cf 93 push r28 11f0a: 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 11f0c: ca e7 ldi r28, 0x7A ; 122 11f0e: d0 e0 ldi r29, 0x00 ; 0 11f10: 88 81 ld r24, Y 11f12: 8f 7b andi r24, 0xBF ; 191 11f14: 88 83 st Y, r24 adc_count = 0; 11f16: 10 92 27 03 sts 0x0327, r1 ; 0x800327 adc_channel = 0; 11f1a: 10 92 38 03 sts 0x0338, r1 ; 0x800338 adc_channel_idx = first_channel_idx; 11f1e: 10 92 26 03 sts 0x0326, r1 ; 0x800326 <__data_end> adc_setmux(adc_channel_idx); 11f22: 80 e0 ldi r24, 0x00 ; 0 11f24: 0e 94 f9 5b call 0xb7f2 ; 0xb7f2 memset((void*)adc_values, 0, sizeof(adc_values)); 11f28: e8 e2 ldi r30, 0x28 ; 40 11f2a: f3 e0 ldi r31, 0x03 ; 3 11f2c: 80 e1 ldi r24, 0x10 ; 16 11f2e: df 01 movw r26, r30 11f30: 1d 92 st X+, r1 11f32: 8a 95 dec r24 11f34: e9 f7 brne .-6 ; 0x11f30 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 11f36: 88 81 ld r24, Y 11f38: 80 64 ori r24, 0x40 ; 64 11f3a: 88 83 st Y, r24 } 11f3c: df 91 pop r29 11f3e: cf 91 pop r28 11f40: 08 95 ret 00011f42 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { 11f42: 2f 92 push r2 11f44: 3f 92 push r3 11f46: 4f 92 push r4 11f48: 5f 92 push r5 11f4a: 6f 92 push r6 11f4c: 7f 92 push r7 11f4e: 8f 92 push r8 11f50: 9f 92 push r9 11f52: af 92 push r10 11f54: bf 92 push r11 11f56: cf 92 push r12 11f58: df 92 push r13 11f5a: ef 92 push r14 11f5c: ff 92 push r15 11f5e: 0f 93 push r16 11f60: 1f 93 push r17 11f62: cf 93 push r28 11f64: df 93 push r29 11f66: cd b7 in r28, 0x3d ; 61 11f68: de b7 in r29, 0x3e ; 62 11f6a: a4 97 sbiw r28, 0x24 ; 36 11f6c: 0f b6 in r0, 0x3f ; 63 11f6e: f8 94 cli 11f70: de bf out 0x3e, r29 ; 62 11f72: 0f be out 0x3f, r0 ; 63 11f74: 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(); 11f76: 0f 94 2c 59 call 0x2b258 ; 0x2b258 if (planner_aborted) 11f7a: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 11f7e: 81 11 cpse r24, r1 11f80: 17 c0 rjmp .+46 ; 0x11fb0 return; mesh_bed_leveling_flag = true; 11f82: 81 e0 ldi r24, 0x01 ; 1 11f84: 80 93 59 0e sts 0x0E59, r24 ; 0x800e59 // Firstly check if we know where we are if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) { 11f88: 80 91 40 07 lds r24, 0x0740 ; 0x800740 11f8c: 88 23 and r24, r24 11f8e: 49 f0 breq .+18 ; 0x11fa2 11f90: 80 91 41 07 lds r24, 0x0741 ; 0x800741 11f94: 88 23 and r24, r24 11f96: 29 f0 breq .+10 ; 0x11fa2 11f98: 20 91 42 07 lds r18, 0x0742 ; 0x800742 11f9c: 2f 83 std Y+7, r18 ; 0x07 11f9e: 21 11 cpse r18, r1 11fa0: 20 c0 rjmp .+64 ; 0x11fe2 11fa2: 81 e0 ldi r24, 0x01 ; 1 11fa4: 80 93 80 10 sts 0x1080, r24 ; 0x801080 // We don't know where we are! HOME! // Push the commands to the front of the message queue in the reverse order! // There shall be always enough space reserved for these commands. repeatcommand_front(); // repeat G80 with all its parameters enquecommand_front_P(G28W); 11fa8: 81 e2 ldi r24, 0x21 ; 33 11faa: 9c e6 ldi r25, 0x6C ; 108 11fac: 0f 94 21 77 call 0x2ee42 ; 0x2ee42 custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } 11fb0: a4 96 adiw r28, 0x24 ; 36 11fb2: 0f b6 in r0, 0x3f ; 63 11fb4: f8 94 cli 11fb6: de bf out 0x3e, r29 ; 62 11fb8: 0f be out 0x3f, r0 ; 63 11fba: cd bf out 0x3d, r28 ; 61 11fbc: df 91 pop r29 11fbe: cf 91 pop r28 11fc0: 1f 91 pop r17 11fc2: 0f 91 pop r16 11fc4: ff 90 pop r15 11fc6: ef 90 pop r14 11fc8: df 90 pop r13 11fca: cf 90 pop r12 11fcc: bf 90 pop r11 11fce: af 90 pop r10 11fd0: 9f 90 pop r9 11fd2: 8f 90 pop r8 11fd4: 7f 90 pop r7 11fd6: 6f 90 pop r6 11fd8: 5f 90 pop r5 11fda: 4f 90 pop r4 11fdc: 3f 90 pop r3 11fde: 2f 90 pop r2 11fe0: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 11fe2: 8b ea ldi r24, 0xAB ; 171 11fe4: 9d e0 ldi r25, 0x0D ; 13 11fe6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 11fea: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) 11fec: 8e e4 ldi r24, 0x4E ; 78 11fee: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 11ff2: 08 2f mov r16, r24 11ff4: 0e 94 0e 5c call 0xb81c ; 0xb81c 11ff8: 8e 83 std Y+6, r24 ; 0x06 11ffa: 00 23 and r16, r16 11ffc: 29 f0 breq .+10 ; 0x12008 11ffe: 87 30 cpi r24, 0x07 ; 7 12000: 09 f4 brne .+2 ; 0x12004 12002: c9 c0 rjmp .+402 ; 0x12196 12004: 83 30 cpi r24, 0x03 ; 3 12006: 29 f0 breq .+10 ; 0x12012 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; 12008: 13 30 cpi r17, 0x03 ; 3 1200a: 09 f0 breq .+2 ; 0x1200e 1200c: c3 c0 rjmp .+390 ; 0x12194 1200e: 63 e0 ldi r22, 0x03 ; 3 12010: 6e 83 std Y+6, r22 ; 0x06 12012: 80 e0 ldi r24, 0x00 ; 0 12014: 90 e0 ldi r25, 0x00 ; 0 12016: a0 e8 ldi r26, 0x80 ; 128 12018: bf e3 ldi r27, 0x3F ; 63 1201a: 8a 83 std Y+2, r24 ; 0x02 1201c: 9b 83 std Y+3, r25 ; 0x03 1201e: ac 83 std Y+4, r26 ; 0x04 12020: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 12022: 8a ea ldi r24, 0xAA ; 170 12024: 9d e0 ldi r25, 0x0D ; 13 12026: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1202a: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) 1202c: 83 e4 ldi r24, 0x43 ; 67 1202e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 12032: 18 2f mov r17, r24 12034: 0e 94 0e 5c call 0xb81c ; 0xb81c 12038: 11 23 and r17, r17 1203a: 29 f0 breq .+10 ; 0x12046 1203c: 88 23 and r24, r24 1203e: 19 f0 breq .+6 ; 0x12046 12040: 8b 30 cpi r24, 0x0B ; 11 12042: 08 f4 brcc .+2 ; 0x12046 12044: 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; 12046: 88 e5 ldi r24, 0x58 ; 88 12048: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1204c: 88 23 and r24, r24 1204e: 09 f4 brne .+2 ; 0x12052 12050: ab c0 rjmp .+342 ; 0x121a8 12052: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 12056: 20 e0 ldi r18, 0x00 ; 0 12058: 30 e0 ldi r19, 0x00 ; 0 1205a: 48 e0 ldi r20, 0x08 ; 8 1205c: 52 e4 ldi r21, 0x42 ; 66 1205e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 12062: 20 e0 ldi r18, 0x00 ; 0 12064: 30 e0 ldi r19, 0x00 ; 0 12066: 48 eb ldi r20, 0xB8 ; 184 12068: 51 e4 ldi r21, 0x41 ; 65 1206a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1206e: 6a 87 std Y+10, r22 ; 0x0a 12070: 7b 87 std Y+11, r23 ; 0x0b 12072: 8c 87 std Y+12, r24 ; 0x0c 12074: 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; 12076: 89 e5 ldi r24, 0x59 ; 89 12078: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1207c: 88 23 and r24, r24 1207e: 09 f4 brne .+2 ; 0x12082 12080: 9c c0 rjmp .+312 ; 0x121ba 12082: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 12086: 20 e0 ldi r18, 0x00 ; 0 12088: 30 e0 ldi r19, 0x00 ; 0 1208a: 48 e0 ldi r20, 0x08 ; 8 1208c: 52 e4 ldi r21, 0x42 ; 66 1208e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 12092: 20 e0 ldi r18, 0x00 ; 0 12094: 30 e0 ldi r19, 0x00 ; 0 12096: 40 ea ldi r20, 0xA0 ; 160 12098: 50 e4 ldi r21, 0x40 ; 64 1209a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1209e: 6c 8b std Y+20, r22 ; 0x14 120a0: 7d 8b std Y+21, r23 ; 0x15 120a2: 8e 8b std Y+22, r24 ; 0x16 120a4: 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; 120a6: 87 e5 ldi r24, 0x57 ; 87 120a8: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 120ac: 88 23 and r24, r24 120ae: 09 f4 brne .+2 ; 0x120b2 120b0: 89 c0 rjmp .+274 ; 0x121c4 120b2: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 120b6: 2a 85 ldd r18, Y+10 ; 0x0a 120b8: 3b 85 ldd r19, Y+11 ; 0x0b 120ba: 4c 85 ldd r20, Y+12 ; 0x0c 120bc: 5d 85 ldd r21, Y+13 ; 0x0d 120be: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 120c2: 20 e0 ldi r18, 0x00 ; 0 120c4: 30 e0 ldi r19, 0x00 ; 0 120c6: 48 e8 ldi r20, 0x88 ; 136 120c8: 52 e4 ldi r21, 0x42 ; 66 120ca: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 120ce: 69 8f std Y+25, r22 ; 0x19 120d0: 7a 8f std Y+26, r23 ; 0x1a 120d2: 8b 8f std Y+27, r24 ; 0x1b 120d4: 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; 120d6: 88 e4 ldi r24, 0x48 ; 72 120d8: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 120dc: 88 23 and r24, r24 120de: 09 f4 brne .+2 ; 0x120e2 120e0: 7a c0 rjmp .+244 ; 0x121d6 120e2: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 120e6: 2c 89 ldd r18, Y+20 ; 0x14 120e8: 3d 89 ldd r19, Y+21 ; 0x15 120ea: 4e 89 ldd r20, Y+22 ; 0x16 120ec: 5f 89 ldd r21, Y+23 ; 0x17 120ee: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 120f2: 20 e0 ldi r18, 0x00 ; 0 120f4: 30 e0 ldi r19, 0x00 ; 0 120f6: 48 e8 ldi r20, 0x88 ; 136 120f8: 52 e4 ldi r21, 0x42 ; 66 120fa: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 120fe: 6d 8f std Y+29, r22 ; 0x1d 12100: 7e 8f std Y+30, r23 ; 0x1e 12102: 8f 8f std Y+31, r24 ; 0x1f 12104: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling 12106: 0f 94 1f 8c call 0x3183e ; 0x3183e mbl.z_values[0][0] = min_pos[Z_AXIS]; 1210a: 80 91 29 02 lds r24, 0x0229 ; 0x800229 1210e: 90 91 2a 02 lds r25, 0x022A ; 0x80022a 12112: a0 91 2b 02 lds r26, 0x022B ; 0x80022b 12116: b0 91 2c 02 lds r27, 0x022C ; 0x80022c 1211a: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 1211e: 90 93 a2 13 sts 0x13A2, r25 ; 0x8013a2 12122: a0 93 a3 13 sts 0x13A3, r26 ; 0x8013a3 12126: b0 93 a4 13 sts 0x13A4, r27 ; 0x8013a4 // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); 1212a: 0f 94 55 c7 call 0x38eaa ; 0x38eaa 1212e: 05 ec ldi r16, 0xC5 ; 197 12130: 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) 12132: c8 01 movw r24, r16 12134: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 12138: 01 96 adiw r24, 0x01 ; 1 1213a: 09 f0 breq .+2 ; 0x1213e 1213c: 51 c0 rjmp .+162 ; 0x121e0 1213e: 0e 5f subi r16, 0xFE ; 254 12140: 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) { 12142: 05 3d cpi r16, 0xD5 ; 213 12144: 8f e0 ldi r24, 0x0F ; 15 12146: 18 07 cpc r17, r24 12148: a1 f7 brne .-24 ; 0x12132 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; 1214a: 21 2c mov r2, r1 1214c: a0 ea ldi r26, 0xA0 ; 160 1214e: b3 e1 ldi r27, 0x13 ; 19 12150: ba a3 std Y+34, r27 ; 0x22 12152: 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; 12154: b9 87 std Y+9, r27 ; 0x09 12156: a8 87 std Y+8, r26 ; 0x08 12158: 51 2c mov r5, r1 1215a: 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; 1215c: 31 2c mov r3, r1 1215e: 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)); 12160: 84 2d mov r24, r4 12162: 63 e0 ldi r22, 0x03 ; 3 12164: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 12168: 98 8b std Y+16, r25 ; 0x10 1216a: 68 84 ldd r6, Y+8 ; 0x08 1216c: 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++) { 1216e: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); 12170: f8 89 ldd r31, Y+16 ; 0x10 12172: f1 11 cpse r31, r1 12174: 37 c0 rjmp .+110 ; 0x121e4 12176: 81 2f mov r24, r17 12178: 63 e0 ldi r22, 0x03 ; 3 1217a: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 1217e: 91 11 cpse r25, r1 12180: 31 c0 rjmp .+98 ; 0x121e4 if (isOn3x3Mesh) { if (has_z && (row || col)) { 12182: 21 10 cpse r2, r1 12184: 3f c1 rjmp .+638 ; 0x12404 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 12186: 7e 81 ldd r23, Y+6 ; 0x06 12188: 73 30 cpi r23, 0x03 ; 3 1218a: 09 f4 brne .+2 ; 0x1218e 1218c: 70 c0 rjmp .+224 ; 0x1226e 1218e: 8f 81 ldd r24, Y+7 ; 0x07 12190: 8e 87 std Y+14, r24 ; 0x0e 12192: 37 c0 rjmp .+110 ; 0x12202 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; 12194: 1e 83 std Y+6, r17 ; 0x06 12196: 6a e9 ldi r22, 0x9A ; 154 12198: 79 e9 ldi r23, 0x99 ; 153 1219a: 89 e1 ldi r24, 0x19 ; 25 1219c: 9f e3 ldi r25, 0x3F ; 63 1219e: 6a 83 std Y+2, r22 ; 0x02 121a0: 7b 83 std Y+3, r23 ; 0x03 121a2: 8c 83 std Y+4, r24 ; 0x04 121a4: 9d 83 std Y+5, r25 ; 0x05 121a6: 3d cf rjmp .-390 ; 0x12022 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; 121a8: 80 e0 ldi r24, 0x00 ; 0 121aa: 90 e0 ldi r25, 0x00 ; 0 121ac: a0 e8 ldi r26, 0x80 ; 128 121ae: bf ef ldi r27, 0xFF ; 255 121b0: 8a 87 std Y+10, r24 ; 0x0a 121b2: 9b 87 std Y+11, r25 ; 0x0b 121b4: ac 87 std Y+12, r26 ; 0x0c 121b6: bd 87 std Y+13, r27 ; 0x0d 121b8: 5e cf rjmp .-324 ; 0x12076 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; 121ba: 60 e0 ldi r22, 0x00 ; 0 121bc: 70 e0 ldi r23, 0x00 ; 0 121be: 80 e8 ldi r24, 0x80 ; 128 121c0: 9f ef ldi r25, 0xFF ; 255 121c2: 6d cf rjmp .-294 ; 0x1209e const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; 121c4: 80 e0 ldi r24, 0x00 ; 0 121c6: 90 e0 ldi r25, 0x00 ; 0 121c8: a0 e8 ldi r26, 0x80 ; 128 121ca: bf e7 ldi r27, 0x7F ; 127 121cc: 89 8f std Y+25, r24 ; 0x19 121ce: 9a 8f std Y+26, r25 ; 0x1a 121d0: ab 8f std Y+27, r26 ; 0x1b 121d2: bc 8f std Y+28, r27 ; 0x1c 121d4: 80 cf rjmp .-256 ; 0x120d6 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; 121d6: 60 e0 ldi r22, 0x00 ; 0 121d8: 70 e0 ldi r23, 0x00 ; 0 121da: 80 e8 ldi r24, 0x80 ; 128 121dc: 9f e7 ldi r25, 0x7F ; 127 121de: 8f cf rjmp .-226 ; 0x120fe 121e0: 2f 80 ldd r2, Y+7 ; 0x07 121e2: b4 cf rjmp .-152 ; 0x1214c 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; } 121e4: 60 e0 ldi r22, 0x00 ; 0 121e6: 70 e0 ldi r23, 0x00 ; 0 121e8: 80 ec ldi r24, 0xC0 ; 192 121ea: 9f e7 ldi r25, 0x7F ; 127 121ec: d3 01 movw r26, r6 121ee: 11 96 adiw r26, 0x01 ; 1 121f0: 6d 93 st X+, r22 121f2: 7d 93 st X+, r23 121f4: 8d 93 st X+, r24 121f6: 9c 93 st X, r25 121f8: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { 121fa: be 81 ldd r27, Y+6 ; 0x06 121fc: b3 30 cpi r27, 0x03 ; 3 121fe: c1 f1 breq .+112 ; 0x12270 12200: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); 12202: 81 2f mov r24, r17 12204: 0f 94 af c7 call 0x38f5e ; 0x38f5e 12208: 4b 01 movw r8, r22 1220a: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); 1220c: 80 2f mov r24, r16 1220e: 0f 94 af c7 call 0x38f5e ; 0x38f5e 12212: 6b 01 movw r12, r22 12214: 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)) { 12216: a5 01 movw r20, r10 12218: 94 01 movw r18, r8 1221a: 6a 85 ldd r22, Y+10 ; 0x0a 1221c: 7b 85 ldd r23, Y+11 ; 0x0b 1221e: 8c 85 ldd r24, Y+12 ; 0x0c 12220: 9d 85 ldd r25, Y+13 ; 0x0d 12222: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 12226: 18 16 cp r1, r24 12228: 0c f4 brge .+2 ; 0x1222c 1222a: 1c c1 rjmp .+568 ; 0x12464 1222c: 29 8d ldd r18, Y+25 ; 0x19 1222e: 3a 8d ldd r19, Y+26 ; 0x1a 12230: 4b 8d ldd r20, Y+27 ; 0x1b 12232: 5c 8d ldd r21, Y+28 ; 0x1c 12234: c5 01 movw r24, r10 12236: b4 01 movw r22, r8 12238: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1223c: 18 16 cp r1, r24 1223e: 0c f4 brge .+2 ; 0x12242 12240: 11 c1 rjmp .+546 ; 0x12464 12242: a7 01 movw r20, r14 12244: 96 01 movw r18, r12 12246: 6c 89 ldd r22, Y+20 ; 0x14 12248: 7d 89 ldd r23, Y+21 ; 0x15 1224a: 8e 89 ldd r24, Y+22 ; 0x16 1224c: 9f 89 ldd r25, Y+23 ; 0x17 1224e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 12252: 18 16 cp r1, r24 12254: 0c f4 brge .+2 ; 0x12258 12256: 06 c1 rjmp .+524 ; 0x12464 12258: 2d 8d ldd r18, Y+29 ; 0x1d 1225a: 3e 8d ldd r19, Y+30 ; 0x1e 1225c: 4f 8d ldd r20, Y+31 ; 0x1f 1225e: 58 a1 ldd r21, Y+32 ; 0x20 12260: c7 01 movw r24, r14 12262: b6 01 movw r22, r12 12264: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 12268: 18 16 cp r1, r24 1226a: 0c f4 brge .+2 ; 0x1226e 1226c: fb c0 rjmp .+502 ; 0x12464 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; 1226e: 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++) { 12270: 1f 5f subi r17, 0xFF ; 255 12272: 24 e0 ldi r18, 0x04 ; 4 12274: 62 0e add r6, r18 12276: 71 1c adc r7, r1 12278: 17 30 cpi r17, 0x07 ; 7 1227a: 09 f0 breq .+2 ; 0x1227e 1227c: 79 cf rjmp .-270 ; 0x12170 1227e: 6f ef ldi r22, 0xFF ; 255 12280: 46 1a sub r4, r22 12282: 56 0a sbc r5, r22 12284: 88 85 ldd r24, Y+8 ; 0x08 12286: 99 85 ldd r25, Y+9 ; 0x09 12288: 4c 96 adiw r24, 0x1c ; 28 1228a: 99 87 std Y+9, r25 ; 0x09 1228c: 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++) { 1228e: 97 e0 ldi r25, 0x07 ; 7 12290: 49 16 cp r4, r25 12292: 51 04 cpc r5, r1 12294: 09 f0 breq .+2 ; 0x12298 12296: 63 cf rjmp .-314 ; 0x1215e // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh 12298: 0f 94 87 17 call 0x22f0e ; 0x22f0e // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; 1229c: a0 91 75 07 lds r26, 0x0775 ; 0x800775 122a0: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; 122a2: b0 91 f3 03 lds r27, 0x03F3 ; 0x8003f3 122a6: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; 122a8: 81 e0 ldi r24, 0x01 ; 1 122aa: 80 93 75 07 sts 0x0775, r24 ; 0x800775 custom_message_state = meshPointsToProbe + 10; 122ae: 8a e0 ldi r24, 0x0A ; 10 122b0: 83 0d add r24, r3 122b2: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 lcd_update(1); 122b6: 81 e0 ldi r24, 0x01 ; 1 122b8: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 122bc: 80 e0 ldi r24, 0x00 ; 0 122be: 90 e0 ldi r25, 0x00 ; 0 122c0: a0 ea ldi r26, 0xA0 ; 160 122c2: b0 e4 ldi r27, 0x40 ; 64 122c4: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 122c8: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 122cc: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 122d0: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 122d4: 65 e5 ldi r22, 0x55 ; 85 122d6: 75 e5 ldi r23, 0x55 ; 85 122d8: 85 e5 ldi r24, 0x55 ; 85 122da: 91 e4 ldi r25, 0x41 ; 65 122dc: 0f 94 93 ba call 0x37526 ; 0x37526 // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 122e0: 80 e0 ldi r24, 0x00 ; 0 122e2: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 122e6: 9c a3 std Y+36, r25 ; 0x24 122e8: 8b a3 std Y+35, r24 ; 0x23 122ea: 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 122ec: 83 2d mov r24, r3 122ee: 67 e0 ldi r22, 0x07 ; 7 122f0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 122f4: f8 2e mov r15, r24 122f6: 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 122f8: 68 2f mov r22, r24 122fa: 70 e0 ldi r23, 0x00 ; 0 122fc: 7f 87 std Y+15, r23 ; 0x0f 122fe: 6e 87 std Y+14, r22 ; 0x0e 12300: 80 ff sbrs r24, 0 12302: 03 c0 rjmp .+6 ; 0x1230a 12304: 76 e0 ldi r23, 0x06 ; 6 12306: 79 1b sub r23, r25 12308: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); 1230a: 80 2f mov r24, r16 1230c: 63 e0 ldi r22, 0x03 ; 3 1230e: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 12312: 91 11 cpse r25, r1 12314: 05 c0 rjmp .+10 ; 0x12320 12316: 8f 2d mov r24, r15 12318: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 1231c: 11 e0 ldi r17, 0x01 ; 1 1231e: 91 11 cpse r25, r1 12320: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); 12322: 80 2f mov r24, r16 12324: 0f 94 af c7 call 0x38f5e ; 0x38f5e 12328: 68 8b std Y+16, r22 ; 0x10 1232a: 79 8b std Y+17, r23 ; 0x11 1232c: 8a 8b std Y+18, r24 ; 0x12 1232e: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); 12330: 8f 2d mov r24, r15 12332: 0f 94 af c7 call 0x38f5e ; 0x38f5e 12336: 4b 01 movw r8, r22 12338: 5c 01 movw r10, r24 if (nMeasPoints == 3) { 1233a: 8e 81 ldd r24, Y+6 ; 0x06 1233c: 83 30 cpi r24, 0x03 ; 3 1233e: 09 f0 breq .+2 ; 0x12342 12340: 99 c0 rjmp .+306 ; 0x12474 if (!isOn3x3Mesh) { 12342: 11 11 cpse r17, r1 12344: c8 c0 rjmp .+400 ; 0x124d6 12346: 27 e0 ldi r18, 0x07 ; 7 12348: ae 85 ldd r26, Y+14 ; 0x0e 1234a: bf 85 ldd r27, Y+15 ; 0x0f 1234c: 2a 9f mul r18, r26 1234e: f0 01 movw r30, r0 12350: 2b 9f mul r18, r27 12352: f0 0d add r31, r0 12354: 11 24 eor r1, r1 12356: e0 0f add r30, r16 12358: f1 1d adc r31, r1 1235a: ee 0f add r30, r30 1235c: ff 1f adc r31, r31 1235e: ee 0f add r30, r30 12360: ff 1f adc r31, r31 12362: e0 56 subi r30, 0x60 ; 96 12364: fc 4e sbci r31, 0xEC ; 236 12366: 60 e0 ldi r22, 0x00 ; 0 12368: 70 e0 ldi r23, 0x00 ; 0 1236a: 80 ec ldi r24, 0xC0 ; 192 1236c: 9f e7 ldi r25, 0x7F ; 127 1236e: 61 83 std Z+1, r22 ; 0x01 12370: 72 83 std Z+2, r23 ; 0x02 12372: 83 83 std Z+3, r24 ; 0x03 12374: 94 83 std Z+4, r25 ; 0x04 12376: 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) { 12378: e1 e3 ldi r30, 0x31 ; 49 1237a: 3e 12 cpse r3, r30 1237c: b7 cf rjmp .-146 ; 0x122ec custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1237e: 80 e0 ldi r24, 0x00 ; 0 12380: 90 e0 ldi r25, 0x00 ; 0 12382: a0 ea ldi r26, 0xA0 ; 160 12384: b0 e4 ldi r27, 0x40 ; 64 12386: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 1238a: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1238e: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 12392: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12396: 65 e5 ldi r22, 0x55 ; 85 12398: 75 e5 ldi r23, 0x55 ; 85 1239a: 85 e5 ldi r24, 0x55 ; 85 1239c: 91 e4 ldi r25, 0x41 ; 65 1239e: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 123a2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { 123a6: b1 e3 ldi r27, 0x31 ; 49 123a8: 3b 16 cp r3, r27 123aa: 09 f4 brne .+2 ; 0x123ae 123ac: 33 c2 rjmp .+1126 ; 0x12814 if (g80_fail_cnt++ >= 1) { 123ae: 80 91 6c 03 lds r24, 0x036C ; 0x80036c 123b2: 91 e0 ldi r25, 0x01 ; 1 123b4: 98 0f add r25, r24 123b6: 90 93 6c 03 sts 0x036C, r25 ; 0x80036c 123ba: 88 23 and r24, r24 123bc: 09 f4 brne .+2 ; 0x123c0 123be: d3 c1 rjmp .+934 ; 0x12766 print_stop(); 123c0: 60 e0 ldi r22, 0x00 ; 0 123c2: 80 e0 ldi r24, 0x00 ; 0 123c4: 0f 94 17 16 call 0x22c2e ; 0x22c2e lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); 123c8: 86 e4 ldi r24, 0x46 ; 70 123ca: 96 e3 ldi r25, 0x36 ; 54 123cc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 123d0: 0f 94 0c 36 call 0x26c18 ; 0x26c18 lcd_z_calibration_prompt(false); 123d4: 80 e0 ldi r24, 0x00 ; 0 123d6: 0f 94 d9 67 call 0x2cfb2 ; 0x2cfb2 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); 123da: 81 e0 ldi r24, 0x01 ; 1 123dc: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); 123e0: 8a e6 ldi r24, 0x6A ; 106 123e2: 90 e7 ldi r25, 0x70 ; 112 123e4: 0f 94 ea 0b call 0x217d4 ; 0x217d4 custom_message_type = custom_message_type_old; 123e8: 2f 81 ldd r18, Y+7 ; 0x07 123ea: 20 93 75 07 sts 0x0775, r18 ; 0x800775 custom_message_state = custom_message_state_old; 123ee: 68 85 ldd r22, Y+8 ; 0x08 123f0: 60 93 f3 03 sts 0x03F3, r22 ; 0x8003f3 lcd_update(2); 123f4: 82 e0 ldi r24, 0x02 ; 2 123f6: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 st_synchronize(); 123fa: 0f 94 2c 59 call 0x2b258 ; 0x2b258 mesh_bed_leveling_flag = false; 123fe: 10 92 59 0e sts 0x0E59, r1 ; 0x800e59 12402: d6 cd rjmp .-1108 ; 0x11fb0 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)) { 12404: 01 11 cpse r16, r1 12406: 03 c0 rjmp .+6 ; 0x1240e 12408: 11 23 and r17, r17 1240a: 09 f4 brne .+2 ; 0x1240e 1240c: bc ce rjmp .-648 ; 0x12186 // 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))); 1240e: 81 2f mov r24, r17 12410: 63 e0 ldi r22, 0x03 ; 3 12412: 0f 94 4c de call 0x3bc98 ; 0x3bc98 <__divmodqi4> 12416: 84 0d add r24, r4 12418: 95 2d mov r25, r5 1241a: 91 1d adc r25, r1 1241c: 88 0f add r24, r24 1241e: 99 1f adc r25, r25 12420: 8d 53 subi r24, 0x3D ; 61 12422: 90 4f sbci r25, 0xF0 ; 240 12424: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 12428: bc 01 movw r22, r24 1242a: 99 0f add r25, r25 1242c: 88 0b sbc r24, r24 1242e: 99 0b sbc r25, r25 12430: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 12434: 2a e0 ldi r18, 0x0A ; 10 12436: 37 ed ldi r19, 0xD7 ; 215 12438: 43 e2 ldi r20, 0x23 ; 35 1243a: 5c e3 ldi r21, 0x3C ; 60 1243c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 12440: 9b 01 movw r18, r22 12442: ac 01 movw r20, r24 12444: 60 91 a1 13 lds r22, 0x13A1 ; 0x8013a1 12448: 70 91 a2 13 lds r23, 0x13A2 ; 0x8013a2 1244c: 80 91 a3 13 lds r24, 0x13A3 ; 0x8013a3 12450: 90 91 a4 13 lds r25, 0x13A4 ; 0x8013a4 12454: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 12458: f3 01 movw r30, r6 1245a: 61 83 std Z+1, r22 ; 0x01 1245c: 72 83 std Z+2, r23 ; 0x02 1245e: 83 83 std Z+3, r24 ; 0x03 12460: 94 83 std Z+4, r25 ; 0x04 12462: 91 ce rjmp .-734 ; 0x12186 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)) { 12464: fe 85 ldd r31, Y+14 ; 0x0e 12466: ff 23 and r31, r31 12468: 09 f4 brne .+2 ; 0x1246c 1246a: 02 cf rjmp .-508 ; 0x12270 1246c: 22 20 and r2, r2 1246e: 09 f4 brne .+2 ; 0x12472 12470: fe ce rjmp .-516 ; 0x1226e 12472: fe ce rjmp .-516 ; 0x12270 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)) { 12474: 28 89 ldd r18, Y+16 ; 0x10 12476: 39 89 ldd r19, Y+17 ; 0x11 12478: 4a 89 ldd r20, Y+18 ; 0x12 1247a: 5b 89 ldd r21, Y+19 ; 0x13 1247c: 6a 85 ldd r22, Y+10 ; 0x0a 1247e: 7b 85 ldd r23, Y+11 ; 0x0b 12480: 8c 85 ldd r24, Y+12 ; 0x0c 12482: 9d 85 ldd r25, Y+13 ; 0x0d 12484: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 12488: 18 16 cp r1, r24 1248a: 04 f1 brlt .+64 ; 0x124cc 1248c: 28 89 ldd r18, Y+16 ; 0x10 1248e: 39 89 ldd r19, Y+17 ; 0x11 12490: 4a 89 ldd r20, Y+18 ; 0x12 12492: 5b 89 ldd r21, Y+19 ; 0x13 12494: 69 8d ldd r22, Y+25 ; 0x19 12496: 7a 8d ldd r23, Y+26 ; 0x1a 12498: 8b 8d ldd r24, Y+27 ; 0x1b 1249a: 9c 8d ldd r25, Y+28 ; 0x1c 1249c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 124a0: 87 fd sbrc r24, 7 124a2: 14 c0 rjmp .+40 ; 0x124cc 124a4: a5 01 movw r20, r10 124a6: 94 01 movw r18, r8 124a8: 6c 89 ldd r22, Y+20 ; 0x14 124aa: 7d 89 ldd r23, Y+21 ; 0x15 124ac: 8e 89 ldd r24, Y+22 ; 0x16 124ae: 9f 89 ldd r25, Y+23 ; 0x17 124b0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 124b4: 18 16 cp r1, r24 124b6: 54 f0 brlt .+20 ; 0x124cc 124b8: a5 01 movw r20, r10 124ba: 94 01 movw r18, r8 124bc: 6d 8d ldd r22, Y+29 ; 0x1d 124be: 7e 8d ldd r23, Y+30 ; 0x1e 124c0: 8f 8d ldd r24, Y+31 ; 0x1f 124c2: 98 a1 ldd r25, Y+32 ; 0x20 124c4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 124c8: 87 ff sbrs r24, 7 124ca: 05 c0 rjmp .+10 ; 0x124d6 124cc: 11 23 and r17, r17 124ce: 09 f4 brne .+2 ; 0x124d2 124d0: 52 cf rjmp .-348 ; 0x12376 124d2: 21 10 cpse r2, r1 124d4: 50 cf rjmp .-352 ; 0x12376 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 124d6: 10 e0 ldi r17, 0x00 ; 0 124d8: a7 e0 ldi r26, 0x07 ; 7 124da: 8e 85 ldd r24, Y+14 ; 0x0e 124dc: 9f 85 ldd r25, Y+15 ; 0x0f 124de: a8 9f mul r26, r24 124e0: f0 01 movw r30, r0 124e2: a9 9f mul r26, r25 124e4: f0 0d add r31, r0 124e6: 11 24 eor r1, r1 124e8: e0 0f add r30, r16 124ea: f1 1f adc r31, r17 124ec: ee 0f add r30, r30 124ee: ff 1f adc r31, r31 124f0: ee 0f add r30, r30 124f2: ff 1f adc r31, r31 124f4: e0 56 subi r30, 0x60 ; 96 124f6: fc 4e sbci r31, 0xEC ; 236 124f8: 41 80 ldd r4, Z+1 ; 0x01 124fa: 52 80 ldd r5, Z+2 ; 0x02 124fc: 63 80 ldd r6, Z+3 ; 0x03 124fe: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 12500: c1 2c mov r12, r1 12502: d1 2c mov r13, r1 12504: e0 ea ldi r30, 0xA0 ; 160 12506: ee 2e mov r14, r30 12508: e0 e4 ldi r30, 0x40 ; 64 1250a: fe 2e mov r15, r30 1250c: 22 20 and r2, r2 1250e: 51 f0 breq .+20 ; 0x12524 12510: 23 e3 ldi r18, 0x33 ; 51 12512: 33 e3 ldi r19, 0x33 ; 51 12514: 43 eb ldi r20, 0xB3 ; 179 12516: 5e e3 ldi r21, 0x3E ; 62 12518: c3 01 movw r24, r6 1251a: b2 01 movw r22, r4 1251c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 12520: 6b 01 movw r12, r22 12522: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 12524: a7 01 movw r20, r14 12526: 96 01 movw r18, r12 12528: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 1252c: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 12530: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 12534: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 12538: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1253c: 87 ff sbrs r24, 7 1253e: 10 c0 rjmp .+32 ; 0x12560 current_position[Z_AXIS] = init_z_bckp; 12540: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 12544: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 12548: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 1254c: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12550: 65 e5 ldi r22, 0x55 ; 85 12552: 75 e5 ldi r23, 0x55 ; 85 12554: 85 e5 ldi r24, 0x55 ; 85 12556: 91 e4 ldi r25, 0x41 ; 65 12558: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1255c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 12560: 68 89 ldd r22, Y+16 ; 0x10 12562: 79 89 ldd r23, Y+17 ; 0x11 12564: 8a 89 ldd r24, Y+18 ; 0x12 12566: 9b 89 ldd r25, Y+19 ; 0x13 12568: 60 93 43 07 sts 0x0743, r22 ; 0x800743 1256c: 70 93 44 07 sts 0x0744, r23 ; 0x800744 12570: 80 93 45 07 sts 0x0745, r24 ; 0x800745 12574: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = y_pos; 12578: 80 92 47 07 sts 0x0747, r8 ; 0x800747 1257c: 90 92 48 07 sts 0x0748, r9 ; 0x800748 12580: a0 92 49 07 sts 0x0749, r10 ; 0x800749 12584: b0 92 4a 07 sts 0x074A, r11 ; 0x80074a world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 12588: 67 e4 ldi r22, 0x47 ; 71 1258a: 77 e0 ldi r23, 0x07 ; 7 1258c: 83 e4 ldi r24, 0x43 ; 67 1258e: 97 e0 ldi r25, 0x07 ; 7 12590: 0e 94 5f 6b call 0xd6be ; 0xd6be plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 12594: 60 e0 ldi r22, 0x00 ; 0 12596: 70 e0 ldi r23, 0x00 ; 0 12598: 86 e1 ldi r24, 0x16 ; 22 1259a: 93 e4 ldi r25, 0x43 ; 67 1259c: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 125a0: 0f 94 2c 59 call 0x2b258 ; 0x2b258 if (planner_aborted) 125a4: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 125a8: 88 23 and r24, r24 125aa: 39 f0 breq .+14 ; 0x125ba { custom_message_type = custom_message_type_old; 125ac: 7f 81 ldd r23, Y+7 ; 0x07 125ae: 70 93 75 07 sts 0x0775, r23 ; 0x800775 custom_message_state = custom_message_state_old; 125b2: 88 85 ldd r24, Y+8 ; 0x08 125b4: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 125b8: fb cc rjmp .-1546 ; 0x11fb0 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 125ba: 81 2c mov r8, r1 125bc: 91 2c mov r9, r1 125be: 70 e2 ldi r23, 0x20 ; 32 125c0: a7 2e mov r10, r23 125c2: 71 ec ldi r23, 0xC1 ; 193 125c4: b7 2e mov r11, r23 125c6: 22 20 and r2, r2 125c8: 51 f0 breq .+20 ; 0x125de 125ca: 2a 81 ldd r18, Y+2 ; 0x02 125cc: 3b 81 ldd r19, Y+3 ; 0x03 125ce: 4c 81 ldd r20, Y+4 ; 0x04 125d0: 5d 81 ldd r21, Y+5 ; 0x05 125d2: c3 01 movw r24, r6 125d4: b2 01 movw r22, r4 125d6: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 125da: 4b 01 movw r8, r22 125dc: 5c 01 movw r10, r24 125de: 48 8d ldd r20, Y+24 ; 0x18 125e0: c5 01 movw r24, r10 125e2: b4 01 movw r22, r8 125e4: 0f 94 29 8c call 0x31852 ; 0x31852 125e8: 81 11 cpse r24, r1 125ea: 0b c0 rjmp .+22 ; 0x12602 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)); 125ec: 80 ec ldi r24, 0xC0 ; 192 125ee: 94 e6 ldi r25, 0x64 ; 100 125f0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 125f4: 9f 93 push r25 125f6: 8f 93 push r24 125f8: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 125fc: 0f 90 pop r0 125fe: 0f 90 pop r0 12600: be ce rjmp .-644 ; 0x1237e // 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. 12602: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 12606: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 1260a: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 1260e: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 12612: c7 01 movw r24, r14 12614: b6 01 movw r22, r12 12616: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1261a: 20 e0 ldi r18, 0x00 ; 0 1261c: 30 e0 ldi r19, 0x00 ; 0 1261e: a9 01 movw r20, r18 12620: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 12624: 87 ff sbrs r24, 7 12626: 36 c0 rjmp .+108 ; 0x12694 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12628: 60 e0 ldi r22, 0x00 ; 0 1262a: 70 e0 ldi r23, 0x00 ; 0 1262c: 80 ea ldi r24, 0xA0 ; 160 1262e: 90 e4 ldi r25, 0x40 ; 64 12630: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 12634: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 12638: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 1263c: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 12640: 65 e5 ldi r22, 0x55 ; 85 12642: 75 e5 ldi r23, 0x55 ; 85 12644: 85 e5 ldi r24, 0x55 ; 85 12646: 91 e4 ldi r25, 0x41 ; 65 12648: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1264c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 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 12650: 48 8d ldd r20, Y+24 ; 0x18 12652: c5 01 movw r24, r10 12654: b4 01 movw r22, r8 12656: 0f 94 29 8c call 0x31852 ; 0x31852 1265a: 88 23 and r24, r24 1265c: 39 f2 breq .-114 ; 0x125ec printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 1265e: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 12662: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 12666: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 1266a: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 1266e: 60 e0 ldi r22, 0x00 ; 0 12670: 70 e0 ldi r23, 0x00 ; 0 12672: 80 ea ldi r24, 0xA0 ; 160 12674: 90 e4 ldi r25, 0x40 ; 64 12676: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1267a: 2d ec ldi r18, 0xCD ; 205 1267c: 3c ec ldi r19, 0xCC ; 204 1267e: 4c ec ldi r20, 0xCC ; 204 12680: 5d e3 ldi r21, 0x3D ; 61 12682: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 12686: 87 ff sbrs r24, 7 12688: 05 c0 rjmp .+10 ; 0x12694 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1268a: 89 e6 ldi r24, 0x69 ; 105 1268c: 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")); 1268e: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 12692: 75 ce rjmp .-790 ; 0x1237e 12694: c0 90 4b 07 lds r12, 0x074B ; 0x80074b 12698: d0 90 4c 07 lds r13, 0x074C ; 0x80074c 1269c: e0 90 4d 07 lds r14, 0x074D ; 0x80074d 126a0: f0 90 4e 07 lds r15, 0x074E ; 0x80074e if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); break; } } if (has_z && fabs(z0 - current_position[Z_AXIS]) > Z_CALIBRATION_THRESHOLD) { //if we have data from z calibration, max. allowed difference is 1mm for each point 126a4: 22 20 and r2, r2 126a6: a1 f0 breq .+40 ; 0x126d0 126a8: a7 01 movw r20, r14 126aa: 96 01 movw r18, r12 126ac: c3 01 movw r24, r6 126ae: b2 01 movw r22, r4 126b0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 126b4: 9b 01 movw r18, r22 126b6: ac 01 movw r20, r24 126b8: 5f 77 andi r21, 0x7F ; 127 126ba: 6a 81 ldd r22, Y+2 ; 0x02 126bc: 7b 81 ldd r23, Y+3 ; 0x03 126be: 8c 81 ldd r24, Y+4 ; 0x04 126c0: 9d 81 ldd r25, Y+5 ; 0x05 126c2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 126c6: 87 ff sbrs r24, 7 126c8: 03 c0 rjmp .+6 ; 0x126d0 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 126ca: 80 e3 ldi r24, 0x30 ; 48 126cc: 9d e7 ldi r25, 0x7D ; 125 126ce: df cf rjmp .-66 ; 0x1268e } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 126d0: 8f ea ldi r24, 0xAF ; 175 126d2: 9f e0 ldi r25, 0x0F ; 15 126d4: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 126d8: 88 23 and r24, r24 126da: 09 f4 brne .+2 ; 0x126de 126dc: 40 c0 rjmp .+128 ; 0x1275e 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); } 126de: 86 ea ldi r24, 0xA6 ; 166 126e0: 9f e0 ldi r25, 0x0F ; 15 126e2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (!calibration_status_pinda()) return 0; 126e6: 88 23 and r24, r24 126e8: d1 f1 breq .+116 ; 0x1275e return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 126ea: 60 91 99 03 lds r22, 0x0399 ; 0x800399 126ee: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 126f2: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 126f6: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 126fa: 0e 94 3f 5d call 0xba7e ; 0xba7e 126fe: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 12702: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 12706: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 1270a: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 1270e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 12712: 9b 01 movw r18, r22 12714: ac 01 movw r20, r24 12716: e7 e0 ldi r30, 0x07 ; 7 12718: ae 85 ldd r26, Y+14 ; 0x0e 1271a: bf 85 ldd r27, Y+15 ; 0x0f 1271c: ea 9f mul r30, r26 1271e: c0 01 movw r24, r0 12720: eb 9f mul r30, r27 12722: 90 0d add r25, r0 12724: 11 24 eor r1, r1 12726: 08 0f add r16, r24 12728: 19 1f adc r17, r25 1272a: 00 0f add r16, r16 1272c: 11 1f adc r17, r17 1272e: 00 0f add r16, r16 12730: 11 1f adc r17, r17 12732: 00 56 subi r16, 0x60 ; 96 12734: 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; 12736: c7 01 movw r24, r14 12738: b6 01 movw r22, r12 1273a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1273e: d8 01 movw r26, r16 12740: 11 96 adiw r26, 0x01 ; 1 12742: 6d 93 st X+, r22 12744: 7d 93 st X+, r23 12746: 8d 93 st X+, r24 12748: 9c 93 st X, r25 1274a: 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--; 1274c: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 12750: 81 50 subi r24, 0x01 ; 1 12752: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 mesh_point++; lcd_update(1); 12756: 81 e0 ldi r24, 0x01 ; 1 12758: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 1275c: 0c ce rjmp .-1000 ; 0x12376 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 1275e: 20 e0 ldi r18, 0x00 ; 0 12760: 30 e0 ldi r19, 0x00 ; 0 12762: a9 01 movw r20, r18 12764: d8 cf rjmp .-80 ; 0x12716 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); 12766: 85 e0 ldi r24, 0x05 ; 5 12768: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe 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; 1276c: c1 2c mov r12, r1 1276e: d1 2c mov r13, r1 12770: 90 ea ldi r25, 0xA0 ; 160 12772: e9 2e mov r14, r25 12774: 90 e4 ldi r25, 0x40 ; 64 12776: 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)); 12778: 82 e1 ldi r24, 0x12 ; 18 1277a: 96 e3 ldi r25, 0x36 ; 54 1277c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 12780: 0f 94 85 35 call 0x26b0a ; 0x26b0a #ifdef TMC2130 lcd_wait_for_click_delay(MSG_BED_LEVELING_FAILED_TIMEOUT); 12784: 8e e1 ldi r24, 0x1E ; 30 12786: 90 e0 ldi r25, 0x00 ; 0 12788: 0f 94 73 50 call 0x2a0e6 ; 0x2a0e6 calibrate_z_auto(); // Z-leveling (X-assembly stay up!!!) 1278c: 0e 94 f3 73 call 0xe7e6 ; 0xe7e6 #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); 12790: 80 e0 ldi r24, 0x00 ; 0 12792: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 12796: 18 2f mov r17, r24 raise_z(-1); 12798: 60 e0 ldi r22, 0x00 ; 0 1279a: 70 e0 ldi r23, 0x00 ; 0 1279c: 80 e8 ldi r24, 0x80 ; 128 1279e: 9f eb ldi r25, 0xBF ; 191 127a0: 0e 94 96 6e call 0xdd2c ; 0xdd2c enable_z_endstop(true); 127a4: 81 e0 ldi r24, 0x01 ; 1 127a6: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 127aa: 84 e0 ldi r24, 0x04 ; 4 127ac: 0f 94 93 3b call 0x27726 ; 0x27726 #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 127b0: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 127b4: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 127b8: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 127bc: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 127c0: 65 e5 ldi r22, 0x55 ; 85 127c2: 75 e5 ldi r23, 0x55 ; 85 127c4: 85 e5 ldi r24, 0x55 ; 85 127c6: 91 e4 ldi r25, 0x41 ; 65 127c8: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 127cc: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #ifdef TMC2130 tmc2130_home_exit(); 127d0: 0f 94 64 3b call 0x276c8 ; 0x276c8 #endif // TMC2130 enable_z_endstop(bState); 127d4: 81 2f mov r24, r17 127d6: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 127da: 82 e0 ldi r24, 0x02 ; 2 127dc: 0f 94 18 59 call 0x2b230 ; 0x2b230 127e0: 20 e0 ldi r18, 0x00 ; 0 127e2: 30 e0 ldi r19, 0x00 ; 0 127e4: 40 ea ldi r20, 0xA0 ; 160 127e6: 50 e4 ldi r21, 0x40 ; 64 127e8: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 127ec: 18 16 cp r1, r24 127ee: 24 f2 brlt .-120 ; 0x12778 custom_message_type = custom_message_type_old; 127f0: ef 81 ldd r30, Y+7 ; 0x07 127f2: e0 93 75 07 sts 0x0775, r30 ; 0x800775 custom_message_state = custom_message_state_old; 127f6: f8 85 ldd r31, Y+8 ; 0x08 127f8: f0 93 f3 03 sts 0x03F3, r31 ; 0x8003f3 lcd_update_enable(true); // display / status-line recovery 127fc: 81 e0 ldi r24, 0x01 ; 1 127fe: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 gcode_G28(true, true, true); // X & Y & Z-homing (must be after individual Z-homing (problem with spool-holder)!) 12802: 41 e0 ldi r20, 0x01 ; 1 12804: 61 e0 ldi r22, 0x01 ; 1 12806: 81 e0 ldi r24, 0x01 ; 1 12808: 0e 94 90 80 call 0x10120 ; 0x10120 1280c: 81 e0 ldi r24, 0x01 ; 1 1280e: 80 93 80 10 sts 0x1080, r24 ; 0x801080 12812: ce cb rjmp .-2148 ; 0x11fb0 repeatcommand_front(); // re-run (i.e. of "G80") return; } g80_fail_cnt = 0; // no fail was detected. Reset the error counter. 12814: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c clean_up_after_endstop_move(l_feedmultiply); 12818: 8b a1 ldd r24, Y+35 ; 0x23 1281a: 9c a1 ldd r25, Y+36 ; 0x24 1281c: 0e 94 83 67 call 0xcf06 ; 0xcf06 } } void babystep_apply() { babystep_load(); 12820: 0f 94 ff c6 call 0x38dfe ; 0x38dfe shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 12824: 60 91 6a 05 lds r22, 0x056A ; 0x80056a <_ZL13babystepLoadZ.lto_priv.516> 12828: 70 91 6b 05 lds r23, 0x056B ; 0x80056b <_ZL13babystepLoadZ.lto_priv.516+0x1> 1282c: 07 2e mov r0, r23 1282e: 00 0c add r0, r0 12830: 88 0b sbc r24, r24 12832: 99 0b sbc r25, r25 12834: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 12838: 90 58 subi r25, 0x80 ; 128 1283a: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 1283e: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 12842: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 12846: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 1284a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1284e: 0f 94 1b c7 call 0x38e36 ; 0x38e36 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; 12852: 80 ec ldi r24, 0xC0 ; 192 12854: 9f e0 ldi r25, 0x0F ; 15 12856: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1285a: 91 e0 ldi r25, 0x01 ; 1 1285c: 81 30 cpi r24, 0x01 ; 1 1285e: 09 f0 breq .+2 ; 0x12862 12860: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 12862: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 12864: 4f eb ldi r20, 0xBF ; 191 12866: 5f e0 ldi r21, 0x0F ; 15 12868: 6c e4 ldi r22, 0x4C ; 76 1286a: ce 01 movw r24, r28 1286c: 01 96 adiw r24, 0x01 ; 1 1286e: 0e 94 91 5c call 0xb922 ; 0xb922 12872: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 12874: 4e eb ldi r20, 0xBE ; 190 12876: 5f e0 ldi r21, 0x0F ; 15 12878: 62 e5 ldi r22, 0x52 ; 82 1287a: ce 01 movw r24, r28 1287c: 01 96 adiw r24, 0x01 ; 1 1287e: 0e 94 91 5c call 0xb922 ; 0xb922 12882: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 12884: 4d eb ldi r20, 0xBD ; 189 12886: 5f e0 ldi r21, 0x0F ; 15 12888: 66 e4 ldi r22, 0x46 ; 70 1288a: ce 01 movw r24, r28 1288c: 01 96 adiw r24, 0x01 ; 1 1288e: 0e 94 91 5c call 0xb922 ; 0xb922 12892: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 12894: 4c eb ldi r20, 0xBC ; 188 12896: 5f e0 ldi r21, 0x0F ; 15 12898: 62 e4 ldi r22, 0x42 ; 66 1289a: ce 01 movw r24, r28 1289c: 01 96 adiw r24, 0x01 ; 1 1289e: 0e 94 91 5c call 0xb922 ; 0xb922 128a2: 21 2f mov r18, r17 128a4: 11 0f add r17, r17 128a6: 33 0b sbc r19, r19 128a8: 08 2e mov r0, r24 128aa: 00 0c add r0, r0 128ac: 99 0b sbc r25, r25 128ae: 5c 01 movw r10, r24 128b0: a2 1a sub r10, r18 128b2: b3 0a sbc r11, r19 128b4: 8f 2d mov r24, r15 128b6: ff 0c add r15, r15 128b8: 99 0b sbc r25, r25 128ba: 28 0f add r18, r24 128bc: 39 1f adc r19, r25 128be: 46 e0 ldi r20, 0x06 ; 6 128c0: 42 9f mul r20, r18 128c2: 60 01 movw r12, r0 128c4: 43 9f mul r20, r19 128c6: d0 0c add r13, r0 128c8: 11 24 eor r1, r1 128ca: f1 2c mov r15, r1 128cc: e1 2c mov r14, r1 128ce: 00 2e mov r0, r16 128d0: 00 0c add r0, r0 128d2: 11 0b sbc r17, r17 128d4: 08 1b sub r16, r24 128d6: 19 0b sbc r17, r25 128d8: b7 01 movw r22, r14 128da: 6f 55 subi r22, 0x5F ; 95 128dc: 7c 4e sbci r23, 0xEC ; 236 128de: 3b 01 movw r6, r22 128e0: 46 01 movw r8, r12 128e2: 77 e0 ldi r23, 0x07 ; 7 128e4: 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 * ( 128e6: d3 01 movw r26, r6 128e8: 2d 90 ld r2, X+ 128ea: 3d 90 ld r3, X+ 128ec: 4d 90 ld r4, X+ 128ee: 5d 90 ld r5, X+ 128f0: 3d 01 movw r6, r26 128f2: fd 01 movw r30, r26 128f4: 34 97 sbiw r30, 0x04 ; 4 128f6: fb 87 std Y+11, r31 ; 0x0b 128f8: ea 87 std Y+10, r30 ; 0x0a 128fa: b4 01 movw r22, r8 128fc: 09 2c mov r0, r9 128fe: 00 0c add r0, r0 12900: 88 0b sbc r24, r24 12902: 99 0b sbc r25, r25 12904: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 12908: 2f e3 ldi r18, 0x3F ; 63 1290a: 33 ec ldi r19, 0xC3 ; 195 1290c: 4e e2 ldi r20, 0x2E ; 46 1290e: 59 e3 ldi r21, 0x39 ; 57 12910: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 12914: a2 01 movw r20, r4 12916: 91 01 movw r18, r2 12918: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1291c: aa 85 ldd r26, Y+10 ; 0x0a 1291e: bb 85 ldd r27, Y+11 ; 0x0b 12920: 6d 93 st X+, r22 12922: 7d 93 st X+, r23 12924: 8d 93 st X+, r24 12926: 9c 93 st X, r25 12928: 13 97 sbiw r26, 0x03 ; 3 1292a: ba 81 ldd r27, Y+2 ; 0x02 1292c: b1 50 subi r27, 0x01 ; 1 1292e: ba 83 std Y+2, r27 ; 0x02 12930: 80 0e add r8, r16 12932: 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++) { 12934: b1 11 cpse r27, r1 12936: d7 cf rjmp .-82 ; 0x128e6 12938: ca 0c add r12, r10 1293a: db 1c adc r13, r11 1293c: ec e1 ldi r30, 0x1C ; 28 1293e: ee 0e add r14, r30 12940: 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++) { 12942: f4 ec ldi r31, 0xC4 ; 196 12944: ef 16 cp r14, r31 12946: f1 04 cpc r15, r1 12948: 39 f6 brne .-114 ; 0x128d8 + 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) 1294a: 0f 94 87 17 call 0x22f0e ; 0x22f0e { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 1294e: 8d e4 ldi r24, 0x4D ; 77 12950: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 12954: 88 23 and r24, r24 12956: 09 f4 brne .+2 ; 0x1295a 12958: 84 c0 rjmp .+264 ; 0x12a62 1295a: 0e 94 0e 5c call 0xb81c ; 0xb81c if (nMeasPoints == 7 && useMagnetCompensation) { 1295e: 2e 81 ldd r18, Y+6 ; 0x06 12960: 27 30 cpi r18, 0x07 ; 7 12962: 09 f0 breq .+2 ; 0x12966 12964: 94 c0 rjmp .+296 ; 0x12a8e 12966: 88 23 and r24, r24 12968: 09 f4 brne .+2 ; 0x1296c 1296a: 91 c0 rjmp .+290 ; 0x12a8e 1296c: bb 24 eor r11, r11 1296e: b3 94 inc r11 12970: aa 24 eor r10, r10 12972: aa 94 dec r10 12974: ab 0c add r10, r11 12976: 09 a1 ldd r16, Y+33 ; 0x21 12978: 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++) { 1297a: 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++; } 1297c: 8e ef ldi r24, 0xFE ; 254 1297e: 88 2e mov r8, r24 12980: 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)) { 12982: 6a 2d mov r22, r10 12984: 86 2d mov r24, r6 12986: 0f 94 ca c6 call 0x38d94 ; 0x38d94 1298a: 99 24 eor r9, r9 1298c: 93 94 inc r9 1298e: 96 0c add r9, r6 12990: 81 11 cpse r24, r1 12992: 6e c0 rjmp .+220 ; 0x12a70 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++; } 12994: 6b 2d mov r22, r11 12996: 86 2d mov r24, r6 12998: 0f 94 ca c6 call 0x38d94 ; 0x38d94 } 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; 1299c: c1 2c mov r12, r1 1299e: d1 2c mov r13, r1 129a0: 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; 129a2: 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++; } 129a4: 88 23 and r24, r24 129a6: 81 f0 breq .+32 ; 0x129c8 129a8: 20 e0 ldi r18, 0x00 ; 0 129aa: 30 e0 ldi r19, 0x00 ; 0 129ac: a9 01 movw r20, r18 129ae: d8 01 movw r26, r16 129b0: 5d 96 adiw r26, 0x1d ; 29 129b2: 6d 91 ld r22, X+ 129b4: 7d 91 ld r23, X+ 129b6: 8d 91 ld r24, X+ 129b8: 9c 91 ld r25, X 129ba: 90 97 sbiw r26, 0x20 ; 32 129bc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 129c0: 6b 01 movw r12, r22 129c2: 7c 01 movw r14, r24 129c4: 77 24 eor r7, r7 129c6: 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++; } 129c8: 68 2d mov r22, r8 129ca: 86 2d mov r24, r6 129cc: 0f 94 ca c6 call 0x38d94 ; 0x38d94 129d0: 88 23 and r24, r24 129d2: 69 f0 breq .+26 ; 0x129ee 129d4: f8 01 movw r30, r16 129d6: 7b 97 sbiw r30, 0x1b ; 27 129d8: 20 81 ld r18, Z 129da: 31 81 ldd r19, Z+1 ; 0x01 129dc: 42 81 ldd r20, Z+2 ; 0x02 129de: 53 81 ldd r21, Z+3 ; 0x03 129e0: c7 01 movw r24, r14 129e2: b6 01 movw r22, r12 129e4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 129e8: 6b 01 movw r12, r22 129ea: 7c 01 movw r14, r24 129ec: 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++; } 129ee: 6a 2d mov r22, r10 129f0: 89 2d mov r24, r9 129f2: 0f 94 ca c6 call 0x38d94 ; 0x38d94 129f6: 88 23 and r24, r24 129f8: 61 f0 breq .+24 ; 0x12a12 129fa: f8 01 movw r30, r16 129fc: 25 81 ldd r18, Z+5 ; 0x05 129fe: 36 81 ldd r19, Z+6 ; 0x06 12a00: 47 81 ldd r20, Z+7 ; 0x07 12a02: 50 85 ldd r21, Z+8 ; 0x08 12a04: c7 01 movw r24, r14 12a06: b6 01 movw r22, r12 12a08: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 12a0c: 6b 01 movw r12, r22 12a0e: 7c 01 movw r14, r24 12a10: 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++; } 12a12: 6a 2d mov r22, r10 12a14: 8f ef ldi r24, 0xFF ; 255 12a16: 86 0d add r24, r6 12a18: 0f 94 ca c6 call 0x38d94 ; 0x38d94 12a1c: 88 23 and r24, r24 12a1e: 31 f1 breq .+76 ; 0x12a6c 12a20: f8 01 movw r30, r16 12a22: 33 97 sbiw r30, 0x03 ; 3 12a24: 20 81 ld r18, Z 12a26: 31 81 ldd r19, Z+1 ; 0x01 12a28: 42 81 ldd r20, Z+2 ; 0x02 12a2a: 53 81 ldd r21, Z+3 ; 0x03 12a2c: c7 01 movw r24, r14 12a2e: b6 01 movw r22, r12 12a30: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 12a34: 6b 01 movw r12, r22 12a36: 7c 01 movw r14, r24 12a38: 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 12a3a: 67 2d mov r22, r7 12a3c: 70 e0 ldi r23, 0x00 ; 0 12a3e: 90 e0 ldi r25, 0x00 ; 0 12a40: 80 e0 ldi r24, 0x00 ; 0 12a42: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 12a46: 9b 01 movw r18, r22 12a48: ac 01 movw r20, r24 12a4a: c7 01 movw r24, r14 12a4c: b6 01 movw r22, r12 12a4e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 12a52: d8 01 movw r26, r16 12a54: 11 96 adiw r26, 0x01 ; 1 12a56: 6d 93 st X+, r22 12a58: 7d 93 st X+, r23 12a5a: 8d 93 st X+, r24 12a5c: 9c 93 st X, r25 12a5e: 14 97 sbiw r26, 0x04 ; 4 12a60: 07 c0 rjmp .+14 ; 0x12a70 } 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); 12a62: 8c ea ldi r24, 0xAC ; 172 12a64: 9d e0 ldi r25, 0x0D ; 13 12a66: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12a6a: 79 cf rjmp .-270 ; 0x1295e 12a6c: 71 10 cpse r7, r1 12a6e: e5 cf rjmp .-54 ; 0x12a3a //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++) { 12a70: 69 2c mov r6, r9 12a72: 0c 5f subi r16, 0xFC ; 252 12a74: 1f 4f sbci r17, 0xFF ; 255 12a76: b7 e0 ldi r27, 0x07 ; 7 12a78: 9b 12 cpse r9, r27 12a7a: 83 cf rjmp .-250 ; 0x12982 12a7c: b3 94 inc r11 12a7e: e9 a1 ldd r30, Y+33 ; 0x21 12a80: fa a1 ldd r31, Y+34 ; 0x22 12a82: 7c 96 adiw r30, 0x1c ; 28 12a84: fa a3 std Y+34, r31 ; 0x22 12a86: 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++) { 12a88: f8 e0 ldi r31, 0x08 ; 8 12a8a: bf 12 cpse r11, r31 12a8c: 71 cf rjmp .-286 ; 0x12970 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 12a8e: 81 e0 ldi r24, 0x01 ; 1 12a90: 80 93 a0 13 sts 0x13A0, r24 ; 0x8013a0 if (code_seen('O') && !code_value_uint8()) { 12a94: 8f e4 ldi r24, 0x4F ; 79 12a96: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 12a9a: 81 11 cpse r24, r1 12a9c: 03 c0 rjmp .+6 ; 0x12aa4 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 12a9e: 0f 94 70 c7 call 0x38ee0 ; 0x38ee0 12aa2: 9b cc rjmp .-1738 ; 0x123da } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 12aa4: 0e 94 0e 5c call 0xb81c ; 0xb81c 12aa8: 81 11 cpse r24, r1 12aaa: f9 cf rjmp .-14 ; 0x12a9e // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 12aac: 0e 94 78 67 call 0xcef0 ; 0xcef0 12ab0: 94 cc rjmp .-1752 ; 0x123da 00012ab2 : //! @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() { 12ab2: 4f 92 push r4 12ab4: 5f 92 push r5 12ab6: 6f 92 push r6 12ab8: 7f 92 push r7 12aba: 8f 92 push r8 12abc: 9f 92 push r9 12abe: af 92 push r10 12ac0: bf 92 push r11 12ac2: ef 92 push r14 12ac4: ff 92 push r15 12ac6: 0f 93 push r16 12ac8: 1f 93 push r17 12aca: cf 93 push r28 12acc: df 93 push r29 12ace: 1f 92 push r1 12ad0: cd b7 in r28, 0x3d ; 61 12ad2: de b7 in r29, 0x3e ; 62 eeprom_read_block(reinterpret_cast(cs.version), reinterpret_cast(EEPROM_M500_base->version), sizeof(cs.version)); 12ad4: 44 e0 ldi r20, 0x04 ; 4 12ad6: 50 e0 ldi r21, 0x00 ; 0 12ad8: 64 e1 ldi r22, 0x14 ; 20 12ada: 70 e0 ldi r23, 0x00 ; 0 12adc: 8e e6 ldi r24, 0x6E ; 110 12ade: 96 e0 ldi r25, 0x06 ; 6 12ae0: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 12ae4: 43 e0 ldi r20, 0x03 ; 3 12ae6: 50 e0 ldi r21, 0x00 ; 0 12ae8: 6f eb ldi r22, 0xBF ; 191 12aea: 78 e7 ldi r23, 0x78 ; 120 12aec: 8e e6 ldi r24, 0x6E ; 110 12aee: 96 e0 ldi r25, 0x06 ; 6 12af0: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 12af4: 89 2b or r24, r25 12af6: 09 f0 breq .+2 ; 0x12afa 12af8: a0 c1 rjmp .+832 ; 0x12e3a { // 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)); 12afa: e3 e8 ldi r30, 0x83 ; 131 12afc: f9 e7 ldi r31, 0x79 ; 121 12afe: 45 91 lpm r20, Z+ 12b00: 55 91 lpm r21, Z+ 12b02: 65 91 lpm r22, Z+ 12b04: 74 91 lpm r23, Z 12b06: 88 ed ldi r24, 0xD8 ; 216 12b08: 90 e0 ldi r25, 0x00 ; 0 12b0a: 0e 94 dc 64 call 0xc9b8 ; 0xc9b8 eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 12b0e: e7 e8 ldi r30, 0x87 ; 135 12b10: f9 e7 ldi r31, 0x79 ; 121 12b12: 45 91 lpm r20, Z+ 12b14: 55 91 lpm r21, Z+ 12b16: 65 91 lpm r22, Z+ 12b18: 74 91 lpm r23, Z 12b1a: 8c ed ldi r24, 0xDC ; 220 12b1c: 90 e0 ldi r25, 0x00 ; 0 12b1e: 0e 94 dc 64 call 0xc9b8 ; 0xc9b8 eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 12b22: eb e8 ldi r30, 0x8B ; 139 12b24: f9 e7 ldi r31, 0x79 ; 121 12b26: 64 91 lpm r22, Z 12b28: 80 ee ldi r24, 0xE0 ; 224 12b2a: 90 e0 ldi r25, 0x00 ; 0 12b2c: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 12b30: ec e8 ldi r30, 0x8C ; 140 12b32: f9 e7 ldi r31, 0x79 ; 121 12b34: 65 91 lpm r22, Z+ 12b36: 74 91 lpm r23, Z 12b38: 81 ee ldi r24, 0xE1 ; 225 12b3a: 90 e0 ldi r25, 0x00 ; 0 12b3c: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 12b40: ee e8 ldi r30, 0x8E ; 142 12b42: f9 e7 ldi r31, 0x79 ; 121 12b44: 65 91 lpm r22, Z+ 12b46: 74 91 lpm r23, Z 12b48: 83 ee ldi r24, 0xE3 ; 227 12b4a: 90 e0 ldi r25, 0x00 ; 0 12b4c: 0e 94 7c 77 call 0xeef8 ; 0xeef8 // 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)); 12b50: ef e7 ldi r30, 0x7F ; 127 12b52: f9 e7 ldi r31, 0x79 ; 121 12b54: 45 91 lpm r20, Z+ 12b56: 55 91 lpm r21, Z+ 12b58: 65 91 lpm r22, Z+ 12b5a: 74 91 lpm r23, Z 12b5c: 84 ed ldi r24, 0xD4 ; 212 12b5e: 90 e0 ldi r25, 0x00 ; 0 12b60: 0e 94 dc 64 call 0xc9b8 ; 0xc9b8 // 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); 12b64: 4b e5 ldi r20, 0x5B ; 91 12b66: 59 e7 ldi r21, 0x79 ; 121 12b68: 60 e1 ldi r22, 0x10 ; 16 12b6a: 70 e0 ldi r23, 0x00 ; 0 12b6c: 80 eb ldi r24, 0xB0 ; 176 12b6e: 90 e0 ldi r25, 0x00 ; 0 12b70: 0e 94 5d 77 call 0xeeba ; 0xeeba 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); 12b74: 4b e6 ldi r20, 0x6B ; 107 12b76: 59 e7 ldi r21, 0x79 ; 121 12b78: 60 e1 ldi r22, 0x10 ; 16 12b7a: 70 e0 ldi r23, 0x00 ; 0 12b7c: 80 ec ldi r24, 0xC0 ; 192 12b7e: 90 e0 ldi r25, 0x00 ; 0 12b80: 0e 94 5d 77 call 0xeeba ; 0xeeba #ifdef TMC2130 eeprom_init_default_block(&EEPROM_M500_base->axis_ustep_resolution, sizeof(EEPROM_M500_base->axis_ustep_resolution), default_conf.axis_ustep_resolution); 12b84: 4b e7 ldi r20, 0x7B ; 123 12b86: 59 e7 ldi r21, 0x79 ; 121 12b88: 64 e0 ldi r22, 0x04 ; 4 12b8a: 70 e0 ldi r23, 0x00 ; 0 12b8c: 80 ed ldi r24, 0xD0 ; 208 12b8e: 90 e0 ldi r25, 0x00 ; 0 12b90: 0e 94 5d 77 call 0xeeba ; 0xeeba #endif // TMC2130 // load the CS to RAM eeprom_read_block(reinterpret_cast(&cs), reinterpret_cast(EEPROM_M500_base), sizeof(cs)); 12b94: 41 ed ldi r20, 0xD1 ; 209 12b96: 50 e0 ldi r21, 0x00 ; 0 12b98: 64 e1 ldi r22, 0x14 ; 20 12b9a: 70 e0 ldi r23, 0x00 ; 0 12b9c: 8e e6 ldi r24, 0x6E ; 110 12b9e: 96 e0 ldi r25, 0x06 ; 6 12ba0: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 calculate_extruder_multipliers(); 12ba4: 0e 94 6e 66 call 0xccdc ; 0xccdc 12ba8: 0e e6 ldi r16, 0x6E ; 110 12baa: 16 e0 ldi r17, 0x06 ; 6 12bac: 8a e0 ldi r24, 0x0A ; 10 12bae: e8 2e mov r14, r24 12bb0: 87 e0 ldi r24, 0x07 ; 7 12bb2: 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; 12bb4: 94 ec ldi r25, 0xC4 ; 196 12bb6: 89 2e mov r8, r25 12bb8: 99 e0 ldi r25, 0x09 ; 9 12bba: 99 2e mov r9, r25 12bbc: a1 2c mov r10, r1 12bbe: 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; 12bc0: 20 ec ldi r18, 0xC0 ; 192 12bc2: 42 2e mov r4, r18 12bc4: 23 e0 ldi r18, 0x03 ; 3 12bc6: 52 2e mov r5, r18 12bc8: 61 2c mov r6, r1 12bca: 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) 12bcc: 20 e0 ldi r18, 0x00 ; 0 12bce: 30 e0 ldi r19, 0x00 ; 0 12bd0: 48 e4 ldi r20, 0x48 ; 72 12bd2: 53 e4 ldi r21, 0x43 ; 67 12bd4: f8 01 movw r30, r16 12bd6: 64 89 ldd r22, Z+20 ; 0x14 12bd8: 75 89 ldd r23, Z+21 ; 0x15 12bda: 86 89 ldd r24, Z+22 ; 0x16 12bdc: 97 89 ldd r25, Z+23 ; 0x17 12bde: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 12be2: 18 16 cp r1, r24 12be4: 4c f4 brge .+18 ; 0x12bf8 cs.max_feedrate_normal[j] = NORMAL_MAX_FEEDRATE_XY; 12be6: 80 e0 ldi r24, 0x00 ; 0 12be8: 90 e0 ldi r25, 0x00 ; 0 12bea: a8 e4 ldi r26, 0x48 ; 72 12bec: b3 e4 ldi r27, 0x43 ; 67 12bee: f8 01 movw r30, r16 12bf0: 84 8b std Z+20, r24 ; 0x14 12bf2: 95 8b std Z+21, r25 ; 0x15 12bf4: a6 8b std Z+22, r26 ; 0x16 12bf6: b7 8b std Z+23, r27 ; 0x17 if (cs.max_feedrate_silent[j] > SILENT_MAX_FEEDRATE_XY) 12bf8: f7 01 movw r30, r14 12bfa: 61 91 ld r22, Z+ 12bfc: 71 91 ld r23, Z+ 12bfe: 81 91 ld r24, Z+ 12c00: 91 91 ld r25, Z+ 12c02: 7f 01 movw r14, r30 12c04: 20 e0 ldi r18, 0x00 ; 0 12c06: 30 e0 ldi r19, 0x00 ; 0 12c08: 48 ec ldi r20, 0xC8 ; 200 12c0a: 52 e4 ldi r21, 0x42 ; 66 12c0c: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 12c10: 18 16 cp r1, r24 12c12: 54 f4 brge .+20 ; 0x12c28 cs.max_feedrate_silent[j] = SILENT_MAX_FEEDRATE_XY; 12c14: 80 e0 ldi r24, 0x00 ; 0 12c16: 90 e0 ldi r25, 0x00 ; 0 12c18: a8 ec ldi r26, 0xC8 ; 200 12c1a: b2 e4 ldi r27, 0x42 ; 66 12c1c: f7 01 movw r30, r14 12c1e: 34 97 sbiw r30, 0x04 ; 4 12c20: 80 83 st Z, r24 12c22: 91 83 std Z+1, r25 ; 0x01 12c24: a2 83 std Z+2, r26 ; 0x02 12c26: b3 83 std Z+3, r27 ; 0x03 if (cs.max_acceleration_mm_per_s2_normal[j] > NORMAL_MAX_ACCEL_XY) 12c28: f8 01 movw r30, r16 12c2a: 84 a1 ldd r24, Z+36 ; 0x24 12c2c: 95 a1 ldd r25, Z+37 ; 0x25 12c2e: a6 a1 ldd r26, Z+38 ; 0x26 12c30: b7 a1 ldd r27, Z+39 ; 0x27 12c32: 85 3c cpi r24, 0xC5 ; 197 12c34: 99 40 sbci r25, 0x09 ; 9 12c36: a1 05 cpc r26, r1 12c38: b1 05 cpc r27, r1 12c3a: 28 f0 brcs .+10 ; 0x12c46 cs.max_acceleration_mm_per_s2_normal[j] = NORMAL_MAX_ACCEL_XY; 12c3c: f8 01 movw r30, r16 12c3e: 84 a2 std Z+36, r8 ; 0x24 12c40: 95 a2 std Z+37, r9 ; 0x25 12c42: a6 a2 std Z+38, r10 ; 0x26 12c44: b7 a2 std Z+39, r11 ; 0x27 if (cs.max_acceleration_mm_per_s2_silent[j] > SILENT_MAX_ACCEL_XY) 12c46: f7 01 movw r30, r14 12c48: 84 85 ldd r24, Z+12 ; 0x0c 12c4a: 95 85 ldd r25, Z+13 ; 0x0d 12c4c: a6 85 ldd r26, Z+14 ; 0x0e 12c4e: b7 85 ldd r27, Z+15 ; 0x0f 12c50: 81 3c cpi r24, 0xC1 ; 193 12c52: 93 40 sbci r25, 0x03 ; 3 12c54: a1 05 cpc r26, r1 12c56: b1 05 cpc r27, r1 12c58: 28 f0 brcs .+10 ; 0x12c64 cs.max_acceleration_mm_per_s2_silent[j] = SILENT_MAX_ACCEL_XY; 12c5a: f7 01 movw r30, r14 12c5c: 44 86 std Z+12, r4 ; 0x0c 12c5e: 55 86 std Z+13, r5 ; 0x0d 12c60: 66 86 std Z+14, r6 ; 0x0e 12c62: 77 86 std Z+15, r7 ; 0x0f 12c64: 0c 5f subi r16, 0xFC ; 252 12c66: 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++) 12c68: f6 e0 ldi r31, 0x06 ; 6 12c6a: 06 37 cpi r16, 0x76 ; 118 12c6c: 1f 07 cpc r17, r31 12c6e: 09 f0 breq .+2 ; 0x12c72 12c70: ad cf rjmp .-166 ; 0x12bcc 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]); 12c72: 60 91 2a 07 lds r22, 0x072A ; 0x80072a 12c76: 70 e0 ldi r23, 0x00 ; 0 12c78: 80 e0 ldi r24, 0x00 ; 0 12c7a: 0f 94 b5 3a call 0x2756a ; 0x2756a tmc2130_set_res(Y_AXIS, cs.axis_ustep_resolution[Y_AXIS]); 12c7e: 60 91 2b 07 lds r22, 0x072B ; 0x80072b 12c82: 70 e0 ldi r23, 0x00 ; 0 12c84: 81 e0 ldi r24, 0x01 ; 1 12c86: 0f 94 b5 3a call 0x2756a ; 0x2756a tmc2130_set_res(Z_AXIS, cs.axis_ustep_resolution[Z_AXIS]); 12c8a: 60 91 2c 07 lds r22, 0x072C ; 0x80072c 12c8e: 70 e0 ldi r23, 0x00 ; 0 12c90: 82 e0 ldi r24, 0x02 ; 2 12c92: 0f 94 b5 3a call 0x2756a ; 0x2756a tmc2130_set_res(E_AXIS, cs.axis_ustep_resolution[E_AXIS]); 12c96: 60 91 2d 07 lds r22, 0x072D ; 0x80072d 12c9a: 70 e0 ldi r23, 0x00 ; 0 12c9c: 83 e0 ldi r24, 0x03 ; 3 12c9e: 0f 94 b5 3a call 0x2756a ; 0x2756a #endif //TMC2130 reset_acceleration_rates(); 12ca2: 0f 94 85 aa call 0x3550a ; 0x3550a // Call updatePID (similar to when we have processed M301) updatePID(); 12ca6: 0f 94 17 51 call 0x2a22e ; 0x2a22e } 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; 12caa: ce 01 movw r24, r28 12cac: 01 96 adiw r24, 0x01 ; 1 12cae: 0f 94 de 47 call 0x28fbc ; 0x28fbc // 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)); 12cb2: 44 e3 ldi r20, 0x34 ; 52 12cb4: 50 e8 ldi r21, 0x80 ; 128 12cb6: 67 eb ldi r22, 0xB7 ; 183 12cb8: 7a eb ldi r23, 0xBA ; 186 12cba: 82 ea ldi r24, 0xA2 ; 162 12cbc: 9c e0 ldi r25, 0x0C ; 12 12cbe: 0e 94 dc 64 call 0xc9b8 ; 0xc9b8 eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_V, THERMAL_MODEL_DEF(V)); 12cc2: 46 e6 ldi r20, 0x66 ; 102 12cc4: 56 e6 ldi r21, 0x66 ; 102 12cc6: 66 e8 ldi r22, 0x86 ; 134 12cc8: 7f e3 ldi r23, 0x3F ; 63 12cca: 8e e9 ldi r24, 0x9E ; 158 12ccc: 9c e0 ldi r25, 0x0C ; 12 12cce: 0e 94 dc 64 call 0xc9b8 ; 0xc9b8 eeprom_init_default_float((float*)EEPROM_THERMAL_MODEL_D, THERMAL_MODEL_DEF(fS)); 12cd2: 4a e9 ldi r20, 0x9A ; 154 12cd4: 59 e9 ldi r21, 0x99 ; 153 12cd6: 69 e1 ldi r22, 0x19 ; 25 12cd8: 7e e3 ldi r23, 0x3E ; 62 12cda: 8a e9 ldi r24, 0x9A ; 154 12cdc: 9c e0 ldi r25, 0x0C ; 12 12cde: 0e 94 dc 64 call 0xc9b8 ; 0xc9b8 eeprom_init_default_word((uint16_t*)EEPROM_THERMAL_MODEL_L, THERMAL_MODEL_DEF(LAG)); 12ce2: 6e e0 ldi r22, 0x0E ; 14 12ce4: 71 e0 ldi r23, 0x01 ; 1 12ce6: 88 e9 ldi r24, 0x98 ; 152 12ce8: 9c e0 ldi r25, 0x0C ; 12 12cea: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_byte((uint8_t*)EEPROM_THERMAL_MODEL_VER, THERMAL_MODEL_DEF(VER)); 12cee: 61 e0 ldi r22, 0x01 ; 1 12cf0: 87 e9 ldi r24, 0x97 ; 151 12cf2: 9c e0 ldi r25, 0x0C ; 12 12cf4: 0e 94 94 77 call 0xef28 ; 0xef28 thermal_model::enabled = eeprom_read_byte((uint8_t*)EEPROM_THERMAL_MODEL_ENABLE); 12cf8: 82 e0 ldi r24, 0x02 ; 2 12cfa: 9d e0 ldi r25, 0x0D ; 13 12cfc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 12d00: 91 e0 ldi r25, 0x01 ; 1 12d02: 81 11 cpse r24, r1 12d04: 01 c0 rjmp .+2 ; 0x12d08 12d06: 90 e0 ldi r25, 0x00 ; 0 12d08: 90 93 20 05 sts 0x0520, r25 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> thermal_model::data.P = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_P); 12d0c: 8e ef ldi r24, 0xFE ; 254 12d0e: 9c e0 ldi r25, 0x0C ; 12 12d10: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12d14: 60 93 b8 12 sts 0x12B8, r22 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 12d18: 70 93 b9 12 sts 0x12B9, r23 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 12d1c: 80 93 ba 12 sts 0x12BA, r24 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 12d20: 90 93 bb 12 sts 0x12BB, r25 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> thermal_model::data.U = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_U); 12d24: 82 ea ldi r24, 0xA2 ; 162 12d26: 9c e0 ldi r25, 0x0C ; 12 12d28: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12d2c: 60 93 bc 12 sts 0x12BC, r22 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 12d30: 70 93 bd 12 sts 0x12BD, r23 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 12d34: 80 93 be 12 sts 0x12BE, r24 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 12d38: 90 93 bf 12 sts 0x12BF, r25 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> thermal_model::data.V = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_V); 12d3c: 8e e9 ldi r24, 0x9E ; 158 12d3e: 9c e0 ldi r25, 0x0C ; 12 12d40: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12d44: 60 93 c0 12 sts 0x12C0, r22 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 12d48: 70 93 c1 12 sts 0x12C1, r23 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 12d4c: 80 93 c2 12 sts 0x12C2, r24 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 12d50: 90 93 c3 12 sts 0x12C3, r25 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> thermal_model::data.C = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_C); 12d54: 8a ef ldi r24, 0xFA ; 250 12d56: 9c e0 ldi r25, 0x0C ; 12 12d58: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12d5c: 60 93 c4 12 sts 0x12C4, r22 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 12d60: 70 93 c5 12 sts 0x12C5, r23 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 12d64: 80 93 c6 12 sts 0x12C6, r24 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 12d68: 90 93 c7 12 sts 0x12C7, r25 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> thermal_model::data.fS = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_D); 12d6c: 8a e9 ldi r24, 0x9A ; 154 12d6e: 9c e0 ldi r25, 0x0C ; 12 12d70: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12d74: 60 93 c8 12 sts 0x12C8, r22 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 12d78: 70 93 c9 12 sts 0x12C9, r23 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 12d7c: 80 93 ca 12 sts 0x12CA, r24 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 12d80: 90 93 cb 12 sts 0x12CB, r25 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> thermal_model_set_lag(eeprom_read_word((uint16_t*)EEPROM_THERMAL_MODEL_L)); 12d84: 88 e9 ldi r24, 0x98 ; 152 12d86: 9c e0 ldi r25, 0x0C ; 12 12d88: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 12d8c: 0f 94 c1 44 call 0x28982 ; 0x28982 eeprom_read_block(&thermal_model::data.R[0], (float*)EEPROM_THERMAL_MODEL_R, THERMAL_MODEL_R_SIZE * sizeof(float)); 12d90: 40 e4 ldi r20, 0x40 ; 64 12d92: 50 e0 ldi r21, 0x00 ; 0 12d94: 6a eb ldi r22, 0xBA ; 186 12d96: 7c e0 ldi r23, 0x0C ; 12 12d98: 8e ec ldi r24, 0xCE ; 206 12d9a: 92 e1 ldi r25, 0x12 ; 18 12d9c: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 thermal_model::data.Ta_corr = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_Ta_corr); 12da0: 86 eb ldi r24, 0xB6 ; 182 12da2: 9c e0 ldi r25, 0x0C ; 12 12da4: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12da8: 60 93 0e 13 sts 0x130E, r22 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 12dac: 70 93 0f 13 sts 0x130F, r23 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 12db0: 80 93 10 13 sts 0x1310, r24 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 12db4: 90 93 11 13 sts 0x1311, r25 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> thermal_model::data.warn = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_W); 12db8: 82 eb ldi r24, 0xB2 ; 178 12dba: 9c e0 ldi r25, 0x0C ; 12 12dbc: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12dc0: 60 93 12 13 sts 0x1312, r22 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 12dc4: 70 93 13 13 sts 0x1313, r23 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 12dc8: 80 93 14 13 sts 0x1314, r24 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 12dcc: 90 93 15 13 sts 0x1315, r25 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::data.err = eeprom_read_float((float*)EEPROM_THERMAL_MODEL_E); 12dd0: 8e ea ldi r24, 0xAE ; 174 12dd2: 9c e0 ldi r25, 0x0C ; 12 12dd4: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 12dd8: 60 93 16 13 sts 0x1316, r22 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 12ddc: 70 93 17 13 sts 0x1317, r23 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 12de0: 80 93 18 13 sts 0x1318, r24 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 12de4: 90 93 19 13 sts 0x1319, r25 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> if(!thermal_model::calibrated()) { 12de8: 0f 94 e0 44 call 0x289c0 ; 0x289c0 12dec: 81 11 cpse r24, r1 12dee: 06 c0 rjmp .+12 ; 0x12dfc SERIAL_ECHOLNPGM("TM: stored calibration invalid, resetting"); 12df0: 89 e5 ldi r24, 0x59 ; 89 12df2: 98 e7 ldi r25, 0x78 ; 120 12df4: 0e 94 06 7b call 0xf60c ; 0xf60c thermal_model_reset_settings(); 12df8: 0f 94 ec 47 call 0x28fd8 ; 0x28fd8 } thermal_model::setup(); 12dfc: 0f 94 48 45 call 0x28a90 ; 0x28a90 } 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; 12e00: ce 01 movw r24, r28 12e02: 01 96 adiw r24, 0x01 ; 1 12e04: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 12e08: 82 ef ldi r24, 0xF2 ; 242 12e0a: 99 ea ldi r25, 0xA9 ; 169 12e0c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM("Stored settings retrieved"); 12e10: 83 e8 ldi r24, 0x83 ; 131 12e12: 98 e7 ldi r25, 0x78 ; 120 12e14: 0e 94 06 7b call 0xf60c ; 0xf60c 12e18: 81 e0 ldi r24, 0x01 ; 1 if (eeprom_is_initialized_block(EEPROM_M500_base->version, sizeof(EEPROM_M500_base->version))) { return false; } } return true; } 12e1a: 0f 90 pop r0 12e1c: df 91 pop r29 12e1e: cf 91 pop r28 12e20: 1f 91 pop r17 12e22: 0f 91 pop r16 12e24: ff 90 pop r15 12e26: ef 90 pop r14 12e28: bf 90 pop r11 12e2a: af 90 pop r10 12e2c: 9f 90 pop r9 12e2e: 8f 90 pop r8 12e30: 7f 90 pop r7 12e32: 6f 90 pop r6 12e34: 5f 90 pop r5 12e36: 4f 90 pop r4 12e38: 08 95 ret SERIAL_ECHO_START; SERIAL_ECHOLNPGM("Stored settings retrieved"); } else { Config_ResetDefault(); 12e3a: 0e 94 b7 83 call 0x1076e ; 0x1076e //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))) { 12e3e: 64 e0 ldi r22, 0x04 ; 4 12e40: 70 e0 ldi r23, 0x00 ; 0 12e42: 84 e1 ldi r24, 0x14 ; 20 12e44: 90 e0 ldi r25, 0x00 ; 0 12e46: 0e 94 61 5c call 0xb8c2 ; 0xb8c2 12e4a: 91 e0 ldi r25, 0x01 ; 1 12e4c: 89 27 eor r24, r25 12e4e: e5 cf rjmp .-54 ; 0x12e1a 00012e50 : 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() 12e50: 2f 92 push r2 12e52: 3f 92 push r3 12e54: 4f 92 push r4 12e56: 5f 92 push r5 12e58: 6f 92 push r6 12e5a: 7f 92 push r7 12e5c: 8f 92 push r8 12e5e: 9f 92 push r9 12e60: af 92 push r10 12e62: bf 92 push r11 12e64: cf 92 push r12 12e66: df 92 push r13 12e68: ef 92 push r14 12e6a: ff 92 push r15 12e6c: 0f 93 push r16 12e6e: 1f 93 push r17 12e70: cf 93 push r28 12e72: df 93 push r29 12e74: cd b7 in r28, 0x3d ; 61 12e76: de b7 in r29, 0x3e ; 62 12e78: cf 58 subi r28, 0x8F ; 143 12e7a: d1 09 sbc r29, r1 12e7c: 0f b6 in r0, 0x3f ; 63 12e7e: f8 94 cli 12e80: de bf out 0x3e, r29 ; 62 12e82: 0f be out 0x3f, r0 ; 63 12e84: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 12e86: 82 e0 ldi r24, 0x02 ; 2 12e88: 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) 12e8c: a0 90 70 12 lds r10, 0x1270 ; 0x801270 12e90: b0 90 71 12 lds r11, 0x1271 ; 0x801271 12e94: 85 01 movw r16, r10 12e96: 0a 57 subi r16, 0x7A ; 122 12e98: 1f 4e sbci r17, 0xEF ; 239 12e9a: 46 e0 ldi r20, 0x06 ; 6 12e9c: 50 e0 ldi r21, 0x00 ; 0 12e9e: 67 ec ldi r22, 0xC7 ; 199 12ea0: 79 e8 ldi r23, 0x89 ; 137 12ea2: c8 01 movw r24, r16 12ea4: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 12ea8: 89 2b or r24, r25 12eaa: 09 f0 breq .+2 ; 0x12eae 12eac: b8 c0 rjmp .+368 ; 0x1301e { // ### CRASH_DETECTED - TMC2130 // --------------------------------- if(code_seen_P(PSTR("CRASH_DETECTED"))) 12eae: 88 eb ldi r24, 0xB8 ; 184 12eb0: 99 e8 ldi r25, 0x89 ; 137 12eb2: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 12eb6: 88 23 and r24, r24 12eb8: 09 f4 brne .+2 ; 0x12ebc 12eba: 91 c0 rjmp .+290 ; 0x12fde { uint8_t mask = 0; if (code_seen('X')) mask |= X_AXIS_MASK; 12ebc: 88 e5 ldi r24, 0x58 ; 88 12ebe: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 12ec2: 18 2f mov r17, r24 if (code_seen('Y')) mask |= Y_AXIS_MASK; 12ec4: 89 e5 ldi r24, 0x59 ; 89 12ec6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 12eca: 81 11 cpse r24, r1 12ecc: 12 60 ori r17, 0x02 ; 2 strcpy_P(buf, _T(MSG_CRASH_DETECTED)); } void crashdet_detected(uint8_t mask) { st_synchronize(); 12ece: 0f 94 2c 59 call 0x2b258 ; 0x2b258 static uint8_t crashDet_counter = 0; static uint8_t crashDet_axes = 0; bool automatic_recovery_after_crash = true; char msg[LCD_WIDTH+1] = ""; 12ed2: 1a 82 std Y+2, r1 ; 0x02 12ed4: 19 82 std Y+1, r1 ; 0x01 12ed6: fe 01 movw r30, r28 12ed8: 33 96 adiw r30, 0x03 ; 3 12eda: 83 e1 ldi r24, 0x13 ; 19 12edc: df 01 movw r26, r30 12ede: 1d 92 st X+, r1 12ee0: 8a 95 dec r24 12ee2: e9 f7 brne .-6 ; 0x12ede if (crashDetTimer.expired(CRASHDET_TIMER * 1000ul)) { 12ee4: 48 ec ldi r20, 0xC8 ; 200 12ee6: 5f ea ldi r21, 0xAF ; 175 12ee8: 60 e0 ldi r22, 0x00 ; 0 12eea: 70 e0 ldi r23, 0x00 ; 0 12eec: 87 e7 ldi r24, 0x77 ; 119 12eee: 93 e0 ldi r25, 0x03 ; 3 12ef0: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 12ef4: 81 11 cpse r24, r1 crashDet_counter = 0; 12ef6: 10 92 76 03 sts 0x0376, r1 ; 0x800376 } if(++crashDet_counter >= CRASHDET_COUNTER_MAX) { 12efa: 00 91 76 03 lds r16, 0x0376 ; 0x800376 12efe: 0f 5f subi r16, 0xFF ; 255 12f00: 00 93 76 03 sts 0x0376, r16 ; 0x800376 automatic_recovery_after_crash = false; } crashDetTimer.start(); 12f04: 87 e7 ldi r24, 0x77 ; 119 12f06: 93 e0 ldi r25, 0x03 ; 3 12f08: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> crashDet_axes |= mask; 12f0c: 80 91 75 03 lds r24, 0x0375 ; 0x800375 12f10: 81 2b or r24, r17 12f12: 80 93 75 03 sts 0x0375, r24 ; 0x800375 if (mask & X_AXIS_MASK) { 12f16: 10 ff sbrs r17, 0 12f18: 08 c0 rjmp .+16 ; 0x12f2a eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 12f1a: 86 e6 ldi r24, 0x66 ; 102 12f1c: 9f e0 ldi r25, 0x0F ; 15 12f1e: 0e 94 b3 77 call 0xef66 ; 0xef66 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT); 12f22: 85 e0 ldi r24, 0x05 ; 5 12f24: 9f e0 ldi r25, 0x0F ; 15 12f26: 0e 94 a6 77 call 0xef4c ; 0xef4c } if (mask & Y_AXIS_MASK) { 12f2a: 11 ff sbrs r17, 1 12f2c: 08 c0 rjmp .+16 ; 0x12f3e eeprom_increment_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 12f2e: 88 e6 ldi r24, 0x68 ; 104 12f30: 9f e0 ldi r25, 0x0F ; 15 12f32: 0e 94 b3 77 call 0xef66 ; 0xef66 eeprom_increment_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT); 12f36: 83 e0 ldi r24, 0x03 ; 3 12f38: 9f e0 ldi r25, 0x0F ; 15 12f3a: 0e 94 a6 77 call 0xef4c ; 0xef4c } lcd_update_enable(true); 12f3e: 81 e0 ldi r24, 0x01 ; 1 12f40: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_update(2); 12f44: 82 e0 ldi r24, 0x02 ; 2 12f46: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 // prepare the status message with the _current_ axes status crashdet_fmt_error(msg, mask); 12f4a: 61 2f mov r22, r17 12f4c: ce 01 movw r24, r28 12f4e: 01 96 adiw r24, 0x01 ; 1 12f50: 0e 94 be 74 call 0xe97c ; 0xe97c lcd_setstatus(msg); 12f54: ce 01 movw r24, r28 12f56: 01 96 adiw r24, 0x01 ; 1 12f58: 0f 94 56 15 call 0x22aac ; 0x22aac gcode_G28(true, true, false); //home X and Y 12f5c: 40 e0 ldi r20, 0x00 ; 0 12f5e: 61 e0 ldi r22, 0x01 ; 1 12f60: 81 e0 ldi r24, 0x01 ; 1 12f62: 0e 94 90 80 call 0x10120 ; 0x10120 if (automatic_recovery_after_crash) { enquecommand_P(PSTR("CRASH_RECOVER")); 12f66: 61 e0 ldi r22, 0x01 ; 1 12f68: 84 e4 ldi r24, 0x44 ; 68 12f6a: 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) { 12f6c: 03 30 cpi r16, 0x03 ; 3 12f6e: 60 f1 brcs .+88 ; 0x12fc8 12f70: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 12f74: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d enquecommand_P(PSTR("CRASH_RECOVER")); }else{ setTargetHotend(0); // notify the user of *all* the axes previously affected, not just the last one lcd_update_enable(false); 12f78: 80 e0 ldi r24, 0x00 ; 0 12f7a: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); 12f7e: 0e 94 c8 6f call 0xdf90 ; 0xdf90 crashdet_fmt_error(msg, crashDet_axes); 12f82: 60 91 75 03 lds r22, 0x0375 ; 0x800375 12f86: ce 01 movw r24, r28 12f88: 01 96 adiw r24, 0x01 ; 1 12f8a: 0e 94 be 74 call 0xe97c ; 0xe97c crashDet_axes = 0; 12f8e: 10 92 75 03 sts 0x0375, r1 ; 0x800375 lcd_print(msg); 12f92: ce 01 movw r24, r28 12f94: 01 96 adiw r24, 0x01 ; 1 12f96: 0e 94 9c 71 call 0xe338 ; 0xe338 // ask whether to resume printing lcd_puts_at_P(0, 1, _T(MSG_RESUME_PRINT)); 12f9a: 81 e2 ldi r24, 0x21 ; 33 12f9c: 9c e3 ldi r25, 0x3C ; 60 12f9e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 12fa2: ac 01 movw r20, r24 12fa4: 61 e0 ldi r22, 0x01 ; 1 12fa6: 80 e0 ldi r24, 0x00 ; 0 12fa8: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_putc('?'); 12fac: 8f e3 ldi r24, 0x3F ; 63 12fae: 0e 94 84 6f call 0xdf08 ; 0xdf08 //! @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); 12fb2: 40 e0 ldi r20, 0x00 ; 0 12fb4: 60 e0 ldi r22, 0x00 ; 0 12fb6: 90 e0 ldi r25, 0x00 ; 0 12fb8: 80 e0 ldi r24, 0x00 ; 0 12fba: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 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")); 12fbe: 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) 12fc0: 81 11 cpse r24, r1 12fc2: 0a c0 rjmp .+20 ; 0x12fd8 { enquecommand_P(PSTR("CRASH_RECOVER")); 12fc4: 86 e3 ldi r24, 0x36 ; 54 12fc6: 96 e8 ldi r25, 0x86 ; 134 } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12fc8: 0e 94 4b 89 call 0x11296 ; 0x11296 SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 12fcc: 81 e0 ldi r24, 0x01 ; 1 12fce: 80 93 96 02 sts 0x0296, r24 ; 0x800296 ClearToSend(); 12fd2: 0e 94 b5 80 call 0x1016a ; 0x1016a 12fd6: 5e c3 rjmp .+1724 ; 0x13694 { enquecommand_P(PSTR("CRASH_RECOVER")); } else // LCD_MIDDLE_BUTTON_CHOICE { enquecommand_P(PSTR("CRASH_CANCEL")); 12fd8: 89 e2 ldi r24, 0x29 ; 41 12fda: 96 e8 ldi r25, 0x86 ; 134 12fdc: f5 cf rjmp .-22 ; 0x12fc8 crashdet_detected(mask); } // ### CRASH_RECOVER - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_RECOVER"))) 12fde: 8a ea ldi r24, 0xAA ; 170 12fe0: 99 e8 ldi r25, 0x89 ; 137 12fe2: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 12fe6: 88 23 and r24, r24 12fe8: 69 f0 breq .+26 ; 0x13004 } } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); 12fea: 0e 94 3a 68 call 0xd074 ; 0xd074 12fee: 81 11 cpse r24, r1 12ff0: 06 c0 rjmp .+12 ; 0x12ffe 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 12ff2: 60 e0 ldi r22, 0x00 ; 0 12ff4: 70 e0 ldi r23, 0x00 ; 0 12ff6: 80 e8 ldi r24, 0x80 ; 128 12ff8: 9f e3 ldi r25, 0x3F ; 63 12ffa: 0e 94 f9 68 call 0xd1f2 ; 0xd1f2 } void crashdet_recover() { if (!printingIsPaused()) crashdet_restore_print_and_continue(); crashdet_use_eeprom_setting(); 12ffe: 0f 94 10 3c call 0x27820 ; 0x27820 13002: e4 cf rjmp .-56 ; 0x12fcc else if(code_seen_P(PSTR("CRASH_RECOVER"))) crashdet_recover(); // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) 13004: 8d e9 ldi r24, 0x9D ; 157 13006: 99 e8 ldi r25, 0x89 ; 137 13008: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 1300c: 88 23 and r24, r24 1300e: f1 f2 breq .-68 ; 0x12fcc } /// Crash detection cancels the print void crashdet_cancel() { // Restore crash detection crashdet_use_eeprom_setting(); 13010: 0f 94 10 3c call 0x27820 ; 0x27820 // Abort the print print_stop(); 13014: 60 e0 ldi r22, 0x00 ; 0 13016: 80 e0 ldi r24, 0x00 ; 0 13018: 0f 94 17 16 call 0x22c2e ; 0x22c2e 1301c: d7 cf rjmp .-82 ; 0x12fcc // ### CRASH_CANCEL - TMC2130 // ---------------------------------- else if(code_seen_P(PSTR("CRASH_CANCEL"))) crashdet_cancel(); } else if (strncmp_P(CMDBUFFER_CURRENT_STRING, PSTR("TMC_"), 4) == 0) 1301e: 44 e0 ldi r20, 0x04 ; 4 13020: 50 e0 ldi r21, 0x00 ; 0 13022: 68 e9 ldi r22, 0x98 ; 152 13024: 79 e8 ldi r23, 0x89 ; 137 13026: c8 01 movw r24, r16 13028: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 1302c: 89 2b or r24, r25 1302e: 09 f0 breq .+2 ; 0x13032 13030: fc c0 rjmp .+504 ; 0x1322a { // ### TMC_SET_WAVE_ // -------------------- if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_WAVE_"), 9) == 0) 13032: 85 01 movw r16, r10 13034: 06 57 subi r16, 0x76 ; 118 13036: 1f 4e sbci r17, 0xEF ; 239 13038: 49 e0 ldi r20, 0x09 ; 9 1303a: 50 e0 ldi r21, 0x00 ; 0 1303c: 6e e8 ldi r22, 0x8E ; 142 1303e: 79 e8 ldi r23, 0x89 ; 137 13040: c8 01 movw r24, r16 13042: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 13046: 89 2b or r24, r25 13048: c9 f4 brne .+50 ; 0x1307c { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1304a: f5 01 movw r30, r10 1304c: ed 56 subi r30, 0x6D ; 109 1304e: ff 4e sbci r31, 0xEF ; 239 13050: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13052: 15 34 cpi r17, 0x45 ; 69 13054: 89 f0 breq .+34 ; 0x13078 13056: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 13058: 14 30 cpi r17, 0x04 ; 4 1305a: 08 f0 brcs .+2 ; 0x1305e 1305c: b7 cf rjmp .-146 ; 0x12fcc { uint8_t fac = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 1305e: 4a e0 ldi r20, 0x0A ; 10 13060: 50 e0 ldi r21, 0x00 ; 0 13062: 70 e0 ldi r23, 0x00 ; 0 13064: 60 e0 ldi r22, 0x00 ; 0 13066: c5 01 movw r24, r10 13068: 8c 56 subi r24, 0x6C ; 108 1306a: 9f 4e sbci r25, 0xEF ; 239 1306c: 0f 94 1c d9 call 0x3b238 ; 0x3b238 tmc2130_set_wave(axis, 247, fac); 13070: 81 2f mov r24, r17 13072: 0f 94 5e 88 call 0x310bc ; 0x310bc 13076: aa cf rjmp .-172 ; 0x12fcc // ### 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'); 13078: 13 e0 ldi r17, 0x03 ; 3 1307a: f1 cf rjmp .-30 ; 0x1305e } } // ### TMC_SET_STEP_ // ------------------ else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_STEP_"), 9) == 0) 1307c: 49 e0 ldi r20, 0x09 ; 9 1307e: 50 e0 ldi r21, 0x00 ; 0 13080: 64 e8 ldi r22, 0x84 ; 132 13082: 79 e8 ldi r23, 0x89 ; 137 13084: c8 01 movw r24, r16 13086: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 1308a: 89 2b or r24, r25 1308c: 51 f5 brne .+84 ; 0x130e2 { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 1308e: f5 01 movw r30, r10 13090: ed 56 subi r30, 0x6D ; 109 13092: ff 4e sbci r31, 0xEF ; 239 13094: 10 81 ld r17, Z axis = (axis == 'E')?3:(axis - 'X'); 13096: 15 34 cpi r17, 0x45 ; 69 13098: 11 f1 breq .+68 ; 0x130de 1309a: 18 55 subi r17, 0x58 ; 88 if (axis < 4) 1309c: 14 30 cpi r17, 0x04 ; 4 1309e: 08 f0 brcs .+2 ; 0x130a2 130a0: 95 cf rjmp .-214 ; 0x12fcc { uint8_t step = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, NULL, 10); 130a2: 4a e0 ldi r20, 0x0A ; 10 130a4: 50 e0 ldi r21, 0x00 ; 0 130a6: 70 e0 ldi r23, 0x00 ; 0 130a8: 60 e0 ldi r22, 0x00 ; 0 130aa: c5 01 movw r24, r10 130ac: 8c 56 subi r24, 0x6C ; 108 130ae: 9f 4e sbci r25, 0xEF ; 239 130b0: 0f 94 1c d9 call 0x3b238 ; 0x3b238 130b4: e1 2f mov r30, r17 130b6: f0 e0 ldi r31, 0x00 ; 0 130b8: e8 50 subi r30, 0x08 ; 8 130ba: fb 4f sbci r31, 0xFB ; 251 130bc: 80 81 ld r24, Z 130be: 40 e0 ldi r20, 0x00 ; 0 130c0: 51 e0 ldi r21, 0x01 ; 1 130c2: 02 c0 rjmp .+4 ; 0x130c8 130c4: 56 95 lsr r21 130c6: 47 95 ror r20 130c8: 8a 95 dec r24 130ca: e2 f7 brpl .-8 ; 0x130c4 uint16_t res = tmc2130_get_res(axis); tmc2130_goto_step(axis, step & (4*res - 1), 2, 1000, res); 130cc: 84 2f mov r24, r20 130ce: 88 0f add r24, r24 130d0: 88 0f add r24, r24 130d2: 81 50 subi r24, 0x01 ; 1 130d4: 68 23 and r22, r24 130d6: 81 2f mov r24, r17 130d8: 0f 94 75 8b call 0x316ea ; 0x316ea 130dc: 77 cf rjmp .-274 ; 0x12fcc // ### 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'); 130de: 13 e0 ldi r17, 0x03 ; 3 130e0: e0 cf rjmp .-64 ; 0x130a2 } } // ### TMC_SET_CHOP_ // ------------------- else if (strncmp_P(CMDBUFFER_CURRENT_STRING + 4, PSTR("SET_CHOP_"), 9) == 0) 130e2: 49 e0 ldi r20, 0x09 ; 9 130e4: 50 e0 ldi r21, 0x00 ; 0 130e6: 6a e7 ldi r22, 0x7A ; 122 130e8: 79 e8 ldi r23, 0x89 ; 137 130ea: c8 01 movw r24, r16 130ec: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 130f0: 89 2b or r24, r25 130f2: 09 f0 breq .+2 ; 0x130f6 130f4: 6b cf rjmp .-298 ; 0x12fcc { uint8_t axis = *(CMDBUFFER_CURRENT_STRING + 13); 130f6: f5 01 movw r30, r10 130f8: ed 56 subi r30, 0x6D ; 109 130fa: ff 4e sbci r31, 0xEF ; 239 130fc: 80 81 ld r24, Z axis = (axis == 'E')?3:(axis - 'X'); 130fe: 85 34 cpi r24, 0x45 ; 69 13100: 09 f4 brne .+2 ; 0x13104 13102: 90 c0 rjmp .+288 ; 0x13224 13104: 18 ea ldi r17, 0xA8 ; 168 13106: c1 2e mov r12, r17 13108: c8 0e add r12, r24 if (axis < 4) 1310a: b3 e0 ldi r27, 0x03 ; 3 1310c: bc 15 cp r27, r12 1310e: 08 f4 brcc .+2 ; 0x13112 13110: 5d cf rjmp .-326 ; 0x12fcc { uint8_t chop0 = tmc2130_chopper_config[axis].toff; 13112: ec 2c mov r14, r12 13114: f1 2c mov r15, r1 13116: 47 01 movw r8, r14 13118: 88 0c add r8, r8 1311a: 99 1c adc r9, r9 1311c: f4 01 movw r30, r8 1311e: e3 58 subi r30, 0x83 ; 131 13120: fd 4f sbci r31, 0xFD ; 253 13122: 00 81 ld r16, Z 13124: 20 2f mov r18, r16 13126: 2f 70 andi r18, 0x0F ; 15 uint8_t chop1 = tmc2130_chopper_config[axis].hstr; 13128: 10 2f mov r17, r16 1312a: 12 95 swap r17 1312c: 17 70 andi r17, 0x07 ; 7 uint8_t chop2 = tmc2130_chopper_config[axis].hend; 1312e: 00 1f adc r16, r16 13130: 00 27 eor r16, r16 13132: 00 1f adc r16, r16 13134: 61 81 ldd r22, Z+1 ; 0x01 13136: 67 70 andi r22, 0x07 ; 7 13138: 66 0f add r22, r22 1313a: 06 2b or r16, r22 uint8_t chop3 = tmc2130_chopper_config[axis].tbl; 1313c: f4 01 movw r30, r8 1313e: e2 58 subi r30, 0x82 ; 130 13140: fd 4f sbci r31, 0xFD ; 253 13142: d0 80 ld r13, Z 13144: d6 94 lsr r13 13146: d6 94 lsr r13 13148: d6 94 lsr r13 1314a: ed 2d mov r30, r13 1314c: e3 70 andi r30, 0x03 ; 3 1314e: de 2e mov r13, r30 char* str_end = 0; 13150: 1a 82 std Y+2, r1 ; 0x02 13152: 19 82 std Y+1, r1 ; 0x01 if (CMDBUFFER_CURRENT_STRING[14]) 13154: c5 01 movw r24, r10 13156: 8c 56 subi r24, 0x6C ; 108 13158: 9f 4e sbci r25, 0xEF ; 239 1315a: dc 01 movw r26, r24 1315c: 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; 1315e: 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]) 13160: 33 23 and r19, r19 13162: e1 f1 breq .+120 ; 0x131dc { chop0 = (uint8_t)strtol(CMDBUFFER_CURRENT_STRING + 14, &str_end, 10) & 15; 13164: 4a e0 ldi r20, 0x0A ; 10 13166: 50 e0 ldi r21, 0x00 ; 0 13168: be 01 movw r22, r28 1316a: 6f 5f subi r22, 0xFF ; 255 1316c: 7f 4f sbci r23, 0xFF ; 255 1316e: 0f 94 1c d9 call 0x3b238 ; 0x3b238 13172: 6f 70 andi r22, 0x0F ; 15 13174: b6 2e mov r11, r22 if (str_end && *str_end) 13176: 89 81 ldd r24, Y+1 ; 0x01 13178: 9a 81 ldd r25, Y+2 ; 0x02 1317a: 00 97 sbiw r24, 0x00 ; 0 1317c: 79 f1 breq .+94 ; 0x131dc 1317e: fc 01 movw r30, r24 13180: 20 81 ld r18, Z 13182: 22 23 and r18, r18 13184: 59 f1 breq .+86 ; 0x131dc { chop1 = (uint8_t)strtol(str_end, &str_end, 10) & 7; 13186: 4a e0 ldi r20, 0x0A ; 10 13188: 50 e0 ldi r21, 0x00 ; 0 1318a: be 01 movw r22, r28 1318c: 6f 5f subi r22, 0xFF ; 255 1318e: 7f 4f sbci r23, 0xFF ; 255 13190: 0f 94 1c d9 call 0x3b238 ; 0x3b238 13194: 16 2f mov r17, r22 13196: 17 70 andi r17, 0x07 ; 7 if (str_end && *str_end) 13198: 89 81 ldd r24, Y+1 ; 0x01 1319a: 9a 81 ldd r25, Y+2 ; 0x02 1319c: 00 97 sbiw r24, 0x00 ; 0 1319e: f1 f0 breq .+60 ; 0x131dc 131a0: dc 01 movw r26, r24 131a2: 2c 91 ld r18, X 131a4: 22 23 and r18, r18 131a6: d1 f0 breq .+52 ; 0x131dc { chop2 = (uint8_t)strtol(str_end, &str_end, 10) & 15; 131a8: 4a e0 ldi r20, 0x0A ; 10 131aa: 50 e0 ldi r21, 0x00 ; 0 131ac: be 01 movw r22, r28 131ae: 6f 5f subi r22, 0xFF ; 255 131b0: 7f 4f sbci r23, 0xFF ; 255 131b2: 0f 94 1c d9 call 0x3b238 ; 0x3b238 131b6: 06 2f mov r16, r22 131b8: 0f 70 andi r16, 0x0F ; 15 if (str_end && *str_end) 131ba: 89 81 ldd r24, Y+1 ; 0x01 131bc: 9a 81 ldd r25, Y+2 ; 0x02 131be: 00 97 sbiw r24, 0x00 ; 0 131c0: 69 f0 breq .+26 ; 0x131dc 131c2: fc 01 movw r30, r24 131c4: 20 81 ld r18, Z 131c6: 22 23 and r18, r18 131c8: 49 f0 breq .+18 ; 0x131dc chop3 = (uint8_t)strtol(str_end, &str_end, 10) & 3; 131ca: 4a e0 ldi r20, 0x0A ; 10 131cc: 50 e0 ldi r21, 0x00 ; 0 131ce: be 01 movw r22, r28 131d0: 6f 5f subi r22, 0xFF ; 255 131d2: 7f 4f sbci r23, 0xFF ; 255 131d4: 0f 94 1c d9 call 0x3b238 ; 0x3b238 131d8: 63 70 andi r22, 0x03 ; 3 131da: d6 2e mov r13, r22 } } } tmc2130_chopper_config[axis].toff = chop0; 131dc: f4 01 movw r30, r8 131de: e3 58 subi r30, 0x83 ; 131 131e0: fd 4f sbci r31, 0xFD ; 253 tmc2130_chopper_config[axis].hstr = chop1 & 7; 131e2: 17 70 andi r17, 0x07 ; 7 131e4: 12 95 swap r17 131e6: 10 7f andi r17, 0xF0 ; 240 tmc2130_chopper_config[axis].hend = chop2 & 15; 131e8: 60 2f mov r22, r16 131ea: 67 95 ror r22 131ec: 66 27 eor r22, r22 131ee: 67 95 ror r22 131f0: 1b 29 or r17, r11 131f2: 16 2b or r17, r22 131f4: 10 83 st Z, r17 131f6: 60 2f mov r22, r16 131f8: 66 95 lsr r22 131fa: 01 81 ldd r16, Z+1 ; 0x01 131fc: 00 7e andi r16, 0xE0 ; 224 tmc2130_chopper_config[axis].tbl = chop3 & 3; 131fe: 2d 2d mov r18, r13 13200: 23 70 andi r18, 0x03 ; 3 13202: d2 2e mov r13, r18 13204: dd 0c add r13, r13 13206: dd 0c add r13, r13 13208: dd 0c add r13, r13 1320a: 06 2b or r16, r22 1320c: d0 2a or r13, r16 1320e: d1 82 std Z+1, r13 ; 0x01 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 13210: f7 01 movw r30, r14 13212: e8 50 subi r30, 0x08 ; 8 13214: fb 4f sbci r31, 0xFB ; 251 13216: 50 e0 ldi r21, 0x00 ; 0 13218: 40 e0 ldi r20, 0x00 ; 0 1321a: 60 81 ld r22, Z 1321c: 8c 2d mov r24, r12 1321e: 0f 94 4a 3a call 0x27494 ; 0x27494 13222: d4 ce rjmp .-600 ; 0x12fcc // ### 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'); 13224: b3 e0 ldi r27, 0x03 ; 3 13226: cb 2e mov r12, r27 13228: 74 cf rjmp .-280 ; 0x13112 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) { 1322a: 45 e0 ldi r20, 0x05 ; 5 1322c: 50 e0 ldi r21, 0x00 ; 0 1322e: 64 e7 ldi r22, 0x74 ; 116 13230: 79 e8 ldi r23, 0x89 ; 137 13232: c8 01 movw r24, r16 13234: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 13238: 89 2b or r24, r25 1323a: 09 f0 breq .+2 ; 0x1323e 1323c: 64 c1 rjmp .+712 ; 0x13506 - `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"))) { 1323e: 8a e6 ldi r24, 0x6A ; 106 13240: 99 e8 ldi r25, 0x89 ; 137 13242: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 13246: 88 23 and r24, r24 13248: 09 f4 brne .+2 ; 0x1324c 1324a: 3c c0 rjmp .+120 ; 0x132c4 //! 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 1324c: 10 92 36 05 sts 0x0536, r1 ; 0x800536 13250: 14 e6 ldi r17, 0x64 ; 100 unsigned long tach1max = 0; 13252: c1 2c mov r12, r1 13254: d1 2c mov r13, r1 13256: 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); 13258: 6f 9a sbi 0x0d, 7 ; 13 WRITE(TACH_1, LOW); 1325a: 77 98 cbi 0x0e, 7 ; 14 _delay(20); // the delay may be lower 1325c: 64 e1 ldi r22, 0x14 ; 20 1325e: 70 e0 ldi r23, 0x00 ; 0 13260: 80 e0 ldi r24, 0x00 ; 0 13262: 90 e0 ldi r25, 0x00 ; 0 13264: 0f 94 92 3d call 0x27b24 ; 0x27b24 unsigned long tachMeasure = _micros(); 13268: 0f 94 6c 3d call 0x27ad8 ; 0x27ad8 1326c: 4b 01 movw r8, r22 1326e: 5c 01 movw r10, r24 cli(); 13270: f8 94 cli SET_INPUT(TACH_1); 13272: 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 ) ; 13274: 67 9b sbis 0x0c, 7 ; 12 13276: fe cf rjmp .-4 ; 0x13274 sei(); 13278: 78 94 sei tachMeasure = _micros() - tachMeasure; 1327a: 0f 94 6c 3d call 0x27ad8 ; 0x27ad8 1327e: dc 01 movw r26, r24 13280: cb 01 movw r24, r22 13282: 88 19 sub r24, r8 13284: 99 09 sbc r25, r9 13286: aa 09 sbc r26, r10 13288: bb 09 sbc r27, r11 1328a: c8 16 cp r12, r24 1328c: d9 06 cpc r13, r25 1328e: ea 06 cpc r14, r26 13290: fb 06 cpc r15, r27 13292: 10 f4 brcc .+4 ; 0x13298 13294: 6c 01 movw r12, r24 13296: 7d 01 movw r14, r26 13298: 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){ 1329a: f1 f6 brne .-68 ; 0x13258 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 "); 1329c: 8e e1 ldi r24, 0x1E ; 30 1329e: 96 e8 ldi r25, 0x86 ; 134 132a0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if( tach1max > 500 ){ // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); 132a4: 8a e1 ldi r24, 0x1A ; 26 132a6: 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 ){ 132a8: 35 ef ldi r19, 0xF5 ; 245 132aa: c3 16 cp r12, r19 132ac: 31 e0 ldi r19, 0x01 ; 1 132ae: d3 06 cpc r13, r19 132b0: e1 04 cpc r14, r1 132b2: f1 04 cpc r15, r1 132b4: 10 f4 brcc .+4 ; 0x132ba // bad RAMBo SERIAL_PROTOCOLLNPGM("BAD"); } else { SERIAL_PROTOCOLLNPGM("OK"); 132b6: 87 e1 ldi r24, 0x17 ; 23 132b8: 96 e8 ldi r25, 0x86 ; 134 132ba: 0e 94 06 7b call 0xf60c ; 0xf60c } // cleanup after the test function SET_INPUT(TACH_1); 132be: 6f 98 cbi 0x0d, 7 ; 13 WRITE(TACH_1, HIGH); 132c0: 77 9a sbi 0x0e, 7 ; 14 132c2: 84 ce rjmp .-760 ; 0x12fcc */ if (farm_prusa_code_seen()) {} else if(code_seen_P(PSTR("FANPINTST"))) { gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 132c4: 86 e6 ldi r24, 0x66 ; 102 132c6: 99 e8 ldi r25, 0x89 ; 137 132c8: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 132cc: 88 23 and r24, r24 132ce: 21 f1 breq .+72 ; 0x13318 printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 132d0: 40 91 b3 04 lds r20, 0x04B3 ; 0x8004b3 132d4: 50 91 b4 04 lds r21, 0x04B4 ; 0x8004b4 132d8: 2c e3 ldi r18, 0x3C ; 60 132da: 24 9f mul r18, r20 132dc: c0 01 movw r24, r0 132de: 25 9f mul r18, r21 132e0: 90 0d add r25, r0 132e2: 11 24 eor r1, r1 132e4: 9f 93 push r25 132e6: 8f 93 push r24 132e8: 40 91 b1 04 lds r20, 0x04B1 ; 0x8004b1 132ec: 50 91 b2 04 lds r21, 0x04B2 ; 0x8004b2 132f0: 24 9f mul r18, r20 132f2: c0 01 movw r24, r0 132f4: 25 9f mul r18, r21 132f6: 90 0d add r25, r0 132f8: 11 24 eor r1, r1 132fa: 9f 93 push r25 132fc: 8f 93 push r24 132fe: 88 ec ldi r24, 0xC8 ; 200 13300: 9a e6 ldi r25, 0x6A ; 106 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 13302: 9f 93 push r25 13304: 8f 93 push r24 13306: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1330a: 0f 90 pop r0 1330c: 0f 90 pop r0 1330e: 0f 90 pop r0 13310: 0f 90 pop r0 13312: 0f 90 pop r0 13314: 0f 90 pop r0 13316: 5a ce rjmp .-844 ; 0x12fcc 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 13318: 81 e6 ldi r24, 0x61 ; 97 1331a: 99 e8 ldi r25, 0x89 ; 137 1331c: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 13320: 88 23 and r24, r24 13322: 11 f1 breq .+68 ; 0x13368 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 13324: 8c e8 ldi r24, 0x8C ; 140 13326: 9f e0 ldi r25, 0x0F ; 15 13328: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1332c: 81 11 cpse r24, r1 1332e: 10 c0 rjmp .+32 ; 0x13350 // M24 - Start SD print enquecommand_P(MSG_M24); 13330: 61 e0 ldi r22, 0x01 ; 1 13332: 89 ee ldi r24, 0xE9 ; 233 13334: 90 e7 ldi r25, 0x70 ; 112 13336: 0e 94 4b 89 call 0x11296 ; 0x11296 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1333a: 60 e0 ldi r22, 0x00 ; 0 1333c: 85 ea ldi r24, 0xA5 ; 165 1333e: 9f e0 ldi r25, 0x0F ; 15 13340: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 13344: 60 e0 ldi r22, 0x00 ; 0 13346: 8f e7 ldi r24, 0x7F ; 127 13348: 9c e0 ldi r25, 0x0C ; 12 1334a: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 1334e: 3e ce rjmp .-900 ; 0x12fcc // 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) { 13350: 81 30 cpi r24, 0x01 ; 1 13352: 09 f0 breq .+2 ; 0x13356 13354: 3b ce rjmp .-906 ; 0x12fcc // 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(); 13356: 0f 94 d1 58 call 0x2b1a2 ; 0x2b1a2 usb_timer.start(); 1335a: 81 e1 ldi r24, 0x11 ; 17 1335c: 95 e0 ldi r25, 0x05 ; 5 1335e: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::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(); 13362: 0f 94 97 3f call 0x27f2e ; 0x27f2e 13366: 32 ce rjmp .-924 ; 0x12fcc } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 13368: 8a e5 ldi r24, 0x5A ; 90 1336a: 99 e8 ldi r25, 0x89 ; 137 1336c: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 13370: 88 23 and r24, r24 13372: 21 f0 breq .+8 ; 0x1337c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 13374: 80 e0 ldi r24, 0x00 ; 0 13376: 0f 94 bc 1d call 0x23b78 ; 0x23b78 1337a: 28 ce rjmp .-944 ; 0x12fcc MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 1337c: 84 e5 ldi r24, 0x54 ; 84 1337e: 99 e8 ldi r25, 0x89 ; 137 13380: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 13384: 88 23 and r24, r24 13386: 51 f0 breq .+20 ; 0x1339c #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; 13388: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e3> 1338c: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e4> 13390: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e5> 13394: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e6> #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 13398: 0e 94 01 68 call 0xd002 ; 0xd002 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 1339c: 81 e5 ldi r24, 0x51 ; 81 1339e: 99 e8 ldi r25, 0x89 ; 137 133a0: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 133a4: 88 23 and r24, r24 133a6: a9 f0 breq .+42 ; 0x133d2 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 133a8: 44 e1 ldi r20, 0x14 ; 20 133aa: 50 e0 ldi r21, 0x00 ; 0 133ac: 65 e1 ldi r22, 0x15 ; 21 133ae: 7d e0 ldi r23, 0x0D ; 13 133b0: ce 01 movw r24, r28 133b2: 01 96 adiw r24, 0x01 ; 1 133b4: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 if (SN[19]) 133b8: 8c 89 ldd r24, Y+20 ; 0x14 133ba: 88 23 and r24, r24 133bc: 29 f0 breq .+10 ; 0x133c8 puts_P(PSTR("SN invalid")); 133be: 86 e4 ldi r24, 0x46 ; 70 133c0: 99 e8 ldi r25, 0x89 ; 137 133c2: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 133c6: 02 ce rjmp .-1020 ; 0x12fcc else puts(SN); 133c8: ce 01 movw r24, r28 133ca: 01 96 adiw r24, 0x01 ; 1 133cc: 0f 94 20 e4 call 0x3c840 ; 0x3c840 133d0: fd cd rjmp .-1030 ; 0x12fcc } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 133d2: 82 e4 ldi r24, 0x42 ; 66 133d4: 99 e8 ldi r25, 0x89 ; 137 133d6: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 133da: 88 23 and r24, r24 133dc: 29 f0 breq .+10 ; 0x133e8 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 133de: 86 e3 ldi r24, 0x36 ; 54 133e0: 99 e8 ldi r25, 0x89 ; 137 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 133e2: 0e 94 06 7b call 0xf60c ; 0xf60c 133e6: f2 cd rjmp .-1052 ; 0x12fcc 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 133e8: 82 e3 ldi r24, 0x32 ; 50 133ea: 99 e8 ldi r25, 0x89 ; 137 133ec: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 133f0: 88 23 and r24, r24 133f2: 19 f0 breq .+6 ; 0x133fa SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 133f4: 8d e0 ldi r24, 0x0D ; 13 133f6: 99 e8 ldi r25, 0x89 ; 137 133f8: f4 cf rjmp .-24 ; 0x133e2 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 133fa: 88 e0 ldi r24, 0x08 ; 8 133fc: 99 e8 ldi r25, 0x89 ; 137 133fe: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 13402: 88 23 and r24, r24 13404: 19 f0 breq .+6 ; 0x1340c lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 13406: 0e 94 e1 71 call 0xe3c2 ; 0xe3c2 1340a: e0 cd rjmp .-1088 ; 0x12fcc 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 1340c: 85 e0 ldi r24, 0x05 ; 5 1340e: 99 e8 ldi r25, 0x89 ; 137 13410: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 13414: 88 23 and r24, r24 13416: 79 f0 breq .+30 ; 0x13436 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 13418: 81 ea ldi r24, 0xA1 ; 161 1341a: 9d e0 ldi r25, 0x0D ; 13 1341c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 13420: 4b e0 ldi r20, 0x0B ; 11 13422: 84 9f mul r24, r20 13424: c0 01 movw r24, r0 13426: 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); 13428: 70 e0 ldi r23, 0x00 ; 0 1342a: 60 e0 ldi r22, 0x00 ; 0 1342c: 80 5b subi r24, 0xB0 ; 176 1342e: 92 4f sbci r25, 0xF2 ; 242 13430: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 13434: cb cd rjmp .-1130 ; 0x12fcc } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 13436: 82 e0 ldi r24, 0x02 ; 2 13438: 99 e8 ldi r25, 0x89 ; 137 1343a: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 1343e: 88 23 and r24, r24 13440: 51 f0 breq .+20 ; 0x13456 // 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(); 13442: 0e 94 c8 6f call 0xdf90 ; 0xdf90 Sound_MakeCustom(100,0,false); 13446: 40 e0 ldi r20, 0x00 ; 0 13448: 70 e0 ldi r23, 0x00 ; 0 1344a: 60 e0 ldi r22, 0x00 ; 0 1344c: 84 e6 ldi r24, 0x64 ; 100 1344e: 90 e0 ldi r25, 0x00 ; 0 13450: 0f 94 a1 6a call 0x2d542 ; 0x2d542 13454: d8 cf rjmp .-80 ; 0x13406 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 13456: 8e ef ldi r24, 0xFE ; 254 13458: 98 e8 ldi r25, 0x88 ; 136 1345a: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 1345e: 88 23 and r24, r24 13460: e1 f0 breq .+56 ; 0x1349a // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 13462: 86 e5 ldi r24, 0x56 ; 86 13464: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 13468: 88 23 and r24, r24 1346a: 09 f4 brne .+2 ; 0x1346e 1346c: af cd rjmp .-1186 ; 0x12fcc bool value = code_value_short(); 1346e: 0e 94 1b 5c call 0xb836 ; 0xb836 13472: 11 e0 ldi r17, 0x01 ; 1 13474: 89 2b or r24, r25 13476: 09 f4 brne .+2 ; 0x1347a 13478: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 1347a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 if(value != mbl.active) { 1347e: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 13482: 90 e0 ldi r25, 0x00 ; 0 13484: 18 17 cp r17, r24 13486: 19 06 cpc r1, r25 13488: 09 f4 brne .+2 ; 0x1348c 1348a: a0 cd rjmp .-1216 ; 0x12fcc mbl.active = value; 1348c: 10 93 a0 13 sts 0x13A0, r17 ; 0x8013a0 // Use plan_set_z_position to reset the physical values plan_set_z_position(current_position[Z_AXIS]); 13490: 8b e4 ldi r24, 0x4B ; 75 13492: 97 e0 ldi r25, 0x07 ; 7 13494: 0f 94 17 ab call 0x3562e ; 0x3562e 13498: 99 cd rjmp .-1230 ; 0x12fcc } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 1349a: 87 ef ldi r24, 0xF7 ; 247 1349c: 98 e8 ldi r25, 0x88 ; 136 1349e: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 134a2: 88 23 and r24, r24 134a4: 09 f4 brne .+2 ; 0x134a8 134a6: 92 cd rjmp .-1244 ; 0x12fcc uint16_t nDiameter; if(code_seen('D')) { 134a8: 84 e4 ldi r24, 0x44 ; 68 134aa: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 134ae: 88 23 and r24, r24 134b0: a1 f0 breq .+40 ; 0x134da nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 134b2: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 134b6: 20 e0 ldi r18, 0x00 ; 0 134b8: 30 e0 ldi r19, 0x00 ; 0 134ba: 4a e7 ldi r20, 0x7A ; 122 134bc: 54 e4 ldi r21, 0x44 ; 68 134be: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 134c2: 20 e0 ldi r18, 0x00 ; 0 134c4: 30 e0 ldi r19, 0x00 ; 0 134c6: 40 e0 ldi r20, 0x00 ; 0 134c8: 5f e3 ldi r21, 0x3F ; 63 134ca: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 134ce: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> nozzle_diameter_check(nDiameter); 134d2: cb 01 movw r24, r22 134d4: 0f 94 ad 16 call 0x22d5a ; 0x22d5a 134d8: 79 cd rjmp .-1294 ; 0x12fcc } else if(code_seen_P(PSTR("set")) && farm_mode) { 134da: 83 ef ldi r24, 0xF3 ; 243 134dc: 98 e8 ldi r25, 0x88 ; 136 134de: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 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); 134e2: 85 ea ldi r24, 0xA5 ; 165 134e4: 9d e0 ldi r25, 0x0D ; 13 134e6: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 134ea: bc 01 movw r22, r24 134ec: 90 e0 ldi r25, 0x00 ; 0 134ee: 80 e0 ldi r24, 0x00 ; 0 134f0: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 134f4: 20 e0 ldi r18, 0x00 ; 0 134f6: 30 e0 ldi r19, 0x00 ; 0 134f8: 4a e7 ldi r20, 0x7A ; 122 134fa: 54 e4 ldi r21, 0x44 ; 68 134fc: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13500: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 13504: 63 cd rjmp .-1338 ; 0x12fcc } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 13506: d8 01 movw r26, r16 13508: 8c 91 ld r24, X 1350a: 87 34 cpi r24, 0x47 ; 71 1350c: 11 f0 breq .+4 ; 0x13512 1350e: 0c 94 1e a6 jmp 0x14c3c ; 0x14c3c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 13512: 10 93 98 03 sts 0x0398, r17 ; 0x800398 13516: 00 93 97 03 sts 0x0397, r16 ; 0x800397 gcode_in_progress = code_value_short(); 1351a: 0e 94 1b 5c call 0xb836 ; 0xb836 1351e: 90 93 96 03 sts 0x0396, r25 ; 0x800396 13522: 80 93 95 03 sts 0x0395, r24 ; 0x800395 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 13526: 8e 31 cpi r24, 0x1E ; 30 13528: 91 05 cpc r25, r1 1352a: 09 f4 brne .+2 ; 0x1352e 1352c: da c6 rjmp .+3508 ; 0x142e2 1352e: 0c f0 brlt .+2 ; 0x13532 13530: 45 c1 rjmp .+650 ; 0x137bc 13532: 84 30 cpi r24, 0x04 ; 4 13534: 91 05 cpc r25, r1 13536: 09 f4 brne .+2 ; 0x1353a 13538: 7e c6 rjmp .+3324 ; 0x14236 1353a: 0c f0 brlt .+2 ; 0x1353e 1353c: c5 c0 rjmp .+394 ; 0x136c8 1353e: 97 fd sbrc r25, 7 13540: cb c0 rjmp .+406 ; 0x136d8 13542: 02 97 sbiw r24, 0x02 ; 2 13544: 0c f0 brlt .+2 ; 0x13548 13546: fc c1 rjmp .+1016 ; 0x13940 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 13548: 0e 94 19 5b call 0xb632 ; 0xb632 1354c: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 1354e: 0e 94 79 62 call 0xc4f2 ; 0xc4f2 if (total_filament_used > ((current_position[E_AXIS] - destination[E_AXIS]) * 100)) { //protection against total_filament_used overflow 13552: 60 91 62 06 lds r22, 0x0662 ; 0x800662 13556: 70 91 63 06 lds r23, 0x0663 ; 0x800663 1355a: 80 91 64 06 lds r24, 0x0664 ; 0x800664 1355e: 90 91 65 06 lds r25, 0x0665 ; 0x800665 13562: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 13566: 6b 01 movw r12, r22 13568: 7c 01 movw r14, r24 1356a: 40 90 4f 07 lds r4, 0x074F ; 0x80074f 1356e: 50 90 50 07 lds r5, 0x0750 ; 0x800750 13572: 60 90 51 07 lds r6, 0x0751 ; 0x800751 13576: 70 90 52 07 lds r7, 0x0752 ; 0x800752 1357a: 80 90 60 05 lds r8, 0x0560 ; 0x800560 1357e: 90 90 61 05 lds r9, 0x0561 ; 0x800561 13582: a0 90 62 05 lds r10, 0x0562 ; 0x800562 13586: b0 90 63 05 lds r11, 0x0563 ; 0x800563 1358a: a5 01 movw r20, r10 1358c: 94 01 movw r18, r8 1358e: c3 01 movw r24, r6 13590: b2 01 movw r22, r4 13592: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13596: 20 e0 ldi r18, 0x00 ; 0 13598: 30 e0 ldi r19, 0x00 ; 0 1359a: 48 ec ldi r20, 0xC8 ; 200 1359c: 52 e4 ldi r21, 0x42 ; 66 1359e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 135a2: 9b 01 movw r18, r22 135a4: ac 01 movw r20, r24 135a6: c7 01 movw r24, r14 135a8: b6 01 movw r22, r12 135aa: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 135ae: 18 16 cp r1, r24 135b0: d4 f4 brge .+52 ; 0x135e6 total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 135b2: a3 01 movw r20, r6 135b4: 92 01 movw r18, r4 135b6: c5 01 movw r24, r10 135b8: b4 01 movw r22, r8 135ba: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 135be: 20 e0 ldi r18, 0x00 ; 0 135c0: 30 e0 ldi r19, 0x00 ; 0 135c2: 48 ec ldi r20, 0xC8 ; 200 135c4: 52 e4 ldi r21, 0x42 ; 66 135c6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 135ca: a7 01 movw r20, r14 135cc: 96 01 movw r18, r12 135ce: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 135d2: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 135d6: 60 93 62 06 sts 0x0662, r22 ; 0x800662 135da: 70 93 63 06 sts 0x0663, r23 ; 0x800663 135de: 80 93 64 06 sts 0x0664, r24 ; 0x800664 135e2: 90 93 65 06 sts 0x0665, r25 ; 0x800665 } #ifdef FWRETRACT if(cs.autoretract_enabled) { 135e6: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 135ea: 88 23 and r24, r24 135ec: 09 f4 brne .+2 ; 0x135f0 135ee: a4 c1 rjmp .+840 ; 0x13938 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 135f0: 88 e5 ldi r24, 0x58 ; 88 135f2: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 135f6: 81 11 cpse r24, r1 135f8: 9f c1 rjmp .+830 ; 0x13938 135fa: 89 e5 ldi r24, 0x59 ; 89 135fc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 13600: 81 11 cpse r24, r1 13602: 9a c1 rjmp .+820 ; 0x13938 13604: 8a e5 ldi r24, 0x5A ; 90 13606: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1360a: 81 11 cpse r24, r1 1360c: 95 c1 rjmp .+810 ; 0x13938 1360e: 85 e4 ldi r24, 0x45 ; 69 13610: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 13614: 88 23 and r24, r24 13616: 09 f4 brne .+2 ; 0x1361a 13618: 8f c1 rjmp .+798 ; 0x13938 float echange=destination[E_AXIS]-current_position[E_AXIS]; 1361a: 20 91 4f 07 lds r18, 0x074F ; 0x80074f 1361e: 30 91 50 07 lds r19, 0x0750 ; 0x800750 13622: 40 91 51 07 lds r20, 0x0751 ; 0x800751 13626: 50 91 52 07 lds r21, 0x0752 ; 0x800752 1362a: 60 91 60 05 lds r22, 0x0560 ; 0x800560 1362e: 70 91 61 05 lds r23, 0x0561 ; 0x800561 13632: 80 91 62 05 lds r24, 0x0562 ; 0x800562 13636: 90 91 63 05 lds r25, 0x0563 ; 0x800563 1363a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1363e: 6b 01 movw r12, r22 13640: 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 13642: 2d ec ldi r18, 0xCD ; 205 13644: 3c ec ldi r19, 0xCC ; 204 13646: 4c ec ldi r20, 0xCC ; 204 13648: 5d eb ldi r21, 0xBD ; 189 1364a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1364e: 87 ff sbrs r24, 7 13650: 65 c1 rjmp .+714 ; 0x1391c 13652: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 13656: 81 11 cpse r24, r1 13658: 0c 94 28 cf jmp 0x19e50 ; 0x19e50 st_synchronize(); 1365c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 13660: 80 91 60 05 lds r24, 0x0560 ; 0x800560 13664: 90 91 61 05 lds r25, 0x0561 ; 0x800561 13668: a0 91 62 05 lds r26, 0x0562 ; 0x800562 1366c: b0 91 63 05 lds r27, 0x0563 ; 0x800563 13670: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 13674: 90 93 50 07 sts 0x0750, r25 ; 0x800750 13678: a0 93 51 07 sts 0x0751, r26 ; 0x800751 1367c: b0 93 52 07 sts 0x0752, r27 ; 0x800752 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 13680: 8f e4 ldi r24, 0x4F ; 79 13682: 97 e0 ldi r25, 0x07 ; 7 13684: 0f 94 e4 aa call 0x355c8 ; 0x355c8 retract(!retracted[active_extruder]); 13688: 90 91 3f 07 lds r25, 0x073F ; 0x80073f 1368c: 81 e0 ldi r24, 0x01 ; 1 1368e: 89 27 eor r24, r25 13690: 0f 94 fa 89 call 0x313f4 ; 0x313f4 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 13694: c1 57 subi r28, 0x71 ; 113 13696: df 4f sbci r29, 0xFF ; 255 13698: 0f b6 in r0, 0x3f ; 63 1369a: f8 94 cli 1369c: de bf out 0x3e, r29 ; 62 1369e: 0f be out 0x3f, r0 ; 63 136a0: cd bf out 0x3d, r28 ; 61 136a2: df 91 pop r29 136a4: cf 91 pop r28 136a6: 1f 91 pop r17 136a8: 0f 91 pop r16 136aa: ff 90 pop r15 136ac: ef 90 pop r14 136ae: df 90 pop r13 136b0: cf 90 pop r12 136b2: bf 90 pop r11 136b4: af 90 pop r10 136b6: 9f 90 pop r9 136b8: 8f 90 pop r8 136ba: 7f 90 pop r7 136bc: 6f 90 pop r6 136be: 5f 90 pop r5 136c0: 4f 90 pop r4 136c2: 3f 90 pop r3 136c4: 2f 90 pop r2 136c6: 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) 136c8: 8b 30 cpi r24, 0x0B ; 11 136ca: 91 05 cpc r25, r1 136cc: 09 f4 brne .+2 ; 0x136d0 136ce: 00 c6 rjmp .+3072 ; 0x142d0 136d0: dc f4 brge .+54 ; 0x13708 136d2: 0a 97 sbiw r24, 0x0a ; 10 136d4: 09 f4 brne .+2 ; 0x136d8 136d6: f8 c5 rjmp .+3056 ; 0x142c8 case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 136d8: 80 91 70 12 lds r24, 0x1270 ; 0x801270 136dc: 90 91 71 12 lds r25, 0x1271 ; 0x801271 136e0: 8a 57 subi r24, 0x7A ; 122 136e2: 9f 4e sbci r25, 0xEF ; 239 136e4: 9f 93 push r25 136e6: 8f 93 push r24 136e8: 1f 92 push r1 136ea: 87 e4 ldi r24, 0x47 ; 71 136ec: 8f 93 push r24 136ee: 8a ee ldi r24, 0xEA ; 234 136f0: 99 e6 ldi r25, 0x69 ; 105 136f2: 9f 93 push r25 136f4: 8f 93 push r24 136f6: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 136fa: 0f 90 pop r0 136fc: 0f 90 pop r0 136fe: 0f 90 pop r0 13700: 0f 90 pop r0 13702: 0f 90 pop r0 13704: 0f 90 pop r0 13706: a5 c0 rjmp .+330 ; 0x13852 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) 13708: 85 31 cpi r24, 0x15 ; 21 1370a: 91 05 cpc r25, r1 1370c: 09 f4 brne .+2 ; 0x13710 1370e: a1 c0 rjmp .+322 ; 0x13852 13710: 4c 97 sbiw r24, 0x1c ; 28 13712: 11 f7 brne .-60 ; 0x136d8 { 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]); 13714: 88 e5 ldi r24, 0x58 ; 88 13716: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1371a: 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; 1371c: 41 2c mov r4, r1 1371e: 51 2c mov r5, r1 13720: 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(); 13722: 88 23 and r24, r24 13724: 21 f0 breq .+8 ; 0x1372e 13726: 0e 94 28 5c call 0xb850 ; 0xb850 1372a: 2b 01 movw r4, r22 1372c: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 1372e: 89 e5 ldi r24, 0x59 ; 89 13730: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 13734: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 13736: 88 23 and r24, r24 13738: 09 f4 brne .+2 ; 0x1373c 1373a: cc c5 rjmp .+2968 ; 0x142d4 1373c: 0e 94 28 5c call 0xb850 ; 0xb850 13740: 6e 96 adiw r28, 0x1e ; 30 13742: 6c af std Y+60, r22 ; 0x3c 13744: 7d af std Y+61, r23 ; 0x3d 13746: 8e af std Y+62, r24 ; 0x3e 13748: 9f af std Y+63, r25 ; 0x3f 1374a: 6e 97 sbiw r28, 0x1e ; 30 bool home_z = code_seen(axis_codes[Z_AXIS]); 1374c: 8a e5 ldi r24, 0x5A ; 90 1374e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 13752: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 13754: 81 2c mov r8, r1 13756: 91 2c mov r9, r1 13758: 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(); 1375a: 88 23 and r24, r24 1375c: 21 f0 breq .+8 ; 0x13766 1375e: 0e 94 28 5c call 0xb850 ; 0xb850 13762: 4b 01 movw r8, r22 13764: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 13766: 87 e5 ldi r24, 0x57 ; 87 13768: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1376c: 67 96 adiw r28, 0x17 ; 23 1376e: 8f af std Y+63, r24 ; 0x3f 13770: 67 97 sbiw r28, 0x17 ; 23 // calibrate? #ifdef TMC2130 bool calib = code_seen('C'); 13772: 83 e4 ldi r24, 0x43 ; 67 13774: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 gcode_G28(home_x, home_x_value, home_y, home_y_value, home_z, home_z_value, calib, without_mbl); 13778: 67 96 adiw r28, 0x17 ; 23 1377a: ff ad ldd r31, Y+63 ; 0x3f 1377c: 67 97 sbiw r28, 0x17 ; 23 1377e: ff 93 push r31 13780: 8f 93 push r24 13782: cd 2c mov r12, r13 13784: 6e 96 adiw r28, 0x1e ; 30 13786: ec ac ldd r14, Y+60 ; 0x3c 13788: fd ac ldd r15, Y+61 ; 0x3d 1378a: 0e ad ldd r16, Y+62 ; 0x3e 1378c: 1f ad ldd r17, Y+63 ; 0x3f 1378e: 6e 97 sbiw r28, 0x1e ; 30 13790: 22 2d mov r18, r2 13792: b3 01 movw r22, r6 13794: a2 01 movw r20, r4 13796: 83 2d mov r24, r3 13798: 0e 94 b2 7e call 0xfd64 ; 0xfd64 #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) { 1379c: 0f 90 pop r0 1379e: 0f 90 pop r0 137a0: 31 10 cpse r3, r1 137a2: 57 c0 rjmp .+174 ; 0x13852 137a4: 21 10 cpse r2, r1 137a6: 55 c0 rjmp .+170 ; 0x13852 137a8: 67 96 adiw r28, 0x17 ; 23 137aa: 2f ad ldd r18, Y+63 ; 0x3f 137ac: 67 97 sbiw r28, 0x17 ; 23 137ae: 21 11 cpse r18, r1 137b0: 50 c0 rjmp .+160 ; 0x13852 137b2: d1 10 cpse r13, r1 137b4: 4e c0 rjmp .+156 ; 0x13852 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 137b6: 0e 94 a1 8f call 0x11f42 ; 0x11f42 137ba: 4b c0 rjmp .+150 ; 0x13852 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) 137bc: 86 35 cpi r24, 0x56 ; 86 137be: 91 05 cpc r25, r1 137c0: 11 f4 brne .+4 ; 0x137c6 137c2: 0c 94 cd a5 jmp 0x14b9a ; 0x14b9a 137c6: b4 f5 brge .+108 ; 0x13834 137c8: 8c 34 cpi r24, 0x4C ; 76 137ca: 91 05 cpc r25, r1 137cc: 09 f4 brne .+2 ; 0x137d0 137ce: df c5 rjmp .+3006 ; 0x1438e 137d0: 3c f5 brge .+78 ; 0x13820 137d2: 08 e2 ldi r16, 0x28 ; 40 137d4: 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)); 137d6: 2a e9 ldi r18, 0x9A ; 154 137d8: e2 2e mov r14, r18 137da: 2a e6 ldi r18, 0x6A ; 106 137dc: 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) 137de: 8b 34 cpi r24, 0x4B ; 75 137e0: 91 05 cpc r25, r1 137e2: 09 f0 breq .+2 ; 0x137e6 137e4: 79 cf rjmp .-270 ; 0x136d8 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)); 137e6: 60 2f mov r22, r16 137e8: 70 e0 ldi r23, 0x00 ; 0 137ea: 90 e0 ldi r25, 0x00 ; 0 137ec: 80 e0 ldi r24, 0x00 ; 0 137ee: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 137f2: 0e 94 3f 5d call 0xba7e ; 0xba7e 137f6: 9f 93 push r25 137f8: 8f 93 push r24 137fa: 7f 93 push r23 137fc: 6f 93 push r22 137fe: 1f 93 push r17 13800: 0f 93 push r16 13802: ff 92 push r15 13804: ef 92 push r14 13806: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1380a: 0f 5f subi r16, 0xFF ; 255 1380c: 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++) 1380e: 0f b6 in r0, 0x3f ; 63 13810: f8 94 cli 13812: de bf out 0x3e, r29 ; 62 13814: 0f be out 0x3f, r0 ; 63 13816: cd bf out 0x3d, r28 ; 61 13818: 0f 36 cpi r16, 0x6F ; 111 1381a: 11 05 cpc r17, r1 1381c: 21 f7 brne .-56 ; 0x137e6 1381e: 19 c0 rjmp .+50 ; 0x13852 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) 13820: 80 35 cpi r24, 0x50 ; 80 13822: 91 05 cpc r25, r1 13824: 41 f2 breq .-112 ; 0x137b6 13826: 81 35 cpi r24, 0x51 ; 81 13828: 91 05 cpc r25, r1 1382a: 09 f0 breq .+2 ; 0x1382e 1382c: 55 cf rjmp .-342 ; 0x136d8 /*! ### 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(); 1382e: 0e 94 e6 80 call 0x101cc ; 0x101cc 13832: 0f c0 rjmp .+30 ; 0x13852 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) 13834: 8a 35 cpi r24, 0x5A ; 90 13836: 91 05 cpc r25, r1 13838: 11 f4 brne .+4 ; 0x1383e 1383a: 0c 94 d7 a5 jmp 0x14bae ; 0x14bae 1383e: 74 f4 brge .+28 ; 0x1385c 13840: 87 35 cpi r24, 0x57 ; 87 13842: 91 05 cpc r25, r1 13844: 11 f4 brne .+4 ; 0x1384a 13846: 0c 94 d2 a5 jmp 0x14ba4 ; 0x14ba4 1384a: 88 35 cpi r24, 0x58 ; 88 1384c: 91 05 cpc r25, r1 1384e: 09 f0 breq .+2 ; 0x13852 13850: 43 cf rjmp .-378 ; 0x136d8 #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; 13852: 10 92 96 03 sts 0x0396, r1 ; 0x800396 13856: 10 92 95 03 sts 0x0395, r1 ; 0x800395 1385a: b8 cb rjmp .-2192 ; 0x12fcc 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) 1385c: 8b 35 cpi r24, 0x5B ; 91 1385e: 91 05 cpc r25, r1 13860: 11 f4 brne .+4 ; 0x13866 13862: 0c 94 de a5 jmp 0x14bbc ; 0x14bbc 13866: 8c 35 cpi r24, 0x5C ; 92 13868: 91 05 cpc r25, r1 1386a: 09 f0 breq .+2 ; 0x1386e 1386c: 35 cf rjmp .-406 ; 0x136d8 1386e: 6d ed ldi r22, 0xDD ; 221 13870: c6 2e mov r12, r22 13872: 62 e0 ldi r22, 0x02 ; 2 13874: d6 2e mov r13, r22 13876: 8e 01 movw r16, r28 13878: 0f 5b subi r16, 0xBF ; 191 1387a: 1f 4f sbci r17, 0xFF ; 255 1387c: 9e 01 movw r18, r28 1387e: 2f 5f subi r18, 0xFF ; 255 13880: 3f 4f sbci r19, 0xFF ; 255 13882: 79 01 movw r14, r18 13884: 71 ee ldi r23, 0xE1 ; 225 13886: 87 2e mov r8, r23 13888: 72 e0 ldi r23, 0x02 ; 2 1388a: 97 2e mov r9, r23 1388c: 58 01 movw r10, r16 1388e: 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]); 13890: d6 01 movw r26, r12 13892: 8d 91 ld r24, X+ 13894: 6d 01 movw r12, r26 13896: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1389a: f5 01 movw r30, r10 1389c: 81 93 st Z+, r24 1389e: 5f 01 movw r10, r30 if(codes[i]) 138a0: 88 23 and r24, r24 138a2: 41 f0 breq .+16 ; 0x138b4 values[i] = code_value(); 138a4: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 138a8: d7 01 movw r26, r14 138aa: 6d 93 st X+, r22 138ac: 7d 93 st X+, r23 138ae: 8d 93 st X+, r24 138b0: 9c 93 st X, r25 138b2: 13 97 sbiw r26, 0x03 ; 3 138b4: b4 e0 ldi r27, 0x04 ; 4 138b6: eb 0e add r14, r27 138b8: 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) 138ba: 8c 14 cp r8, r12 138bc: 9d 04 cpc r9, r13 138be: 41 f7 brne .-48 ; 0x13890 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 138c0: f8 01 movw r30, r16 138c2: d3 80 ldd r13, Z+3 ; 0x03 138c4: dd 20 and r13, r13 138c6: 11 f4 brne .+4 ; 0x138cc 138c8: 0c 94 e2 a5 jmp 0x14bc4 ; 0x14bc4 138cc: 20 e0 ldi r18, 0x00 ; 0 138ce: 30 e0 ldi r19, 0x00 ; 0 138d0: a9 01 movw r20, r18 138d2: 6d 85 ldd r22, Y+13 ; 0x0d 138d4: 7e 85 ldd r23, Y+14 ; 0x0e 138d6: 8f 85 ldd r24, Y+15 ; 0x0f 138d8: 98 89 ldd r25, Y+16 ; 0x10 138da: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 138de: 81 11 cpse r24, r1 138e0: 0c 94 e2 a5 jmp 0x14bc4 ; 0x14bc4 138e4: d8 01 movw r26, r16 138e6: 8c 91 ld r24, X 138e8: 81 11 cpse r24, r1 138ea: 0c 94 e2 a5 jmp 0x14bc4 ; 0x14bc4 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 138ee: 11 96 adiw r26, 0x01 ; 1 138f0: 8c 91 ld r24, X 138f2: 11 97 sbiw r26, 0x01 ; 1 138f4: 81 11 cpse r24, r1 138f6: 0c 94 e2 a5 jmp 0x14bc4 ; 0x14bc4 138fa: 12 96 adiw r26, 0x02 ; 2 138fc: 8c 91 ld r24, X 138fe: 81 11 cpse r24, r1 13900: 0c 94 e2 a5 jmp 0x14bc4 ; 0x14bc4 { // 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; 13904: 10 92 4f 07 sts 0x074F, r1 ; 0x80074f 13908: 10 92 50 07 sts 0x0750, r1 ; 0x800750 1390c: 10 92 51 07 sts 0x0751, r1 ; 0x800751 13910: 10 92 52 07 sts 0x0752, r1 ; 0x800752 st_set_e_position(position[E_AXIS]); } void plan_reset_next_e() { plan_reset_next_e_queue = true; 13914: 81 e0 ldi r24, 0x01 ; 1 13916: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.505> 1391a: 9b cf rjmp .-202 ; 0x13852 #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 1391c: 2d ec ldi r18, 0xCD ; 205 1391e: 3c ec ldi r19, 0xCC ; 204 13920: 4c ec ldi r20, 0xCC ; 204 13922: 5d e3 ldi r21, 0x3D ; 61 13924: c7 01 movw r24, r14 13926: b6 01 movw r22, r12 13928: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1392c: 18 16 cp r1, r24 1392e: 24 f4 brge .+8 ; 0x13938 13930: 80 91 3f 07 lds r24, 0x073F ; 0x80073f 13934: 81 11 cpse r24, r1 13936: 92 ce rjmp .-732 ; 0x1365c } } } #endif //FWRETRACT prepare_move(start_segment_idx); 13938: c8 01 movw r24, r16 1393a: 0e 94 bd 6c call 0xd97a ; 0xd97a 1393e: 89 cf rjmp .-238 ; 0x13852 */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 13940: 0e 94 19 5b call 0xb632 ; 0xb632 13944: e0 96 adiw r28, 0x30 ; 48 13946: 9f af std Y+63, r25 ; 0x3f 13948: 8e af std Y+62, r24 ; 0x3e 1394a: 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 1394c: 0e 94 79 62 call 0xc4f2 ; 0xc4f2 #ifdef SF_ARC_FIX relative_mode=relative_mode_backup; #endif offset[0] = code_seen('I') ? code_value() : 0.f; 13950: 89 e4 ldi r24, 0x49 ; 73 13952: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 13956: 88 23 and r24, r24 13958: 09 f4 brne .+2 ; 0x1395c 1395a: 00 c4 rjmp .+2048 ; 0x1415c 1395c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 13960: 60 93 8d 03 sts 0x038D, r22 ; 0x80038d 13964: 70 93 8e 03 sts 0x038E, r23 ; 0x80038e 13968: 80 93 8f 03 sts 0x038F, r24 ; 0x80038f 1396c: 90 93 90 03 sts 0x0390, r25 ; 0x800390 offset[1] = code_seen('J') ? code_value() : 0.f; 13970: 8a e4 ldi r24, 0x4A ; 74 13972: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 13976: c1 2c mov r12, r1 13978: d1 2c mov r13, r1 1397a: 76 01 movw r14, r12 1397c: 88 23 and r24, r24 1397e: 21 f0 breq .+8 ; 0x13988 13980: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 13984: 6b 01 movw r12, r22 13986: 7c 01 movw r14, r24 13988: c0 92 91 03 sts 0x0391, r12 ; 0x800391 1398c: d0 92 92 03 sts 0x0392, r13 ; 0x800392 13990: e0 92 93 03 sts 0x0393, r14 ; 0x800393 13994: f0 92 94 03 sts 0x0394, r15 ; 0x800394 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 13998: e0 91 95 03 lds r30, 0x0395 ; 0x800395 1399c: f0 91 96 03 lds r31, 0x0396 ; 0x800396 139a0: c2 57 subi r28, 0x72 ; 114 139a2: df 4f sbci r29, 0xFF ; 255 139a4: f9 83 std Y+1, r31 ; 0x01 139a6: e8 83 st Y, r30 139a8: ce 58 subi r28, 0x8E ; 142 139aa: 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 139ac: 80 90 8d 03 lds r8, 0x038D ; 0x80038d 139b0: 90 90 8e 03 lds r9, 0x038E ; 0x80038e 139b4: a0 90 8f 03 lds r10, 0x038F ; 0x80038f 139b8: b0 90 90 03 lds r11, 0x0390 ; 0x800390 139bc: a7 01 movw r20, r14 139be: 96 01 movw r18, r12 139c0: c5 01 movw r24, r10 139c2: b4 01 movw r22, r8 139c4: 0f 94 55 e1 call 0x3c2aa ; 0x3c2aa 139c8: ae 96 adiw r28, 0x2e ; 46 139ca: 6c af std Y+60, r22 ; 0x3c 139cc: 7d af std Y+61, r23 ; 0x3d 139ce: 8e af std Y+62, r24 ; 0x3e 139d0: 9f af std Y+63, r25 ; 0x3f 139d2: 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); 139d4: 60 91 39 02 lds r22, 0x0239 ; 0x800239 139d8: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 139dc: 07 2e mov r0, r23 139de: 00 0c add r0, r0 139e0: 88 0b sbc r24, r24 139e2: 99 0b sbc r25, r25 139e4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 139e8: 20 91 90 02 lds r18, 0x0290 ; 0x800290 139ec: 30 91 91 02 lds r19, 0x0291 ; 0x800291 139f0: 40 91 92 02 lds r20, 0x0292 ; 0x800292 139f4: 50 91 93 02 lds r21, 0x0293 ; 0x800293 139f8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 139fc: 2e e3 ldi r18, 0x3E ; 62 139fe: 33 ec ldi r19, 0xC3 ; 195 13a00: 4e e2 ldi r20, 0x2E ; 46 13a02: 59 e3 ldi r21, 0x39 ; 57 13a04: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13a08: aa 96 adiw r28, 0x2a ; 42 13a0a: 6c af std Y+60, r22 ; 0x3c 13a0c: 7d af std Y+61, r23 ; 0x3d 13a0e: 8e af std Y+62, r24 ; 0x3e 13a10: 9f af std Y+63, r25 ; 0x3f 13a12: 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)); 13a14: 80 e1 ldi r24, 0x10 ; 16 13a16: e3 e4 ldi r30, 0x43 ; 67 13a18: f7 e0 ldi r31, 0x07 ; 7 13a1a: de 01 movw r26, r28 13a1c: 11 96 adiw r26, 0x01 ; 1 13a1e: 01 90 ld r0, Z+ 13a20: 0d 92 st X+, r0 13a22: 8a 95 dec r24 13a24: e1 f7 brne .-8 ; 0x13a1e float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 13a26: a5 01 movw r20, r10 13a28: 94 01 movw r18, r8 13a2a: 50 58 subi r21, 0x80 ; 128 13a2c: 6a 96 adiw r28, 0x1a ; 26 13a2e: 2c af std Y+60, r18 ; 0x3c 13a30: 3d af std Y+61, r19 ; 0x3d 13a32: 4e af std Y+62, r20 ; 0x3e 13a34: 5f af std Y+63, r21 ; 0x3f 13a36: 6a 97 sbiw r28, 0x1a ; 26 float r_axis_y = -offset[Y_AXIS]; 13a38: d7 01 movw r26, r14 13a3a: c6 01 movw r24, r12 13a3c: b0 58 subi r27, 0x80 ; 128 13a3e: 6e 96 adiw r28, 0x1e ; 30 13a40: 8c af std Y+60, r24 ; 0x3c 13a42: 9d af std Y+61, r25 ; 0x3d 13a44: ae af std Y+62, r26 ; 0x3e 13a46: bf af std Y+63, r27 ; 0x3f 13a48: 6e 97 sbiw r28, 0x1e ; 30 float center_axis_x = start_position[X_AXIS] - r_axis_x; 13a4a: 29 81 ldd r18, Y+1 ; 0x01 13a4c: 3a 81 ldd r19, Y+2 ; 0x02 13a4e: 4b 81 ldd r20, Y+3 ; 0x03 13a50: 5c 81 ldd r21, Y+4 ; 0x04 13a52: e6 96 adiw r28, 0x36 ; 54 13a54: 2c af std Y+60, r18 ; 0x3c 13a56: 3d af std Y+61, r19 ; 0x3d 13a58: 4e af std Y+62, r20 ; 0x3e 13a5a: 5f af std Y+63, r21 ; 0x3f 13a5c: e6 97 sbiw r28, 0x36 ; 54 13a5e: c5 01 movw r24, r10 13a60: b4 01 movw r22, r8 13a62: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 13a66: ea 96 adiw r28, 0x3a ; 58 13a68: 6c af std Y+60, r22 ; 0x3c 13a6a: 7d af std Y+61, r23 ; 0x3d 13a6c: 8e af std Y+62, r24 ; 0x3e 13a6e: 9f af std Y+63, r25 ; 0x3f 13a70: ea 97 sbiw r28, 0x3a ; 58 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 13a72: 8d 81 ldd r24, Y+5 ; 0x05 13a74: 9e 81 ldd r25, Y+6 ; 0x06 13a76: af 81 ldd r26, Y+7 ; 0x07 13a78: b8 85 ldd r27, Y+8 ; 0x08 13a7a: ee 96 adiw r28, 0x3e ; 62 13a7c: 8c af std Y+60, r24 ; 0x3c 13a7e: 9d af std Y+61, r25 ; 0x3d 13a80: ae af std Y+62, r26 ; 0x3e 13a82: bf af std Y+63, r27 ; 0x3f 13a84: ee 97 sbiw r28, 0x3e ; 62 13a86: 9c 01 movw r18, r24 13a88: ad 01 movw r20, r26 13a8a: c7 01 movw r24, r14 13a8c: b6 01 movw r22, r12 13a8e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 13a92: ce 57 subi r28, 0x7E ; 126 13a94: df 4f sbci r29, 0xFF ; 255 13a96: 68 83 st Y, r22 13a98: 79 83 std Y+1, r23 ; 0x01 13a9a: 8a 83 std Y+2, r24 ; 0x02 13a9c: 9b 83 std Y+3, r25 ; 0x03 13a9e: c2 58 subi r28, 0x82 ; 130 13aa0: d0 40 sbci r29, 0x00 ; 0 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 13aa2: 29 85 ldd r18, Y+9 ; 0x09 13aa4: 3a 85 ldd r19, Y+10 ; 0x0a 13aa6: 4b 85 ldd r20, Y+11 ; 0x0b 13aa8: 5c 85 ldd r21, Y+12 ; 0x0c 13aaa: 60 91 5c 05 lds r22, 0x055C ; 0x80055c 13aae: 70 91 5d 05 lds r23, 0x055D ; 0x80055d 13ab2: 80 91 5e 05 lds r24, 0x055E ; 0x80055e 13ab6: 90 91 5f 05 lds r25, 0x055F ; 0x80055f 13aba: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13abe: c2 58 subi r28, 0x82 ; 130 13ac0: df 4f sbci r29, 0xFF ; 255 13ac2: 68 83 st Y, r22 13ac4: 79 83 std Y+1, r23 ; 0x01 13ac6: 8a 83 std Y+2, r24 ; 0x02 13ac8: 9b 83 std Y+3, r25 ; 0x03 13aca: ce 57 subi r28, 0x7E ; 126 13acc: d0 40 sbci r29, 0x00 ; 0 float rt_x = target[X_AXIS] - center_axis_x; 13ace: 20 91 54 05 lds r18, 0x0554 ; 0x800554 13ad2: 30 91 55 05 lds r19, 0x0555 ; 0x800555 13ad6: 40 91 56 05 lds r20, 0x0556 ; 0x800556 13ada: 50 91 57 05 lds r21, 0x0557 ; 0x800557 13ade: ca 57 subi r28, 0x7A ; 122 13ae0: df 4f sbci r29, 0xFF ; 255 13ae2: 28 83 st Y, r18 13ae4: 39 83 std Y+1, r19 ; 0x01 13ae6: 4a 83 std Y+2, r20 ; 0x02 13ae8: 5b 83 std Y+3, r21 ; 0x03 13aea: c6 58 subi r28, 0x86 ; 134 13aec: d0 40 sbci r29, 0x00 ; 0 13aee: ea 96 adiw r28, 0x3a ; 58 13af0: 2c ad ldd r18, Y+60 ; 0x3c 13af2: 3d ad ldd r19, Y+61 ; 0x3d 13af4: 4e ad ldd r20, Y+62 ; 0x3e 13af6: 5f ad ldd r21, Y+63 ; 0x3f 13af8: ea 97 sbiw r28, 0x3a ; 58 13afa: ca 57 subi r28, 0x7A ; 122 13afc: df 4f sbci r29, 0xFF ; 255 13afe: 68 81 ld r22, Y 13b00: 79 81 ldd r23, Y+1 ; 0x01 13b02: 8a 81 ldd r24, Y+2 ; 0x02 13b04: 9b 81 ldd r25, Y+3 ; 0x03 13b06: c6 58 subi r28, 0x86 ; 134 13b08: d0 40 sbci r29, 0x00 ; 0 13b0a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13b0e: 6b 01 movw r12, r22 13b10: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 13b12: 80 91 58 05 lds r24, 0x0558 ; 0x800558 13b16: 90 91 59 05 lds r25, 0x0559 ; 0x800559 13b1a: a0 91 5a 05 lds r26, 0x055A ; 0x80055a 13b1e: b0 91 5b 05 lds r27, 0x055B ; 0x80055b 13b22: c6 57 subi r28, 0x76 ; 118 13b24: df 4f sbci r29, 0xFF ; 255 13b26: 88 83 st Y, r24 13b28: 99 83 std Y+1, r25 ; 0x01 13b2a: aa 83 std Y+2, r26 ; 0x02 13b2c: bb 83 std Y+3, r27 ; 0x03 13b2e: ca 58 subi r28, 0x8A ; 138 13b30: d0 40 sbci r29, 0x00 ; 0 13b32: ce 57 subi r28, 0x7E ; 126 13b34: df 4f sbci r29, 0xFF ; 255 13b36: 28 81 ld r18, Y 13b38: 39 81 ldd r19, Y+1 ; 0x01 13b3a: 4a 81 ldd r20, Y+2 ; 0x02 13b3c: 5b 81 ldd r21, Y+3 ; 0x03 13b3e: c2 58 subi r28, 0x82 ; 130 13b40: d0 40 sbci r29, 0x00 ; 0 13b42: bc 01 movw r22, r24 13b44: cd 01 movw r24, r26 13b46: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13b4a: 4b 01 movw r8, r22 13b4c: 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; 13b4e: 30 90 32 07 lds r3, 0x0732 ; 0x800732 13b52: 20 90 33 07 lds r2, 0x0733 ; 0x800733 13b56: 90 91 34 07 lds r25, 0x0734 ; 0x800734 13b5a: 6f 96 adiw r28, 0x1f ; 31 13b5c: 9f af std Y+63, r25 ; 0x3f 13b5e: 6f 97 sbiw r28, 0x1f ; 31 13b60: a0 91 35 07 lds r26, 0x0735 ; 0x800735 13b64: a3 96 adiw r28, 0x23 ; 35 13b66: af af std Y+63, r26 ; 0x3f 13b68: 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); 13b6a: a7 01 movw r20, r14 13b6c: 96 01 movw r18, r12 13b6e: 6a 96 adiw r28, 0x1a ; 26 13b70: 6c ad ldd r22, Y+60 ; 0x3c 13b72: 7d ad ldd r23, Y+61 ; 0x3d 13b74: 8e ad ldd r24, Y+62 ; 0x3e 13b76: 9f ad ldd r25, Y+63 ; 0x3f 13b78: 6a 97 sbiw r28, 0x1a ; 26 13b7a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13b7e: 2b 01 movw r4, r22 13b80: 3c 01 movw r6, r24 13b82: a5 01 movw r20, r10 13b84: 94 01 movw r18, r8 13b86: 6e 96 adiw r28, 0x1e ; 30 13b88: 6c ad ldd r22, Y+60 ; 0x3c 13b8a: 7d ad ldd r23, Y+61 ; 0x3d 13b8c: 8e ad ldd r24, Y+62 ; 0x3e 13b8e: 9f ad ldd r25, Y+63 ; 0x3f 13b90: 6e 97 sbiw r28, 0x1e ; 30 13b92: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13b96: 9b 01 movw r18, r22 13b98: ac 01 movw r20, r24 13b9a: c3 01 movw r24, r6 13b9c: b2 01 movw r22, r4 13b9e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 13ba2: 2b 01 movw r4, r22 13ba4: 3c 01 movw r6, r24 13ba6: a5 01 movw r20, r10 13ba8: 94 01 movw r18, r8 13baa: 6a 96 adiw r28, 0x1a ; 26 13bac: 6c ad ldd r22, Y+60 ; 0x3c 13bae: 7d ad ldd r23, Y+61 ; 0x3d 13bb0: 8e ad ldd r24, Y+62 ; 0x3e 13bb2: 9f ad ldd r25, Y+63 ; 0x3f 13bb4: 6a 97 sbiw r28, 0x1a ; 26 13bb6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13bba: 4b 01 movw r8, r22 13bbc: 5c 01 movw r10, r24 13bbe: a7 01 movw r20, r14 13bc0: 96 01 movw r18, r12 13bc2: 6e 96 adiw r28, 0x1e ; 30 13bc4: 6c ad ldd r22, Y+60 ; 0x3c 13bc6: 7d ad ldd r23, Y+61 ; 0x3d 13bc8: 8e ad ldd r24, Y+62 ; 0x3e 13bca: 9f ad ldd r25, Y+63 ; 0x3f 13bcc: 6e 97 sbiw r28, 0x1e ; 30 13bce: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13bd2: 9b 01 movw r18, r22 13bd4: ac 01 movw r20, r24 13bd6: c5 01 movw r24, r10 13bd8: b4 01 movw r22, r8 13bda: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13bde: a3 01 movw r20, r6 13be0: 92 01 movw r18, r4 13be2: 0f 94 38 df call 0x3be70 ; 0x3be70 13be6: 6b 01 movw r12, r22 13be8: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 13bea: 20 e0 ldi r18, 0x00 ; 0 13bec: 30 e0 ldi r19, 0x00 ; 0 13bee: a9 01 movw r20, r18 13bf0: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 13bf4: 87 ff sbrs r24, 7 13bf6: 0a c0 rjmp .+20 ; 0x13c0c 13bf8: 2b ed ldi r18, 0xDB ; 219 13bfa: 3f e0 ldi r19, 0x0F ; 15 13bfc: 49 ec ldi r20, 0xC9 ; 201 13bfe: 50 e4 ldi r21, 0x40 ; 64 13c00: c7 01 movw r24, r14 13c02: b6 01 movw r22, r12 13c04: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 13c08: 6b 01 movw r12, r22 13c0a: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 13c0c: 60 91 3b 07 lds r22, 0x073B ; 0x80073b 13c10: 70 91 3c 07 lds r23, 0x073C ; 0x80073c 13c14: 61 15 cp r22, r1 13c16: 71 05 cpc r23, r1 13c18: 09 f4 brne .+2 ; 0x13c1c 13c1a: a4 c2 rjmp .+1352 ; 0x14164 { // 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); 13c1c: 90 e0 ldi r25, 0x00 ; 0 13c1e: 80 e0 ldi r24, 0x00 ; 0 13c20: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 13c24: 9b 01 movw r18, r22 13c26: ac 01 movw r20, r24 13c28: 6b ed ldi r22, 0xDB ; 219 13c2a: 7f e0 ldi r23, 0x0F ; 15 13c2c: 89 ec ldi r24, 0xC9 ; 201 13c2e: 90 e4 ldi r25, 0x40 ; 64 13c30: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13c34: ae 96 adiw r28, 0x2e ; 46 13c36: 2c ad ldd r18, Y+60 ; 0x3c 13c38: 3d ad ldd r19, Y+61 ; 0x3d 13c3a: 4e ad ldd r20, Y+62 ; 0x3e 13c3c: 5f ad ldd r21, Y+63 ; 0x3f 13c3e: ae 97 sbiw r28, 0x2e ; 46 13c40: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13c44: 5b 01 movw r10, r22 13c46: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 13c48: 60 91 3d 07 lds r22, 0x073D ; 0x80073d 13c4c: 70 91 3e 07 lds r23, 0x073E ; 0x80073e 13c50: 61 15 cp r22, r1 13c52: 71 05 cpc r23, r1 13c54: f1 f0 breq .+60 ; 0x13c92 { // 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)); 13c56: 90 e0 ldi r25, 0x00 ; 0 13c58: 80 e0 ldi r24, 0x00 ; 0 13c5a: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 13c5e: 20 e0 ldi r18, 0x00 ; 0 13c60: 30 e0 ldi r19, 0x00 ; 0 13c62: 40 e7 ldi r20, 0x70 ; 112 13c64: 52 e4 ldi r21, 0x42 ; 66 13c66: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13c6a: 9b 01 movw r18, r22 13c6c: ac 01 movw r20, r24 13c6e: aa 96 adiw r28, 0x2a ; 42 13c70: 6c ad ldd r22, Y+60 ; 0x3c 13c72: 7d ad ldd r23, Y+61 ; 0x3d 13c74: 8e ad ldd r24, Y+62 ; 0x3e 13c76: 9f ad ldd r25, Y+63 ; 0x3f 13c78: aa 97 sbiw r28, 0x2a ; 42 13c7a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13c7e: 3b 01 movw r6, r22 13c80: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 13c82: 95 01 movw r18, r10 13c84: a8 01 movw r20, r16 13c86: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 13c8a: 87 ff sbrs r24, 7 13c8c: 02 c0 rjmp .+4 ; 0x13c92 mm_per_arc_segment = mm_per_arc_segment_sec; 13c8e: 53 01 movw r10, r6 13c90: 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) 13c92: 40 90 36 07 lds r4, 0x0736 ; 0x800736 13c96: 50 90 37 07 lds r5, 0x0737 ; 0x800737 13c9a: 60 90 38 07 lds r6, 0x0738 ; 0x800738 13c9e: 70 90 39 07 lds r7, 0x0739 ; 0x800739 13ca2: 95 01 movw r18, r10 13ca4: a8 01 movw r20, r16 13ca6: b2 01 movw r22, r4 13ca8: c3 01 movw r24, r6 13caa: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 13cae: 18 16 cp r1, r24 13cb0: c4 f0 brlt .+48 ; 0x13ce2 { // 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) { 13cb2: 95 01 movw r18, r10 13cb4: a8 01 movw r20, r16 13cb6: 63 2d mov r22, r3 13cb8: 72 2d mov r23, r2 13cba: 6f 96 adiw r28, 0x1f ; 31 13cbc: 8f ad ldd r24, Y+63 ; 0x3f 13cbe: 6f 97 sbiw r28, 0x1f ; 31 13cc0: a3 96 adiw r28, 0x23 ; 35 13cc2: 9f ad ldd r25, Y+63 ; 0x3f 13cc4: a3 97 sbiw r28, 0x23 ; 35 13cc6: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 13cca: 25 01 movw r4, r10 13ccc: 38 01 movw r6, r16 13cce: 87 ff sbrs r24, 7 13cd0: 08 c0 rjmp .+16 ; 0x13ce2 // 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; 13cd2: 43 2c mov r4, r3 13cd4: 52 2c mov r5, r2 13cd6: 6f 96 adiw r28, 0x1f ; 31 13cd8: 6f ac ldd r6, Y+63 ; 0x3f 13cda: 6f 97 sbiw r28, 0x1f ; 31 13cdc: a3 96 adiw r28, 0x23 ; 35 13cde: 7f ac ldd r7, Y+63 ; 0x3f 13ce0: a3 97 sbiw r28, 0x23 ; 35 } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 13ce2: c2 57 subi r28, 0x72 ; 114 13ce4: df 4f sbci r29, 0xFF ; 255 13ce6: e8 81 ld r30, Y 13ce8: f9 81 ldd r31, Y+1 ; 0x01 13cea: ce 58 subi r28, 0x8E ; 142 13cec: d0 40 sbci r29, 0x00 ; 0 13cee: 32 97 sbiw r30, 0x02 ; 2 13cf0: 51 f4 brne .+20 ; 0x13d06 13cf2: 2b ed ldi r18, 0xDB ; 219 13cf4: 3f e0 ldi r19, 0x0F ; 15 13cf6: 49 ec ldi r20, 0xC9 ; 201 13cf8: 50 e4 ldi r21, 0x40 ; 64 13cfa: c7 01 movw r24, r14 13cfc: b6 01 movw r22, r12 13cfe: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13d02: 6b 01 movw r12, r22 13d04: 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) 13d06: ca 57 subi r28, 0x7A ; 122 13d08: df 4f sbci r29, 0xFF ; 255 13d0a: 28 81 ld r18, Y 13d0c: 39 81 ldd r19, Y+1 ; 0x01 13d0e: 4a 81 ldd r20, Y+2 ; 0x02 13d10: 5b 81 ldd r21, Y+3 ; 0x03 13d12: c6 58 subi r28, 0x86 ; 134 13d14: d0 40 sbci r29, 0x00 ; 0 13d16: e6 96 adiw r28, 0x36 ; 54 13d18: 6c ad ldd r22, Y+60 ; 0x3c 13d1a: 7d ad ldd r23, Y+61 ; 0x3d 13d1c: 8e ad ldd r24, Y+62 ; 0x3e 13d1e: 9f ad ldd r25, Y+63 ; 0x3f 13d20: e6 97 sbiw r28, 0x36 ; 54 13d22: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 13d26: 81 11 cpse r24, r1 13d28: 25 c0 rjmp .+74 ; 0x13d74 13d2a: c6 57 subi r28, 0x76 ; 118 13d2c: df 4f sbci r29, 0xFF ; 255 13d2e: 28 81 ld r18, Y 13d30: 39 81 ldd r19, Y+1 ; 0x01 13d32: 4a 81 ldd r20, Y+2 ; 0x02 13d34: 5b 81 ldd r21, Y+3 ; 0x03 13d36: ca 58 subi r28, 0x8A ; 138 13d38: d0 40 sbci r29, 0x00 ; 0 13d3a: ee 96 adiw r28, 0x3e ; 62 13d3c: 6c ad ldd r22, Y+60 ; 0x3c 13d3e: 7d ad ldd r23, Y+61 ; 0x3d 13d40: 8e ad ldd r24, Y+62 ; 0x3e 13d42: 9f ad ldd r25, Y+63 ; 0x3f 13d44: ee 97 sbiw r28, 0x3e ; 62 13d46: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 13d4a: 81 11 cpse r24, r1 13d4c: 13 c0 rjmp .+38 ; 0x13d74 13d4e: 20 e0 ldi r18, 0x00 ; 0 13d50: 30 e0 ldi r19, 0x00 ; 0 13d52: a9 01 movw r20, r18 13d54: c7 01 movw r24, r14 13d56: b6 01 movw r22, r12 13d58: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 13d5c: 81 11 cpse r24, r1 13d5e: 0a c0 rjmp .+20 ; 0x13d74 { angular_travel_total += 2 * M_PI; 13d60: 2b ed ldi r18, 0xDB ; 219 13d62: 3f e0 ldi r19, 0x0F ; 15 13d64: 49 ec ldi r20, 0xC9 ; 201 13d66: 50 e4 ldi r21, 0x40 ; 64 13d68: c7 01 movw r24, r14 13d6a: b6 01 movw r22, r12 13d6c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 13d70: 6b 01 movw r12, r22 13d72: 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)); 13d74: a7 01 movw r20, r14 13d76: 96 01 movw r18, r12 13d78: ae 96 adiw r28, 0x2e ; 46 13d7a: 6c ad ldd r22, Y+60 ; 0x3c 13d7c: 7d ad ldd r23, Y+61 ; 0x3d 13d7e: 8e ad ldd r24, Y+62 ; 0x3e 13d80: 9f ad ldd r25, Y+63 ; 0x3f 13d82: ae 97 sbiw r28, 0x2e ; 46 13d84: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13d88: c2 58 subi r28, 0x82 ; 130 13d8a: df 4f sbci r29, 0xFF ; 255 13d8c: 28 81 ld r18, Y 13d8e: 39 81 ldd r19, Y+1 ; 0x01 13d90: 4a 81 ldd r20, Y+2 ; 0x02 13d92: 5b 81 ldd r21, Y+3 ; 0x03 13d94: ce 57 subi r28, 0x7E ; 126 13d96: d0 40 sbci r29, 0x00 ; 0 13d98: 0f 94 55 e1 call 0x3c2aa ; 0x3c2aa 13d9c: 4b 01 movw r8, r22 13d9e: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 13da0: 2f e6 ldi r18, 0x6F ; 111 13da2: 32 e1 ldi r19, 0x12 ; 18 13da4: 43 e8 ldi r20, 0x83 ; 131 13da6: 5a e3 ldi r21, 0x3A ; 58 13da8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 13dac: 87 fd sbrc r24, 7 13dae: cf c1 rjmp .+926 ; 0x1414e // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 13db0: 92 01 movw r18, r4 13db2: a3 01 movw r20, r6 13db4: c5 01 movw r24, r10 13db6: b4 01 movw r22, r8 13db8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13dbc: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 13dc0: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 13dc4: a4 96 adiw r28, 0x24 ; 36 13dc6: 7f af std Y+63, r23 ; 0x3f 13dc8: 6e af std Y+62, r22 ; 0x3e 13dca: 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) 13dcc: 62 30 cpi r22, 0x02 ; 2 13dce: 71 05 cpc r23, r1 13dd0: 08 f4 brcc .+2 ; 0x13dd4 13dd2: 8b c1 rjmp .+790 ; 0x140ea 13dd4: e0 96 adiw r28, 0x30 ; 48 13dd6: 4e ad ldd r20, Y+62 ; 0x3e 13dd8: 5f ad ldd r21, Y+63 ; 0x3f 13dda: e0 97 sbiw r28, 0x30 ; 48 13ddc: 45 2b or r20, r21 13dde: 09 f4 brne .+2 ; 0x13de2 13de0: 84 c1 rjmp .+776 ; 0x140ea 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; 13de2: 50 91 3a 07 lds r21, 0x073A ; 0x80073a 13de6: 6f 96 adiw r28, 0x1f ; 31 13de8: 5f af std Y+63, r21 ; 0x3f 13dea: 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, 13dec: 90 e0 ldi r25, 0x00 ; 0 13dee: 80 e0 ldi r24, 0x00 ; 0 13df0: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 13df4: 4b 01 movw r8, r22 13df6: 5c 01 movw r10, r24 13df8: ac 01 movw r20, r24 13dfa: 9b 01 movw r18, r22 13dfc: c7 01 movw r24, r14 13dfe: b6 01 movw r22, r12 13e00: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13e04: 2b 01 movw r4, r22 13e06: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 13e08: a5 01 movw r20, r10 13e0a: 94 01 movw r18, r8 13e0c: c2 58 subi r28, 0x82 ; 130 13e0e: df 4f sbci r29, 0xFF ; 255 13e10: 68 81 ld r22, Y 13e12: 79 81 ldd r23, Y+1 ; 0x01 13e14: 8a 81 ldd r24, Y+2 ; 0x02 13e16: 9b 81 ldd r25, Y+3 ; 0x03 13e18: ce 57 subi r28, 0x7E ; 126 13e1a: d0 40 sbci r29, 0x00 ; 0 13e1c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13e20: ee 96 adiw r28, 0x3e ; 62 13e22: 6c af std Y+60, r22 ; 0x3c 13e24: 7d af std Y+61, r23 ; 0x3d 13e26: 8e af std Y+62, r24 ; 0x3e 13e28: 9f af std Y+63, r25 ; 0x3f 13e2a: ee 97 sbiw r28, 0x3e ; 62 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 13e2c: 2d 85 ldd r18, Y+13 ; 0x0d 13e2e: 3e 85 ldd r19, Y+14 ; 0x0e 13e30: 4f 85 ldd r20, Y+15 ; 0x0f 13e32: 58 89 ldd r21, Y+16 ; 0x10 13e34: 60 91 60 05 lds r22, 0x0560 ; 0x800560 13e38: 70 91 61 05 lds r23, 0x0561 ; 0x800561 13e3c: 80 91 62 05 lds r24, 0x0562 ; 0x800562 13e40: 90 91 63 05 lds r25, 0x0563 ; 0x800563 13e44: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13e48: a5 01 movw r20, r10 13e4a: 94 01 movw r18, r8 13e4c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13e50: c2 58 subi r28, 0x82 ; 130 13e52: df 4f sbci r29, 0xFF ; 255 13e54: 68 83 st Y, r22 13e56: 79 83 std Y+1, r23 ; 0x01 13e58: 8a 83 std Y+2, r24 ; 0x02 13e5a: 9b 83 std Y+3, r25 ; 0x03 13e5c: ce 57 subi r28, 0x7E ; 126 13e5e: d0 40 sbci r29, 0x00 ; 0 sq_theta_per_segment = theta_per_segment * theta_per_segment, 13e60: a3 01 movw r20, r6 13e62: 92 01 movw r18, r4 13e64: c3 01 movw r24, r6 13e66: b2 01 movw r22, r4 13e68: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13e6c: 6b 01 movw r12, r22 13e6e: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 13e70: ac 01 movw r20, r24 13e72: 9b 01 movw r18, r22 13e74: c3 01 movw r24, r6 13e76: b2 01 movw r22, r4 13e78: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13e7c: 20 e0 ldi r18, 0x00 ; 0 13e7e: 30 e0 ldi r19, 0x00 ; 0 13e80: 40 ec ldi r20, 0xC0 ; 192 13e82: 50 e4 ldi r21, 0x40 ; 64 13e84: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 13e88: 9b 01 movw r18, r22 13e8a: ac 01 movw r20, r24 13e8c: c3 01 movw r24, r6 13e8e: b2 01 movw r22, r4 13e90: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13e94: ae 96 adiw r28, 0x2e ; 46 13e96: 6c af std Y+60, r22 ; 0x3c 13e98: 7d af std Y+61, r23 ; 0x3d 13e9a: 8e af std Y+62, r24 ; 0x3e 13e9c: 9f af std Y+63, r25 ; 0x3f 13e9e: ae 97 sbiw r28, 0x2e ; 46 cos_T = 1 - 0.5f * sq_theta_per_segment; 13ea0: 20 e0 ldi r18, 0x00 ; 0 13ea2: 30 e0 ldi r19, 0x00 ; 0 13ea4: 40 e0 ldi r20, 0x00 ; 0 13ea6: 5f e3 ldi r21, 0x3F ; 63 13ea8: c7 01 movw r24, r14 13eaa: b6 01 movw r22, r12 13eac: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13eb0: 9b 01 movw r18, r22 13eb2: ac 01 movw r20, r24 13eb4: 60 e0 ldi r22, 0x00 ; 0 13eb6: 70 e0 ldi r23, 0x00 ; 0 13eb8: 80 e8 ldi r24, 0x80 ; 128 13eba: 9f e3 ldi r25, 0x3F ; 63 13ebc: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13ec0: e6 96 adiw r28, 0x36 ; 54 13ec2: 6c af std Y+60, r22 ; 0x3c 13ec4: 7d af std Y+61, r23 ; 0x3d 13ec6: 8e af std Y+62, r24 ; 0x3e 13ec8: 9f af std Y+63, r25 ; 0x3f 13eca: 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++) { 13ecc: 22 24 eor r2, r2 13ece: 23 94 inc r2 13ed0: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 13ed2: 6f 96 adiw r28, 0x1f ; 31 13ed4: 8f ad ldd r24, Y+63 ; 0x3f 13ed6: 6f 97 sbiw r28, 0x1f ; 31 13ed8: 81 11 cpse r24, r1 13eda: 4d c1 rjmp .+666 ; 0x14176 // 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); 13edc: b1 01 movw r22, r2 13ede: 90 e0 ldi r25, 0x00 ; 0 13ee0: 80 e0 ldi r24, 0x00 ; 0 13ee2: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 13ee6: a3 01 movw r20, r6 13ee8: 92 01 movw r18, r4 13eea: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13eee: 6b 01 movw r12, r22 13ef0: 7c 01 movw r14, r24 13ef2: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 13ef6: 6e 96 adiw r28, 0x1e ; 30 13ef8: 6c af std Y+60, r22 ; 0x3c 13efa: 7d af std Y+61, r23 ; 0x3d 13efc: 8e af std Y+62, r24 ; 0x3e 13efe: 9f af std Y+63, r25 ; 0x3f 13f00: 6e 97 sbiw r28, 0x1e ; 30 13f02: c7 01 movw r24, r14 13f04: b6 01 movw r22, r12 13f06: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 13f0a: 4b 01 movw r8, r22 13f0c: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 13f0e: c0 90 8d 03 lds r12, 0x038D ; 0x80038d 13f12: d0 90 8e 03 lds r13, 0x038E ; 0x80038e 13f16: e0 90 8f 03 lds r14, 0x038F ; 0x80038f 13f1a: f0 90 90 03 lds r15, 0x0390 ; 0x800390 13f1e: f7 fa bst r15, 7 13f20: f0 94 com r15 13f22: f7 f8 bld r15, 7 13f24: f0 94 com r15 13f26: 20 91 91 03 lds r18, 0x0391 ; 0x800391 13f2a: 30 91 92 03 lds r19, 0x0392 ; 0x800392 13f2e: 40 91 93 03 lds r20, 0x0393 ; 0x800393 13f32: 50 91 94 03 lds r21, 0x0394 ; 0x800394 13f36: a2 96 adiw r28, 0x22 ; 34 13f38: 2c af std Y+60, r18 ; 0x3c 13f3a: 3d af std Y+61, r19 ; 0x3d 13f3c: 4e af std Y+62, r20 ; 0x3e 13f3e: 5f af std Y+63, r21 ; 0x3f 13f40: a2 97 sbiw r28, 0x22 ; 34 13f42: a7 01 movw r20, r14 13f44: 96 01 movw r18, r12 13f46: 6e 96 adiw r28, 0x1e ; 30 13f48: 6c ad ldd r22, Y+60 ; 0x3c 13f4a: 7d ad ldd r23, Y+61 ; 0x3d 13f4c: 8e ad ldd r24, Y+62 ; 0x3e 13f4e: 9f ad ldd r25, Y+63 ; 0x3f 13f50: 6e 97 sbiw r28, 0x1e ; 30 13f52: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13f56: 6a 96 adiw r28, 0x1a ; 26 13f58: 6c af std Y+60, r22 ; 0x3c 13f5a: 7d af std Y+61, r23 ; 0x3d 13f5c: 8e af std Y+62, r24 ; 0x3e 13f5e: 9f af std Y+63, r25 ; 0x3f 13f60: 6a 97 sbiw r28, 0x1a ; 26 13f62: a2 96 adiw r28, 0x22 ; 34 13f64: 2c ad ldd r18, Y+60 ; 0x3c 13f66: 3d ad ldd r19, Y+61 ; 0x3d 13f68: 4e ad ldd r20, Y+62 ; 0x3e 13f6a: 5f ad ldd r21, Y+63 ; 0x3f 13f6c: a2 97 sbiw r28, 0x22 ; 34 13f6e: c5 01 movw r24, r10 13f70: b4 01 movw r22, r8 13f72: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13f76: 9b 01 movw r18, r22 13f78: ac 01 movw r20, r24 13f7a: 6a 96 adiw r28, 0x1a ; 26 13f7c: 6c ad ldd r22, Y+60 ; 0x3c 13f7e: 7d ad ldd r23, Y+61 ; 0x3d 13f80: 8e ad ldd r24, Y+62 ; 0x3e 13f82: 9f ad ldd r25, Y+63 ; 0x3f 13f84: 6a 97 sbiw r28, 0x1a ; 26 13f86: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 13f8a: 6a 96 adiw r28, 0x1a ; 26 13f8c: 6c af std Y+60, r22 ; 0x3c 13f8e: 7d af std Y+61, r23 ; 0x3d 13f90: 8e af std Y+62, r24 ; 0x3e 13f92: 9f af std Y+63, r25 ; 0x3f 13f94: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 13f96: a7 01 movw r20, r14 13f98: 96 01 movw r18, r12 13f9a: c5 01 movw r24, r10 13f9c: b4 01 movw r22, r8 13f9e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13fa2: 6b 01 movw r12, r22 13fa4: 7c 01 movw r14, r24 13fa6: a2 96 adiw r28, 0x22 ; 34 13fa8: 2c ad ldd r18, Y+60 ; 0x3c 13faa: 3d ad ldd r19, Y+61 ; 0x3d 13fac: 4e ad ldd r20, Y+62 ; 0x3e 13fae: 5f ad ldd r21, Y+63 ; 0x3f 13fb0: a2 97 sbiw r28, 0x22 ; 34 13fb2: 6e 96 adiw r28, 0x1e ; 30 13fb4: 6c ad ldd r22, Y+60 ; 0x3c 13fb6: 7d ad ldd r23, Y+61 ; 0x3d 13fb8: 8e ad ldd r24, Y+62 ; 0x3e 13fba: 9f ad ldd r25, Y+63 ; 0x3f 13fbc: 6e 97 sbiw r28, 0x1e ; 30 13fbe: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 13fc2: 9b 01 movw r18, r22 13fc4: ac 01 movw r20, r24 13fc6: c7 01 movw r24, r14 13fc8: b6 01 movw r22, r12 13fca: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 13fce: 6e 96 adiw r28, 0x1e ; 30 13fd0: 6c af std Y+60, r22 ; 0x3c 13fd2: 7d af std Y+61, r23 ; 0x3d 13fd4: 8e af std Y+62, r24 ; 0x3e 13fd6: 9f af std Y+63, r25 ; 0x3f 13fd8: 6e 97 sbiw r28, 0x1e ; 30 // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 13fda: 30 91 3a 07 lds r19, 0x073A ; 0x80073a 13fde: 6f 96 adiw r28, 0x1f ; 31 13fe0: 3f af std Y+63, r19 ; 0x3f 13fe2: 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; 13fe4: 6a 96 adiw r28, 0x1a ; 26 13fe6: 2c ad ldd r18, Y+60 ; 0x3c 13fe8: 3d ad ldd r19, Y+61 ; 0x3d 13fea: 4e ad ldd r20, Y+62 ; 0x3e 13fec: 5f ad ldd r21, Y+63 ; 0x3f 13fee: 6a 97 sbiw r28, 0x1a ; 26 13ff0: ea 96 adiw r28, 0x3a ; 58 13ff2: 6c ad ldd r22, Y+60 ; 0x3c 13ff4: 7d ad ldd r23, Y+61 ; 0x3d 13ff6: 8e ad ldd r24, Y+62 ; 0x3e 13ff8: 9f ad ldd r25, Y+63 ; 0x3f 13ffa: ea 97 sbiw r28, 0x3a ; 58 13ffc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 14000: 69 83 std Y+1, r22 ; 0x01 14002: 7a 83 std Y+2, r23 ; 0x02 14004: 8b 83 std Y+3, r24 ; 0x03 14006: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 14008: 6e 96 adiw r28, 0x1e ; 30 1400a: 2c ad ldd r18, Y+60 ; 0x3c 1400c: 3d ad ldd r19, Y+61 ; 0x3d 1400e: 4e ad ldd r20, Y+62 ; 0x3e 14010: 5f ad ldd r21, Y+63 ; 0x3f 14012: 6e 97 sbiw r28, 0x1e ; 30 14014: ce 57 subi r28, 0x7E ; 126 14016: df 4f sbci r29, 0xFF ; 255 14018: 68 81 ld r22, Y 1401a: 79 81 ldd r23, Y+1 ; 0x01 1401c: 8a 81 ldd r24, Y+2 ; 0x02 1401e: 9b 81 ldd r25, Y+3 ; 0x03 14020: c2 58 subi r28, 0x82 ; 130 14022: d0 40 sbci r29, 0x00 ; 0 14024: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 14028: 6d 83 std Y+5, r22 ; 0x05 1402a: 7e 83 std Y+6, r23 ; 0x06 1402c: 8f 83 std Y+7, r24 ; 0x07 1402e: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 14030: ee 96 adiw r28, 0x3e ; 62 14032: 2c ad ldd r18, Y+60 ; 0x3c 14034: 3d ad ldd r19, Y+61 ; 0x3d 14036: 4e ad ldd r20, Y+62 ; 0x3e 14038: 5f ad ldd r21, Y+63 ; 0x3f 1403a: ee 97 sbiw r28, 0x3e ; 62 1403c: 69 85 ldd r22, Y+9 ; 0x09 1403e: 7a 85 ldd r23, Y+10 ; 0x0a 14040: 8b 85 ldd r24, Y+11 ; 0x0b 14042: 9c 85 ldd r25, Y+12 ; 0x0c 14044: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 14048: 69 87 std Y+9, r22 ; 0x09 1404a: 7a 87 std Y+10, r23 ; 0x0a 1404c: 8b 87 std Y+11, r24 ; 0x0b 1404e: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 14050: c2 58 subi r28, 0x82 ; 130 14052: df 4f sbci r29, 0xFF ; 255 14054: 28 81 ld r18, Y 14056: 39 81 ldd r19, Y+1 ; 0x01 14058: 4a 81 ldd r20, Y+2 ; 0x02 1405a: 5b 81 ldd r21, Y+3 ; 0x03 1405c: ce 57 subi r28, 0x7E ; 126 1405e: d0 40 sbci r29, 0x00 ; 0 14060: 6d 85 ldd r22, Y+13 ; 0x0d 14062: 7e 85 ldd r23, Y+14 ; 0x0e 14064: 8f 85 ldd r24, Y+15 ; 0x0f 14066: 98 89 ldd r25, Y+16 ; 0x10 14068: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1406c: 6d 87 std Y+13, r22 ; 0x0d 1406e: 7e 87 std Y+14, r23 ; 0x0e 14070: 8f 87 std Y+15, r24 ; 0x0f 14072: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 14074: ce 01 movw r24, r28 14076: 01 96 adiw r24, 0x01 ; 1 14078: 0e 94 7e 6c call 0xd8fc ; 0xd8fc // Insert the segment into the buffer if (i >= start_segment_idx) 1407c: e0 96 adiw r28, 0x30 ; 48 1407e: 8e ad ldd r24, Y+62 ; 0x3e 14080: 9f ad ldd r25, Y+63 ; 0x3f 14082: e0 97 sbiw r28, 0x30 ; 48 14084: 28 16 cp r2, r24 14086: 39 06 cpc r3, r25 14088: 08 f1 brcs .+66 ; 0x140cc plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 1408a: e9 84 ldd r14, Y+9 ; 0x09 1408c: fa 84 ldd r15, Y+10 ; 0x0a 1408e: 0b 85 ldd r16, Y+11 ; 0x0b 14090: 1c 85 ldd r17, Y+12 ; 0x0c 14092: 2d 81 ldd r18, Y+5 ; 0x05 14094: 3e 81 ldd r19, Y+6 ; 0x06 14096: 4f 81 ldd r20, Y+7 ; 0x07 14098: 58 85 ldd r21, Y+8 ; 0x08 1409a: 69 81 ldd r22, Y+1 ; 0x01 1409c: 7a 81 ldd r23, Y+2 ; 0x02 1409e: 8b 81 ldd r24, Y+3 ; 0x03 140a0: 9c 81 ldd r25, Y+4 ; 0x04 140a2: 3f 92 push r3 140a4: 2f 92 push r2 140a6: a3 e4 ldi r26, 0x43 ; 67 140a8: b7 e0 ldi r27, 0x07 ; 7 140aa: bf 93 push r27 140ac: af 93 push r26 140ae: aa 96 adiw r28, 0x2a ; 42 140b0: 8c ac ldd r8, Y+60 ; 0x3c 140b2: 9d ac ldd r9, Y+61 ; 0x3d 140b4: ae ac ldd r10, Y+62 ; 0x3e 140b6: bf ac ldd r11, Y+63 ; 0x3f 140b8: aa 97 sbiw r28, 0x2a ; 42 140ba: de 01 movw r26, r28 140bc: 1d 96 adiw r26, 0x0d ; 13 140be: 6d 01 movw r12, r26 140c0: 0f 94 3e ab call 0x3567c ; 0x3567c 140c4: 0f 90 pop r0 140c6: 0f 90 pop r0 140c8: 0f 90 pop r0 140ca: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 140cc: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 140d0: 81 11 cpse r24, r1 140d2: 3d c0 rjmp .+122 ; 0x1414e 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++) { 140d4: bf ef ldi r27, 0xFF ; 255 140d6: 2b 1a sub r2, r27 140d8: 3b 0a sbc r3, r27 140da: a4 96 adiw r28, 0x24 ; 36 140dc: ee ad ldd r30, Y+62 ; 0x3e 140de: ff ad ldd r31, Y+63 ; 0x3f 140e0: a4 97 sbiw r28, 0x24 ; 36 140e2: e2 15 cp r30, r2 140e4: f3 05 cpc r31, r3 140e6: 09 f0 breq .+2 ; 0x140ea 140e8: f4 ce rjmp .-536 ; 0x13ed2 if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 140ea: 84 e5 ldi r24, 0x54 ; 84 140ec: 95 e0 ldi r25, 0x05 ; 5 140ee: 0e 94 7e 6c call 0xd8fc ; 0xd8fc // 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); 140f2: e0 90 5c 05 lds r14, 0x055C ; 0x80055c 140f6: f0 90 5d 05 lds r15, 0x055D ; 0x80055d 140fa: 00 91 5e 05 lds r16, 0x055E ; 0x80055e 140fe: 10 91 5f 05 lds r17, 0x055F ; 0x80055f 14102: 20 91 58 05 lds r18, 0x0558 ; 0x800558 14106: 30 91 59 05 lds r19, 0x0559 ; 0x800559 1410a: 40 91 5a 05 lds r20, 0x055A ; 0x80055a 1410e: 50 91 5b 05 lds r21, 0x055B ; 0x80055b 14112: 60 91 54 05 lds r22, 0x0554 ; 0x800554 14116: 70 91 55 05 lds r23, 0x0555 ; 0x800555 1411a: 80 91 56 05 lds r24, 0x0556 ; 0x800556 1411e: 90 91 57 05 lds r25, 0x0557 ; 0x800557 14122: 1f 92 push r1 14124: 1f 92 push r1 14126: e3 e4 ldi r30, 0x43 ; 67 14128: f7 e0 ldi r31, 0x07 ; 7 1412a: ff 93 push r31 1412c: ef 93 push r30 1412e: aa 96 adiw r28, 0x2a ; 42 14130: 8c ac ldd r8, Y+60 ; 0x3c 14132: 9d ac ldd r9, Y+61 ; 0x3d 14134: ae ac ldd r10, Y+62 ; 0x3e 14136: bf ac ldd r11, Y+63 ; 0x3f 14138: aa 97 sbiw r28, 0x2a ; 42 1413a: e0 e6 ldi r30, 0x60 ; 96 1413c: ce 2e mov r12, r30 1413e: e5 e0 ldi r30, 0x05 ; 5 14140: de 2e mov r13, r30 14142: 0f 94 3e ab call 0x3567c ; 0x3567c 14146: 0f 90 pop r0 14148: 0f 90 pop r0 1414a: 0f 90 pop r0 1414c: 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(); 1414e: 0e 94 a5 5b call 0xb74a ; 0xb74a previous_millis_cmd.start(); 14152: 88 e8 ldi r24, 0x88 ; 136 14154: 93 e0 ldi r25, 0x03 ; 3 14156: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> 1415a: 7b cb rjmp .-2314 ; 0x13852 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; 1415c: 60 e0 ldi r22, 0x00 ; 0 1415e: 70 e0 ldi r23, 0x00 ; 0 14160: cb 01 movw r24, r22 14162: fe cb rjmp .-2052 ; 0x13960 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; 14164: a3 2c mov r10, r3 14166: b2 2c mov r11, r2 14168: 6f 96 adiw r28, 0x1f ; 31 1416a: 0f ad ldd r16, Y+63 ; 0x3f 1416c: 6f 97 sbiw r28, 0x1f ; 31 1416e: a3 96 adiw r28, 0x23 ; 35 14170: 1f ad ldd r17, Y+63 ; 0x3f 14172: a3 97 sbiw r28, 0x23 ; 35 14174: 69 cd rjmp .-1326 ; 0x13c48 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) { 14176: 6f 96 adiw r28, 0x1f ; 31 14178: 4f ad ldd r20, Y+63 ; 0x3f 1417a: 6f 97 sbiw r28, 0x1f ; 31 1417c: 41 50 subi r20, 0x01 ; 1 1417e: 6f 96 adiw r28, 0x1f ; 31 14180: 4f af std Y+63, r20 ; 0x3f 14182: 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; 14184: ae 96 adiw r28, 0x2e ; 46 14186: 2c ad ldd r18, Y+60 ; 0x3c 14188: 3d ad ldd r19, Y+61 ; 0x3d 1418a: 4e ad ldd r20, Y+62 ; 0x3e 1418c: 5f ad ldd r21, Y+63 ; 0x3f 1418e: ae 97 sbiw r28, 0x2e ; 46 14190: 6a 96 adiw r28, 0x1a ; 26 14192: 6c ad ldd r22, Y+60 ; 0x3c 14194: 7d ad ldd r23, Y+61 ; 0x3d 14196: 8e ad ldd r24, Y+62 ; 0x3e 14198: 9f ad ldd r25, Y+63 ; 0x3f 1419a: 6a 97 sbiw r28, 0x1a ; 26 1419c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 141a0: 6b 01 movw r12, r22 141a2: 7c 01 movw r14, r24 141a4: e6 96 adiw r28, 0x36 ; 54 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: e6 97 sbiw r28, 0x36 ; 54 141b0: 6e 96 adiw r28, 0x1e ; 30 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: 6e 97 sbiw r28, 0x1e ; 30 141bc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 141c0: 9b 01 movw r18, r22 141c2: ac 01 movw r20, r24 141c4: c7 01 movw r24, r14 141c6: b6 01 movw r22, r12 141c8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 141cc: 7b 01 movw r14, r22 141ce: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 141d0: e6 96 adiw r28, 0x36 ; 54 141d2: 2c ad ldd r18, Y+60 ; 0x3c 141d4: 3d ad ldd r19, Y+61 ; 0x3d 141d6: 4e ad ldd r20, Y+62 ; 0x3e 141d8: 5f ad ldd r21, Y+63 ; 0x3f 141da: e6 97 sbiw r28, 0x36 ; 54 141dc: 6a 96 adiw r28, 0x1a ; 26 141de: 6c ad ldd r22, Y+60 ; 0x3c 141e0: 7d ad ldd r23, Y+61 ; 0x3d 141e2: 8e ad ldd r24, Y+62 ; 0x3e 141e4: 9f ad ldd r25, Y+63 ; 0x3f 141e6: 6a 97 sbiw r28, 0x1a ; 26 141e8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 141ec: 4b 01 movw r8, r22 141ee: 5c 01 movw r10, r24 141f0: ae 96 adiw r28, 0x2e ; 46 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: ae 97 sbiw r28, 0x2e ; 46 141fc: 6e 96 adiw r28, 0x1e ; 30 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: 6e 97 sbiw r28, 0x1e ; 30 14208: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1420c: 9b 01 movw r18, r22 1420e: ac 01 movw r20, r24 14210: c5 01 movw r24, r10 14212: b4 01 movw r22, r8 14214: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 14218: 6a 96 adiw r28, 0x1a ; 26 1421a: 6c af std Y+60, r22 ; 0x3c 1421c: 7d af std Y+61, r23 ; 0x3d 1421e: 8e af std Y+62, r24 ; 0x3e 14220: 9f af std Y+63, r25 ; 0x3f 14222: 6a 97 sbiw r28, 0x1a ; 26 r_axis_y = r_axisi; 14224: c7 01 movw r24, r14 14226: d8 01 movw r26, r16 14228: 6e 96 adiw r28, 0x1e ; 30 1422a: 8c af std Y+60, r24 ; 0x3c 1422c: 9d af std Y+61, r25 ; 0x3d 1422e: ae af std Y+62, r26 ; 0x3e 14230: bf af std Y+63, r27 ; 0x3f 14232: 6e 97 sbiw r28, 0x1e ; 30 14234: d7 ce rjmp .-594 ; 0x13fe4 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14236: 80 e5 ldi r24, 0x50 ; 80 14238: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 1423c: c1 2c mov r12, r1 1423e: d1 2c mov r13, r1 14240: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 14242: 88 23 and r24, r24 14244: 31 f0 breq .+12 ; 0x14252 14246: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1424a: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 1424e: 6b 01 movw r12, r22 14250: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 14252: 83 e5 ldi r24, 0x53 ; 83 14254: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 14258: 88 23 and r24, r24 1425a: 61 f0 breq .+24 ; 0x14274 1425c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 14260: 20 e0 ldi r18, 0x00 ; 0 14262: 30 e0 ldi r19, 0x00 ; 0 14264: 4a e7 ldi r20, 0x7A ; 122 14266: 54 e4 ldi r21, 0x44 ; 68 14268: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1426c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 14270: 6b 01 movw r12, r22 14272: 7c 01 movw r14, r24 if(codenum != 0) 14274: c1 14 cp r12, r1 14276: d1 04 cpc r13, r1 14278: e1 04 cpc r14, r1 1427a: f1 04 cpc r15, r1 1427c: 41 f0 breq .+16 ; 0x1428e { if(custom_message_type != CustomMsg::M117) 1427e: 80 91 75 07 lds r24, 0x0775 ; 0x800775 14282: 87 30 cpi r24, 0x07 ; 7 14284: 21 f0 breq .+8 ; 0x1428e { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 14286: 8f eb ldi r24, 0xBF ; 191 14288: 9a e6 ldi r25, 0x6A ; 106 1428a: 0f 94 ea 0b call 0x217d4 ; 0x217d4 } } st_synchronize(); 1428e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 codenum += _millis(); // keep track of when we started waiting 14292: 0f 94 8b 3f call 0x27f16 ; 0x27f16 14296: c6 0e add r12, r22 14298: d7 1e adc r13, r23 1429a: e8 1e adc r14, r24 1429c: f9 1e adc r15, r25 previous_millis_cmd.start(); 1429e: 88 e8 ldi r24, 0x88 ; 136 142a0: 93 e0 ldi r25, 0x03 ; 3 142a2: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> while(_millis() < codenum) { 142a6: 0f 94 8b 3f call 0x27f16 ; 0x27f16 142aa: 6c 15 cp r22, r12 142ac: 7d 05 cpc r23, r13 142ae: 8e 05 cpc r24, r14 142b0: 9f 05 cpc r25, r15 142b2: 08 f0 brcs .+2 ; 0x142b6 142b4: ce ca rjmp .-2660 ; 0x13852 manage_heater(); 142b6: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(); 142ba: 80 e0 ldi r24, 0x00 ; 0 142bc: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_update(0); 142c0: 80 e0 ldi r24, 0x00 ; 0 142c2: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 142c6: ef cf rjmp .-34 ; 0x142a6 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); 142c8: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 142ca: 0f 94 fa 89 call 0x313f4 ; 0x313f4 142ce: c1 ca rjmp .-2686 ; 0x13852 142d0: 80 e0 ldi r24, 0x00 ; 0 142d2: fb cf rjmp .-10 ; 0x142ca - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 142d4: 6e 96 adiw r28, 0x1e ; 30 142d6: 1c ae std Y+60, r1 ; 0x3c 142d8: 1d ae std Y+61, r1 ; 0x3d 142da: 1e ae std Y+62, r1 ; 0x3e 142dc: 1f ae std Y+63, r1 ; 0x3f 142de: 6e 97 sbiw r28, 0x1e ; 30 142e0: 35 ca rjmp .-2966 ; 0x1374c Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 142e2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 homing_flag = true; 142e6: 81 e0 ldi r24, 0x01 ; 1 142e8: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 // TODO: make sure the bed_level_rotation_matrix is identity or the planner will get set incorectly int l_feedmultiply = setup_for_endstop_move(); 142ec: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 142f0: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 142f2: 80 e0 ldi r24, 0x00 ; 0 142f4: 90 e0 ldi r25, 0x00 ; 0 142f6: a8 e4 ldi r26, 0x48 ; 72 142f8: b4 e4 ldi r27, 0x44 ; 68 142fa: 80 93 90 02 sts 0x0290, r24 ; 0x800290 142fe: 90 93 91 02 sts 0x0291, r25 ; 0x800291 14302: a0 93 92 02 sts 0x0292, r26 ; 0x800292 14306: b0 93 93 02 sts 0x0293, r27 ; 0x800293 find_bed_induction_sensor_point_z(-10.f, 3); 1430a: 43 e0 ldi r20, 0x03 ; 3 1430c: 60 e0 ldi r22, 0x00 ; 0 1430e: 70 e0 ldi r23, 0x00 ; 0 14310: 80 e2 ldi r24, 0x20 ; 32 14312: 91 ec ldi r25, 0xC1 ; 193 14314: 0f 94 29 8c call 0x31852 ; 0x31852 printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 14318: 70 90 4b 07 lds r7, 0x074B ; 0x80074b 1431c: 60 90 4c 07 lds r6, 0x074C ; 0x80074c 14320: 50 90 4d 07 lds r5, 0x074D ; 0x80074d 14324: 40 90 4e 07 lds r4, 0x074E ; 0x80074e 14328: b0 90 47 07 lds r11, 0x0747 ; 0x800747 1432c: a0 90 48 07 lds r10, 0x0748 ; 0x800748 14330: 90 90 49 07 lds r9, 0x0749 ; 0x800749 14334: 80 90 4a 07 lds r8, 0x074A ; 0x80074a 14338: f0 90 43 07 lds r15, 0x0743 ; 0x800743 1433c: e0 90 44 07 lds r14, 0x0744 ; 0x800744 14340: d0 90 45 07 lds r13, 0x0745 ; 0x800745 14344: c0 90 46 07 lds r12, 0x0746 ; 0x800746 14348: 86 e2 ldi r24, 0x26 ; 38 1434a: 97 e5 ldi r25, 0x57 ; 87 1434c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 14350: 4f 92 push r4 14352: 5f 92 push r5 14354: 6f 92 push r6 14356: 7f 92 push r7 14358: 8f 92 push r8 1435a: 9f 92 push r9 1435c: af 92 push r10 1435e: bf 92 push r11 14360: cf 92 push r12 14362: df 92 push r13 14364: ef 92 push r14 14366: ff 92 push r15 14368: 9f 93 push r25 1436a: 8f 93 push r24 1436c: 83 ea ldi r24, 0xA3 ; 163 1436e: 9a e6 ldi r25, 0x6A ; 106 14370: 9f 93 push r25 14372: 8f 93 push r24 14374: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 clean_up_after_endstop_move(l_feedmultiply); 14378: c8 01 movw r24, r16 1437a: 0e 94 83 67 call 0xcf06 ; 0xcf06 homing_flag = false; 1437e: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 14382: 0f b6 in r0, 0x3f ; 63 14384: f8 94 cli 14386: de bf out 0x3e, r29 ; 62 14388: 0f be out 0x3f, r0 ; 63 1438a: cd bf out 0x3d, r28 ; 61 1438c: 62 ca rjmp .-2876 ; 0x13852 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 1438e: 20 e0 ldi r18, 0x00 ; 0 14390: 30 e0 ldi r19, 0x00 ; 0 14392: 40 e2 ldi r20, 0x20 ; 32 14394: 51 e4 ldi r21, 0x41 ; 65 14396: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1439a: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1439e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 143a2: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 143a6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 143aa: 87 ff sbrs r24, 7 143ac: 05 c0 rjmp .+10 ; 0x143b8 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 143ae: 8f ed ldi r24, 0xDF ; 223 143b0: 98 e8 ldi r25, 0x88 ; 136 143b2: 0e 94 06 7b call 0xf60c ; 0xf60c 143b6: 4d ca rjmp .-2918 ; 0x13852 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 143b8: 82 e0 ldi r24, 0x02 ; 2 143ba: 0e 94 4b f9 call 0x1f296 ; 0x1f296 143be: 81 11 cpse r24, r1 143c0: 07 c0 rjmp .+14 ; 0x143d0 //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)); 143c2: 8e e0 ldi r24, 0x0E ; 14 143c4: 9a e3 ldi r25, 0x3A ; 58 143c6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 143ca: 0f 94 0c 36 call 0x26c18 ; 0x26c18 143ce: 41 ca rjmp .-2942 ; 0x13852 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 143d0: 80 91 40 07 lds r24, 0x0740 ; 0x800740 143d4: 88 23 and r24, r24 143d6: 41 f0 breq .+16 ; 0x143e8 143d8: 80 91 41 07 lds r24, 0x0741 ; 0x800741 143dc: 88 23 and r24, r24 143de: 21 f0 breq .+8 ; 0x143e8 143e0: 10 91 42 07 lds r17, 0x0742 ; 0x800742 143e4: 11 11 cpse r17, r1 143e6: 08 c0 rjmp .+16 ; 0x143f8 143e8: 81 e0 ldi r24, 0x01 ; 1 143ea: 80 93 80 10 sts 0x1080, r24 ; 0x801080 { // We don't know where we are! HOME! // Push the commands to the front of the message queue in the reverse order! // There shall be always enough space reserved for these commands. repeatcommand_front(); // repeat G76 with all its parameters enquecommand_front_P(G28W); 143ee: 81 e2 ldi r24, 0x21 ; 33 143f0: 9c e6 ldi r25, 0x6C ; 108 143f2: 0f 94 21 77 call 0x2ee42 ; 0x2ee42 143f6: 2d ca rjmp .-2982 ; 0x13852 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 143f8: 85 ec ldi r24, 0xC5 ; 197 143fa: 99 e3 ldi r25, 0x39 ; 57 143fc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 14400: 0f 94 0c 36 call 0x26c18 ; 0x26c18 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 14404: 80 e0 ldi r24, 0x00 ; 0 14406: 92 e5 ldi r25, 0x52 ; 82 14408: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1440c: 41 e0 ldi r20, 0x01 ; 1 1440e: 60 e0 ldi r22, 0x00 ; 0 14410: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 if (result == LCD_LEFT_BUTTON_CHOICE) 14414: 81 11 cpse r24, r1 14416: 61 c0 rjmp .+194 ; 0x144da { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14418: 80 e0 ldi r24, 0x00 ; 0 1441a: 90 e0 ldi r25, 0x00 ; 0 1441c: a0 ea ldi r26, 0xA0 ; 160 1441e: b0 e4 ldi r27, 0x40 ; 64 14420: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14424: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 14428: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 1442c: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14430: 60 e0 ldi r22, 0x00 ; 0 14432: 70 e0 ldi r23, 0x00 ; 0 14434: 88 e4 ldi r24, 0x48 ; 72 14436: 92 e4 ldi r25, 0x42 ; 66 14438: 0f 94 93 ba call 0x37526 ; 0x37526 current_position[Z_AXIS] = 50; 1443c: 80 e0 ldi r24, 0x00 ; 0 1443e: 90 e0 ldi r25, 0x00 ; 0 14440: a8 e4 ldi r26, 0x48 ; 72 14442: b2 e4 ldi r27, 0x42 ; 66 14444: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14448: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1444c: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 14450: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e current_position[Y_AXIS] = 180; 14454: 80 e0 ldi r24, 0x00 ; 0 14456: 90 e0 ldi r25, 0x00 ; 0 14458: a4 e3 ldi r26, 0x34 ; 52 1445a: b3 e4 ldi r27, 0x43 ; 67 1445c: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14460: 90 93 48 07 sts 0x0748, r25 ; 0x800748 14464: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14468: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 1446c: 60 e0 ldi r22, 0x00 ; 0 1446e: 70 e0 ldi r23, 0x00 ; 0 14470: 88 e4 ldi r24, 0x48 ; 72 14472: 92 e4 ldi r25, 0x42 ; 66 14474: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 14478: 0f 94 2c 59 call 0x2b258 ; 0x2b258 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 1447c: 86 ed ldi r24, 0xD6 ; 214 1447e: 91 e5 ldi r25, 0x51 ; 81 14480: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 14484: 0f 94 0c 36 call 0x26c18 ; 0x26c18 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14488: e3 e2 ldi r30, 0x23 ; 35 1448a: f2 e9 ldi r31, 0x92 ; 146 1448c: 85 91 lpm r24, Z+ 1448e: 95 91 lpm r25, Z+ 14490: a5 91 lpm r26, Z+ 14492: b4 91 lpm r27, Z 14494: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14498: 90 93 48 07 sts 0x0748, r25 ; 0x800748 1449c: a0 93 49 07 sts 0x0749, r26 ; 0x800749 144a0: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 144a4: ef e1 ldi r30, 0x1F ; 31 144a6: f2 e9 ldi r31, 0x92 ; 146 144a8: 85 91 lpm r24, Z+ 144aa: 95 91 lpm r25, Z+ 144ac: a5 91 lpm r26, Z+ 144ae: b4 91 lpm r27, Z 144b0: 80 93 43 07 sts 0x0743, r24 ; 0x800743 144b4: 90 93 44 07 sts 0x0744, r25 ; 0x800744 144b8: a0 93 45 07 sts 0x0745, r26 ; 0x800745 144bc: b0 93 46 07 sts 0x0746, r27 ; 0x800746 plan_buffer_line_curposXYZE(3000 / 60); 144c0: 60 e0 ldi r22, 0x00 ; 0 144c2: 70 e0 ldi r23, 0x00 ; 0 144c4: 88 e4 ldi r24, 0x48 ; 72 144c6: 92 e4 ldi r25, 0x42 ; 66 144c8: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 144cc: 0f 94 2c 59 call 0x2b258 ; 0x2b258 gcode_G28(false, false, true); 144d0: 41 e0 ldi r20, 0x01 ; 1 144d2: 60 e0 ldi r22, 0x00 ; 0 144d4: 80 e0 ldi r24, 0x00 ; 0 144d6: 0e 94 90 80 call 0x10120 ; 0x10120 } if ((current_temperature_pinda > 35) && (farm_mode == false)) { 144da: 20 e0 ldi r18, 0x00 ; 0 144dc: 30 e0 ldi r19, 0x00 ; 0 144de: 4c e0 ldi r20, 0x0C ; 12 144e0: 52 e4 ldi r21, 0x42 ; 66 144e2: 60 91 99 03 lds r22, 0x0399 ; 0x800399 144e6: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 144ea: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 144ee: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 144f2: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 144f6: 18 16 cp r1, r24 144f8: 0c f0 brlt .+2 ; 0x144fc 144fa: 73 c0 rjmp .+230 ; 0x145e2 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 144fc: 80 e0 ldi r24, 0x00 ; 0 144fe: 90 e0 ldi r25, 0x00 ; 0 14500: a8 ec ldi r26, 0xC8 ; 200 14502: b2 e4 ldi r27, 0x42 ; 66 14504: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14508: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1450c: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 14510: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14514: 60 e0 ldi r22, 0x00 ; 0 14516: 70 e0 ldi r23, 0x00 ; 0 14518: 88 e4 ldi r24, 0x48 ; 72 1451a: 92 e4 ldi r25, 0x42 ; 66 1451c: 0f 94 93 ba call 0x37526 ; 0x37526 } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 14520: 0f 94 57 45 call 0x28aae ; 0x28aae LongTimer pinda_timeout; 14524: 19 82 std Y+1, r1 ; 0x01 14526: 1a 82 std Y+2, r1 ; 0x02 14528: 1b 82 std Y+3, r1 ; 0x03 1452a: 1c 82 std Y+4, r1 ; 0x04 1452c: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 1452e: ce 01 movw r24, r28 14530: 01 96 adiw r24, 0x01 ; 1 14532: 0f 94 2e 42 call 0x2845c ; 0x2845c ::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); 14536: 03 e2 ldi r16, 0x23 ; 35 14538: 9f e0 ldi r25, 0x0F ; 15 1453a: e9 2e mov r14, r25 1453c: 96 e8 ldi r25, 0x86 ; 134 1453e: f9 2e mov r15, r25 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 14540: 20 e0 ldi r18, 0x00 ; 0 14542: 30 e0 ldi r19, 0x00 ; 0 14544: 4c e0 ldi r20, 0x0C ; 12 14546: 52 e4 ldi r21, 0x42 ; 66 14548: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1454c: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14550: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14554: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 14558: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1455c: 18 16 cp r1, r24 1455e: c4 f5 brge .+112 ; 0x145d0 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 14560: 87 e7 ldi r24, 0x77 ; 119 14562: 99 e3 ldi r25, 0x39 ; 57 14564: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 14568: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1456c: 42 e8 ldi r20, 0x82 ; 130 1456e: 64 e0 ldi r22, 0x04 ; 4 14570: 80 e0 ldi r24, 0x00 ; 0 14572: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 14576: 1f 92 push r1 14578: 0f 93 push r16 1457a: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1457e: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 14582: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14586: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1458a: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 1458e: 7f 93 push r23 14590: 6f 93 push r22 14592: ff 92 push r15 14594: ef 92 push r14 14596: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(LCD_STR_DEGREE[0]); 1459a: 81 e8 ldi r24, 0x81 ; 129 1459c: 0e 94 84 6f call 0xdf08 ; 0xdf08 delay_keep_alive(1000); 145a0: 88 ee ldi r24, 0xE8 ; 232 145a2: 93 e0 ldi r25, 0x03 ; 3 145a4: 0e 94 87 8e call 0x11d0e ; 0x11d0e serialecho_temperatures(); 145a8: 0e 94 e9 78 call 0xf1d2 ; 0xf1d2 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 145ac: 40 e0 ldi r20, 0x00 ; 0 145ae: 53 e5 ldi r21, 0x53 ; 83 145b0: 67 e0 ldi r22, 0x07 ; 7 145b2: 70 e0 ldi r23, 0x00 ; 0 145b4: ce 01 movw r24, r28 145b6: 01 96 adiw r24, 0x01 ; 1 145b8: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 145bc: 0f 90 pop r0 145be: 0f 90 pop r0 145c0: 0f 90 pop r0 145c2: 0f 90 pop r0 145c4: 0f 90 pop r0 145c6: 0f 90 pop r0 145c8: 88 23 and r24, r24 145ca: 09 f4 brne .+2 ; 0x145ce 145cc: b9 cf rjmp .-142 ; 0x14540 target_temp_reached = false; 145ce: 10 e0 ldi r17, 0x00 ; 0 break; } } lcd_update_enable(true); 145d0: 81 e0 ldi r24, 0x01 ; 1 145d2: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 145d6: 11 11 cpse r17, r1 145d8: 04 c0 rjmp .+8 ; 0x145e2 lcd_temp_cal_show_result(false); 145da: 80 e0 ldi r24, 0x00 ; 0 145dc: 0f 94 9d 36 call 0x26d3a ; 0x26d3a 145e0: 38 c9 rjmp .-3472 ; 0x13852 break; } } st_synchronize(); 145e2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 145e6: 81 e0 ldi r24, 0x01 ; 1 145e8: 80 93 58 0e sts 0x0E58, r24 ; 0x800e58 lcd_update_enable(true); 145ec: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 145f0: 81 ec ldi r24, 0xC1 ; 193 145f2: 98 e8 ldi r25, 0x88 ; 136 145f4: 0e 94 06 7b call 0xf60c ; 0xf60c float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 145f8: 80 90 99 03 lds r8, 0x0399 ; 0x800399 145fc: 90 90 9a 03 lds r9, 0x039A ; 0x80039a 14600: a0 90 9b 03 lds r10, 0x039B ; 0x80039b 14604: b0 90 9c 03 lds r11, 0x039C ; 0x80039c 14608: 20 e0 ldi r18, 0x00 ; 0 1460a: 30 e0 ldi r19, 0x00 ; 0 1460c: 40 ea ldi r20, 0xA0 ; 160 1460e: 50 e4 ldi r21, 0x40 ; 64 14610: c5 01 movw r24, r10 14612: b4 01 movw r22, r8 14614: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 14618: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 1461c: 25 e0 ldi r18, 0x05 ; 5 1461e: 26 9f mul r18, r22 14620: a0 01 movw r20, r0 14622: 27 9f mul r18, r23 14624: 50 0d add r21, r0 14626: 11 24 eor r1, r1 14628: ba 01 movw r22, r20 1462a: 55 0f add r21, r21 1462c: 88 0b sbc r24, r24 1462e: 99 0b sbc r25, r25 14630: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 14634: 1b 01 movw r2, r22 14636: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 14638: 20 e0 ldi r18, 0x00 ; 0 1463a: 30 e0 ldi r19, 0x00 ; 0 1463c: 4c e0 ldi r20, 0x0C ; 12 1463e: 52 e4 ldi r21, 0x42 ; 66 14640: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 14644: 87 ff sbrs r24, 7 14646: 06 c0 rjmp .+12 ; 0x14654 14648: 21 2c mov r2, r1 1464a: 31 2c mov r3, r1 1464c: 0c e0 ldi r16, 0x0C ; 12 1464e: e0 2e mov r14, r16 14650: 82 e4 ldi r24, 0x42 ; 66 14652: f8 2e mov r15, r24 if (start_temp < current_temperature_pinda) start_temp += 5; 14654: 22 2d mov r18, r2 14656: 33 2d mov r19, r3 14658: 4e 2d mov r20, r14 1465a: 5f 2d mov r21, r15 1465c: c5 01 movw r24, r10 1465e: b4 01 movw r22, r8 14660: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 14664: 18 16 cp r1, r24 14666: 64 f4 brge .+24 ; 0x14680 14668: 20 e0 ldi r18, 0x00 ; 0 1466a: 30 e0 ldi r19, 0x00 ; 0 1466c: 40 ea ldi r20, 0xA0 ; 160 1466e: 50 e4 ldi r21, 0x40 ; 64 14670: 62 2d mov r22, r2 14672: 73 2d mov r23, r3 14674: 8e 2d mov r24, r14 14676: 9f 2d mov r25, r15 14678: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1467c: 1b 01 movw r2, r22 1467e: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 14680: ff 92 push r15 14682: ef 92 push r14 14684: 3f 92 push r3 14686: 2f 92 push r2 14688: 81 e8 ldi r24, 0x81 ; 129 1468a: 9a e6 ldi r25, 0x6A ; 106 1468c: 9f 93 push r25 1468e: 8f 93 push r24 14690: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 setTargetBed(70 + (start_temp - 30)); 14694: 20 e0 ldi r18, 0x00 ; 0 14696: 30 e0 ldi r19, 0x00 ; 0 14698: 40 ef ldi r20, 0xF0 ; 240 1469a: 51 e4 ldi r21, 0x41 ; 65 1469c: 62 2d mov r22, r2 1469e: 73 2d mov r23, r3 146a0: 8e 2d mov r24, r14 146a2: 9f 2d mov r25, r15 146a4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 146a8: 20 e0 ldi r18, 0x00 ; 0 146aa: 30 e0 ldi r19, 0x00 ; 0 146ac: 4c e8 ldi r20, 0x8C ; 140 146ae: 52 e4 ldi r21, 0x42 ; 66 146b0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 146b4: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 146b8: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 146bc: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b custom_message_type = CustomMsg::TempCal; 146c0: 84 e0 ldi r24, 0x04 ; 4 146c2: 80 93 75 07 sts 0x0775, r24 ; 0x800775 custom_message_state = 1; 146c6: 81 e0 ldi r24, 0x01 ; 1 146c8: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 146cc: 82 e3 ldi r24, 0x32 ; 50 146ce: 9a e3 ldi r25, 0x3A ; 58 146d0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 146d4: 0f 94 ea 0b call 0x217d4 ; 0x217d4 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 146d8: 80 e0 ldi r24, 0x00 ; 0 146da: 90 e0 ldi r25, 0x00 ; 0 146dc: a0 ea ldi r26, 0xA0 ; 160 146de: b0 e4 ldi r27, 0x40 ; 64 146e0: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 146e4: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 146e8: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 146ec: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 146f0: 60 e0 ldi r22, 0x00 ; 0 146f2: 70 e0 ldi r23, 0x00 ; 0 146f4: 88 e4 ldi r24, 0x48 ; 72 146f6: 92 e4 ldi r25, 0x42 ; 66 146f8: 0f 94 93 ba call 0x37526 ; 0x37526 current_position[X_AXIS] = PINDA_PREHEAT_X; 146fc: 80 e0 ldi r24, 0x00 ; 0 146fe: 90 e0 ldi r25, 0x00 ; 0 14700: a0 ea ldi r26, 0xA0 ; 160 14702: b1 e4 ldi r27, 0x41 ; 65 14704: 80 93 43 07 sts 0x0743, r24 ; 0x800743 14708: 90 93 44 07 sts 0x0744, r25 ; 0x800744 1470c: a0 93 45 07 sts 0x0745, r26 ; 0x800745 14710: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 14714: 80 e0 ldi r24, 0x00 ; 0 14716: 90 e0 ldi r25, 0x00 ; 0 14718: a0 e7 ldi r26, 0x70 ; 112 1471a: b2 e4 ldi r27, 0x42 ; 66 1471c: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14720: 90 93 48 07 sts 0x0748, r25 ; 0x800748 14724: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14728: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 1472c: 60 e0 ldi r22, 0x00 ; 0 1472e: 70 e0 ldi r23, 0x00 ; 0 14730: 88 e4 ldi r24, 0x48 ; 72 14732: 92 e4 ldi r25, 0x42 ; 66 14734: 0f 94 93 ba call 0x37526 ; 0x37526 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14738: 8a e9 ldi r24, 0x9A ; 154 1473a: 99 e9 ldi r25, 0x99 ; 153 1473c: a9 e1 ldi r26, 0x19 ; 25 1473e: be e3 ldi r27, 0x3E ; 62 14740: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14744: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 14748: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 1474c: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14750: 60 e0 ldi r22, 0x00 ; 0 14752: 70 e0 ldi r23, 0x00 ; 0 14754: 88 e4 ldi r24, 0x48 ; 72 14756: 92 e4 ldi r25, 0x42 ; 66 14758: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1475c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 14760: 0f 90 pop r0 14762: 0f 90 pop r0 14764: 0f 90 pop r0 14766: 0f 90 pop r0 14768: 0f 90 pop r0 1476a: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 1476c: 20 91 99 03 lds r18, 0x0399 ; 0x800399 14770: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 14774: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 14778: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 1477c: 62 2d mov r22, r2 1477e: 73 2d mov r23, r3 14780: 8e 2d mov r24, r14 14782: 9f 2d mov r25, r15 14784: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 14788: 18 16 cp r1, r24 1478a: 3c f4 brge .+14 ; 0x1479a { delay_keep_alive(1000); 1478c: 88 ee ldi r24, 0xE8 ; 232 1478e: 93 e0 ldi r25, 0x03 ; 3 14790: 0e 94 87 8e call 0x11d0e ; 0x11d0e serialecho_temperatures(); 14794: 0e 94 e9 78 call 0xf1d2 ; 0xf1d2 14798: e9 cf rjmp .-46 ; 0x1476c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1479a: 60 e0 ldi r22, 0x00 ; 0 1479c: 86 ea ldi r24, 0xA6 ; 166 1479e: 9f e0 ldi r25, 0x0F ; 15 147a0: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } 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; 147a4: 80 e0 ldi r24, 0x00 ; 0 147a6: 90 e0 ldi r25, 0x00 ; 0 147a8: a0 ea ldi r26, 0xA0 ; 160 147aa: b0 e4 ldi r27, 0x40 ; 64 147ac: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 147b0: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 147b4: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 147b8: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 147bc: 60 e0 ldi r22, 0x00 ; 0 147be: 70 e0 ldi r23, 0x00 ; 0 147c0: 88 e4 ldi r24, 0x48 ; 72 147c2: 92 e4 ldi r25, 0x42 ; 66 147c4: 0f 94 93 ba call 0x37526 ; 0x37526 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 147c8: ef e1 ldi r30, 0x1F ; 31 147ca: f2 e9 ldi r31, 0x92 ; 146 147cc: 85 91 lpm r24, Z+ 147ce: 95 91 lpm r25, Z+ 147d0: a5 91 lpm r26, Z+ 147d2: b4 91 lpm r27, Z 147d4: 80 93 43 07 sts 0x0743, r24 ; 0x800743 147d8: 90 93 44 07 sts 0x0744, r25 ; 0x800744 147dc: a0 93 45 07 sts 0x0745, r26 ; 0x800745 147e0: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 147e4: e3 e2 ldi r30, 0x23 ; 35 147e6: f2 e9 ldi r31, 0x92 ; 146 147e8: 85 91 lpm r24, Z+ 147ea: 95 91 lpm r25, Z+ 147ec: a5 91 lpm r26, Z+ 147ee: b4 91 lpm r27, Z 147f0: 80 93 47 07 sts 0x0747, r24 ; 0x800747 147f4: 90 93 48 07 sts 0x0748, r25 ; 0x800748 147f8: a0 93 49 07 sts 0x0749, r26 ; 0x800749 147fc: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 14800: 60 e0 ldi r22, 0x00 ; 0 14802: 70 e0 ldi r23, 0x00 ; 0 14804: 88 e4 ldi r24, 0x48 ; 72 14806: 92 e4 ldi r25, 0x42 ; 66 14808: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1480c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 14810: 43 e0 ldi r20, 0x03 ; 3 14812: 60 e0 ldi r22, 0x00 ; 0 14814: 70 e0 ldi r23, 0x00 ; 0 14816: 80 e8 ldi r24, 0x80 ; 128 14818: 9f eb ldi r25, 0xBF ; 191 1481a: 0f 94 29 8c call 0x31852 ; 0x31852 if (find_z_result == false) { 1481e: 81 11 cpse r24, r1 14820: 06 c0 rjmp .+12 ; 0x1482e 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); 14822: 0f 94 9d 36 call 0x26d3a ; 0x26d3a homing_flag = false; 14826: 10 92 58 0e sts 0x0E58, r1 ; 0x800e58 1482a: 0c 94 29 9c jmp 0x13852 ; 0x13852 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 1482e: 90 91 4b 07 lds r25, 0x074B ; 0x80074b 14832: 67 96 adiw r28, 0x17 ; 23 14834: 9f af std Y+63, r25 ; 0x3f 14836: 67 97 sbiw r28, 0x17 ; 23 14838: a0 91 4c 07 lds r26, 0x074C ; 0x80074c 1483c: 6b 96 adiw r28, 0x1b ; 27 1483e: af af std Y+63, r26 ; 0x3f 14840: 6b 97 sbiw r28, 0x1b ; 27 14842: b0 91 4d 07 lds r27, 0x074D ; 0x80074d 14846: 6f 96 adiw r28, 0x1f ; 31 14848: bf af std Y+63, r27 ; 0x3f 1484a: 6f 97 sbiw r28, 0x1f ; 31 1484c: e0 91 4e 07 lds r30, 0x074E ; 0x80074e 14850: a7 96 adiw r28, 0x27 ; 39 14852: ef af std Y+63, r30 ; 0x3f 14854: a7 97 sbiw r28, 0x27 ; 39 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 14856: ef 93 push r30 14858: bf 93 push r27 1485a: af 93 push r26 1485c: 9f 93 push r25 1485e: 84 e7 ldi r24, 0x74 ; 116 14860: 9a e6 ldi r25, 0x6A ; 106 14862: 9f 93 push r25 14864: 8f 93 push r24 14866: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1486a: 0f 90 pop r0 1486c: 0f 90 pop r0 1486e: 0f 90 pop r0 14870: 0f 90 pop r0 14872: 0f 90 pop r0 14874: 0f 90 pop r0 14876: be ea ldi r27, 0xAE ; 174 14878: 8b 2e mov r8, r27 1487a: bf e0 ldi r27, 0x0F ; 15 1487c: 9b 2e mov r9, r27 1487e: 13 e2 ldi r17, 0x23 ; 35 14880: c1 2e mov r12, r17 14882: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 14884: 0f ef ldi r16, 0xFF ; 255 14886: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 14888: b6 01 movw r22, r12 1488a: 0d 2c mov r0, r13 1488c: 00 0c add r0, r0 1488e: 88 0b sbc r24, r24 14890: 99 0b sbc r25, r25 14892: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 14896: 2b 01 movw r4, r22 14898: 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)); 1489a: df 92 push r13 1489c: cf 92 push r12 1489e: c8 01 movw r24, r16 148a0: 02 96 adiw r24, 0x02 ; 2 148a2: 9f 93 push r25 148a4: 8f 93 push r24 148a6: 28 e3 ldi r18, 0x38 ; 56 148a8: 3a e6 ldi r19, 0x6A ; 106 148aa: 3f 93 push r19 148ac: 2f 93 push r18 148ae: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 148b2: 58 01 movw r10, r16 148b4: 5f ef ldi r21, 0xFF ; 255 148b6: a5 1a sub r10, r21 148b8: b5 0a sbc r11, r21 if (i >= 0) { 148ba: 0f 90 pop r0 148bc: 0f 90 pop r0 148be: 0f 90 pop r0 148c0: 0f 90 pop r0 148c2: 0f 90 pop r0 148c4: 0f 90 pop r0 148c6: 11 f4 brne .+4 ; 0x148cc 148c8: 0c 94 36 cf jmp 0x19e6c ; 0x19e6c if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 148cc: 70 e0 ldi r23, 0x00 ; 0 148ce: 60 e0 ldi r22, 0x00 ; 0 148d0: c4 01 movw r24, r8 148d2: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 148d6: a3 01 movw r20, r6 148d8: 92 01 movw r18, r4 148da: 62 2d mov r22, r2 148dc: 73 2d mov r23, r3 148de: 8e 2d mov r24, r14 148e0: 9f 2d mov r25, r15 148e2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 148e6: 18 16 cp r1, r24 148e8: 44 f4 brge .+16 ; 0x148fa } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 148ea: 85 e0 ldi r24, 0x05 ; 5 148ec: a8 16 cp r10, r24 148ee: b1 04 cpc r11, r1 148f0: 11 f0 breq .+4 ; 0x148f6 148f2: 0c 94 42 cf jmp 0x19e84 ; 0x19e84 148f6: 05 e0 ldi r16, 0x05 ; 5 148f8: 10 e0 ldi r17, 0x00 ; 0 148fa: 58 01 movw r10, r16 148fc: 97 e2 ldi r25, 0x27 ; 39 148fe: a9 1a sub r10, r25 14900: 98 ef ldi r25, 0xF8 ; 248 14902: b9 0a sbc r11, r25 14904: aa 0c add r10, r10 14906: bb 1c adc r11, r11 14908: 85 e0 ldi r24, 0x05 ; 5 1490a: 80 9f mul r24, r16 1490c: 10 01 movw r2, r0 1490e: 81 9f mul r24, r17 14910: 30 0c add r3, r0 14912: 11 24 eor r1, r1 14914: 0d 5f subi r16, 0xFD ; 253 14916: 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; 14918: fa e9 ldi r31, 0x9A ; 154 1491a: 4f 2e mov r4, r31 1491c: f9 e9 ldi r31, 0x99 ; 153 1491e: 5f 2e mov r5, r31 14920: f9 e1 ldi r31, 0x19 ; 25 14922: 6f 2e mov r6, r31 14924: fe e3 ldi r31, 0x3E ; 62 14926: 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); 14928: af ef ldi r26, 0xFF ; 255 1492a: 8a 2e mov r8, r26 1492c: a9 e6 ldi r26, 0x69 ; 105 1492e: 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++) 14930: c8 01 movw r24, r16 14932: 02 97 sbiw r24, 0x02 ; 2 14934: 05 97 sbiw r24, 0x05 ; 5 14936: 0c f0 brlt .+2 ; 0x1493a 14938: d4 c0 rjmp .+424 ; 0x14ae2 { float temp = (40 + i * 5); 1493a: b1 01 movw r22, r2 1493c: 63 5d subi r22, 0xD3 ; 211 1493e: 7f 4f sbci r23, 0xFF ; 255 14940: 07 2e mov r0, r23 14942: 00 0c add r0, r0 14944: 88 0b sbc r24, r24 14946: 99 0b sbc r25, r25 14948: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1494c: 6b 01 movw r12, r22 1494e: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 14950: 1f 93 push r17 14952: 0f 93 push r16 14954: ab e2 ldi r26, 0x2B ; 43 14956: ba e6 ldi r27, 0x6A ; 106 14958: bf 93 push r27 1495a: af 93 push r26 1495c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 custom_message_state = i + 2; 14960: 00 93 f3 03 sts 0x03F3, r16 ; 0x8003f3 setTargetBed(50 + 10 * (temp - 30) / 5); 14964: 20 e0 ldi r18, 0x00 ; 0 14966: 30 e0 ldi r19, 0x00 ; 0 14968: 40 ef ldi r20, 0xF0 ; 240 1496a: 51 e4 ldi r21, 0x41 ; 65 1496c: c7 01 movw r24, r14 1496e: b6 01 movw r22, r12 14970: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 14974: 20 e0 ldi r18, 0x00 ; 0 14976: 30 e0 ldi r19, 0x00 ; 0 14978: 40 e2 ldi r20, 0x20 ; 32 1497a: 51 e4 ldi r21, 0x41 ; 65 1497c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 14980: 20 e0 ldi r18, 0x00 ; 0 14982: 30 e0 ldi r19, 0x00 ; 0 14984: 40 ea ldi r20, 0xA0 ; 160 14986: 50 e4 ldi r21, 0x40 ; 64 14988: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1498c: 20 e0 ldi r18, 0x00 ; 0 1498e: 30 e0 ldi r19, 0x00 ; 0 14990: 48 e4 ldi r20, 0x48 ; 72 14992: 52 e4 ldi r21, 0x42 ; 66 14994: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 14998: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 1499c: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 149a0: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 149a4: 80 e0 ldi r24, 0x00 ; 0 149a6: 90 e0 ldi r25, 0x00 ; 0 149a8: a0 ea ldi r26, 0xA0 ; 160 149aa: b0 e4 ldi r27, 0x40 ; 64 149ac: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 149b0: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 149b4: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 149b8: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 149bc: 60 e0 ldi r22, 0x00 ; 0 149be: 70 e0 ldi r23, 0x00 ; 0 149c0: 88 e4 ldi r24, 0x48 ; 72 149c2: 92 e4 ldi r25, 0x42 ; 66 149c4: 0f 94 93 ba call 0x37526 ; 0x37526 current_position[X_AXIS] = PINDA_PREHEAT_X; 149c8: 20 e0 ldi r18, 0x00 ; 0 149ca: 30 e0 ldi r19, 0x00 ; 0 149cc: 40 ea ldi r20, 0xA0 ; 160 149ce: 51 e4 ldi r21, 0x41 ; 65 149d0: 20 93 43 07 sts 0x0743, r18 ; 0x800743 149d4: 30 93 44 07 sts 0x0744, r19 ; 0x800744 149d8: 40 93 45 07 sts 0x0745, r20 ; 0x800745 149dc: 50 93 46 07 sts 0x0746, r21 ; 0x800746 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 149e0: 80 e0 ldi r24, 0x00 ; 0 149e2: 90 e0 ldi r25, 0x00 ; 0 149e4: a0 e7 ldi r26, 0x70 ; 112 149e6: b2 e4 ldi r27, 0x42 ; 66 149e8: 80 93 47 07 sts 0x0747, r24 ; 0x800747 149ec: 90 93 48 07 sts 0x0748, r25 ; 0x800748 149f0: a0 93 49 07 sts 0x0749, r26 ; 0x800749 149f4: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 149f8: 60 e0 ldi r22, 0x00 ; 0 149fa: 70 e0 ldi r23, 0x00 ; 0 149fc: 88 e4 ldi r24, 0x48 ; 72 149fe: 92 e4 ldi r25, 0x42 ; 66 14a00: 0f 94 93 ba call 0x37526 ; 0x37526 current_position[Z_AXIS] = PINDA_PREHEAT_Z; 14a04: 40 92 4b 07 sts 0x074B, r4 ; 0x80074b 14a08: 50 92 4c 07 sts 0x074C, r5 ; 0x80074c 14a0c: 60 92 4d 07 sts 0x074D, r6 ; 0x80074d 14a10: 70 92 4e 07 sts 0x074E, r7 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14a14: 60 e0 ldi r22, 0x00 ; 0 14a16: 70 e0 ldi r23, 0x00 ; 0 14a18: 88 e4 ldi r24, 0x48 ; 72 14a1a: 92 e4 ldi r25, 0x42 ; 66 14a1c: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 14a20: 0f 94 2c 59 call 0x2b258 ; 0x2b258 14a24: 0f 90 pop r0 14a26: 0f 90 pop r0 14a28: 0f 90 pop r0 14a2a: 0f 90 pop r0 while (current_temperature_pinda < temp) 14a2c: 20 91 99 03 lds r18, 0x0399 ; 0x800399 14a30: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 14a34: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 14a38: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 14a3c: c7 01 movw r24, r14 14a3e: b6 01 movw r22, r12 14a40: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 14a44: 18 16 cp r1, r24 14a46: 3c f4 brge .+14 ; 0x14a56 { delay_keep_alive(1000); 14a48: 88 ee ldi r24, 0xE8 ; 232 14a4a: 93 e0 ldi r25, 0x03 ; 3 14a4c: 0e 94 87 8e call 0x11d0e ; 0x11d0e serialecho_temperatures(); 14a50: 0e 94 e9 78 call 0xf1d2 ; 0xf1d2 14a54: eb cf rjmp .-42 ; 0x14a2c } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 14a56: 80 e0 ldi r24, 0x00 ; 0 14a58: 90 e0 ldi r25, 0x00 ; 0 14a5a: a0 ea ldi r26, 0xA0 ; 160 14a5c: b0 e4 ldi r27, 0x40 ; 64 14a5e: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 14a62: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 14a66: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 14a6a: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(3000 / 60); 14a6e: 60 e0 ldi r22, 0x00 ; 0 14a70: 70 e0 ldi r23, 0x00 ; 0 14a72: 88 e4 ldi r24, 0x48 ; 72 14a74: 92 e4 ldi r25, 0x42 ; 66 14a76: 0f 94 93 ba call 0x37526 ; 0x37526 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 14a7a: ef e1 ldi r30, 0x1F ; 31 14a7c: f2 e9 ldi r31, 0x92 ; 146 14a7e: 85 91 lpm r24, Z+ 14a80: 95 91 lpm r25, Z+ 14a82: a5 91 lpm r26, Z+ 14a84: b4 91 lpm r27, Z 14a86: 80 93 43 07 sts 0x0743, r24 ; 0x800743 14a8a: 90 93 44 07 sts 0x0744, r25 ; 0x800744 14a8e: a0 93 45 07 sts 0x0745, r26 ; 0x800745 14a92: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 14a96: e3 e2 ldi r30, 0x23 ; 35 14a98: f2 e9 ldi r31, 0x92 ; 146 14a9a: 85 91 lpm r24, Z+ 14a9c: 95 91 lpm r25, Z+ 14a9e: a5 91 lpm r26, Z+ 14aa0: b4 91 lpm r27, Z 14aa2: 80 93 47 07 sts 0x0747, r24 ; 0x800747 14aa6: 90 93 48 07 sts 0x0748, r25 ; 0x800748 14aaa: a0 93 49 07 sts 0x0749, r26 ; 0x800749 14aae: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(3000 / 60); 14ab2: 60 e0 ldi r22, 0x00 ; 0 14ab4: 70 e0 ldi r23, 0x00 ; 0 14ab6: 88 e4 ldi r24, 0x48 ; 72 14ab8: 92 e4 ldi r25, 0x42 ; 66 14aba: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 14abe: 0f 94 2c 59 call 0x2b258 ; 0x2b258 find_z_result = find_bed_induction_sensor_point_z(-1.f); 14ac2: 43 e0 ldi r20, 0x03 ; 3 14ac4: 60 e0 ldi r22, 0x00 ; 0 14ac6: 70 e0 ldi r23, 0x00 ; 0 14ac8: 80 e8 ldi r24, 0x80 ; 128 14aca: 9f eb ldi r25, 0xBF ; 191 14acc: 0f 94 29 8c call 0x31852 ; 0x31852 14ad0: 95 e0 ldi r25, 0x05 ; 5 14ad2: 29 0e add r2, r25 14ad4: 31 1c adc r3, r1 14ad6: 0f 5f subi r16, 0xFF ; 255 14ad8: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 14ada: 81 11 cpse r24, r1 14adc: 04 c0 rjmp .+8 ; 0x14ae6 lcd_temp_cal_show_result(find_z_result); 14ade: 0f 94 9d 36 call 0x26d3a ; 0x26d3a 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); 14ae2: 81 e0 ldi r24, 0x01 ; 1 14ae4: 9e ce rjmp .-708 ; 0x14822 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]); 14ae6: 67 96 adiw r28, 0x17 ; 23 14ae8: 7f ad ldd r23, Y+63 ; 0x3f 14aea: 67 97 sbiw r28, 0x17 ; 23 14aec: 6b 96 adiw r28, 0x1b ; 27 14aee: 6f ad ldd r22, Y+63 ; 0x3f 14af0: 6b 97 sbiw r28, 0x1b ; 27 14af2: 6f 96 adiw r28, 0x1f ; 31 14af4: 9f ad ldd r25, Y+63 ; 0x3f 14af6: 6f 97 sbiw r28, 0x1f ; 31 14af8: a7 96 adiw r28, 0x27 ; 39 14afa: 8f ad ldd r24, Y+63 ; 0x3f 14afc: a7 97 sbiw r28, 0x27 ; 39 14afe: 27 2f mov r18, r23 14b00: 36 2f mov r19, r22 14b02: 49 2f mov r20, r25 14b04: 58 2f mov r21, r24 14b06: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 14b0a: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 14b0e: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 14b12: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 14b16: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 14b1a: f6 2e mov r15, r22 14b1c: e7 2e mov r14, r23 14b1e: d8 2e mov r13, r24 14b20: c9 2e mov r12, r25 14b22: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 14b26: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 14b2a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 14b2e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 14b32: d7 01 movw r26, r14 14b34: f6 01 movw r30, r12 14b36: 6b 2f mov r22, r27 14b38: 7a 2f mov r23, r26 14b3a: 8f 2f mov r24, r31 14b3c: 9e 2f mov r25, r30 14b3e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 14b42: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 14b46: a6 96 adiw r28, 0x26 ; 38 14b48: 6c af std Y+60, r22 ; 0x3c 14b4a: 7d af std Y+61, r23 ; 0x3d 14b4c: 8e af std Y+62, r24 ; 0x3e 14b4e: 9f af std Y+63, r25 ; 0x3f 14b50: 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); 14b52: cf 92 push r12 14b54: df 92 push r13 14b56: ef 92 push r14 14b58: ff 92 push r15 14b5a: 80 91 9c 03 lds r24, 0x039C ; 0x80039c 14b5e: 8f 93 push r24 14b60: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 14b64: 8f 93 push r24 14b66: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 14b6a: 8f 93 push r24 14b6c: 80 91 99 03 lds r24, 0x0399 ; 0x800399 14b70: 8f 93 push r24 14b72: 9f 92 push r9 14b74: 8f 92 push r8 14b76: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 14b7a: a4 96 adiw r28, 0x24 ; 36 14b7c: 6e ad ldd r22, Y+62 ; 0x3e 14b7e: 7f ad ldd r23, Y+63 ; 0x3f 14b80: a4 97 sbiw r28, 0x24 ; 36 14b82: c5 01 movw r24, r10 14b84: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 14b88: a2 e0 ldi r26, 0x02 ; 2 14b8a: aa 0e add r10, r26 14b8c: b1 1c adc r11, r1 14b8e: 0f b6 in r0, 0x3f ; 63 14b90: f8 94 cli 14b92: de bf out 0x3e, r29 ; 62 14b94: 0f be out 0x3f, r0 ; 63 14b96: cd bf out 0x3d, r28 ; 61 14b98: cb ce rjmp .-618 ; 0x14930 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 14b9a: 80 e1 ldi r24, 0x10 ; 16 14b9c: 0e 94 11 e7 call 0x1ce22 ; 0x1ce22 14ba0: 0c 94 29 9c jmp 0x13852 ; 0x13852 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 14ba4: 80 e1 ldi r24, 0x10 ; 16 14ba6: 0e 94 66 e7 call 0x1cecc ; 0x1cecc 14baa: 0c 94 29 9c jmp 0x13852 ; 0x13852 /*! ### 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); 14bae: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 14bb2: 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; 14bb4: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 14bb8: 0c 94 29 9c jmp 0x13852 ; 0x13852 14bbc: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 14bc0: 87 60 ori r24, 0x07 ; 7 14bc2: f8 cf rjmp .-16 ; 0x14bb4 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 14bc4: 0f 94 2c 59 call 0x2b258 ; 0x2b258 14bc8: f1 2c mov r15, r1 14bca: e1 2c mov r14, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 14bcc: f8 01 movw r30, r16 14bce: 81 91 ld r24, Z+ 14bd0: 8f 01 movw r16, r30 14bd2: 88 23 and r24, r24 14bd4: d1 f0 breq .+52 ; 0x14c0a current_position[i] = values[i] + cs.add_homing[i]; 14bd6: 97 01 movw r18, r14 14bd8: 2d 5b subi r18, 0xBD ; 189 14bda: 38 4f sbci r19, 0xF8 ; 248 14bdc: 59 01 movw r10, r18 14bde: f3 01 movw r30, r6 14be0: ee 0d add r30, r14 14be2: ff 1d adc r31, r15 14be4: 20 81 ld r18, Z 14be6: 31 81 ldd r19, Z+1 ; 0x01 14be8: 42 81 ldd r20, Z+2 ; 0x02 14bea: 53 81 ldd r21, Z+3 ; 0x03 14bec: f7 01 movw r30, r14 14bee: ea 53 subi r30, 0x3A ; 58 14bf0: f9 4f sbci r31, 0xF9 ; 249 14bf2: 60 81 ld r22, Z 14bf4: 71 81 ldd r23, Z+1 ; 0x01 14bf6: 82 81 ldd r24, Z+2 ; 0x02 14bf8: 93 81 ldd r25, Z+3 ; 0x03 14bfa: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 14bfe: d5 01 movw r26, r10 14c00: 6d 93 st X+, r22 14c02: 7d 93 st X+, r23 14c04: 8d 93 st X+, r24 14c06: 9c 93 st X, r25 14c08: 13 97 sbiw r26, 0x03 ; 3 14c0a: b4 e0 ldi r27, 0x04 ; 4 14c0c: eb 0e add r14, r27 14c0e: 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) 14c10: ec e0 ldi r30, 0x0C ; 12 14c12: ee 16 cp r14, r30 14c14: f1 04 cpc r15, r1 14c16: d1 f6 brne .-76 ; 0x14bcc { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 14c18: dd 20 and r13, r13 14c1a: 61 f0 breq .+24 ; 0x14c34 current_position[E_AXIS] = values[E_AXIS]; 14c1c: 8d 85 ldd r24, Y+13 ; 0x0d 14c1e: 9e 85 ldd r25, Y+14 ; 0x0e 14c20: af 85 ldd r26, Y+15 ; 0x0f 14c22: b8 89 ldd r27, Y+16 ; 0x10 14c24: 80 93 4f 07 sts 0x074F, r24 ; 0x80074f 14c28: 90 93 50 07 sts 0x0750, r25 ; 0x800750 14c2c: a0 93 51 07 sts 0x0751, r26 ; 0x800751 14c30: b0 93 52 07 sts 0x0752, r27 ; 0x800752 // Set all at once plan_set_position_curposXYZE(); 14c34: 0f 94 53 b9 call 0x372a6 ; 0x372a6 14c38: 0c 94 29 9c jmp 0x13852 ; 0x13852 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 14c3c: 8d 34 cpi r24, 0x4D ; 77 14c3e: 11 f0 breq .+4 ; 0x14c44 14c40: 0c 94 a7 cd jmp 0x19b4e ; 0x19b4e { strchr_pointer = CMDBUFFER_CURRENT_STRING; 14c44: 10 93 98 03 sts 0x0398, r17 ; 0x800398 14c48: 00 93 97 03 sts 0x0397, r16 ; 0x800397 14c4c: f8 01 movw r30, r16 14c4e: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 14c50: 81 91 ld r24, Z+ 14c52: 80 32 cpi r24, 0x20 ; 32 14c54: e9 f3 breq .-6 ; 0x14c50 14c56: 89 30 cpi r24, 0x09 ; 9 14c58: d9 f3 breq .-10 ; 0x14c50 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 14c5a: 80 53 subi r24, 0x30 ; 48 14c5c: 8a 30 cpi r24, 0x0A ; 10 14c5e: 70 f0 brcs .+28 ; 0x14c7c printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 14c60: 1f 93 push r17 14c62: 0f 93 push r16 14c64: 8d ea ldi r24, 0xAD ; 173 14c66: 98 e8 ldi r25, 0x88 ; 136 14c68: 9f 93 push r25 14c6a: 8f 93 push r24 14c6c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 14c70: 0f 90 pop r0 14c72: 0f 90 pop r0 14c74: 0f 90 pop r0 14c76: 0f 90 pop r0 14c78: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc } else { mcode_in_progress = code_value_short(); 14c7c: 0e 94 1b 5c call 0xb836 ; 0xb836 14c80: 90 93 5c 0e sts 0x0E5C, r25 ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.551+0x1> 14c84: 80 93 5b 0e sts 0x0E5B, r24 ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.551> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14c88: 89 3c cpi r24, 0xC9 ; 201 14c8a: 91 05 cpc r25, r1 14c8c: 11 f4 brne .+4 ; 0x14c92 14c8e: 0c 94 6a ba jmp 0x174d4 ; 0x174d4 14c92: 0c f0 brlt .+2 ; 0x14c96 14c94: 40 c3 rjmp .+1664 ; 0x15316 14c96: 8e 34 cpi r24, 0x4E ; 78 14c98: 91 05 cpc r25, r1 14c9a: 11 f4 brne .+4 ; 0x14ca0 14c9c: 0c 94 d0 b5 jmp 0x16ba0 ; 0x16ba0 14ca0: 0c f0 brlt .+2 ; 0x14ca4 14ca2: 35 c2 rjmp .+1130 ; 0x1510e 14ca4: 8c 31 cpi r24, 0x1C ; 28 14ca6: 91 05 cpc r25, r1 14ca8: 11 f4 brne .+4 ; 0x14cae 14caa: 0c 94 2f b4 jmp 0x1685e ; 0x1685e 14cae: 0c f0 brlt .+2 ; 0x14cb2 14cb0: 00 c1 rjmp .+512 ; 0x14eb2 14cb2: 85 31 cpi r24, 0x15 ; 21 14cb4: 91 05 cpc r25, r1 14cb6: 11 f4 brne .+4 ; 0x14cbc 14cb8: 0c 94 48 b3 jmp 0x16690 ; 0x16690 14cbc: 0c f0 brlt .+2 ; 0x14cc0 14cbe: 5e c0 rjmp .+188 ; 0x14d7c 14cc0: 81 31 cpi r24, 0x11 ; 17 14cc2: 91 05 cpc r25, r1 14cc4: 11 f4 brne .+4 ; 0x14cca 14cc6: 0c 94 3d b3 jmp 0x1667a ; 0x1667a 14cca: ec f4 brge .+58 ; 0x14d06 14ccc: 02 97 sbiw r24, 0x02 ; 2 14cce: 10 f4 brcc .+4 ; 0x14cd4 14cd0: 0c 94 b1 b2 jmp 0x16562 ; 0x16562 /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 14cd4: 80 91 70 12 lds r24, 0x1270 ; 0x801270 14cd8: 90 91 71 12 lds r25, 0x1271 ; 0x801271 14cdc: 8a 57 subi r24, 0x7A ; 122 14cde: 9f 4e sbci r25, 0xEF ; 239 14ce0: 9f 93 push r25 14ce2: 8f 93 push r24 14ce4: 1f 92 push r1 14ce6: 8d e4 ldi r24, 0x4D ; 77 14ce8: 8f 93 push r24 14cea: 8a ee ldi r24, 0xEA ; 234 14cec: 99 e6 ldi r25, 0x69 ; 105 14cee: 9f 93 push r25 14cf0: 8f 93 push r24 14cf2: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 14cf6: 0f 90 pop r0 14cf8: 0f 90 pop r0 14cfa: 0f 90 pop r0 14cfc: 0f 90 pop r0 14cfe: 0f 90 pop r0 14d00: 0f 90 pop r0 14d02: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d06: 82 31 cpi r24, 0x12 ; 18 14d08: 91 05 cpc r25, r1 14d0a: 11 f4 brne .+4 ; 0x14d10 14d0c: 0c 94 85 b7 jmp 0x16f0a ; 0x16f0a 14d10: 44 97 sbiw r24, 0x14 ; 20 14d12: 01 f7 brne .-64 ; 0x14cd4 #### 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() 14d14: 81 e0 ldi r24, 0x01 ; 1 14d16: 80 93 96 02 sts 0x0296, r24 ; 0x800296 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 14d1a: 8a ed ldi r24, 0xDA ; 218 14d1c: 99 e6 ldi r25, 0x69 ; 105 14d1e: 0e 94 06 7b call 0xf60c ; 0xf60c card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 14d22: 84 e5 ldi r24, 0x54 ; 84 14d24: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 14d28: 18 2f mov r17, r24 14d2a: 8c e4 ldi r24, 0x4C ; 76 14d2c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 14d30: 00 e0 ldi r16, 0x00 ; 0 14d32: 80 fb bst r24, 0 14d34: 00 f9 bld r16, 0 14d36: 10 fb bst r17, 0 14d38: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 14d3a: 84 ef ldi r24, 0xF4 ; 244 14d3c: 94 e1 ldi r25, 0x14 ; 20 14d3e: 0e 94 b7 78 call 0xf16e ; 0xf16e lsDive("",root, NULL, LS_SerialPrint, params); 14d42: 83 e2 ldi r24, 0x23 ; 35 14d44: e4 ef ldi r30, 0xF4 ; 244 14d46: f4 e1 ldi r31, 0x14 ; 20 14d48: de 01 movw r26, r28 14d4a: 11 96 adiw r26, 0x01 ; 1 14d4c: 01 90 ld r0, Z+ 14d4e: 0d 92 st X+, r0 14d50: 8a 95 dec r24 14d52: e1 f7 brne .-8 ; 0x14d4c 14d54: 20 e0 ldi r18, 0x00 ; 0 14d56: 50 e0 ldi r21, 0x00 ; 0 14d58: 40 e0 ldi r20, 0x00 ; 0 14d5a: be 01 movw r22, r28 14d5c: 6f 5f subi r22, 0xFF ; 255 14d5e: 7f 4f sbci r23, 0xFF ; 255 14d60: 84 ef ldi r24, 0xF4 ; 244 14d62: 92 e0 ldi r25, 0x02 ; 2 14d64: 0f 94 33 79 call 0x2f266 ; 0x2f266 14d68: ce 01 movw r24, r28 14d6a: 01 96 adiw r24, 0x01 ; 1 14d6c: 0e 94 bc 78 call 0xf178 ; 0xf178 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 14d70: 8c ec ldi r24, 0xCC ; 204 14d72: 99 e6 ldi r25, 0x69 ; 105 14d74: 0e 94 06 7b call 0xf60c ; 0xf60c 14d78: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14d7c: 88 31 cpi r24, 0x18 ; 24 14d7e: 91 05 cpc r25, r1 14d80: 11 f4 brne .+4 ; 0x14d86 14d82: 0c 94 59 b3 jmp 0x166b2 ; 0x166b2 14d86: 94 f4 brge .+36 ; 0x14dac 14d88: 86 31 cpi r24, 0x16 ; 22 14d8a: 91 05 cpc r25, r1 14d8c: 11 f4 brne .+4 ; 0x14d92 14d8e: 0c 94 4c b3 jmp 0x16698 ; 0x16698 14d92: 47 97 sbiw r24, 0x17 ; 23 14d94: 09 f0 breq .+2 ; 0x14d98 14d96: 9e cf rjmp .-196 ; 0x14cd4 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 14d98: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14d9c: 90 91 98 03 lds r25, 0x0398 ; 0x800398 14da0: 61 e0 ldi r22, 0x01 ; 1 14da2: 04 96 adiw r24, 0x04 ; 4 14da4: 0f 94 01 80 call 0x30002 ; 0x30002 14da8: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14dac: 8a 31 cpi r24, 0x1A ; 26 14dae: 91 05 cpc r25, r1 14db0: 11 f4 brne .+4 ; 0x14db6 14db2: 0c 94 9f b3 jmp 0x1673e ; 0x1673e 14db6: 14 f0 brlt .+4 ; 0x14dbc 14db8: 0c 94 c1 b3 jmp 0x16782 ; 0x16782 14dbc: 0d ed ldi r16, 0xDD ; 221 14dbe: 12 e0 ldi r17, 0x02 ; 2 14dc0: ff e3 ldi r31, 0x3F ; 63 14dc2: af 2e mov r10, r31 14dc4: f2 e0 ldi r31, 0x02 ; 2 14dc6: bf 2e mov r11, r31 14dc8: a1 e2 ldi r26, 0x21 ; 33 14dca: ca 2e mov r12, r26 14dcc: a2 e0 ldi r26, 0x02 ; 2 14dce: da 2e mov r13, r26 14dd0: b5 e1 ldi r27, 0x15 ; 21 14dd2: eb 2e mov r14, r27 14dd4: b2 e0 ldi r27, 0x02 ; 2 14dd6: fb 2e mov r15, r27 14dd8: 80 ee ldi r24, 0xE0 ; 224 14dda: 88 2e mov r8, r24 14ddc: 82 e0 ldi r24, 0x02 ; 2 14dde: 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])) { 14de0: f8 01 movw r30, r16 14de2: 81 91 ld r24, Z+ 14de4: 8f 01 movw r16, r30 14de6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 14dea: 88 23 and r24, r24 14dec: 21 f1 breq .+72 ; 0x14e36 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 14dee: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 14df2: d6 01 movw r26, r12 14df4: 4d 90 ld r4, X+ 14df6: 5d 90 ld r5, X+ 14df8: 6d 90 ld r6, X+ 14dfa: 7c 90 ld r7, X 14dfc: a3 01 movw r20, r6 14dfe: 92 01 movw r18, r4 14e00: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 14e04: 87 fd sbrc r24, 7 14e06: 11 c0 rjmp .+34 ; 0x14e2a 14e08: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 14e0c: f7 01 movw r30, r14 14e0e: 40 80 ld r4, Z 14e10: 51 80 ldd r5, Z+1 ; 0x01 14e12: 62 80 ldd r6, Z+2 ; 0x02 14e14: 73 80 ldd r7, Z+3 ; 0x03 14e16: a3 01 movw r20, r6 14e18: 92 01 movw r18, r4 14e1a: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 14e1e: 18 16 cp r1, r24 14e20: 24 f0 brlt .+8 ; 0x14e2a 14e22: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 14e26: 2b 01 movw r4, r22 14e28: 3c 01 movw r6, r24 14e2a: d5 01 movw r26, r10 14e2c: 4d 92 st X+, r4 14e2e: 5d 92 st X+, r5 14e30: 6d 92 st X+, r6 14e32: 7c 92 st X, r7 14e34: 13 97 sbiw r26, 0x03 ; 3 14e36: b4 e0 ldi r27, 0x04 ; 4 14e38: ab 0e add r10, r27 14e3a: b1 1c adc r11, r1 14e3c: e4 e0 ldi r30, 0x04 ; 4 14e3e: ce 0e add r12, r30 14e40: d1 1c adc r13, r1 14e42: f4 e0 ldi r31, 0x04 ; 4 14e44: ef 0e add r14, r31 14e46: 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++) { 14e48: 80 16 cp r8, r16 14e4a: 91 06 cpc r9, r17 14e4c: 49 f6 brne .-110 ; 0x14de0 //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')) { 14e4e: 83 e5 ldi r24, 0x53 ; 83 14e50: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 14e54: 88 23 and r24, r24 14e56: 11 f4 brne .+4 ; 0x14e5c 14e58: 0c 94 2c c6 jmp 0x18c58 ; 0x18c58 if ( code_value_uint8() == 0 ) { 14e5c: 0e 94 0e 5c call 0xb81c ; 0xb81c 14e60: 81 11 cpse r24, r1 14e62: 0c 94 95 b2 jmp 0x1652a ; 0x1652a pause_position[X_AXIS] = X_PAUSE_POS; 14e66: 80 e0 ldi r24, 0x00 ; 0 14e68: 90 e0 ldi r25, 0x00 ; 0 14e6a: a8 e4 ldi r26, 0x48 ; 72 14e6c: b2 e4 ldi r27, 0x42 ; 66 14e6e: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f <_ZL14pause_position.lto_priv.497> 14e72: 90 93 40 02 sts 0x0240, r25 ; 0x800240 <_ZL14pause_position.lto_priv.497+0x1> 14e76: a0 93 41 02 sts 0x0241, r26 ; 0x800241 <_ZL14pause_position.lto_priv.497+0x2> 14e7a: b0 93 42 02 sts 0x0242, r27 ; 0x800242 <_ZL14pause_position.lto_priv.497+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 14e7e: 80 e0 ldi r24, 0x00 ; 0 14e80: 90 e0 ldi r25, 0x00 ; 0 14e82: ae e3 ldi r26, 0x3E ; 62 14e84: b3 e4 ldi r27, 0x43 ; 67 14e86: 80 93 43 02 sts 0x0243, r24 ; 0x800243 <_ZL14pause_position.lto_priv.497+0x4> 14e8a: 90 93 44 02 sts 0x0244, r25 ; 0x800244 <_ZL14pause_position.lto_priv.497+0x5> 14e8e: a0 93 45 02 sts 0x0245, r26 ; 0x800245 <_ZL14pause_position.lto_priv.497+0x6> 14e92: b0 93 46 02 sts 0x0246, r27 ; 0x800246 <_ZL14pause_position.lto_priv.497+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 14e96: 80 e0 ldi r24, 0x00 ; 0 14e98: 90 e0 ldi r25, 0x00 ; 0 14e9a: a0 ea ldi r26, 0xA0 ; 160 14e9c: b1 e4 ldi r27, 0x41 ; 65 14e9e: 80 93 47 02 sts 0x0247, r24 ; 0x800247 <_ZL14pause_position.lto_priv.497+0x8> 14ea2: 90 93 48 02 sts 0x0248, r25 ; 0x800248 <_ZL14pause_position.lto_priv.497+0x9> 14ea6: a0 93 49 02 sts 0x0249, r26 ; 0x800249 <_ZL14pause_position.lto_priv.497+0xa> 14eaa: b0 93 4a 02 sts 0x024A, r27 ; 0x80024a <_ZL14pause_position.lto_priv.497+0xb> 14eae: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14eb2: 8d 32 cpi r24, 0x2D ; 45 14eb4: 91 05 cpc r25, r1 14eb6: 11 f4 brne .+4 ; 0x14ebc 14eb8: 0c 94 d4 b4 jmp 0x169a8 ; 0x169a8 14ebc: 0c f0 brlt .+2 ; 0x14ec0 14ebe: f0 c0 rjmp .+480 ; 0x150a0 14ec0: 8f 31 cpi r24, 0x1F ; 31 14ec2: 91 05 cpc r25, r1 14ec4: 11 f4 brne .+4 ; 0x14eca 14ec6: 0c 94 61 b4 jmp 0x168c2 ; 0x168c2 14eca: 0c f0 brlt .+2 ; 0x14ece 14ecc: 6a c0 rjmp .+212 ; 0x14fa2 14ece: 8d 31 cpi r24, 0x1D ; 29 14ed0: 91 05 cpc r25, r1 14ed2: 11 f4 brne .+4 ; 0x14ed8 14ed4: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 14ed8: 4e 97 sbiw r24, 0x1e ; 30 14eda: 09 f0 breq .+2 ; 0x14ede 14edc: fb ce rjmp .-522 ; 0x14cd4 M30 [filename] */ case 30: if (card.mounted){ 14ede: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 14ee2: 88 23 and r24, r24 14ee4: 11 f4 brne .+4 ; 0x14eea 14ee6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 14eea: 8e ef ldi r24, 0xFE ; 254 14eec: 96 e1 ldi r25, 0x16 ; 22 14eee: 0f 94 7c 6e call 0x2dcf8 ; 0x2dcf8 file.close(); 14ef2: 8e ef ldi r24, 0xFE ; 254 14ef4: 96 e1 ldi r25, 0x16 ; 22 14ef6: 0f 94 74 a4 call 0x348e8 ; 0x348e8 saving = false; 14efa: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 14efe: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d card.closefile(); card.removeFile(strchr_pointer + 4); 14f02: 00 91 97 03 lds r16, 0x0397 ; 0x800397 14f06: 10 91 98 03 lds r17, 0x0398 ; 0x800398 14f0a: 0c 5f subi r16, 0xFC ; 252 14f0c: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 14f0e: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 14f12: 88 23 and r24, r24 14f14: 11 f4 brne .+4 ; 0x14f1a 14f16: 0c 94 95 b2 jmp 0x1652a ; 0x1652a file.close(); 14f1a: 8e ef ldi r24, 0xFE ; 254 14f1c: 96 e1 ldi r25, 0x16 ; 22 14f1e: 0f 94 74 a4 call 0x348e8 ; 0x348e8 sdprinting = false; 14f22: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e const char *fname=name; 14f26: 23 96 adiw r28, 0x03 ; 3 14f28: 1f af std Y+63, r17 ; 0x3f 14f2a: 0e af std Y+62, r16 ; 0x3e 14f2c: 23 97 sbiw r28, 0x03 ; 3 if (!diveSubfolder(fname)) 14f2e: ce 01 movw r24, r28 14f30: 8f 5b subi r24, 0xBF ; 191 14f32: 9f 4f sbci r25, 0xFF ; 255 14f34: 0f 94 7c 7f call 0x2fef8 ; 0x2fef8 14f38: 88 23 and r24, r24 14f3a: 11 f4 brne .+4 ; 0x14f40 14f3c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a return; if (file.remove(curDir, fname)) 14f40: 23 96 adiw r28, 0x03 ; 3 14f42: 4e ad ldd r20, Y+62 ; 0x3e 14f44: 5f ad ldd r21, Y+63 ; 0x3f 14f46: 23 97 sbiw r28, 0x03 ; 3 14f48: 60 91 17 15 lds r22, 0x1517 ; 0x801517 14f4c: 70 91 18 15 lds r23, 0x1518 ; 0x801518 * \brief Base class for SdFile with Print and C++ streams. */ class SdBaseFile { public: /** Create an instance. */ SdBaseFile() : writeError(false), type_(FAT_FILE_TYPE_CLOSED) {} 14f50: 19 82 std Y+1, r1 ; 0x01 14f52: 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; 14f54: 22 e0 ldi r18, 0x02 ; 2 14f56: ce 01 movw r24, r28 14f58: 01 96 adiw r24, 0x01 ; 1 14f5a: 0f 94 3e d7 call 0x3ae7c ; 0x3ae7c 14f5e: 81 11 cpse r24, r1 14f60: 0c 94 37 b4 jmp 0x1686e ; 0x1686e return file.remove(); fail: // can't set iostate - static function return false; 14f64: 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; 14f66: ce 01 movw r24, r28 14f68: 01 96 adiw r24, 0x01 ; 1 14f6a: 0e 94 bc 78 call 0xf178 ; 0xf178 14f6e: 11 23 and r17, r17 14f70: 11 f4 brne .+4 ; 0x14f76 14f72: 0c 94 51 b4 jmp 0x168a2 ; 0x168a2 { SERIAL_PROTOCOLPGM("File deleted:"); 14f76: 85 ed ldi r24, 0xD5 ; 213 14f78: 95 e8 ldi r25, 0x85 ; 133 14f7a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLLN(fname); 14f7e: 23 96 adiw r28, 0x03 ; 3 14f80: 8e ad ldd r24, Y+62 ; 0x3e 14f82: 9f ad ldd r25, Y+63 ; 0x3f 14f84: 23 97 sbiw r28, 0x03 ; 3 14f86: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c sdpos = 0; 14f8a: 10 92 82 17 sts 0x1782, r1 ; 0x801782 14f8e: 10 92 83 17 sts 0x1783, r1 ; 0x801783 14f92: 10 92 84 17 sts 0x1784, r1 ; 0x801784 14f96: 10 92 85 17 sts 0x1785, r1 ; 0x801785 #ifdef SDCARD_SORT_ALPHA presort(); 14f9a: 0f 94 48 7d call 0x2fa90 ; 0x2fa90 14f9e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14fa2: 8a 32 cpi r24, 0x2A ; 42 14fa4: 91 05 cpc r25, r1 14fa6: 11 f4 brne .+4 ; 0x14fac 14fa8: 0c 94 88 b4 jmp 0x16910 ; 0x16910 14fac: 8c 32 cpi r24, 0x2C ; 44 14fae: 91 05 cpc r25, r1 14fb0: 11 f4 brne .+4 ; 0x14fb6 14fb2: 0c 94 bb b4 jmp 0x16976 ; 0x16976 14fb6: 80 97 sbiw r24, 0x20 ; 32 14fb8: 09 f0 breq .+2 ; 0x14fbc 14fba: 8c ce rjmp .-744 ; 0x14cd4 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 14fbc: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 14fc0: 81 11 cpse r24, r1 st_synchronize(); 14fc2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14fc6: 00 91 97 03 lds r16, 0x0397 ; 0x800397 14fca: 10 91 98 03 lds r17, 0x0398 ; 0x800398 14fce: 0c 5f subi r16, 0xFC ; 252 14fd0: 1f 4f sbci r17, 0xFF ; 255 14fd2: 61 e2 ldi r22, 0x21 ; 33 14fd4: 70 e0 ldi r23, 0x00 ; 0 14fd6: c8 01 movw r24, r16 14fd8: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 if(namestartpos==NULL) 14fdc: 00 97 sbiw r24, 0x00 ; 0 14fde: 19 f0 breq .+6 ; 0x14fe6 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14fe0: 8c 01 movw r16, r24 14fe2: 0f 5f subi r16, 0xFF ; 255 14fe4: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 14fe6: 80 e5 ldi r24, 0x50 ; 80 14fe8: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 14fec: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 14fee: 80 91 97 03 lds r24, 0x0397 ; 0x800397 14ff2: 90 91 98 03 lds r25, 0x0398 ; 0x800398 14ff6: 08 17 cp r16, r24 14ff8: 19 07 cpc r17, r25 14ffa: 08 f4 brcc .+2 ; 0x14ffe call_procedure=false; //false alert, 'P' found within filename 14ffc: f1 2c mov r15, r1 if( card.mounted ) 14ffe: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 15002: 88 23 and r24, r24 15004: 11 f4 brne .+4 ; 0x1500a 15006: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 1500a: 61 e0 ldi r22, 0x01 ; 1 1500c: 6f 25 eor r22, r15 1500e: c8 01 movw r24, r16 15010: 0f 94 01 80 call 0x30002 ; 0x30002 if(code_seen('S')) 15014: 83 e5 ldi r24, 0x53 ; 83 15016: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1501a: 88 23 and r24, r24 1501c: 99 f0 breq .+38 ; 0x15044 if(strchr_pointer 15022: 90 91 98 03 lds r25, 0x0398 ; 0x800398 15026: 80 17 cp r24, r16 15028: 91 07 cpc r25, r17 1502a: 60 f4 brcc .+24 ; 0x15044 card.setIndex(code_value_long()); 1502c: 0e 94 28 5c call 0xb850 ; 0xb850 { int16_t c = (int16_t)file.readFilteredGcode(); sdpos = file.curPosition(); return c; }; void setIndex(long index) {sdpos = index;file.seekSetFilteredGcode(index);}; 15030: 60 93 82 17 sts 0x1782, r22 ; 0x801782 15034: 70 93 83 17 sts 0x1783, r23 ; 0x801783 15038: 80 93 84 17 sts 0x1784, r24 ; 0x801784 1503c: 90 93 85 17 sts 0x1785, r25 ; 0x801785 15040: 0f 94 c0 77 call 0x2ef80 ; 0x2ef80 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 15044: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 15048: 88 23 and r24, r24 1504a: 31 f0 breq .+12 ; 0x15058 { sdprinting = true; 1504c: 81 e0 ldi r24, 0x01 ; 1 1504e: 80 93 6e 14 sts 0x146E, r24 ; 0x80146e 15052: 85 e0 ldi r24, 0x05 ; 5 15054: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> card.startFileprint(); if(!call_procedure) 15058: f1 10 cpse r15, r1 1505a: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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); }; 1505e: 80 91 01 17 lds r24, 0x1701 ; 0x801701 15062: 88 23 and r24, r24 15064: 61 f0 breq .+24 ; 0x1507e { if(!card.get_sdpos()) 15066: 80 91 82 17 lds r24, 0x1782 ; 0x801782 1506a: 90 91 83 17 lds r25, 0x1783 ; 0x801783 1506e: a0 91 84 17 lds r26, 0x1784 ; 0x801784 15072: b0 91 85 17 lds r27, 0x1785 ; 0x801785 15076: 89 2b or r24, r25 15078: 8a 2b or r24, r26 1507a: 8b 2b or r24, r27 1507c: 69 f4 brne .+26 ; 0x15098 { // A new print has started from scratch, reset stats failstats_reset_print(); 1507e: 0e 94 ca 5c call 0xb994 ; 0xb994 sdpos_atomic = 0; 15082: 10 92 84 03 sts 0x0384, r1 ; 0x800384 15086: 10 92 85 03 sts 0x0385, r1 ; 0x800385 1508a: 10 92 86 03 sts 0x0386, r1 ; 0x800386 1508e: 10 92 87 03 sts 0x0387, r1 ; 0x800387 15092: 80 e0 ldi r24, 0x00 ; 0 15094: 0e 94 42 83 call 0x10684 ; 0x10684 #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 15098: 0f 94 d1 58 call 0x2b1a2 ; 0x2b1a2 1509c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 150a0: 89 34 cpi r24, 0x49 ; 73 150a2: 91 05 cpc r25, r1 150a4: 11 f4 brne .+4 ; 0x150aa 150a6: 0c 94 18 b5 jmp 0x16a30 ; 0x16a30 150aa: f4 f4 brge .+60 ; 0x150e8 150ac: 8e 32 cpi r24, 0x2E ; 46 150ae: 91 05 cpc r25, r1 150b0: 11 f4 brne .+4 ; 0x150b6 150b2: 0c 94 da b4 jmp 0x169b4 ; 0x169b4 150b6: 88 34 cpi r24, 0x48 ; 72 150b8: 91 05 cpc r25, r1 150ba: 09 f0 breq .+2 ; 0x150be 150bc: 0b ce rjmp .-1002 ; 0x14cd4 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 150be: 83 e5 ldi r24, 0x53 ; 83 150c0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 150c4: 88 23 and r24, r24 150c6: 11 f4 brne .+4 ; 0x150cc 150c8: 0c 94 09 b5 jmp 0x16a12 ; 0x16a12 switch (code_value_uint8()){ 150cc: 0e 94 0e 5c call 0xb81c ; 0xb81c 150d0: 88 23 and r24, r24 150d2: 11 f4 brne .+4 ; 0x150d8 150d4: 0c 94 06 b5 jmp 0x16a0c ; 0x16a0c 150d8: 81 30 cpi r24, 0x01 ; 1 150da: 11 f0 breq .+4 ; 0x150e0 150dc: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 150e0: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 150e4: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 150e8: 8c 34 cpi r24, 0x4C ; 76 150ea: 91 05 cpc r25, r1 150ec: 11 f4 brne .+4 ; 0x150f2 150ee: 0c 94 b8 b5 jmp 0x16b70 ; 0x16b70 150f2: 14 f0 brlt .+4 ; 0x150f8 150f4: 0c 94 cb b5 jmp 0x16b96 ; 0x16b96 150f8: 8b 34 cpi r24, 0x4B ; 75 150fa: 91 05 cpc r25, r1 150fc: 09 f0 breq .+2 ; 0x15100 150fe: ea cd rjmp .-1068 ; 0x14cd4 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 15100: 0f 94 7f 16 call 0x22cfe ; 0x22cfe 15104: 88 23 and r24, r24 15106: 11 f4 brne .+4 ; 0x1510c 15108: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 1510c: c5 cf rjmp .-118 ; 0x15098 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1510e: 8e 36 cpi r24, 0x6E ; 110 15110: 91 05 cpc r25, r1 15112: 11 f4 brne .+4 ; 0x15118 15114: 0c 94 7a b8 jmp 0x170f4 ; 0x170f4 15118: 0c f0 brlt .+2 ; 0x1511c 1511a: 86 c0 rjmp .+268 ; 0x15228 1511c: 86 35 cpi r24, 0x56 ; 86 1511e: 91 05 cpc r25, r1 15120: 11 f4 brne .+4 ; 0x15126 15122: 0c 94 d5 b7 jmp 0x16faa ; 0x16faa 15126: d4 f5 brge .+116 ; 0x1519c 15128: 83 35 cpi r24, 0x53 ; 83 1512a: 91 05 cpc r25, r1 1512c: 11 f4 brne .+4 ; 0x15132 1512e: 0c 94 7f b7 jmp 0x16efe ; 0x16efe 15132: 84 f4 brge .+32 ; 0x15154 15134: 8f 34 cpi r24, 0x4F ; 79 15136: 91 05 cpc r25, r1 15138: 11 f4 brne .+4 ; 0x1513e 1513a: 0c 94 3b b6 jmp 0x16c76 ; 0x16c76 1513e: 82 35 cpi r24, 0x52 ; 82 15140: 91 05 cpc r25, r1 15142: 09 f0 breq .+2 ; 0x15146 15144: c7 cd rjmp .-1138 ; 0x14cd4 /*! ### 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; 15146: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 1514a: 87 7f andi r24, 0xF7 ; 247 1514c: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 15150: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15154: 84 35 cpi r24, 0x54 ; 84 15156: 91 05 cpc r25, r1 15158: 11 f4 brne .+4 ; 0x1515e 1515a: 0c 94 85 b7 jmp 0x16f0a ; 0x16f0a 1515e: 85 35 cpi r24, 0x55 ; 85 15160: 91 05 cpc r25, r1 15162: 09 f0 breq .+2 ; 0x15166 15164: b7 cd rjmp .-1170 ; 0x14cd4 #### 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')) { 15166: 83 e5 ldi r24, 0x53 ; 83 15168: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1516c: 88 23 and r24, r24 1516e: 11 f4 brne .+4 ; 0x15174 15170: 0c 94 95 b2 jmp 0x1652a ; 0x1652a max_inactive_time = code_value() * 1000; 15174: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15178: 20 e0 ldi r18, 0x00 ; 0 1517a: 30 e0 ldi r19, 0x00 ; 0 1517c: 4a e7 ldi r20, 0x7A ; 122 1517e: 54 e4 ldi r21, 0x44 ; 68 15180: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 15184: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 15188: 60 93 80 03 sts 0x0380, r22 ; 0x800380 1518c: 70 93 81 03 sts 0x0381, r23 ; 0x800381 15190: 80 93 82 03 sts 0x0382, r24 ; 0x800382 15194: 90 93 83 03 sts 0x0383, r25 ; 0x800383 15198: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1519c: 89 36 cpi r24, 0x69 ; 105 1519e: 91 05 cpc r25, r1 151a0: 11 f4 brne .+4 ; 0x151a6 151a2: 0c 94 97 b6 jmp 0x16d2e ; 0x16d2e 151a6: d4 f4 brge .+52 ; 0x151dc 151a8: 8c 35 cpi r24, 0x5C ; 92 151aa: 91 05 cpc r25, r1 151ac: 11 f4 brne .+4 ; 0x151b2 151ae: 0c 94 f2 b7 jmp 0x16fe4 ; 0x16fe4 151b2: 88 36 cpi r24, 0x68 ; 104 151b4: 91 05 cpc r25, r1 151b6: 09 f0 breq .+2 ; 0x151ba 151b8: 8d cd rjmp .-1254 ; 0x14cd4 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 151ba: 83 e5 ldi r24, 0x53 ; 83 151bc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 151c0: 88 23 and r24, r24 151c2: 11 f4 brne .+4 ; 0x151c8 151c4: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { setTargetHotend(code_value()); 151c8: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 151cc: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 151d0: 70 93 6e 0e sts 0x0E6E, r23 ; 0x800e6e 151d4: 60 93 6d 0e sts 0x0E6D, r22 ; 0x800e6d 151d8: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 151dc: 8b 36 cpi r24, 0x6B ; 107 151de: 91 05 cpc r25, r1 151e0: 11 f4 brne .+4 ; 0x151e6 151e2: 0c 94 7c b7 jmp 0x16ef8 ; 0x16ef8 151e6: 14 f4 brge .+4 ; 0x151ec 151e8: 0c 94 6e b7 jmp 0x16edc ; 0x16edc 151ec: 8d 36 cpi r24, 0x6D ; 109 151ee: 91 05 cpc r25, r1 151f0: 09 f0 breq .+2 ; 0x151f4 151f2: 70 cd rjmp .-1312 ; 0x14cd4 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)); 151f4: 8e ed ldi r24, 0xDE ; 222 151f6: 99 e4 ldi r25, 0x49 ; 73 151f8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 151fc: 0f 94 ea 0b call 0x217d4 ; 0x217d4 heating_status = HeatingStatus::EXTRUDER_HEATING; 15200: 81 e0 ldi r24, 0x01 ; 1 15202: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df prusa_statistics(1); #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 15206: 83 e5 ldi r24, 0x53 ; 83 15208: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1520c: 88 23 and r24, r24 1520e: 11 f4 brne .+4 ; 0x15214 15210: 0c 94 ab b6 jmp 0x16d56 ; 0x16d56 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 15214: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15218: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 1521c: 70 93 6e 0e sts 0x0E6E, r23 ; 0x800e6e 15220: 60 93 6d 0e sts 0x0E6D, r22 ; 0x800e6d 15224: 0c 94 b1 b6 jmp 0x16d62 ; 0x16d62 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15228: 87 37 cpi r24, 0x77 ; 119 1522a: 91 05 cpc r25, r1 1522c: 11 f4 brne .+4 ; 0x15232 1522e: 0c 94 bf b9 jmp 0x1737e ; 0x1737e 15232: ac f5 brge .+106 ; 0x1529e 15234: 82 37 cpi r24, 0x72 ; 114 15236: 91 05 cpc r25, r1 15238: 11 f4 brne .+4 ; 0x1523e 1523a: 0c 94 74 b9 jmp 0x172e8 ; 0x172e8 1523e: b4 f4 brge .+44 ; 0x1526c 15240: 80 37 cpi r24, 0x70 ; 112 15242: 91 05 cpc r25, r1 15244: 11 f4 brne .+4 ; 0x1524a 15246: 0c 94 84 b6 jmp 0x16d08 ; 0x16d08 1524a: 81 37 cpi r24, 0x71 ; 113 1524c: 91 05 cpc r25, r1 1524e: 09 f0 breq .+2 ; 0x15252 15250: 41 cd rjmp .-1406 ; 0x14cd4 #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 15252: 83 e5 ldi r24, 0x53 ; 83 15254: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15258: 88 23 and r24, r24 1525a: 11 f4 brne .+4 ; 0x15260 1525c: 0c 94 8b b8 jmp 0x17116 ; 0x17116 host_keepalive_interval = code_value_uint8(); 15260: 0e 94 0e 5c call 0xb81c ; 0xb81c 15264: 80 93 2f 02 sts 0x022F, r24 ; 0x80022f 15268: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1526c: 85 37 cpi r24, 0x75 ; 117 1526e: 91 05 cpc r25, r1 15270: 11 f4 brne .+4 ; 0x15276 15272: 0c 94 77 b9 jmp 0x172ee ; 0x172ee 15276: 14 f0 brlt .+4 ; 0x1527c 15278: 0c 94 87 b9 jmp 0x1730e ; 0x1730e 1527c: 83 37 cpi r24, 0x73 ; 115 1527e: 91 05 cpc r25, r1 15280: 09 f0 breq .+2 ; 0x15284 15282: 28 cd rjmp .-1456 ; 0x14cd4 #### 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')) { 15284: 86 e5 ldi r24, 0x56 ; 86 15286: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1528a: 88 23 and r24, r24 1528c: 11 f4 brne .+4 ; 0x15292 1528e: 0c 94 a0 b8 jmp 0x17140 ; 0x17140 // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 15292: 86 eb ldi r24, 0xB6 ; 182 15294: 95 e8 ldi r25, 0x85 ; 133 15296: 0e 94 06 7b call 0xf60c ; 0xf60c 1529a: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1529e: 8c 38 cpi r24, 0x8C ; 140 152a0: 91 05 cpc r25, r1 152a2: 11 f4 brne .+4 ; 0x152a8 152a4: 0c 94 88 b6 jmp 0x16d10 ; 0x16d10 152a8: 54 f4 brge .+20 ; 0x152be 152aa: 8b 37 cpi r24, 0x7B ; 123 152ac: 91 05 cpc r25, r1 152ae: 11 f4 brne .+4 ; 0x152b4 152b0: 0c 94 24 ba jmp 0x17448 ; 0x17448 152b4: 8d 37 cpi r24, 0x7D ; 125 152b6: 91 05 cpc r25, r1 152b8: 09 f4 brne .+2 ; 0x152bc 152ba: 80 cd rjmp .-1280 ; 0x14dbc 152bc: 0b cd rjmp .-1514 ; 0x14cd4 152be: 8e 3b cpi r24, 0xBE ; 190 152c0: 91 05 cpc r25, r1 152c2: 11 f4 brne .+4 ; 0x152c8 152c4: 0c 94 e1 b6 jmp 0x16dc2 ; 0x16dc2 152c8: 88 3c cpi r24, 0xC8 ; 200 152ca: 91 05 cpc r25, r1 152cc: 11 f4 brne .+4 ; 0x152d2 152ce: 0c 94 27 ba jmp 0x1744e ; 0x1744e 152d2: 8b 39 cpi r24, 0x9B ; 155 152d4: 91 05 cpc r25, r1 152d6: 09 f0 breq .+2 ; 0x152da 152d8: fd cc rjmp .-1542 ; 0x14cd4 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 152da: 83 e5 ldi r24, 0x53 ; 83 152dc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 152e0: 88 23 and r24, r24 152e2: 61 f0 breq .+24 ; 0x152fc autoReportFeatures.SetPeriod( code_value_uint8() ); 152e4: 0e 94 0e 5c call 0xb81c ; 0xb81c 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; 152e8: 80 93 66 14 sts 0x1466, r24 ; 0x801466 if (auto_report_period != 0){ 152ec: 88 23 and r24, r24 152ee: 11 f4 brne .+4 ; 0x152f4 152f0: 0c 94 a3 b6 jmp 0x16d46 ; 0x16d46 auto_report_timer.start(); 152f4: 87 e6 ldi r24, 0x67 ; 103 152f6: 94 e1 ldi r25, 0x14 ; 20 152f8: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 152fc: 83 e4 ldi r24, 0x43 ; 67 152fe: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15302: 88 23 and r24, r24 15304: 11 f4 brne .+4 ; 0x1530a 15306: 0c 94 a7 b6 jmp 0x16d4e ; 0x16d4e autoReportFeatures.SetMask(code_value_uint8()); 1530a: 0e 94 0e 5c call 0xb81c ; 0xb81c 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; } 1530e: 80 93 65 14 sts 0x1465, r24 ; 0x801465 15312: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15316: 85 3f cpi r24, 0xF5 ; 245 15318: f1 e0 ldi r31, 0x01 ; 1 1531a: 9f 07 cpc r25, r31 1531c: 11 f4 brne .+4 ; 0x15322 1531e: 0c 94 11 c2 jmp 0x18422 ; 0x18422 15322: 0c f0 brlt .+2 ; 0x15326 15324: 60 c4 rjmp .+2240 ; 0x15be6 15326: 81 15 cp r24, r1 15328: 31 e0 ldi r19, 0x01 ; 1 1532a: 93 07 cpc r25, r19 1532c: 11 f4 brne .+4 ; 0x15332 1532e: 0c 94 93 bd jmp 0x17b26 ; 0x17b26 15332: 0c f0 brlt .+2 ; 0x15336 15334: 24 c1 rjmp .+584 ; 0x1557e 15336: 80 3d cpi r24, 0xD0 ; 208 15338: 91 05 cpc r25, r1 1533a: 11 f4 brne .+4 ; 0x15340 1533c: 0c 94 d6 bb jmp 0x177ac ; 0x177ac 15340: 0c f0 brlt .+2 ; 0x15344 15342: 77 c0 rjmp .+238 ; 0x15432 15344: 8d 3c cpi r24, 0xCD ; 205 15346: 91 05 cpc r25, r1 15348: 11 f4 brne .+4 ; 0x1534e 1534a: 0c 94 40 bb jmp 0x17680 ; 0x17680 1534e: ac f5 brge .+106 ; 0x153ba 15350: 8b 3c cpi r24, 0xCB ; 203 15352: 91 05 cpc r25, r1 15354: 11 f4 brne .+4 ; 0x1535a 15356: 0c 94 b7 ba jmp 0x1756e ; 0x1756e 1535a: 8c 3c cpi r24, 0xCC ; 204 1535c: 91 05 cpc r25, r1 1535e: 09 f0 breq .+2 ; 0x15362 15360: b9 cc rjmp .-1678 ; 0x14cd4 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 15362: 83 e5 ldi r24, 0x53 ; 83 15364: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15368: 88 23 and r24, r24 1536a: 11 f4 brne .+4 ; 0x15370 1536c: 0c 94 0f bb jmp 0x1761e ; 0x1761e // 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(); 15370: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15374: 60 93 2e 07 sts 0x072E, r22 ; 0x80072e 15378: 70 93 2f 07 sts 0x072F, r23 ; 0x80072f 1537c: 80 93 30 07 sts 0x0730, r24 ; 0x800730 15380: 90 93 31 07 sts 0x0731, r25 ; 0x800731 15384: 60 93 a2 06 sts 0x06A2, r22 ; 0x8006a2 15388: 70 93 a3 06 sts 0x06A3, r23 ; 0x8006a3 1538c: 80 93 a4 06 sts 0x06A4, r24 ; 0x8006a4 15390: 90 93 a5 06 sts 0x06A5, r25 ; 0x8006a5 // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 15394: 84 e5 ldi r24, 0x54 ; 84 15396: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1539a: 88 23 and r24, r24 1539c: 11 f4 brne .+4 ; 0x153a2 1539e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a cs.retract_acceleration = code_value(); 153a2: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 153a6: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 153aa: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 153ae: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 153b2: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 153b6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 153ba: 8e 3c cpi r24, 0xCE ; 206 153bc: 91 05 cpc r25, r1 153be: 11 f4 brne .+4 ; 0x153c4 153c0: 0c 94 b9 bb jmp 0x17772 ; 0x17772 153c4: 8f 3c cpi r24, 0xCF ; 207 153c6: 91 05 cpc r25, r1 153c8: 09 f0 breq .+2 ; 0x153cc 153ca: 84 cc rjmp .-1784 ; 0x14cd4 - `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')) 153cc: 83 e5 ldi r24, 0x53 ; 83 153ce: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 153d2: 88 23 and r24, r24 153d4: 51 f0 breq .+20 ; 0x153ea { cs.retract_length = code_value() ; 153d6: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 153da: 60 93 f1 06 sts 0x06F1, r22 ; 0x8006f1 153de: 70 93 f2 06 sts 0x06F2, r23 ; 0x8006f2 153e2: 80 93 f3 06 sts 0x06F3, r24 ; 0x8006f3 153e6: 90 93 f4 06 sts 0x06F4, r25 ; 0x8006f4 } if(code_seen('F')) 153ea: 86 e4 ldi r24, 0x46 ; 70 153ec: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 153f0: 88 23 and r24, r24 153f2: 61 f0 breq .+24 ; 0x1540c { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 153f4: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 153f8: 0e 94 7c 67 call 0xcef8 ; 0xcef8 153fc: 60 93 f5 06 sts 0x06F5, r22 ; 0x8006f5 15400: 70 93 f6 06 sts 0x06F6, r23 ; 0x8006f6 15404: 80 93 f7 06 sts 0x06F7, r24 ; 0x8006f7 15408: 90 93 f8 06 sts 0x06F8, r25 ; 0x8006f8 } if(code_seen('Z')) 1540c: 8a e5 ldi r24, 0x5A ; 90 1540e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15412: 88 23 and r24, r24 15414: 11 f4 brne .+4 ; 0x1541a 15416: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { cs.retract_zlift = code_value() ; 1541a: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1541e: 60 93 f9 06 sts 0x06F9, r22 ; 0x8006f9 15422: 70 93 fa 06 sts 0x06FA, r23 ; 0x8006fa 15426: 80 93 fb 06 sts 0x06FB, r24 ; 0x8006fb 1542a: 90 93 fc 06 sts 0x06FC, r25 ; 0x8006fc 1542e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15432: 8c 3d cpi r24, 0xDC ; 220 15434: 91 05 cpc r25, r1 15436: 11 f4 brne .+4 ; 0x1543c 15438: 0c 94 3d bc jmp 0x1787a ; 0x1787a 1543c: 0c f0 brlt .+2 ; 0x15440 1543e: 82 c0 rjmp .+260 ; 0x15544 15440: 81 3d cpi r24, 0xD1 ; 209 15442: 91 05 cpc r25, r1 15444: 11 f4 brne .+4 ; 0x1544a 15446: 0c 94 fa bb jmp 0x177f4 ; 0x177f4 1544a: 86 3d cpi r24, 0xD6 ; 214 1544c: 91 05 cpc r25, r1 1544e: 09 f0 breq .+2 ; 0x15452 15450: 41 cc rjmp .-1918 ; 0x14cd4 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; 15452: 80 e5 ldi r24, 0x50 ; 80 15454: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15458: 88 23 and r24, r24 1545a: 11 f4 brne .+4 ; 0x15460 1545c: 0c 94 29 bc jmp 0x17852 ; 0x17852 15460: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15464: 2b 01 movw r4, r22 15466: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 15468: 83 e5 ldi r24, 0x53 ; 83 1546a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1546e: 88 23 and r24, r24 15470: 11 f4 brne .+4 ; 0x15476 15472: 0c 94 33 bc jmp 0x17866 ; 0x17866 15476: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1547a: 4b 01 movw r8, r22 1547c: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 1547e: 8e e4 ldi r24, 0x4E ; 78 15480: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15484: d0 90 3a 07 lds r13, 0x073A ; 0x80073a 15488: 88 23 and r24, r24 1548a: 29 f0 breq .+10 ; 0x15496 1548c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15490: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 15494: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 15496: 82 e5 ldi r24, 0x52 ; 82 15498: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1549c: e0 90 3b 07 lds r14, 0x073B ; 0x80073b 154a0: f0 90 3c 07 lds r15, 0x073C ; 0x80073c 154a4: 88 23 and r24, r24 154a6: 29 f0 breq .+10 ; 0x154b2 154a8: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 154ac: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 154b0: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 154b2: 86 e4 ldi r24, 0x46 ; 70 154b4: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 154b8: 00 91 3d 07 lds r16, 0x073D ; 0x80073d 154bc: 10 91 3e 07 lds r17, 0x073E ; 0x80073e 154c0: 88 23 and r24, r24 154c2: 29 f0 breq .+10 ; 0x154ce 154c4: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 154c8: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 154cc: 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) 154ce: 20 e0 ldi r18, 0x00 ; 0 154d0: 30 e0 ldi r19, 0x00 ; 0 154d2: a9 01 movw r20, r18 154d4: c3 01 movw r24, r6 154d6: b2 01 movw r22, r4 154d8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 154dc: 18 16 cp r1, r24 154de: 14 f0 brlt .+4 ; 0x154e4 154e0: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 154e4: 20 e0 ldi r18, 0x00 ; 0 154e6: 30 e0 ldi r19, 0x00 ; 0 154e8: a9 01 movw r20, r18 154ea: c5 01 movw r24, r10 154ec: b4 01 movw r22, r8 154ee: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 154f2: 87 ff sbrs r24, 7 154f4: 02 c0 rjmp .+4 ; 0x154fa 154f6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 154fa: a5 01 movw r20, r10 154fc: 94 01 movw r18, r8 154fe: c3 01 movw r24, r6 15500: b2 01 movw r22, r4 15502: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 15506: 87 ff sbrs r24, 7 15508: 02 c0 rjmp .+4 ; 0x1550e 1550a: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 1550e: 40 92 32 07 sts 0x0732, r4 ; 0x800732 15512: 50 92 33 07 sts 0x0733, r5 ; 0x800733 15516: 60 92 34 07 sts 0x0734, r6 ; 0x800734 1551a: 70 92 35 07 sts 0x0735, r7 ; 0x800735 cs.min_mm_per_arc_segment = s; 1551e: 80 92 36 07 sts 0x0736, r8 ; 0x800736 15522: 90 92 37 07 sts 0x0737, r9 ; 0x800737 15526: a0 92 38 07 sts 0x0738, r10 ; 0x800738 1552a: b0 92 39 07 sts 0x0739, r11 ; 0x800739 cs.n_arc_correction = n; 1552e: d0 92 3a 07 sts 0x073A, r13 ; 0x80073a cs.min_arc_segments = r; 15532: f0 92 3c 07 sts 0x073C, r15 ; 0x80073c 15536: e0 92 3b 07 sts 0x073B, r14 ; 0x80073b cs.arc_segments_per_sec = f; 1553a: 10 93 3e 07 sts 0x073E, r17 ; 0x80073e 1553e: 00 93 3d 07 sts 0x073D, r16 ; 0x80073d 15542: f3 c7 rjmp .+4070 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15544: 82 3e cpi r24, 0xE2 ; 226 15546: 91 05 cpc r25, r1 15548: 11 f4 brne .+4 ; 0x1554e 1554a: 0c 94 8e bc jmp 0x1791c ; 0x1791c 1554e: 80 3f cpi r24, 0xF0 ; 240 15550: 91 05 cpc r25, r1 15552: 09 f4 brne .+2 ; 0x15556 15554: ea c7 rjmp .+4052 ; 0x1652a 15556: 8d 3d cpi r24, 0xDD ; 221 15558: 91 05 cpc r25, r1 1555a: 09 f0 breq .+2 ; 0x1555e 1555c: bb cb rjmp .-2186 ; 0x14cd4 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 1555e: 83 e5 ldi r24, 0x53 ; 83 15560: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15564: 88 23 and r24, r24 15566: 11 f4 brne .+4 ; 0x1556c 15568: 0c 94 7c bc jmp 0x178f8 ; 0x178f8 { extrudemultiply = code_value_short(); 1556c: 0e 94 1b 5c call 0xb836 ; 0xb836 15570: 90 93 95 02 sts 0x0295, r25 ; 0x800295 15574: 80 93 94 02 sts 0x0294, r24 ; 0x800294 calculate_extruder_multipliers(); 15578: 0e 94 6e 66 call 0xccdc ; 0xccdc 1557c: d6 c7 rjmp .+4012 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1557e: 8e 35 cpi r24, 0x5E ; 94 15580: 51 e0 ldi r21, 0x01 ; 1 15582: 95 07 cpc r25, r21 15584: 11 f4 brne .+4 ; 0x1558a 15586: 0c 94 c0 cb jmp 0x19780 ; 0x19780 1558a: 0c f0 brlt .+2 ; 0x1558e 1558c: ec c2 rjmp .+1496 ; 0x15b66 1558e: 8e 32 cpi r24, 0x2E ; 46 15590: b1 e0 ldi r27, 0x01 ; 1 15592: 9b 07 cpc r25, r27 15594: 11 f4 brne .+4 ; 0x1559a 15596: 0c 94 f1 bd jmp 0x17be2 ; 0x17be2 1559a: 0c f0 brlt .+2 ; 0x1559e 1559c: 82 c0 rjmp .+260 ; 0x156a2 1559e: 8c 32 cpi r24, 0x2C ; 44 155a0: f1 e0 ldi r31, 0x01 ; 1 155a2: 9f 07 cpc r25, r31 155a4: 11 f4 brne .+4 ; 0x155aa 155a6: 0c 94 e7 bc jmp 0x179ce ; 0x179ce 155aa: 8d 32 cpi r24, 0x2D ; 45 155ac: 91 40 sbci r25, 0x01 ; 1 155ae: 09 f0 breq .+2 ; 0x155b2 155b0: 91 cb rjmp .-2270 ; 0x14cd4 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 155b2: 80 e5 ldi r24, 0x50 ; 80 155b4: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 155b8: 88 23 and r24, r24 155ba: 51 f0 breq .+20 ; 0x155d0 155bc: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 155c0: 60 93 d6 06 sts 0x06D6, r22 ; 0x8006d6 155c4: 70 93 d7 06 sts 0x06D7, r23 ; 0x8006d7 155c8: 80 93 d8 06 sts 0x06D8, r24 ; 0x8006d8 155cc: 90 93 d9 06 sts 0x06D9, r25 ; 0x8006d9 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 155d0: 89 e4 ldi r24, 0x49 ; 73 155d2: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 155d6: 88 23 and r24, r24 155d8: 81 f0 breq .+32 ; 0x155fa 155da: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 155de: 2c ea ldi r18, 0xAC ; 172 155e0: 35 ec ldi r19, 0xC5 ; 197 155e2: 47 e2 ldi r20, 0x27 ; 39 155e4: 5e e3 ldi r21, 0x3E ; 62 155e6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 155ea: 60 93 da 06 sts 0x06DA, r22 ; 0x8006da 155ee: 70 93 db 06 sts 0x06DB, r23 ; 0x8006db 155f2: 80 93 dc 06 sts 0x06DC, r24 ; 0x8006dc 155f6: 90 93 dd 06 sts 0x06DD, r25 ; 0x8006dd if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 155fa: 84 e4 ldi r24, 0x44 ; 68 155fc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15600: 88 23 and r24, r24 15602: 81 f0 breq .+32 ; 0x15624 15604: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 } float unscalePID_i(float i) { return i/PID_dT; 15608: 2c ea ldi r18, 0xAC ; 172 1560a: 35 ec ldi r19, 0xC5 ; 197 1560c: 47 e2 ldi r20, 0x27 ; 39 1560e: 5e e3 ldi r21, 0x3E ; 62 15610: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 15614: 60 93 de 06 sts 0x06DE, r22 ; 0x8006de 15618: 70 93 df 06 sts 0x06DF, r23 ; 0x8006df 1561c: 80 93 e0 06 sts 0x06E0, r24 ; 0x8006e0 15620: 90 93 e1 06 sts 0x06E1, r25 ; 0x8006e1 updatePID(); 15624: 0f 94 17 51 call 0x2a22e ; 0x2a22e SERIAL_PROTOCOLRPGM(MSG_OK); 15628: 8a e0 ldi r24, 0x0A ; 10 1562a: 9e e6 ldi r25, 0x6E ; 110 1562c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLPGM(" p:"); 15630: 8a e8 ldi r24, 0x8A ; 138 15632: 97 e8 ldi r25, 0x87 ; 135 15634: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 15638: 60 91 d6 06 lds r22, 0x06D6 ; 0x8006d6 1563c: 70 91 d7 06 lds r23, 0x06D7 ; 0x8006d7 15640: 80 91 d8 06 lds r24, 0x06D8 ; 0x8006d8 15644: 90 91 d9 06 lds r25, 0x06D9 ; 0x8006d9 15648: 42 e0 ldi r20, 0x02 ; 2 1564a: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 1564e: 86 e8 ldi r24, 0x86 ; 134 15650: 97 e8 ldi r25, 0x87 ; 135 15652: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 15656: 2c ea ldi r18, 0xAC ; 172 15658: 35 ec ldi r19, 0xC5 ; 197 1565a: 47 e2 ldi r20, 0x27 ; 39 1565c: 5e e3 ldi r21, 0x3E ; 62 1565e: 60 91 da 06 lds r22, 0x06DA ; 0x8006da 15662: 70 91 db 06 lds r23, 0x06DB ; 0x8006db 15666: 80 91 dc 06 lds r24, 0x06DC ; 0x8006dc 1566a: 90 91 dd 06 lds r25, 0x06DD ; 0x8006dd 1566e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 15672: 42 e0 ldi r20, 0x02 ; 2 15674: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 15678: 82 e8 ldi r24, 0x82 ; 130 1567a: 97 e8 ldi r25, 0x87 ; 135 1567c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15680: 2c ea ldi r18, 0xAC ; 172 15682: 35 ec ldi r19, 0xC5 ; 197 15684: 47 e2 ldi r20, 0x27 ; 39 15686: 5e e3 ldi r21, 0x3E ; 62 15688: 60 91 de 06 lds r22, 0x06DE ; 0x8006de 1568c: 70 91 df 06 lds r23, 0x06DF ; 0x8006df 15690: 80 91 e0 06 lds r24, 0x06E0 ; 0x8006e0 15694: 90 91 e1 06 lds r25, 0x06E1 ; 0x8006e1 15698: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 1569c: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 156a0: 44 c7 rjmp .+3720 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 156a2: 80 33 cpi r24, 0x30 ; 48 156a4: 31 e0 ldi r19, 0x01 ; 1 156a6: 93 07 cpc r25, r19 156a8: 11 f4 brne .+4 ; 0x156ae 156aa: 0c 94 1a bd jmp 0x17a34 ; 0x17a34 156ae: 14 f4 brge .+4 ; 0x156b4 156b0: 0c 94 01 be jmp 0x17c02 ; 0x17c02 156b4: 86 33 cpi r24, 0x36 ; 54 156b6: 91 40 sbci r25, 0x01 ; 1 156b8: 09 f0 breq .+2 ; 0x156bc 156ba: 0c cb rjmp .-2536 ; 0x14cd4 { // 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(); 156bc: 89 e4 ldi r24, 0x49 ; 73 156be: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 156c2: 88 23 and r24, r24 156c4: 11 f4 brne .+4 ; 0x156ca 156c6: 0c 94 34 be jmp 0x17c68 ; 0x17c68 156ca: 0e 94 1b 5c call 0xb836 ; 0xb836 156ce: ab 96 adiw r28, 0x2b ; 43 156d0: 8f af std Y+63, r24 ; 0x3f 156d2: ab 97 sbiw r28, 0x2b ; 43 if(code_seen('R')) R = code_value(); 156d4: 82 e5 ldi r24, 0x52 ; 82 156d6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 156da: 88 23 and r24, r24 156dc: 11 f4 brne .+4 ; 0x156e2 156de: 0c 94 3a be jmp 0x17c74 ; 0x17c74 156e2: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 156e6: e2 96 adiw r28, 0x32 ; 50 156e8: 6c af std Y+60, r22 ; 0x3c 156ea: 7d af std Y+61, r23 ; 0x3d 156ec: 8e af std Y+62, r24 ; 0x3e 156ee: 9f af std Y+63, r25 ; 0x3f 156f0: e2 97 sbiw r28, 0x32 ; 50 if(code_seen('P')) P = code_value(); 156f2: 80 e5 ldi r24, 0x50 ; 80 156f4: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 - `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; 156f8: c1 2c mov r12, r1 156fa: d1 2c mov r13, r1 156fc: 60 ec ldi r22, 0xC0 ; 192 156fe: e6 2e mov r14, r22 15700: 6f e7 ldi r22, 0x7F ; 127 15702: 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(); 15704: 88 23 and r24, r24 15706: 21 f0 breq .+8 ; 0x15710 15708: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1570c: 6b 01 movw r12, r22 1570e: 7c 01 movw r14, r24 if(code_seen('U')) U = code_value(); 15710: 85 e5 ldi r24, 0x55 ; 85 15712: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15716: 88 23 and r24, r24 15718: 11 f4 brne .+4 ; 0x1571e 1571a: 0c 94 46 be jmp 0x17c8c ; 0x17c8c 1571e: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15722: 6e 96 adiw r28, 0x1e ; 30 15724: 6c af std Y+60, r22 ; 0x3c 15726: 7d af std Y+61, r23 ; 0x3d 15728: 8e af std Y+62, r24 ; 0x3e 1572a: 9f af std Y+63, r25 ; 0x3f 1572c: 6e 97 sbiw r28, 0x1e ; 30 if(code_seen('V')) V = code_value(); 1572e: 86 e5 ldi r24, 0x56 ; 86 15730: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15734: 88 23 and r24, r24 15736: 11 f4 brne .+4 ; 0x1573c 15738: 0c 94 52 be jmp 0x17ca4 ; 0x17ca4 1573c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15740: a2 96 adiw r28, 0x22 ; 34 15742: 6c af std Y+60, r22 ; 0x3c 15744: 7d af std Y+61, r23 ; 0x3d 15746: 8e af std Y+62, r24 ; 0x3e 15748: 9f af std Y+63, r25 ; 0x3f 1574a: a2 97 sbiw r28, 0x22 ; 34 if(code_seen('C')) C = code_value(); 1574c: 83 e4 ldi r24, 0x43 ; 67 1574e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15752: 88 23 and r24, r24 15754: 11 f4 brne .+4 ; 0x1575a 15756: 0c 94 5e be jmp 0x17cbc ; 0x17cbc 1575a: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1575e: 6a 96 adiw r28, 0x1a ; 26 15760: 6c af std Y+60, r22 ; 0x3c 15762: 7d af std Y+61, r23 ; 0x3d 15764: 8e af std Y+62, r24 ; 0x3e 15766: 9f af std Y+63, r25 ; 0x3f 15768: 6a 97 sbiw r28, 0x1a ; 26 if(code_seen('D')) D = code_value(); 1576a: 84 e4 ldi r24, 0x44 ; 68 1576c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15770: 88 23 and r24, r24 15772: 11 f4 brne .+4 ; 0x15778 15774: 0c 94 6a be jmp 0x17cd4 ; 0x17cd4 15778: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1577c: aa 96 adiw r28, 0x2a ; 42 1577e: 6c af std Y+60, r22 ; 0x3c 15780: 7d af std Y+61, r23 ; 0x3d 15782: 8e af std Y+62, r24 ; 0x3e 15784: 9f af std Y+63, r25 ; 0x3f 15786: aa 97 sbiw r28, 0x2a ; 42 if(code_seen('L')) L = code_value_short(); 15788: 8c e4 ldi r24, 0x4C ; 76 1578a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 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; 1578e: 0f ef ldi r16, 0xFF ; 255 15790: 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(); 15792: 88 23 and r24, r24 15794: 19 f0 breq .+6 ; 0x1579c 15796: 0e 94 1b 5c call 0xb836 ; 0xb836 1579a: 8c 01 movw r16, r24 if(code_seen('S')) S = code_value_short(); 1579c: 83 e5 ldi r24, 0x53 ; 83 1579e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 157a2: 88 23 and r24, r24 157a4: 11 f4 brne .+4 ; 0x157aa 157a6: 0c 94 76 be jmp 0x17cec ; 0x17cec 157aa: 0e 94 1b 5c call 0xb836 ; 0xb836 157ae: e3 96 adiw r28, 0x33 ; 51 157b0: 8f af std Y+63, r24 ; 0x3f 157b2: e3 97 sbiw r28, 0x33 ; 51 if(code_seen('B')) B = code_value_short(); 157b4: 82 e4 ldi r24, 0x42 ; 66 157b6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 157ba: 88 23 and r24, r24 157bc: 11 f4 brne .+4 ; 0x157c2 157be: 0c 94 7c be jmp 0x17cf8 ; 0x17cf8 157c2: 0e 94 1b 5c call 0xb836 ; 0xb836 157c6: e7 96 adiw r28, 0x37 ; 55 157c8: 8f af std Y+63, r24 ; 0x3f 157ca: e7 97 sbiw r28, 0x37 ; 55 if(code_seen('T')) T = code_value(); 157cc: 84 e5 ldi r24, 0x54 ; 84 157ce: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 157d2: 88 23 and r24, r24 157d4: 11 f4 brne .+4 ; 0x157da 157d6: 0c 94 82 be jmp 0x17d04 ; 0x17d04 157da: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 157de: a6 96 adiw r28, 0x26 ; 38 157e0: 6c af std Y+60, r22 ; 0x3c 157e2: 7d af std Y+61, r23 ; 0x3d 157e4: 8e af std Y+62, r24 ; 0x3e 157e6: 9f af std Y+63, r25 ; 0x3f 157e8: a6 97 sbiw r28, 0x26 ; 38 if(code_seen('E')) E = code_value(); 157ea: 85 e4 ldi r24, 0x45 ; 69 157ec: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 - `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; 157f0: 41 2c mov r4, r1 157f2: 51 2c mov r5, r1 157f4: 50 ec ldi r21, 0xC0 ; 192 157f6: 65 2e mov r6, r21 157f8: 5f e7 ldi r21, 0x7F ; 127 157fa: 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(); 157fc: 88 23 and r24, r24 157fe: 21 f0 breq .+8 ; 0x15808 15800: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15804: 2b 01 movw r4, r22 15806: 3c 01 movw r6, r24 if(code_seen('W')) W = code_value(); 15808: 87 e5 ldi r24, 0x57 ; 87 1580a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 - `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; 1580e: 81 2c mov r8, r1 15810: 91 2c mov r9, r1 15812: 40 ec ldi r20, 0xC0 ; 192 15814: a4 2e mov r10, r20 15816: 4f e7 ldi r20, 0x7F ; 127 15818: 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(); 1581a: 88 23 and r24, r24 1581c: 21 f0 breq .+8 ; 0x15826 1581e: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 15822: 4b 01 movw r8, r22 15824: 5c 01 movw r10, r24 if(code_seen('A')) A = code_value_short(); 15826: 81 e4 ldi r24, 0x41 ; 65 15828: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 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; 1582c: 22 24 eor r2, r2 1582e: 2a 94 dec r2 15830: 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(); 15832: 88 23 and r24, r24 15834: 19 f0 breq .+6 ; 0x1583c 15836: 0e 94 1b 5c call 0xb836 ; 0xb836 1583a: 1c 01 movw r2, r24 if(code_seen('F')) F = code_value_short(); 1583c: 86 e4 ldi r24, 0x46 ; 70 1583e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15842: 88 23 and r24, r24 15844: 11 f4 brne .+4 ; 0x1584a 15846: 0c 94 8e be jmp 0x17d1c ; 0x17d1c 1584a: 0e 94 1b 5c call 0xb836 ; 0xb836 1584e: eb 96 adiw r28, 0x3b ; 59 15850: 8f af std Y+63, r24 ; 0x3f 15852: 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) 15854: e2 96 adiw r28, 0x32 ; 50 15856: 2c ad ldd r18, Y+60 ; 0x3c 15858: 3d ad ldd r19, Y+61 ; 0x3d 1585a: 4e ad ldd r20, Y+62 ; 0x3e 1585c: 5f ad ldd r21, Y+63 ; 0x3f 1585e: e2 97 sbiw r28, 0x32 ; 50 15860: ca 01 movw r24, r20 15862: b9 01 movw r22, r18 15864: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15868: 88 23 and r24, r24 1586a: 11 f4 brne .+4 ; 0x15870 1586c: 0c 94 98 be jmp 0x17d30 ; 0x17d30 15870: a7 01 movw r20, r14 15872: 96 01 movw r18, r12 15874: c7 01 movw r24, r14 15876: b6 01 movw r22, r12 15878: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 1587c: 88 23 and r24, r24 1587e: 11 f4 brne .+4 ; 0x15884 15880: 0c 94 98 be jmp 0x17d30 ; 0x17d30 15884: 6e 96 adiw r28, 0x1e ; 30 15886: 2c ad ldd r18, Y+60 ; 0x3c 15888: 3d ad ldd r19, Y+61 ; 0x3d 1588a: 4e ad ldd r20, Y+62 ; 0x3e 1588c: 5f ad ldd r21, Y+63 ; 0x3f 1588e: 6e 97 sbiw r28, 0x1e ; 30 15890: ca 01 movw r24, r20 15892: b9 01 movw r22, r18 15894: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15898: 88 23 and r24, r24 1589a: 11 f4 brne .+4 ; 0x158a0 1589c: 0c 94 98 be jmp 0x17d30 ; 0x17d30 158a0: a2 96 adiw r28, 0x22 ; 34 158a2: 2c ad ldd r18, Y+60 ; 0x3c 158a4: 3d ad ldd r19, Y+61 ; 0x3d 158a6: 4e ad ldd r20, Y+62 ; 0x3e 158a8: 5f ad ldd r21, Y+63 ; 0x3f 158aa: a2 97 sbiw r28, 0x22 ; 34 158ac: ca 01 movw r24, r20 158ae: b9 01 movw r22, r18 158b0: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 158b4: 88 23 and r24, r24 158b6: 11 f4 brne .+4 ; 0x158bc 158b8: 0c 94 98 be jmp 0x17d30 ; 0x17d30 158bc: 6a 96 adiw r28, 0x1a ; 26 158be: 2c ad ldd r18, Y+60 ; 0x3c 158c0: 3d ad ldd r19, Y+61 ; 0x3d 158c2: 4e ad ldd r20, Y+62 ; 0x3e 158c4: 5f ad ldd r21, Y+63 ; 0x3f 158c6: 6a 97 sbiw r28, 0x1a ; 26 158c8: ca 01 movw r24, r20 158ca: b9 01 movw r22, r18 158cc: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 158d0: 88 23 and r24, r24 158d2: 11 f4 brne .+4 ; 0x158d8 158d4: 0c 94 98 be jmp 0x17d30 ; 0x17d30 158d8: aa 96 adiw r28, 0x2a ; 42 158da: 2c ad ldd r18, Y+60 ; 0x3c 158dc: 3d ad ldd r19, Y+61 ; 0x3d 158de: 4e ad ldd r20, Y+62 ; 0x3e 158e0: 5f ad ldd r21, Y+63 ; 0x3f 158e2: aa 97 sbiw r28, 0x2a ; 42 158e4: ca 01 movw r24, r20 158e6: b9 01 movw r22, r18 158e8: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 158ec: 88 23 and r24, r24 158ee: 11 f4 brne .+4 ; 0x158f4 158f0: 0c 94 98 be jmp 0x17d30 ; 0x17d30 158f4: a6 96 adiw r28, 0x26 ; 38 158f6: 2c ad ldd r18, Y+60 ; 0x3c 158f8: 3d ad ldd r19, Y+61 ; 0x3d 158fa: 4e ad ldd r20, Y+62 ; 0x3e 158fc: 5f ad ldd r21, Y+63 ; 0x3f 158fe: a6 97 sbiw r28, 0x26 ; 38 15900: ca 01 movw r24, r20 15902: b9 01 movw r22, r18 15904: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15908: 88 23 and r24, r24 1590a: 11 f4 brne .+4 ; 0x15910 1590c: 0c 94 98 be jmp 0x17d30 ; 0x17d30 15910: a5 01 movw r20, r10 15912: 94 01 movw r18, r8 15914: c5 01 movw r24, r10 15916: b4 01 movw r22, r8 15918: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 1591c: 88 23 and r24, r24 1591e: 11 f4 brne .+4 ; 0x15924 15920: 0c 94 98 be jmp 0x17d30 ; 0x17d30 15924: a3 01 movw r20, r6 15926: 92 01 movw r18, r4 15928: c3 01 movw r24, r6 1592a: b2 01 movw r22, r4 1592c: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15930: 88 23 and r24, r24 15932: 11 f4 brne .+4 ; 0x15938 15934: 0c 94 98 be jmp 0x17d30 ; 0x17d30 && I < 0 && S < 0 && B < 0 && A < 0 && L < 0) { 15938: ab 96 adiw r28, 0x2b ; 43 1593a: af ad ldd r26, Y+63 ; 0x3f 1593c: ab 97 sbiw r28, 0x2b ; 43 1593e: a7 fd sbrc r26, 7 15940: 02 c0 rjmp .+4 ; 0x15946 15942: 0c 94 98 be jmp 0x17d30 ; 0x17d30 15946: e3 96 adiw r28, 0x33 ; 51 15948: bf ad ldd r27, Y+63 ; 0x3f 1594a: e3 97 sbiw r28, 0x33 ; 51 1594c: b7 fd sbrc r27, 7 1594e: 02 c0 rjmp .+4 ; 0x15954 15950: 0c 94 98 be jmp 0x17d30 ; 0x17d30 15954: e7 96 adiw r28, 0x37 ; 55 15956: ef ad ldd r30, Y+63 ; 0x3f 15958: e7 97 sbiw r28, 0x37 ; 55 1595a: e7 fd sbrc r30, 7 1595c: 02 c0 rjmp .+4 ; 0x15962 1595e: 0c 94 9d be jmp 0x17d3a ; 0x17d3a 15962: 37 fc sbrc r3, 7 15964: 02 c0 rjmp .+4 ; 0x1596a 15966: 0c 94 e8 be jmp 0x17dd0 ; 0x17dd0 1596a: 17 ff sbrs r17, 7 1596c: 02 c0 rjmp .+4 ; 0x15972 1596e: 0c 94 94 be jmp 0x17d28 ; 0x17d28 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; 15972: ce 01 movw r24, r28 15974: 01 96 adiw r24, 0x01 ; 1 15976: 0f 94 de 47 call 0x28fbc ; 0x28fbc if(!isnan(P) && P > 0) thermal_model::data.P = P; 1597a: a7 01 movw r20, r14 1597c: 96 01 movw r18, r12 1597e: c7 01 movw r24, r14 15980: b6 01 movw r22, r12 15982: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15986: 88 23 and r24, r24 15988: 11 f4 brne .+4 ; 0x1598e 1598a: 0c 94 8c bf jmp 0x17f18 ; 0x17f18 if(!isnan(U)) thermal_model::data.U = U; 1598e: 6e 96 adiw r28, 0x1e ; 30 15990: 2c ad ldd r18, Y+60 ; 0x3c 15992: 3d ad ldd r19, Y+61 ; 0x3d 15994: 4e ad ldd r20, Y+62 ; 0x3e 15996: 5f ad ldd r21, Y+63 ; 0x3f 15998: 6e 97 sbiw r28, 0x1e ; 30 1599a: ca 01 movw r24, r20 1599c: b9 01 movw r22, r18 1599e: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 159a2: 81 11 cpse r24, r1 159a4: 0e c0 rjmp .+28 ; 0x159c2 159a6: 6e 96 adiw r28, 0x1e ; 30 159a8: 8c ad ldd r24, Y+60 ; 0x3c 159aa: 9d ad ldd r25, Y+61 ; 0x3d 159ac: ae ad ldd r26, Y+62 ; 0x3e 159ae: bf ad ldd r27, Y+63 ; 0x3f 159b0: 6e 97 sbiw r28, 0x1e ; 30 159b2: 80 93 bc 12 sts 0x12BC, r24 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 159b6: 90 93 bd 12 sts 0x12BD, r25 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 159ba: a0 93 be 12 sts 0x12BE, r26 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 159be: b0 93 bf 12 sts 0x12BF, r27 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> if(!isnan(V)) thermal_model::data.V = V; 159c2: a2 96 adiw r28, 0x22 ; 34 159c4: 2c ad ldd r18, Y+60 ; 0x3c 159c6: 3d ad ldd r19, Y+61 ; 0x3d 159c8: 4e ad ldd r20, Y+62 ; 0x3e 159ca: 5f ad ldd r21, Y+63 ; 0x3f 159cc: a2 97 sbiw r28, 0x22 ; 34 159ce: ca 01 movw r24, r20 159d0: b9 01 movw r22, r18 159d2: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 159d6: 81 11 cpse r24, r1 159d8: 0e c0 rjmp .+28 ; 0x159f6 159da: a2 96 adiw r28, 0x22 ; 34 159dc: 2c ad ldd r18, Y+60 ; 0x3c 159de: 3d ad ldd r19, Y+61 ; 0x3d 159e0: 4e ad ldd r20, Y+62 ; 0x3e 159e2: 5f ad ldd r21, Y+63 ; 0x3f 159e4: a2 97 sbiw r28, 0x22 ; 34 159e6: 20 93 c0 12 sts 0x12C0, r18 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 159ea: 30 93 c1 12 sts 0x12C1, r19 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 159ee: 40 93 c2 12 sts 0x12C2, r20 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 159f2: 50 93 c3 12 sts 0x12C3, r21 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> if(!isnan(C) && C > 0) thermal_model::data.C = C; 159f6: 6a 96 adiw r28, 0x1a ; 26 159f8: 2c ad ldd r18, Y+60 ; 0x3c 159fa: 3d ad ldd r19, Y+61 ; 0x3d 159fc: 4e ad ldd r20, Y+62 ; 0x3e 159fe: 5f ad ldd r21, Y+63 ; 0x3f 15a00: 6a 97 sbiw r28, 0x1a ; 26 15a02: ca 01 movw r24, r20 15a04: b9 01 movw r22, r18 15a06: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15a0a: 81 11 cpse r24, r1 15a0c: 1b c0 rjmp .+54 ; 0x15a44 15a0e: 20 e0 ldi r18, 0x00 ; 0 15a10: 30 e0 ldi r19, 0x00 ; 0 15a12: a9 01 movw r20, r18 15a14: 6a 96 adiw r28, 0x1a ; 26 15a16: 6c ad ldd r22, Y+60 ; 0x3c 15a18: 7d ad ldd r23, Y+61 ; 0x3d 15a1a: 8e ad ldd r24, Y+62 ; 0x3e 15a1c: 9f ad ldd r25, Y+63 ; 0x3f 15a1e: 6a 97 sbiw r28, 0x1a ; 26 15a20: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 15a24: 18 16 cp r1, r24 15a26: 74 f4 brge .+28 ; 0x15a44 15a28: 6a 96 adiw r28, 0x1a ; 26 15a2a: 8c ad ldd r24, Y+60 ; 0x3c 15a2c: 9d ad ldd r25, Y+61 ; 0x3d 15a2e: ae ad ldd r26, Y+62 ; 0x3e 15a30: bf ad ldd r27, Y+63 ; 0x3f 15a32: 6a 97 sbiw r28, 0x1a ; 26 15a34: 80 93 c4 12 sts 0x12C4, r24 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 15a38: 90 93 c5 12 sts 0x12C5, r25 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 15a3c: a0 93 c6 12 sts 0x12C6, r26 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 15a40: b0 93 c7 12 sts 0x12C7, r27 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> if(!isnan(D)) thermal_model::data.fS = D; 15a44: aa 96 adiw r28, 0x2a ; 42 15a46: 2c ad ldd r18, Y+60 ; 0x3c 15a48: 3d ad ldd r19, Y+61 ; 0x3d 15a4a: 4e ad ldd r20, Y+62 ; 0x3e 15a4c: 5f ad ldd r21, Y+63 ; 0x3f 15a4e: aa 97 sbiw r28, 0x2a ; 42 15a50: ca 01 movw r24, r20 15a52: b9 01 movw r22, r18 15a54: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15a58: 81 11 cpse r24, r1 15a5a: 0e c0 rjmp .+28 ; 0x15a78 15a5c: aa 96 adiw r28, 0x2a ; 42 15a5e: 2c ad ldd r18, Y+60 ; 0x3c 15a60: 3d ad ldd r19, Y+61 ; 0x3d 15a62: 4e ad ldd r20, Y+62 ; 0x3e 15a64: 5f ad ldd r21, Y+63 ; 0x3f 15a66: aa 97 sbiw r28, 0x2a ; 42 15a68: 20 93 c8 12 sts 0x12C8, r18 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 15a6c: 30 93 c9 12 sts 0x12C9, r19 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 15a70: 40 93 ca 12 sts 0x12CA, r20 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 15a74: 50 93 cb 12 sts 0x12CB, r21 ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> if(L >= 0) thermal_model_set_lag(L); 15a78: 17 fd sbrc r17, 7 15a7a: 03 c0 rjmp .+6 ; 0x15a82 15a7c: c8 01 movw r24, r16 15a7e: 0f 94 c1 44 call 0x28982 ; 0x28982 if(!isnan(Ta_corr)) thermal_model::data.Ta_corr = Ta_corr; 15a82: a6 96 adiw r28, 0x26 ; 38 15a84: 2c ad ldd r18, Y+60 ; 0x3c 15a86: 3d ad ldd r19, Y+61 ; 0x3d 15a88: 4e ad ldd r20, Y+62 ; 0x3e 15a8a: 5f ad ldd r21, Y+63 ; 0x3f 15a8c: a6 97 sbiw r28, 0x26 ; 38 15a8e: ca 01 movw r24, r20 15a90: b9 01 movw r22, r18 15a92: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15a96: 81 11 cpse r24, r1 15a98: 0e c0 rjmp .+28 ; 0x15ab6 15a9a: a6 96 adiw r28, 0x26 ; 38 15a9c: 8c ad ldd r24, Y+60 ; 0x3c 15a9e: 9d ad ldd r25, Y+61 ; 0x3d 15aa0: ae ad ldd r26, Y+62 ; 0x3e 15aa2: bf ad ldd r27, Y+63 ; 0x3f 15aa4: a6 97 sbiw r28, 0x26 ; 38 15aa6: 80 93 0e 13 sts 0x130E, r24 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 15aaa: 90 93 0f 13 sts 0x130F, r25 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 15aae: a0 93 10 13 sts 0x1310, r26 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 15ab2: b0 93 11 13 sts 0x1311, r27 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> if(!isnan(warn) && warn > 0) thermal_model::data.warn = warn; 15ab6: a5 01 movw r20, r10 15ab8: 94 01 movw r18, r8 15aba: c5 01 movw r24, r10 15abc: b4 01 movw r22, r8 15abe: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15ac2: 81 11 cpse r24, r1 15ac4: 11 c0 rjmp .+34 ; 0x15ae8 15ac6: 20 e0 ldi r18, 0x00 ; 0 15ac8: 30 e0 ldi r19, 0x00 ; 0 15aca: a9 01 movw r20, r18 15acc: c5 01 movw r24, r10 15ace: b4 01 movw r22, r8 15ad0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 15ad4: 18 16 cp r1, r24 15ad6: 44 f4 brge .+16 ; 0x15ae8 15ad8: 80 92 12 13 sts 0x1312, r8 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15adc: 90 92 13 13 sts 0x1313, r9 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15ae0: a0 92 14 13 sts 0x1314, r10 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15ae4: b0 92 15 13 sts 0x1315, r11 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> if(!isnan(err) && err > 0) thermal_model::data.err = err; 15ae8: a3 01 movw r20, r6 15aea: 92 01 movw r18, r4 15aec: c3 01 movw r24, r6 15aee: b2 01 movw r22, r4 15af0: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 15af4: 81 11 cpse r24, r1 15af6: 11 c0 rjmp .+34 ; 0x15b1a 15af8: 20 e0 ldi r18, 0x00 ; 0 15afa: 30 e0 ldi r19, 0x00 ; 0 15afc: a9 01 movw r20, r18 15afe: c3 01 movw r24, r6 15b00: b2 01 movw r22, r4 15b02: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 15b06: 18 16 cp r1, r24 15b08: 44 f4 brge .+16 ; 0x15b1a 15b0a: 40 92 16 13 sts 0x1316, r4 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 15b0e: 50 92 17 13 sts 0x1317, r5 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 15b12: 60 92 18 13 sts 0x1318, r6 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 15b16: 70 92 19 13 sts 0x1319, r7 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> // ensure warn <= err if (thermal_model::data.warn > thermal_model::data.err) 15b1a: c0 90 16 13 lds r12, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 15b1e: d0 90 17 13 lds r13, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 15b22: e0 90 18 13 lds r14, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 15b26: f0 90 19 13 lds r15, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 15b2a: a7 01 movw r20, r14 15b2c: 96 01 movw r18, r12 15b2e: 60 91 12 13 lds r22, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15b32: 70 91 13 13 lds r23, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15b36: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15b3a: 90 91 15 13 lds r25, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 15b3e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 15b42: 18 16 cp r1, r24 15b44: 44 f4 brge .+16 ; 0x15b56 thermal_model::data.warn = thermal_model::data.err; 15b46: c0 92 12 13 sts 0x1312, r12 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 15b4a: d0 92 13 13 sts 0x1313, r13 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 15b4e: e0 92 14 13 sts 0x1314, r14 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 15b52: f0 92 15 13 sts 0x1315, r15 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::setup(); 15b56: 0f 94 48 45 call 0x28a90 ; 0x28a90 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; 15b5a: ce 01 movw r24, r28 15b5c: 01 96 adiw r24, 0x01 ; 1 15b5e: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 15b62: 0c 94 0e bf jmp 0x17e1c ; 0x17e1c } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15b66: 85 39 cpi r24, 0x95 ; 149 15b68: a1 e0 ldi r26, 0x01 ; 1 15b6a: 9a 07 cpc r25, r26 15b6c: 11 f4 brne .+4 ; 0x15b72 15b6e: 0c 94 04 c2 jmp 0x18408 ; 0x18408 15b72: 2c f5 brge .+74 ; 0x15bbe 15b74: 80 39 cpi r24, 0x90 ; 144 15b76: e1 e0 ldi r30, 0x01 ; 1 15b78: 9e 07 cpc r25, r30 15b7a: 11 f4 brne .+4 ; 0x15b80 15b7c: 0c 94 00 c2 jmp 0x18400 ; 0x18400 15b80: 83 39 cpi r24, 0x93 ; 147 15b82: 91 40 sbci r25, 0x01 ; 1 15b84: 09 f0 breq .+2 ; 0x15b88 15b86: a6 c8 rjmp .-3764 ; 0x14cd4 */ 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()) 15b88: 80 91 98 13 lds r24, 0x1398 ; 0x801398 15b8c: 81 30 cpi r24, 0x01 ; 1 15b8e: 09 f0 breq .+2 ; 0x15b92 15b90: cc c4 rjmp .+2456 ; 0x1652a { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 15b92: 85 e4 ldi r24, 0x45 ; 69 15b94: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15b98: 81 11 cpse r24, r1 15b9a: 0e 94 0e 5c call 0xb81c ; 0xb81c if(code_seen('F')) filament = code_value_uint8(); 15b9e: 86 e4 ldi r24, 0x46 ; 70 15ba0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 15ba4: 81 11 cpse r24, r1 15ba6: 0e 94 0e 5c call 0xb81c ; 0xb81c MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); } bool MMU2::set_filament_type(uint8_t /*slot*/, uint8_t /*type*/) { if (!WaitForMMUReady()) { 15baa: 0f 94 56 88 call 0x310ac ; 0x310ac 15bae: 88 23 and r24, r24 15bb0: 09 f4 brne .+2 ; 0x15bb4 15bb2: bb c4 rjmp .+2422 ; 0x1652a // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 15bb4: 60 e0 ldi r22, 0x00 ; 0 15bb6: 80 e0 ldi r24, 0x00 ; 0 15bb8: 0f 94 a2 9f call 0x33f44 ; 0x33f44 15bbc: b6 c4 rjmp .+2412 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15bbe: 84 3a cpi r24, 0xA4 ; 164 15bc0: 21 e0 ldi r18, 0x01 ; 1 15bc2: 92 07 cpc r25, r18 15bc4: 11 f4 brne .+4 ; 0x15bca 15bc6: 0c 94 09 c2 jmp 0x18412 ; 0x18412 15bca: 84 3f cpi r24, 0xF4 ; 244 15bcc: 31 e0 ldi r19, 0x01 ; 1 15bce: 93 07 cpc r25, r19 15bd0: 11 f4 brne .+4 ; 0x15bd6 15bd2: 0c 94 0d c2 jmp 0x1841a ; 0x1841a 15bd6: 86 39 cpi r24, 0x96 ; 150 15bd8: 91 40 sbci r25, 0x01 ; 1 15bda: 09 f0 breq .+2 ; 0x15bde 15bdc: 7b c8 rjmp .-3850 ; 0x14cd4 */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 15bde: 80 e0 ldi r24, 0x00 ; 0 15be0: 0e 94 b4 75 call 0xeb68 ; 0xeb68 15be4: a2 c4 rjmp .+2372 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 15be6: 83 3c cpi r24, 0xC3 ; 195 15be8: 52 e0 ldi r21, 0x02 ; 2 15bea: 95 07 cpc r25, r21 15bec: 11 f4 brne .+4 ; 0x15bf2 15bee: 0c 94 3d cd jmp 0x19a7a ; 0x19a7a 15bf2: 0c f0 brlt .+2 ; 0x15bf6 15bf4: e7 c3 rjmp .+1998 ; 0x163c4 15bf6: 8a 35 cpi r24, 0x5A ; 90 15bf8: b2 e0 ldi r27, 0x02 ; 2 15bfa: 9b 07 cpc r25, r27 15bfc: 11 f4 brne .+4 ; 0x15c02 15bfe: 0c 94 3b c6 jmp 0x18c76 ; 0x18c76 15c02: 0c f0 brlt .+2 ; 0x15c06 15c04: 76 c3 rjmp .+1772 ; 0x162f2 15c06: 8d 3f cpi r24, 0xFD ; 253 15c08: f1 e0 ldi r31, 0x01 ; 1 15c0a: 9f 07 cpc r25, r31 15c0c: 11 f4 brne .+4 ; 0x15c12 15c0e: 0c 94 27 c2 jmp 0x1844e ; 0x1844e 15c12: 0c f0 brlt .+2 ; 0x15c16 15c14: 2e c3 rjmp .+1628 ; 0x16272 15c16: 86 3f cpi r24, 0xF6 ; 246 15c18: 31 e0 ldi r19, 0x01 ; 1 15c1a: 93 07 cpc r25, r19 15c1c: 11 f4 brne .+4 ; 0x15c22 15c1e: 0c 94 15 c2 jmp 0x1842a ; 0x1842a 15c22: 87 3f cpi r24, 0xF7 ; 247 15c24: 91 40 sbci r25, 0x01 ; 1 15c26: 09 f0 breq .+2 ; 0x15c2a 15c28: 55 c8 rjmp .-3926 ; 0x14cd4 #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( 15c2a: 80 91 d1 06 lds r24, 0x06D1 ; 0x8006d1 15c2e: 8f 93 push r24 15c30: 80 91 d0 06 lds r24, 0x06D0 ; 0x8006d0 15c34: 8f 93 push r24 15c36: 80 91 cf 06 lds r24, 0x06CF ; 0x8006cf 15c3a: 8f 93 push r24 15c3c: 80 91 ce 06 lds r24, 0x06CE ; 0x8006ce 15c40: 8f 93 push r24 15c42: 80 91 cd 06 lds r24, 0x06CD ; 0x8006cd 15c46: 8f 93 push r24 15c48: 80 91 cc 06 lds r24, 0x06CC ; 0x8006cc 15c4c: 8f 93 push r24 15c4e: 80 91 cb 06 lds r24, 0x06CB ; 0x8006cb 15c52: 8f 93 push r24 15c54: 80 91 ca 06 lds r24, 0x06CA ; 0x8006ca 15c58: 8f 93 push r24 15c5a: 80 91 c9 06 lds r24, 0x06C9 ; 0x8006c9 15c5e: 8f 93 push r24 15c60: 80 91 c8 06 lds r24, 0x06C8 ; 0x8006c8 15c64: 8f 93 push r24 15c66: 80 91 c7 06 lds r24, 0x06C7 ; 0x8006c7 15c6a: 8f 93 push r24 15c6c: 80 91 c6 06 lds r24, 0x06C6 ; 0x8006c6 15c70: 8f 93 push r24 15c72: 02 ef ldi r16, 0xF2 ; 242 15c74: 19 ea ldi r17, 0xA9 ; 169 15c76: 1f 93 push r17 15c78: 0f 93 push r16 15c7a: 1f 93 push r17 15c7c: 0f 93 push r16 15c7e: 80 91 c5 06 lds r24, 0x06C5 ; 0x8006c5 15c82: 8f 93 push r24 15c84: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 15c88: 8f 93 push r24 15c8a: 80 91 c3 06 lds r24, 0x06C3 ; 0x8006c3 15c8e: 8f 93 push r24 15c90: 80 91 c2 06 lds r24, 0x06C2 ; 0x8006c2 15c94: 8f 93 push r24 15c96: 80 91 c1 06 lds r24, 0x06C1 ; 0x8006c1 15c9a: 8f 93 push r24 15c9c: 80 91 c0 06 lds r24, 0x06C0 ; 0x8006c0 15ca0: 8f 93 push r24 15ca2: 80 91 bf 06 lds r24, 0x06BF ; 0x8006bf 15ca6: 8f 93 push r24 15ca8: 80 91 be 06 lds r24, 0x06BE ; 0x8006be 15cac: 8f 93 push r24 15cae: 80 91 bd 06 lds r24, 0x06BD ; 0x8006bd 15cb2: 8f 93 push r24 15cb4: 80 91 bc 06 lds r24, 0x06BC ; 0x8006bc 15cb8: 8f 93 push r24 15cba: 80 91 bb 06 lds r24, 0x06BB ; 0x8006bb 15cbe: 8f 93 push r24 15cc0: 80 91 ba 06 lds r24, 0x06BA ; 0x8006ba 15cc4: 8f 93 push r24 15cc6: 80 91 b9 06 lds r24, 0x06B9 ; 0x8006b9 15cca: 8f 93 push r24 15ccc: 80 91 b8 06 lds r24, 0x06B8 ; 0x8006b8 15cd0: 8f 93 push r24 15cd2: 80 91 b7 06 lds r24, 0x06B7 ; 0x8006b7 15cd6: 8f 93 push r24 15cd8: 80 91 b6 06 lds r24, 0x06B6 ; 0x8006b6 15cdc: 8f 93 push r24 15cde: 80 91 b5 06 lds r24, 0x06B5 ; 0x8006b5 15ce2: 8f 93 push r24 15ce4: 80 91 b4 06 lds r24, 0x06B4 ; 0x8006b4 15ce8: 8f 93 push r24 15cea: 80 91 b3 06 lds r24, 0x06B3 ; 0x8006b3 15cee: 8f 93 push r24 15cf0: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 15cf4: 8f 93 push r24 15cf6: 80 91 b1 06 lds r24, 0x06B1 ; 0x8006b1 15cfa: 8f 93 push r24 15cfc: 80 91 b0 06 lds r24, 0x06B0 ; 0x8006b0 15d00: 8f 93 push r24 15d02: 80 91 af 06 lds r24, 0x06AF ; 0x8006af 15d06: 8f 93 push r24 15d08: 80 91 ae 06 lds r24, 0x06AE ; 0x8006ae 15d0c: 8f 93 push r24 15d0e: 80 91 ad 06 lds r24, 0x06AD ; 0x8006ad 15d12: 8f 93 push r24 15d14: 80 91 ac 06 lds r24, 0x06AC ; 0x8006ac 15d18: 8f 93 push r24 15d1a: 80 91 ab 06 lds r24, 0x06AB ; 0x8006ab 15d1e: 8f 93 push r24 15d20: 80 91 aa 06 lds r24, 0x06AA ; 0x8006aa 15d24: 8f 93 push r24 15d26: 1f 93 push r17 15d28: 0f 93 push r16 15d2a: 1f 93 push r17 15d2c: 0f 93 push r16 15d2e: 80 91 31 07 lds r24, 0x0731 ; 0x800731 15d32: 8f 93 push r24 15d34: 80 91 30 07 lds r24, 0x0730 ; 0x800730 15d38: 8f 93 push r24 15d3a: 80 91 2f 07 lds r24, 0x072F ; 0x80072f 15d3e: 8f 93 push r24 15d40: 80 91 2e 07 lds r24, 0x072E ; 0x80072e 15d44: 8f 93 push r24 15d46: 80 91 a9 06 lds r24, 0x06A9 ; 0x8006a9 15d4a: 8f 93 push r24 15d4c: 80 91 a8 06 lds r24, 0x06A8 ; 0x8006a8 15d50: 8f 93 push r24 15d52: 80 91 a7 06 lds r24, 0x06A7 ; 0x8006a7 15d56: 8f 93 push r24 15d58: 80 91 a6 06 lds r24, 0x06A6 ; 0x8006a6 15d5c: 8f 93 push r24 15d5e: 80 91 a5 06 lds r24, 0x06A5 ; 0x8006a5 15d62: 8f 93 push r24 15d64: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 15d68: 8f 93 push r24 15d6a: 80 91 a3 06 lds r24, 0x06A3 ; 0x8006a3 15d6e: 8f 93 push r24 15d70: 80 91 a2 06 lds r24, 0x06A2 ; 0x8006a2 15d74: 8f 93 push r24 15d76: 1f 93 push r17 15d78: 0f 93 push r16 15d7a: 1f 93 push r17 15d7c: 0f 93 push r16 15d7e: 80 91 29 07 lds r24, 0x0729 ; 0x800729 15d82: 8f 93 push r24 15d84: 80 91 28 07 lds r24, 0x0728 ; 0x800728 15d88: 8f 93 push r24 15d8a: 80 91 27 07 lds r24, 0x0727 ; 0x800727 15d8e: 8f 93 push r24 15d90: 80 91 26 07 lds r24, 0x0726 ; 0x800726 15d94: 8f 93 push r24 15d96: 80 91 25 07 lds r24, 0x0725 ; 0x800725 15d9a: 8f 93 push r24 15d9c: 80 91 24 07 lds r24, 0x0724 ; 0x800724 15da0: 8f 93 push r24 15da2: 80 91 23 07 lds r24, 0x0723 ; 0x800723 15da6: 8f 93 push r24 15da8: 80 91 22 07 lds r24, 0x0722 ; 0x800722 15dac: 8f 93 push r24 15dae: 80 91 21 07 lds r24, 0x0721 ; 0x800721 15db2: 8f 93 push r24 15db4: 80 91 20 07 lds r24, 0x0720 ; 0x800720 15db8: 8f 93 push r24 15dba: 80 91 1f 07 lds r24, 0x071F ; 0x80071f 15dbe: 8f 93 push r24 15dc0: 80 91 1e 07 lds r24, 0x071E ; 0x80071e 15dc4: 8f 93 push r24 15dc6: 80 91 1d 07 lds r24, 0x071D ; 0x80071d 15dca: 8f 93 push r24 15dcc: 80 91 1c 07 lds r24, 0x071C ; 0x80071c 15dd0: 8f 93 push r24 15dd2: 80 91 1b 07 lds r24, 0x071B ; 0x80071b 15dd6: 8f 93 push r24 15dd8: 80 91 1a 07 lds r24, 0x071A ; 0x80071a 15ddc: 8f 93 push r24 15dde: 1f 93 push r17 15de0: 0f 93 push r16 15de2: 1f 93 push r17 15de4: 0f 93 push r16 15de6: 80 91 a1 06 lds r24, 0x06A1 ; 0x8006a1 15dea: 8f 93 push r24 15dec: 80 91 a0 06 lds r24, 0x06A0 ; 0x8006a0 15df0: 8f 93 push r24 15df2: 80 91 9f 06 lds r24, 0x069F ; 0x80069f 15df6: 8f 93 push r24 15df8: 80 91 9e 06 lds r24, 0x069E ; 0x80069e 15dfc: 8f 93 push r24 15dfe: 80 91 9d 06 lds r24, 0x069D ; 0x80069d 15e02: 8f 93 push r24 15e04: 80 91 9c 06 lds r24, 0x069C ; 0x80069c 15e08: 8f 93 push r24 15e0a: 80 91 9b 06 lds r24, 0x069B ; 0x80069b 15e0e: 8f 93 push r24 15e10: 80 91 9a 06 lds r24, 0x069A ; 0x80069a 15e14: 8f 93 push r24 15e16: 80 91 99 06 lds r24, 0x0699 ; 0x800699 15e1a: 8f 93 push r24 15e1c: 80 91 98 06 lds r24, 0x0698 ; 0x800698 15e20: 8f 93 push r24 15e22: 80 91 97 06 lds r24, 0x0697 ; 0x800697 15e26: 8f 93 push r24 15e28: 80 91 96 06 lds r24, 0x0696 ; 0x800696 15e2c: 8f 93 push r24 15e2e: 80 91 95 06 lds r24, 0x0695 ; 0x800695 15e32: 8f 93 push r24 15e34: 80 91 94 06 lds r24, 0x0694 ; 0x800694 15e38: 8f 93 push r24 15e3a: 80 91 93 06 lds r24, 0x0693 ; 0x800693 15e3e: 8f 93 push r24 15e40: 80 91 92 06 lds r24, 0x0692 ; 0x800692 15e44: 8f 93 push r24 15e46: 1f 93 push r17 15e48: 0f 93 push r16 15e4a: 1f 93 push r17 15e4c: 0f 93 push r16 15e4e: 80 91 19 07 lds r24, 0x0719 ; 0x800719 15e52: 8f 93 push r24 15e54: 80 91 18 07 lds r24, 0x0718 ; 0x800718 15e58: 8f 93 push r24 15e5a: 80 91 17 07 lds r24, 0x0717 ; 0x800717 15e5e: 8f 93 push r24 15e60: 80 91 16 07 lds r24, 0x0716 ; 0x800716 15e64: 8f 93 push r24 15e66: 80 91 15 07 lds r24, 0x0715 ; 0x800715 15e6a: 8f 93 push r24 15e6c: 80 91 14 07 lds r24, 0x0714 ; 0x800714 15e70: 8f 93 push r24 15e72: 80 91 13 07 lds r24, 0x0713 ; 0x800713 15e76: 8f 93 push r24 15e78: 80 91 12 07 lds r24, 0x0712 ; 0x800712 15e7c: 8f 93 push r24 15e7e: 80 91 11 07 lds r24, 0x0711 ; 0x800711 15e82: 8f 93 push r24 15e84: 80 91 10 07 lds r24, 0x0710 ; 0x800710 15e88: 8f 93 push r24 15e8a: 80 91 0f 07 lds r24, 0x070F ; 0x80070f 15e8e: 8f 93 push r24 15e90: 80 91 0e 07 lds r24, 0x070E ; 0x80070e 15e94: 8f 93 push r24 15e96: 80 91 0d 07 lds r24, 0x070D ; 0x80070d 15e9a: 8f 93 push r24 15e9c: 80 91 0c 07 lds r24, 0x070C ; 0x80070c 15ea0: 8f 93 push r24 15ea2: 80 91 0b 07 lds r24, 0x070B ; 0x80070b 15ea6: 8f 93 push r24 15ea8: 80 91 0a 07 lds r24, 0x070A ; 0x80070a 15eac: 8f 93 push r24 15eae: 1f 93 push r17 15eb0: 0f 93 push r16 15eb2: 1f 93 push r17 15eb4: 0f 93 push r16 15eb6: 80 91 91 06 lds r24, 0x0691 ; 0x800691 15eba: 8f 93 push r24 15ebc: 80 91 90 06 lds r24, 0x0690 ; 0x800690 15ec0: 8f 93 push r24 15ec2: 80 91 8f 06 lds r24, 0x068F ; 0x80068f 15ec6: 8f 93 push r24 15ec8: 80 91 8e 06 lds r24, 0x068E ; 0x80068e 15ecc: 8f 93 push r24 15ece: 80 91 8d 06 lds r24, 0x068D ; 0x80068d 15ed2: 8f 93 push r24 15ed4: 80 91 8c 06 lds r24, 0x068C ; 0x80068c 15ed8: 8f 93 push r24 15eda: 80 91 8b 06 lds r24, 0x068B ; 0x80068b 15ede: 8f 93 push r24 15ee0: 80 91 8a 06 lds r24, 0x068A ; 0x80068a 15ee4: 8f 93 push r24 15ee6: 80 91 89 06 lds r24, 0x0689 ; 0x800689 15eea: 8f 93 push r24 15eec: 80 91 88 06 lds r24, 0x0688 ; 0x800688 15ef0: 8f 93 push r24 15ef2: 80 91 87 06 lds r24, 0x0687 ; 0x800687 15ef6: 8f 93 push r24 15ef8: 80 91 86 06 lds r24, 0x0686 ; 0x800686 15efc: 8f 93 push r24 15efe: 80 91 85 06 lds r24, 0x0685 ; 0x800685 15f02: 8f 93 push r24 15f04: 80 91 84 06 lds r24, 0x0684 ; 0x800684 15f08: 8f 93 push r24 15f0a: 80 91 83 06 lds r24, 0x0683 ; 0x800683 15f0e: 8f 93 push r24 15f10: 80 91 82 06 lds r24, 0x0682 ; 0x800682 15f14: 8f 93 push r24 15f16: 1f 93 push r17 15f18: 0f 93 push r16 15f1a: 1f 93 push r17 15f1c: 0f 93 push r16 15f1e: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 15f22: 1f 92 push r1 15f24: 8f 93 push r24 15f26: 80 91 2c 07 lds r24, 0x072C ; 0x80072c 15f2a: 1f 92 push r1 15f2c: 8f 93 push r24 15f2e: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 15f32: 1f 92 push r1 15f34: 8f 93 push r24 15f36: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 15f3a: 1f 92 push r1 15f3c: 8f 93 push r24 15f3e: 1f 93 push r17 15f40: 0f 93 push r16 15f42: 1f 93 push r17 15f44: 0f 93 push r16 15f46: 80 91 81 06 lds r24, 0x0681 ; 0x800681 15f4a: 8f 93 push r24 15f4c: 80 91 80 06 lds r24, 0x0680 ; 0x800680 15f50: 8f 93 push r24 15f52: 80 91 7f 06 lds r24, 0x067F ; 0x80067f 15f56: 8f 93 push r24 15f58: 80 91 7e 06 lds r24, 0x067E ; 0x80067e 15f5c: 8f 93 push r24 15f5e: 80 91 7d 06 lds r24, 0x067D ; 0x80067d 15f62: 8f 93 push r24 15f64: 80 91 7c 06 lds r24, 0x067C ; 0x80067c 15f68: 8f 93 push r24 15f6a: 80 91 7b 06 lds r24, 0x067B ; 0x80067b 15f6e: 8f 93 push r24 15f70: 80 91 7a 06 lds r24, 0x067A ; 0x80067a 15f74: 8f 93 push r24 15f76: 80 91 79 06 lds r24, 0x0679 ; 0x800679 15f7a: 8f 93 push r24 15f7c: 80 91 78 06 lds r24, 0x0678 ; 0x800678 15f80: 8f 93 push r24 15f82: 80 91 77 06 lds r24, 0x0677 ; 0x800677 15f86: 8f 93 push r24 15f88: 80 91 76 06 lds r24, 0x0676 ; 0x800676 15f8c: 8f 93 push r24 15f8e: 80 91 75 06 lds r24, 0x0675 ; 0x800675 15f92: 8f 93 push r24 15f94: 80 91 74 06 lds r24, 0x0674 ; 0x800674 15f98: 8f 93 push r24 15f9a: 80 91 73 06 lds r24, 0x0673 ; 0x800673 15f9e: 8f 93 push r24 15fa0: 80 91 72 06 lds r24, 0x0672 ; 0x800672 15fa4: 8f 93 push r24 15fa6: 1f 93 push r17 15fa8: 0f 93 push r16 15faa: 1f 93 push r17 15fac: 0f 93 push r16 15fae: 89 ef ldi r24, 0xF9 ; 249 15fb0: 91 e8 ldi r25, 0x81 ; 129 15fb2: 9f 93 push r25 15fb4: 8f 93 push r24 15fb6: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 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"), 15fba: 0f b6 in r0, 0x3f ; 63 15fbc: f8 94 cli 15fbe: de bf out 0x3e, r29 ; 62 15fc0: 0f be out 0x3f, r0 ; 63 15fc2: 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; 15fc4: 2c ea ldi r18, 0xAC ; 172 15fc6: 35 ec ldi r19, 0xC5 ; 197 15fc8: 47 e2 ldi r20, 0x27 ; 39 15fca: 5e e3 ldi r21, 0x3E ; 62 15fcc: 60 91 de 06 lds r22, 0x06DE ; 0x8006de 15fd0: 70 91 df 06 lds r23, 0x06DF ; 0x8006df 15fd4: 80 91 e0 06 lds r24, 0x06E0 ; 0x8006e0 15fd8: 90 91 e1 06 lds r25, 0x06E1 ; 0x8006e1 15fdc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 15fe0: 9f 93 push r25 15fe2: 8f 93 push r24 15fe4: 7f 93 push r23 15fe6: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15fe8: 2c ea ldi r18, 0xAC ; 172 15fea: 35 ec ldi r19, 0xC5 ; 197 15fec: 47 e2 ldi r20, 0x27 ; 39 15fee: 5e e3 ldi r21, 0x3E ; 62 15ff0: 60 91 da 06 lds r22, 0x06DA ; 0x8006da 15ff4: 70 91 db 06 lds r23, 0x06DB ; 0x8006db 15ff8: 80 91 dc 06 lds r24, 0x06DC ; 0x8006dc 15ffc: 90 91 dd 06 lds r25, 0x06DD ; 0x8006dd 16000: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 16004: 9f 93 push r25 16006: 8f 93 push r24 16008: 7f 93 push r23 1600a: 6f 93 push r22 1600c: 80 91 d9 06 lds r24, 0x06D9 ; 0x8006d9 16010: 8f 93 push r24 16012: 80 91 d8 06 lds r24, 0x06D8 ; 0x8006d8 16016: 8f 93 push r24 16018: 80 91 d7 06 lds r24, 0x06D7 ; 0x8006d7 1601c: 8f 93 push r24 1601e: 80 91 d6 06 lds r24, 0x06D6 ; 0x8006d6 16022: 8f 93 push r24 16024: 1f 93 push r17 16026: 0f 93 push r16 16028: 1f 93 push r17 1602a: 0f 93 push r16 1602c: 8c ec ldi r24, 0xCC ; 204 1602e: 91 e8 ldi r25, 0x81 ; 129 16030: 9f 93 push r25 16032: 8f 93 push r24 16034: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 16038: 2c ea ldi r18, 0xAC ; 172 1603a: 35 ec ldi r19, 0xC5 ; 197 1603c: 47 e2 ldi r20, 0x27 ; 39 1603e: 5e e3 ldi r21, 0x3E ; 62 16040: 60 91 ea 06 lds r22, 0x06EA ; 0x8006ea 16044: 70 91 eb 06 lds r23, 0x06EB ; 0x8006eb 16048: 80 91 ec 06 lds r24, 0x06EC ; 0x8006ec 1604c: 90 91 ed 06 lds r25, 0x06ED ; 0x8006ed 16050: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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"), 16054: 9f 93 push r25 16056: 8f 93 push r24 16058: 7f 93 push r23 1605a: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 1605c: 2c ea ldi r18, 0xAC ; 172 1605e: 35 ec ldi r19, 0xC5 ; 197 16060: 47 e2 ldi r20, 0x27 ; 39 16062: 5e e3 ldi r21, 0x3E ; 62 16064: 60 91 e6 06 lds r22, 0x06E6 ; 0x8006e6 16068: 70 91 e7 06 lds r23, 0x06E7 ; 0x8006e7 1606c: 80 91 e8 06 lds r24, 0x06E8 ; 0x8006e8 16070: 90 91 e9 06 lds r25, 0x06E9 ; 0x8006e9 16074: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 16078: 9f 93 push r25 1607a: 8f 93 push r24 1607c: 7f 93 push r23 1607e: 6f 93 push r22 16080: 80 91 e5 06 lds r24, 0x06E5 ; 0x8006e5 16084: 8f 93 push r24 16086: 80 91 e4 06 lds r24, 0x06E4 ; 0x8006e4 1608a: 8f 93 push r24 1608c: 80 91 e3 06 lds r24, 0x06E3 ; 0x8006e3 16090: 8f 93 push r24 16092: 80 91 e2 06 lds r24, 0x06E2 ; 0x8006e2 16096: 8f 93 push r24 16098: 1f 93 push r17 1609a: 0f 93 push r16 1609c: 1f 93 push r17 1609e: 0f 93 push r16 160a0: 87 e9 ldi r24, 0x97 ; 151 160a2: 91 e8 ldi r25, 0x81 ; 129 160a4: 9f 93 push r25 160a6: 8f 93 push r24 160a8: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 160ac: 0f b6 in r0, 0x3f ; 63 160ae: f8 94 cli 160b0: de bf out 0x3e, r29 ; 62 160b2: 0f be out 0x3f, r0 ; 63 160b4: cd bf out 0x3d, r28 ; 61 160b6: 80 91 f0 06 lds r24, 0x06F0 ; 0x8006f0 160ba: 1f 92 push r1 160bc: 8f 93 push r24 160be: 1f 93 push r17 160c0: 0f 93 push r16 160c2: 1f 93 push r17 160c4: 0f 93 push r16 160c6: 20 e0 ldi r18, 0x00 ; 0 160c8: 30 e0 ldi r19, 0x00 ; 0 160ca: 40 e7 ldi r20, 0x70 ; 112 160cc: 52 e4 ldi r21, 0x42 ; 66 160ce: 60 91 01 07 lds r22, 0x0701 ; 0x800701 160d2: 70 91 02 07 lds r23, 0x0702 ; 0x800702 160d6: 80 91 03 07 lds r24, 0x0703 ; 0x800703 160da: 90 91 04 07 lds r25, 0x0704 ; 0x800704 160de: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 160e2: 9f 93 push r25 160e4: 8f 93 push r24 160e6: 7f 93 push r23 160e8: 6f 93 push r22 160ea: 80 91 00 07 lds r24, 0x0700 ; 0x800700 160ee: 8f 93 push r24 160f0: 80 91 ff 06 lds r24, 0x06FF ; 0x8006ff 160f4: 8f 93 push r24 160f6: 80 91 fe 06 lds r24, 0x06FE ; 0x8006fe 160fa: 8f 93 push r24 160fc: 80 91 fd 06 lds r24, 0x06FD ; 0x8006fd 16100: 8f 93 push r24 16102: 1f 93 push r17 16104: 0f 93 push r16 16106: 1f 93 push r17 16108: 0f 93 push r16 1610a: 80 91 fc 06 lds r24, 0x06FC ; 0x8006fc 1610e: 8f 93 push r24 16110: 80 91 fb 06 lds r24, 0x06FB ; 0x8006fb 16114: 8f 93 push r24 16116: 80 91 fa 06 lds r24, 0x06FA ; 0x8006fa 1611a: 8f 93 push r24 1611c: 80 91 f9 06 lds r24, 0x06F9 ; 0x8006f9 16120: 8f 93 push r24 16122: 20 e0 ldi r18, 0x00 ; 0 16124: 30 e0 ldi r19, 0x00 ; 0 16126: 40 e7 ldi r20, 0x70 ; 112 16128: 52 e4 ldi r21, 0x42 ; 66 1612a: 60 91 f5 06 lds r22, 0x06F5 ; 0x8006f5 1612e: 70 91 f6 06 lds r23, 0x06F6 ; 0x8006f6 16132: 80 91 f7 06 lds r24, 0x06F7 ; 0x8006f7 16136: 90 91 f8 06 lds r25, 0x06F8 ; 0x8006f8 1613a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1613e: 9f 93 push r25 16140: 8f 93 push r24 16142: 7f 93 push r23 16144: 6f 93 push r22 16146: 80 91 f4 06 lds r24, 0x06F4 ; 0x8006f4 1614a: 8f 93 push r24 1614c: 80 91 f3 06 lds r24, 0x06F3 ; 0x8006f3 16150: 8f 93 push r24 16152: 80 91 f2 06 lds r24, 0x06F2 ; 0x8006f2 16156: 8f 93 push r24 16158: 80 91 f1 06 lds r24, 0x06F1 ; 0x8006f1 1615c: 8f 93 push r24 1615e: 1f 93 push r17 16160: 0f 93 push r16 16162: 1f 93 push r17 16164: 0f 93 push r16 16166: 86 e9 ldi r24, 0x96 ; 150 16168: 90 e8 ldi r25, 0x80 ; 128 1616a: 9f 93 push r25 1616c: 8f 93 push r24 1616e: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 ); #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) { 16172: 0f b6 in r0, 0x3f ; 63 16174: f8 94 cli 16176: de bf out 0x3e, r29 ; 62 16178: 0f be out 0x3f, r0 ; 63 1617a: cd bf out 0x3d, r28 ; 61 1617c: 80 91 05 07 lds r24, 0x0705 ; 0x800705 16180: 88 23 and r24, r24 16182: 11 f4 brne .+4 ; 0x16188 16184: 0c 94 19 c2 jmp 0x18432 ; 0x18432 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 16188: 80 91 09 07 lds r24, 0x0709 ; 0x800709 1618c: 8f 93 push r24 1618e: 80 91 08 07 lds r24, 0x0708 ; 0x800708 16192: 8f 93 push r24 16194: 80 91 07 07 lds r24, 0x0707 ; 0x800707 16198: 8f 93 push r24 1619a: 80 91 06 07 lds r24, 0x0706 ; 0x800706 1619e: 8f 93 push r24 161a0: 1f 93 push r17 161a2: 0f 93 push r16 161a4: 1f 93 push r17 161a6: 0f 93 push r16 161a8: 80 e7 ldi r24, 0x70 ; 112 161aa: 90 e8 ldi r25, 0x80 ; 128 161ac: 9f 93 push r25 161ae: 8f 93 push r24 161b0: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 161b4: 0f b6 in r0, 0x3f ; 63 161b6: f8 94 cli 161b8: de bf out 0x3e, r29 ; 62 161ba: 0f be out 0x3f, r0 ; 63 161bc: 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( 161be: 80 91 3e 07 lds r24, 0x073E ; 0x80073e 161c2: 8f 93 push r24 161c4: 80 91 3d 07 lds r24, 0x073D ; 0x80073d 161c8: 8f 93 push r24 161ca: 80 91 3c 07 lds r24, 0x073C ; 0x80073c 161ce: 8f 93 push r24 161d0: 80 91 3b 07 lds r24, 0x073B ; 0x80073b 161d4: 8f 93 push r24 161d6: 80 91 3a 07 lds r24, 0x073A ; 0x80073a 161da: 1f 92 push r1 161dc: 8f 93 push r24 161de: 80 91 39 07 lds r24, 0x0739 ; 0x800739 161e2: 8f 93 push r24 161e4: 80 91 38 07 lds r24, 0x0738 ; 0x800738 161e8: 8f 93 push r24 161ea: 80 91 37 07 lds r24, 0x0737 ; 0x800737 161ee: 8f 93 push r24 161f0: 80 91 36 07 lds r24, 0x0736 ; 0x800736 161f4: 8f 93 push r24 161f6: 80 91 35 07 lds r24, 0x0735 ; 0x800735 161fa: 8f 93 push r24 161fc: 80 91 34 07 lds r24, 0x0734 ; 0x800734 16200: 8f 93 push r24 16202: 80 91 33 07 lds r24, 0x0733 ; 0x800733 16206: 8f 93 push r24 16208: 80 91 32 07 lds r24, 0x0732 ; 0x800732 1620c: 8f 93 push r24 1620e: 02 ef ldi r16, 0xF2 ; 242 16210: 19 ea ldi r17, 0xA9 ; 169 16212: 1f 93 push r17 16214: 0f 93 push r16 16216: 1f 93 push r17 16218: 0f 93 push r16 1621a: 8f ec ldi r24, 0xCF ; 207 1621c: 9f e7 ldi r25, 0x7F ; 127 1621e: 9f 93 push r25 16220: 8f 93 push r24 16222: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 "%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(); 16226: 0f 94 00 44 call 0x28800 ; 0x28800 #endif printf_P(PSTR( 1622a: 8d ee ldi r24, 0xED ; 237 1622c: 9f e0 ldi r25, 0x0F ; 15 1622e: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 16232: f6 2e mov r15, r22 16234: e7 2e mov r14, r23 16236: d8 2e mov r13, r24 16238: c9 2e mov r12, r25 1623a: 81 ef ldi r24, 0xF1 ; 241 1623c: 9f e0 ldi r25, 0x0F ; 15 1623e: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 16242: cf 92 push r12 16244: df 92 push r13 16246: ef 92 push r14 16248: ff 92 push r15 1624a: 9f 93 push r25 1624c: 8f 93 push r24 1624e: 7f 93 push r23 16250: 6f 93 push r22 16252: 1f 93 push r17 16254: 0f 93 push r16 16256: 1f 93 push r17 16258: 0f 93 push r16 1625a: 8e ea ldi r24, 0xAE ; 174 1625c: 9f e7 ldi r25, 0x7F ; 127 1625e: 9f 93 push r25 16260: 8f 93 push r24 16262: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 16266: 0f b6 in r0, 0x3f ; 63 16268: f8 94 cli 1626a: de bf out 0x3e, r29 ; 62 1626c: 0f be out 0x3f, r0 ; 63 1626e: cd bf out 0x3d, r28 ; 61 16270: 5c c1 rjmp .+696 ; 0x1652a 16272: 88 35 cpi r24, 0x58 ; 88 16274: 52 e0 ldi r21, 0x02 ; 2 16276: 95 07 cpc r25, r21 16278: 11 f4 brne .+4 ; 0x1627e 1627a: 0c 94 33 c2 jmp 0x18466 ; 0x18466 1627e: 14 f0 brlt .+4 ; 0x16284 16280: 0c 94 de a6 jmp 0x14dbc ; 0x14dbc 16284: 88 32 cpi r24, 0x28 ; 40 16286: 92 40 sbci r25, 0x02 ; 2 16288: 11 f0 breq .+4 ; 0x1628e 1628a: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 1628e: 80 e5 ldi r24, 0x50 ; 80 16290: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16294: 88 23 and r24, r24 16296: 09 f4 brne .+2 ; 0x1629a 16298: 48 c1 rjmp .+656 ; 0x1652a { uint8_t valCnt = 0; IP_address = 0; 1629a: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 1629e: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c 162a2: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 162a6: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 162aa: 0b e5 ldi r16, 0x5B ; 91 162ac: 16 e0 ldi r17, 0x06 ; 6 162ae: 3f e5 ldi r19, 0x5F ; 95 162b0: e3 2e mov r14, r19 162b2: 36 e0 ldi r19, 0x06 ; 6 162b4: f3 2e mov r15, r19 do { *strchr_pointer = '*'; 162b6: 4a e2 ldi r20, 0x2A ; 42 162b8: d4 2e mov r13, r20 162ba: e0 91 97 03 lds r30, 0x0397 ; 0x800397 162be: f0 91 98 03 lds r31, 0x0398 ; 0x800398 162c2: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 162c4: 0e 94 1b 5c call 0xb836 ; 0xb836 162c8: d8 01 movw r26, r16 162ca: 8d 93 st X+, r24 162cc: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 162ce: ea 16 cp r14, r26 162d0: fb 06 cpc r15, r27 162d2: 09 f4 brne .+2 ; 0x162d6 162d4: 2a c1 rjmp .+596 ; 0x1652a 162d6: 8e e2 ldi r24, 0x2E ; 46 162d8: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 162dc: 81 11 cpse r24, r1 162de: ed cf rjmp .-38 ; 0x162ba if (valCnt != 4) IP_address = 0; 162e0: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b 162e4: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c 162e8: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 162ec: 10 92 5e 06 sts 0x065E, r1 ; 0x80065e 162f0: 1c c1 rjmp .+568 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 162f2: 8e 3b cpi r24, 0xBE ; 190 162f4: e2 e0 ldi r30, 0x02 ; 2 162f6: 9e 07 cpc r25, r30 162f8: 11 f4 brne .+4 ; 0x162fe 162fa: 0c 94 fd cc jmp 0x199fa ; 0x199fa 162fe: 0c f0 brlt .+2 ; 0x16302 16300: 4e c0 rjmp .+156 ; 0x1639e 16302: 8b 35 cpi r24, 0x5B ; 91 16304: 22 e0 ldi r18, 0x02 ; 2 16306: 92 07 cpc r25, r18 16308: 11 f4 brne .+4 ; 0x1630e 1630a: 0c 94 43 c6 jmp 0x18c86 ; 0x18c86 1630e: 8d 3b cpi r24, 0xBD ; 189 16310: 92 40 sbci r25, 0x02 ; 2 16312: 11 f0 breq .+4 ; 0x16318 16314: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 16318: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1631c: 81 30 cpi r24, 0x01 ; 1 1631e: 11 f4 brne .+4 ; 0x16324 16320: 0c 94 9e cc jmp 0x1993c ; 0x1993c - `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; 16324: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16326: 8c e4 ldi r24, 0x4C ; 76 16328: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 - `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 1632c: c1 2c mov r12, r1 1632e: d1 2c mov r13, r1 16330: 6c e8 ldi r22, 0x8C ; 140 16332: e6 2e mov r14, r22 16334: 62 e4 ldi r22, 0x42 ; 66 16336: f6 2e mov r15, r22 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16338: 88 23 and r24, r24 1633a: 21 f0 breq .+8 ; 0x16344 1633c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16340: 6b 01 movw r12, r22 16342: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 16344: 8a e5 ldi r24, 0x5A ; 90 16346: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1634a: 88 23 and r24, r24 1634c: 11 f4 brne .+4 ; 0x16352 1634e: 0c 94 af cc jmp 0x1995e ; 0x1995e 16352: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16356: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 16358: 0e 94 96 6e call 0xdd2c ; 0xdd2c 1635c: 4b 01 movw r8, r22 1635e: 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 16360: 8a e5 ldi r24, 0x5A ; 90 16362: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16366: 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; 16368: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1636c: 10 92 89 17 sts 0x1789, r1 ; 0x801789 void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex, bool raise_z_axis = false){ FSensorBlockRunout fsBlockRunout; prusa_statistics(22); if (MMU2::mmu2.Enabled()) { 16370: 80 91 98 13 lds r24, 0x1398 ; 0x801398 16374: 81 30 cpi r24, 0x01 ; 1 16376: 11 f0 breq .+4 ; 0x1637c 16378: 0c 94 b4 cc jmp 0x19968 ; 0x19968 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 1637c: 15 30 cpi r17, 0x05 ; 5 1637e: 18 f4 brcc .+6 ; 0x16386 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 16380: 81 2f mov r24, r17 16382: 0f 94 38 1d call 0x23a70 ; 0x23a70 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 16386: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 1638a: 88 e8 ldi r24, 0x88 ; 136 1638c: 97 e1 ldi r25, 0x17 ; 23 1638e: 0e 94 84 75 call 0xeb08 ; 0xeb08 // 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); 16392: c5 01 movw r24, r10 16394: b4 01 movw r22, r8 16396: 90 58 subi r25, 0x80 ; 128 16398: 0e 94 96 6e call 0xdd2c ; 0xdd2c 1639c: c6 c0 rjmp .+396 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1639e: 81 3c cpi r24, 0xC1 ; 193 163a0: 42 e0 ldi r20, 0x02 ; 2 163a2: 94 07 cpc r25, r20 163a4: 11 f4 brne .+4 ; 0x163aa 163a6: 0c 94 31 cd jmp 0x19a62 ; 0x19a62 163aa: 14 f0 brlt .+4 ; 0x163b0 163ac: 0c 94 37 cd jmp 0x19a6e ; 0x19a6e 163b0: 80 3c cpi r24, 0xC0 ; 192 163b2: 92 40 sbci r25, 0x02 ; 2 163b4: 11 f0 breq .+4 ; 0x163ba 163b6: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 163ba: 80 ec ldi r24, 0xC0 ; 192 163bc: 92 e0 ldi r25, 0x02 ; 2 163be: 0e 94 04 61 call 0xc208 ; 0xc208 163c2: b3 c0 rjmp .+358 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 163c4: 84 38 cpi r24, 0x84 ; 132 163c6: b3 e0 ldi r27, 0x03 ; 3 163c8: 9b 07 cpc r25, r27 163ca: 11 f4 brne .+4 ; 0x163d0 163cc: 0c 94 ed c9 jmp 0x193da ; 0x193da 163d0: 0c f0 brlt .+2 ; 0x163d4 163d2: 99 c0 rjmp .+306 ; 0x16506 163d4: 82 35 cpi r24, 0x52 ; 82 163d6: f3 e0 ldi r31, 0x03 ; 3 163d8: 9f 07 cpc r25, r31 163da: 11 f4 brne .+4 ; 0x163e0 163dc: 0c 94 49 c6 jmp 0x18c92 ; 0x18c92 163e0: 9c f5 brge .+102 ; 0x16448 163e2: 84 3c cpi r24, 0xC4 ; 196 163e4: 32 e0 ldi r19, 0x02 ; 2 163e6: 93 07 cpc r25, r19 163e8: 11 f4 brne .+4 ; 0x163ee 163ea: 0c 94 5a cd jmp 0x19ab4 ; 0x19ab4 163ee: 85 3c cpi r24, 0xC5 ; 197 163f0: 92 40 sbci r25, 0x02 ; 2 163f2: 11 f0 breq .+4 ; 0x163f8 163f4: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 163f8: 83 e5 ldi r24, 0x53 ; 83 163fa: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 163fe: 88 23 and r24, r24 16400: 51 f0 breq .+20 ; 0x16416 { switch (code_value_uint8()) 16402: 0e 94 0e 5c call 0xb81c ; 0xb81c 16406: 88 23 and r24, r24 16408: 11 f4 brne .+4 ; 0x1640e 1640a: 0c 94 86 cd jmp 0x19b0c ; 0x19b0c 1640e: 81 30 cpi r24, 0x01 ; 1 16410: 11 f4 brne .+4 ; 0x16416 16412: 0c 94 93 cd jmp 0x19b26 ; 0x19b26 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 16416: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1641a: 81 30 cpi r24, 0x01 ; 1 1641c: 91 f4 brne .+36 ; 0x16442 1641e: 88 e5 ldi r24, 0x58 ; 88 16420: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16424: 88 23 and r24, r24 16426: 69 f0 breq .+26 ; 0x16442 { switch (code_value_uint8()) 16428: 0e 94 0e 5c call 0xb81c ; 0xb81c 1642c: 81 30 cpi r24, 0x01 ; 1 1642e: 11 f4 brne .+4 ; 0x16434 16430: 0c 94 a1 cd jmp 0x19b42 ; 0x19b42 16434: 10 f4 brcc .+4 ; 0x1643a 16436: 0c 94 9c cd jmp 0x19b38 ; 0x19b38 1643a: 8a 32 cpi r24, 0x2A ; 42 1643c: 11 f4 brne .+4 ; 0x16442 1643e: 0c 94 a5 cd jmp 0x19b4a ; 0x19b4a break; default: break; } } MMU2::mmu2.Status(); 16442: 0f 94 07 77 call 0x2ee0e ; 0x2ee0e 16446: 71 c0 rjmp .+226 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16448: 8d 35 cpi r24, 0x5D ; 93 1644a: 53 e0 ldi r21, 0x03 ; 3 1644c: 95 07 cpc r25, r21 1644e: 11 f4 brne .+4 ; 0x16454 16450: 0c 94 bf c7 jmp 0x18f7e ; 0x18f7e 16454: 8e 35 cpi r24, 0x5E ; 94 16456: a3 e0 ldi r26, 0x03 ; 3 16458: 9a 07 cpc r25, r26 1645a: 11 f4 brne .+4 ; 0x16460 1645c: 0c 94 57 c8 jmp 0x190ae ; 0x190ae 16460: 8c 35 cpi r24, 0x5C ; 92 16462: 93 40 sbci r25, 0x03 ; 3 16464: 11 f0 breq .+4 ; 0x1646a 16466: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 1646a: 83 e5 ldi r24, 0x53 ; 83 1646c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16470: 88 23 and r24, r24 16472: 09 f4 brne .+2 ; 0x16476 16474: 5a c0 rjmp .+180 ; 0x1652a set_target_pinda = code_value_short(); 16476: 0e 94 1b 5c call 0xb836 ; 0xb836 1647a: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 1647c: 89 e9 ldi r24, 0x99 ; 153 1647e: 99 e3 ldi r25, 0x39 ; 57 16480: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 16484: 0f 94 ea 0b call 0x217d4 ; 0x217d4 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 16488: 89 ec ldi r24, 0xC9 ; 201 1648a: 96 e8 ldi r25, 0x86 ; 134 1648c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLLN(set_target_pinda); 16490: c8 01 movw r24, r16 16492: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 codenum = _millis(); 16496: 0f 94 8b 3f call 0x27f16 ; 0x27f16 1649a: 4b 01 movw r8, r22 1649c: 5c 01 movw r10, r24 cancel_heatup = false; 1649e: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.404> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 164a2: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 164a6: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 164aa: 89 2b or r24, r25 164ac: 41 f4 brne .+16 ; 0x164be 164ae: ff 24 eor r15, r15 164b0: f3 94 inc r15 164b2: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 164b6: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 164ba: 89 2b or r24, r25 164bc: 09 f0 breq .+2 ; 0x164c0 SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 164be: 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)) ) { 164c0: 28 01 movw r4, r16 164c2: 01 2e mov r0, r17 164c4: 00 0c add r0, r0 164c6: 66 08 sbc r6, r6 164c8: 77 08 sbc r7, r7 164ca: f1 10 cpse r15, r1 164cc: 0c 94 7f c7 jmp 0x18efe ; 0x18efe 164d0: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.404> 164d4: 81 11 cpse r24, r1 164d6: 12 c0 rjmp .+36 ; 0x164fc 164d8: c3 01 movw r24, r6 164da: b2 01 movw r22, r4 164dc: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 164e0: 20 91 99 03 lds r18, 0x0399 ; 0x800399 164e4: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 164e8: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 164ec: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 164f0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 164f4: 18 16 cp r1, r24 164f6: 14 f4 brge .+4 ; 0x164fc 164f8: 0c 94 91 c7 jmp 0x18f22 ; 0x18f22 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 164fc: 8a e0 ldi r24, 0x0A ; 10 164fe: 9e e6 ldi r25, 0x6E ; 110 16500: 0f 94 ea 0b call 0x217d4 ; 0x217d4 16504: 12 c0 rjmp .+36 ; 0x1652a } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16506: 81 39 cpi r24, 0x91 ; 145 16508: e3 e0 ldi r30, 0x03 ; 3 1650a: 9e 07 cpc r25, r30 1650c: 11 f4 brne .+4 ; 0x16512 1650e: 0c 94 20 cb jmp 0x19640 ; 0x19640 16512: 8c f4 brge .+34 ; 0x16536 16514: 8b 38 cpi r24, 0x8B ; 139 16516: 23 e0 ldi r18, 0x03 ; 3 16518: 92 07 cpc r25, r18 1651a: 11 f4 brne .+4 ; 0x16520 1651c: 0c 94 9c ca jmp 0x19538 ; 0x19538 16520: 8c 38 cpi r24, 0x8C ; 140 16522: 93 40 sbci r25, 0x03 ; 3 16524: 11 f0 breq .+4 ; 0x1652a 16526: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 */ 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; 1652a: 10 92 5c 0e sts 0x0E5C, r1 ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.551+0x1> 1652e: 10 92 5b 0e sts 0x0E5B, r1 ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.551> 16532: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 16536: 84 39 cpi r24, 0x94 ; 148 16538: 43 e0 ldi r20, 0x03 ; 3 1653a: 94 07 cpc r25, r20 1653c: 14 f4 brge .+4 ; 0x16542 1653e: 0c 94 6f cb jmp 0x196de ; 0x196de 16542: 80 3a cpi r24, 0xA0 ; 160 16544: 93 40 sbci r25, 0x03 ; 3 16546: 11 f0 breq .+4 ; 0x1654c 16548: 0c 94 6a a6 jmp 0x14cd4 ; 0x14cd4 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 1654c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 16550: 90 91 98 03 lds r25, 0x0398 ; 0x800398 } } void CardReader::openLogFile(const char* name) { logging = true; 16554: 21 e0 ldi r18, 0x01 ; 1 16556: 20 93 6d 14 sts 0x146D, r18 ; 0x80146d openFileWrite(name); 1655a: 05 96 adiw r24, 0x05 ; 5 1655c: 0f 94 1c 86 call 0x30c38 ; 0x30c38 16560: e4 cf rjmp .-56 ; 0x1652a - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 16562: 00 91 97 03 lds r16, 0x0397 ; 0x800397 16566: 10 91 98 03 lds r17, 0x0398 ; 0x800398 1656a: 0e 5f subi r16, 0xFE ; 254 1656c: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1656e: 80 e5 ldi r24, 0x50 ; 80 16570: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 16574: c1 2c mov r12, r1 16576: d1 2c mov r13, r1 16578: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 1657a: 88 23 and r24, r24 1657c: 21 f0 breq .+8 ; 0x16586 1657e: 0e 94 28 5c call 0xb850 ; 0xb850 16582: 6b 01 movw r12, r22 16584: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 16586: 83 e5 ldi r24, 0x53 ; 83 16588: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1658c: 88 23 and r24, r24 1658e: 51 f0 breq .+20 ; 0x165a4 16590: 0e 94 28 5c call 0xb850 ; 0xb850 16594: 9b 01 movw r18, r22 16596: ac 01 movw r20, r24 16598: a8 ee ldi r26, 0xE8 ; 232 1659a: b3 e0 ldi r27, 0x03 ; 3 1659c: 0f 94 26 de call 0x3bc4c ; 0x3bc4c <__muluhisi3> 165a0: 6b 01 movw r12, r22 165a2: 7c 01 movw r14, r24 165a4: c8 01 movw r24, r16 165a6: 0f 5f subi r16, 0xFF ; 255 165a8: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 165aa: dc 01 movw r26, r24 165ac: 4c 91 ld r20, X 165ae: 40 32 cpi r20, 0x20 ; 32 165b0: c9 f3 breq .-14 ; 0x165a4 custom_message_type = CustomMsg::M0Wait; 165b2: 26 e0 ldi r18, 0x06 ; 6 165b4: 20 93 75 07 sts 0x0775, r18 ; 0x800775 if (!expiration_time_set && *src != '\0') { 165b8: c1 14 cp r12, r1 165ba: d1 04 cpc r13, r1 165bc: e1 04 cpc r14, r1 165be: f1 04 cpc r15, r1 165c0: a1 f5 brne .+104 ; 0x1662a 165c2: 2c 91 ld r18, X 165c4: 22 23 and r18, r18 165c6: 89 f1 breq .+98 ; 0x1662a lcd_setstatus(src); 165c8: 0f 94 56 15 call 0x22aac ; 0x22aac 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(); 165cc: 0f 94 2c 59 call 0x2b258 ; 0x2b258 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 165d0: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 165d4: 84 60 ori r24, 0x04 ; 4 165d6: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 previous_millis_cmd.start(); 165da: 88 e8 ldi r24, 0x88 ; 136 165dc: 93 e0 ldi r25, 0x03 ; 3 165de: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> if (expiration_time_set) { 165e2: c1 14 cp r12, r1 165e4: d1 04 cpc r13, r1 165e6: e1 04 cpc r14, r1 165e8: f1 04 cpc r15, r1 165ea: 79 f1 breq .+94 ; 0x1664a codenum += _millis(); // keep track of when we started waiting 165ec: 0f 94 8b 3f call 0x27f16 ; 0x27f16 165f0: c6 0e add r12, r22 165f2: d7 1e adc r13, r23 165f4: e8 1e adc r14, r24 165f6: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 165f8: 84 e0 ldi r24, 0x04 ; 4 165fa: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(_millis() < codenum && !lcd_clicked()) { 165fe: 0f 94 8b 3f call 0x27f16 ; 0x27f16 16602: 6c 15 cp r22, r12 16604: 7d 05 cpc r23, r13 16606: 8e 05 cpc r24, r14 16608: 9f 05 cpc r25, r15 1660a: b0 f0 brcs .+44 ; 0x16638 delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 1660c: 82 e0 ldi r24, 0x02 ; 2 1660e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 16612: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 16616: 8b 7f andi r24, 0xFB ; 251 16618: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 if (IS_SD_PRINTING) 1661c: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 16620: 88 23 and r24, r24 16622: 31 f1 breq .+76 ; 0x16670 custom_message_type = CustomMsg::Status; 16624: 10 92 75 07 sts 0x0775, r1 ; 0x800775 16628: 80 cf rjmp .-256 ; 0x1652a } 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)); 1662a: 82 eb ldi r24, 0xB2 ; 178 1662c: 99 e3 ldi r25, 0x39 ; 57 1662e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 16632: 0f 94 ea 0b call 0x217d4 ; 0x217d4 16636: ca cf rjmp .-108 ; 0x165cc 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()) { 16638: 0e 94 b2 71 call 0xe364 ; 0xe364 1663c: 81 11 cpse r24, r1 1663e: e6 cf rjmp .-52 ; 0x1660c delay_keep_alive(0); 16640: 90 e0 ldi r25, 0x00 ; 0 16642: 80 e0 ldi r24, 0x00 ; 0 16644: 0e 94 87 8e call 0x11d0e ; 0x11d0e 16648: da cf rjmp .-76 ; 0x165fe //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 1664a: 10 91 96 02 lds r17, 0x0296 ; 0x800296 KEEPALIVE_STATE(PAUSED_FOR_USER); 1664e: 84 e0 ldi r24, 0x04 ; 4 16650: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 16654: 0e 94 ad 71 call 0xe35a ; 0xe35a while(!lcd_clicked()) 16658: 0e 94 b2 71 call 0xe364 ; 0xe364 1665c: 81 11 cpse r24, r1 1665e: 05 c0 rjmp .+10 ; 0x1666a { delay_keep_alive(0); 16660: 90 e0 ldi r25, 0x00 ; 0 16662: 80 e0 ldi r24, 0x00 ; 0 16664: 0e 94 87 8e call 0x11d0e ; 0x11d0e 16668: f7 cf rjmp .-18 ; 0x16658 } KEEPALIVE_STATE(busy_state_backup); 1666a: 10 93 96 02 sts 0x0296, r17 ; 0x800296 1666e: d1 cf rjmp .-94 ; 0x16612 } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 16670: 8a e6 ldi r24, 0x6A ; 106 16672: 90 e7 ldi r25, 0x70 ; 112 16674: 0f 94 ea 0b call 0x217d4 ; 0x217d4 16678: 58 cf rjmp .-336 ; 0x1652a /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 1667a: 87 ea ldi r24, 0xA7 ; 167 1667c: 99 e3 ldi r25, 0x39 ; 57 1667e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 16682: 0f 94 ea 0b call 0x217d4 ; 0x217d4 enable_x(); 16686: 17 98 cbi 0x02, 7 ; 2 enable_y(); 16688: 16 98 cbi 0x02, 6 ; 2 enable_z(); 1668a: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 1668c: 14 98 cbi 0x02, 4 ; 2 1668e: 4d cf rjmp .-358 ; 0x1652a /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 16690: 81 e0 ldi r24, 0x01 ; 1 16692: 0f 94 78 81 call 0x302f0 ; 0x302f0 16696: 49 cf rjmp .-366 ; 0x1652a presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 16698: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e mounted = false; 1669c: 10 92 6f 14 sts 0x146F, r1 ; 0x80146f SERIAL_ECHO_START; 166a0: 82 ef ldi r24, 0xF2 ; 242 166a2: 99 ea ldi r25, 0xA9 ; 169 166a4: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 166a8: 89 ec ldi r24, 0xC9 ; 201 166aa: 9b e6 ldi r25, 0x6B ; 107 166ac: 0e 94 06 7b call 0xf60c ; 0xf60c 166b0: 3c cf rjmp .-392 ; 0x1652a /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 166b2: 0e 94 3a 68 call 0xd074 ; 0xd074 166b6: 88 23 and r24, r24 166b8: 19 f0 breq .+6 ; 0x166c0 lcd_resume_print(); 166ba: 0f 94 2a 15 call 0x22a54 ; 0x22a54 166be: 35 cf rjmp .-406 ; 0x1652a else { if (!filament_presence_check()) { 166c0: 0f 94 7f 16 call 0x22cfe ; 0x22cfe 166c4: 88 23 and r24, r24 166c6: 09 f4 brne .+2 ; 0x166ca 166c8: 30 cf rjmp .-416 ; 0x1652a 166ca: 80 91 01 17 lds r24, 0x1701 ; 0x801701 166ce: 88 23 and r24, r24 166d0: 61 f0 breq .+24 ; 0x166ea // Print was aborted break; } if (!card.get_sdpos()) 166d2: 80 91 82 17 lds r24, 0x1782 ; 0x801782 166d6: 90 91 83 17 lds r25, 0x1783 ; 0x801783 166da: a0 91 84 17 lds r26, 0x1784 ; 0x801784 166de: b0 91 85 17 lds r27, 0x1785 ; 0x801785 166e2: 89 2b or r24, r25 166e4: 8a 2b or r24, r26 166e6: 8b 2b or r24, r27 166e8: 69 f4 brne .+26 ; 0x16704 { // A new print has started from scratch, reset stats failstats_reset_print(); 166ea: 0e 94 ca 5c call 0xb994 ; 0xb994 sdpos_atomic = 0; 166ee: 10 92 84 03 sts 0x0384, r1 ; 0x800384 166f2: 10 92 85 03 sts 0x0385, r1 ; 0x800385 166f6: 10 92 86 03 sts 0x0386, r1 ; 0x800386 166fa: 10 92 87 03 sts 0x0387, r1 ; 0x800387 166fe: 80 e0 ldi r24, 0x00 ; 0 16700: 0e 94 42 83 call 0x10684 ; 0x10684 } void CardReader::startFileprint() { if(mounted) 16704: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 16708: 88 23 and r24, r24 1670a: 31 f0 breq .+12 ; 0x16718 { sdprinting = true; 1670c: 81 e0 ldi r24, 0x01 ; 1 1670e: 80 93 6e 14 sts 0x146E, r24 ; 0x80146e 16712: 85 e0 ldi r24, 0x05 ; 5 16714: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 16718: 0f 94 d1 58 call 0x2b1a2 ; 0x2b1a2 if (MMU2::mmu2.Enabled()) 1671c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 16720: 81 30 cpi r24, 0x01 ; 1 16722: 09 f0 breq .+2 ; 0x16726 16724: 02 cf rjmp .-508 ; 0x1652a { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 16726: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 1672a: 88 23 and r24, r24 1672c: 09 f4 brne .+2 ; 0x16730 1672e: fd ce rjmp .-518 ; 0x1652a 16730: 0e 94 bc e4 call 0x1c978 ; 0x1c978 16734: 81 11 cpse r24, r1 16736: f9 ce rjmp .-526 ; 0x1652a { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 16738: 0f 94 6d a0 call 0x340da ; 0x340da 1673c: f6 ce rjmp .-532 ; 0x1652a #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 1673e: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 16742: 88 23 and r24, r24 16744: 09 f4 brne .+2 ; 0x16748 16746: f1 ce rjmp .-542 ; 0x1652a 16748: 83 e5 ldi r24, 0x53 ; 83 1674a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1674e: 88 23 and r24, r24 16750: 09 f4 brne .+2 ; 0x16754 16752: eb ce rjmp .-554 ; 0x1652a long index = code_value_long(); 16754: 0e 94 28 5c call 0xb850 ; 0xb850 16758: 6b 01 movw r12, r22 1675a: 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);}; 1675c: c0 92 82 17 sts 0x1782, r12 ; 0x801782 16760: d0 92 83 17 sts 0x1783, r13 ; 0x801783 16764: e0 92 84 17 sts 0x1784, r14 ; 0x801784 16768: f0 92 85 17 sts 0x1785, r15 ; 0x801785 1676c: 0f 94 c0 77 call 0x2ef80 ; 0x2ef80 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; 16770: c0 92 84 03 sts 0x0384, r12 ; 0x800384 16774: d0 92 85 03 sts 0x0385, r13 ; 0x800385 16778: e0 92 86 03 sts 0x0386, r14 ; 0x800386 1677c: f0 92 87 03 sts 0x0387, r15 ; 0x800387 16780: d4 ce rjmp .-600 ; 0x1652a #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 16782: 80 e5 ldi r24, 0x50 ; 80 16784: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16788: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 1678a: 0e 94 3a 68 call 0xd074 ; 0xd074 1678e: 88 23 and r24, r24 16790: 91 f0 breq .+36 ; 0x167b6 { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 16792: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 16796: 88 23 and r24, r24 16798: 49 f0 breq .+18 ; 0x167ac 1679a: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1679e: 81 11 cpse r24, r1 167a0: 05 c0 rjmp .+10 ; 0x167ac SERIAL_PROTOCOLLNPGM("SD print paused"); 167a2: 8f ef ldi r24, 0xFF ; 255 167a4: 95 e8 ldi r25, 0x85 ; 133 167a6: 0e 94 06 7b call 0xf60c ; 0xf60c 167aa: bf ce rjmp .-642 ; 0x1652a else SERIAL_PROTOCOLLNPGM("Print saved"); 167ac: 83 ef ldi r24, 0xF3 ; 243 167ae: 95 e8 ldi r25, 0x85 ; 133 167b0: 0e 94 06 7b call 0xf60c ; 0xf60c 167b4: ba ce rjmp .-652 ; 0x1652a } else if (sdprinting) 167b6: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 167ba: 88 23 and r24, r24 167bc: 09 f4 brne .+2 ; 0x167c0 167be: 4a c0 rjmp .+148 ; 0x16854 { if (arg_P) 167c0: 11 23 and r17, r17 167c2: e1 f1 breq .+120 ; 0x1683c { printAbsFilenameFast(); 167c4: 0f 94 45 7c call 0x2f88a ; 0x2f88a SERIAL_PROTOCOLLN(); 167c8: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 167cc: 83 e5 ldi r24, 0x53 ; 83 167ce: 98 e6 ldi r25, 0x68 ; 104 167d0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 167d4: 60 91 82 17 lds r22, 0x1782 ; 0x801782 167d8: 70 91 83 17 lds r23, 0x1783 ; 0x801783 167dc: 80 91 84 17 lds r24, 0x1784 ; 0x801784 167e0: 90 91 85 17 lds r25, 0x1785 ; 0x801785 167e4: 4a e0 ldi r20, 0x0A ; 10 167e6: 0f 94 80 d2 call 0x3a500 ; 0x3a500 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 167ea: 8f e2 ldi r24, 0x2F ; 47 167ec: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 167f0: 60 91 7b 17 lds r22, 0x177B ; 0x80177b 167f4: 70 91 7c 17 lds r23, 0x177C ; 0x80177c 167f8: 80 91 7d 17 lds r24, 0x177D ; 0x80177d 167fc: 90 91 7e 17 lds r25, 0x177E ; 0x80177e 16800: 4a e0 ldi r20, 0x0A ; 10 16802: 0f 94 80 d2 call 0x3a500 ; 0x3a500 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 16806: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 1680a: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce 1680e: 2c e3 ldi r18, 0x3C ; 60 16810: 30 e0 ldi r19, 0x00 ; 0 16812: 40 e0 ldi r20, 0x00 ; 0 16814: 50 e0 ldi r21, 0x00 ; 0 16816: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 1681a: c9 01 movw r24, r18 1681c: 6c e3 ldi r22, 0x3C ; 60 1681e: 70 e0 ldi r23, 0x00 ; 0 16820: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 16824: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 16826: 90 e0 ldi r25, 0x00 ; 0 16828: 80 e0 ldi r24, 0x00 ; 0 1682a: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1682e: 8a e3 ldi r24, 0x3A ; 58 16830: 0e 94 c2 78 call 0xf184 ; 0xf184 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 16834: c8 01 movw r24, r16 16836: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 1683a: 77 ce rjmp .-786 ; 0x1652a { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 1683c: 80 91 85 14 lds r24, 0x1485 ; 0x801485 16840: 88 23 and r24, r24 16842: 29 f0 breq .+10 ; 0x1684e 16844: 85 e8 ldi r24, 0x85 ; 133 16846: 94 e1 ldi r25, 0x14 ; 20 16848: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c 1684c: bf cf rjmp .-130 ; 0x167cc 1684e: 80 e7 ldi r24, 0x70 ; 112 16850: 94 e1 ldi r25, 0x14 ; 20 16852: fa cf rjmp .-12 ; 0x16848 SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 16854: 83 ee ldi r24, 0xE3 ; 227 16856: 95 e8 ldi r25, 0x85 ; 133 16858: 0e 94 06 7b call 0xf60c ; 0xf60c 1685c: 66 ce rjmp .-820 ; 0x1652a /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 1685e: 80 91 97 03 lds r24, 0x0397 ; 0x800397 16862: 90 91 98 03 lds r25, 0x0398 ; 0x800398 16866: 04 96 adiw r24, 0x04 ; 4 16868: 0f 94 1c 86 call 0x30c38 ; 0x30c38 1686c: 5e ce rjmp .-836 ; 0x1652a * 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; 1686e: ce 01 movw r24, r28 16870: 01 96 adiw r24, 0x01 ; 1 16872: 0f 94 a1 78 call 0x2f142 ; 0x2f142 16876: 88 23 and r24, r24 16878: 11 f4 brne .+4 ; 0x1687e 1687a: 0c 94 b2 a7 jmp 0x14f64 ; 0x14f64 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 1687e: 61 e0 ldi r22, 0x01 ; 1 16880: ce 01 movw r24, r28 16882: 01 96 adiw r24, 0x01 ; 1 16884: 0f 94 7d a4 call 0x348fa ; 0x348fa if (!d) goto fail; 16888: 00 97 sbiw r24, 0x00 ; 0 1688a: 11 f4 brne .+4 ; 0x16890 1688c: 0c 94 b2 a7 jmp 0x14f64 ; 0x14f64 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 16890: 25 ee ldi r18, 0xE5 ; 229 16892: fc 01 movw r30, r24 16894: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 16896: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 16898: 0f 94 a0 6b call 0x2d740 ; 0x2d740 1689c: 18 2f mov r17, r24 1689e: 0c 94 b3 a7 jmp 0x14f66 ; 0x14f66 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 168a2: 8d eb ldi r24, 0xBD ; 189 168a4: 95 e8 ldi r25, 0x85 ; 133 168a6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 168aa: 23 96 adiw r28, 0x03 ; 3 168ac: 8e ad ldd r24, Y+62 ; 0x3e 168ae: 9f ad ldd r25, Y+63 ; 0x3f 168b0: 23 97 sbiw r28, 0x03 ; 3 168b2: 0e 94 3f 89 call 0x1127e ; 0x1127e 168b6: 8e e2 ldi r24, 0x2E ; 46 168b8: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 168bc: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 168c0: 34 ce rjmp .-920 ; 0x1652a ### 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(); 168c2: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce int16_t sec, min; min = t / 60; sec = t % 60; 168c6: 2c e3 ldi r18, 0x3C ; 60 168c8: 30 e0 ldi r19, 0x00 ; 0 168ca: 40 e0 ldi r20, 0x00 ; 0 168cc: 50 e0 ldi r21, 0x00 ; 0 168ce: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 168d2: 7f 93 push r23 168d4: 6f 93 push r22 168d6: 3f 93 push r19 168d8: 2f 93 push r18 168da: 8e e9 ldi r24, 0x9E ; 158 168dc: 98 e8 ldi r25, 0x88 ; 136 168de: 9f 93 push r25 168e0: 8f 93 push r24 168e2: 8e 01 movw r16, r28 168e4: 0f 5f subi r16, 0xFF ; 255 168e6: 1f 4f sbci r17, 0xFF ; 255 168e8: 1f 93 push r17 168ea: 0f 93 push r16 168ec: 0f 94 a8 dc call 0x3b950 ; 0x3b950 SERIAL_ECHO_START; 168f0: 82 ef ldi r24, 0xF2 ; 242 168f2: 99 ea ldi r25, 0xA9 ; 169 168f4: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(time); 168f8: c8 01 movw r24, r16 168fa: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c lcd_setstatus(time); 168fe: c8 01 movw r24, r16 16900: 0f 94 56 15 call 0x22aac ; 0x22aac autotempShutdown(); 16904: 0f b6 in r0, 0x3f ; 63 16906: f8 94 cli 16908: de bf out 0x3e, r29 ; 62 1690a: 0f be out 0x3f, r0 ; 63 1690c: cd bf out 0x3d, r28 ; 61 1690e: 0d ce rjmp .-998 ; 0x1652a #### 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')) 16910: 83 e5 ldi r24, 0x53 ; 83 16912: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16916: 88 23 and r24, r24 16918: 09 f4 brne .+2 ; 0x1691c 1691a: 07 ce rjmp .-1010 ; 0x1652a { uint8_t pin_status = code_value_uint8(); 1691c: 0e 94 0e 5c call 0xb81c ; 0xb81c 16920: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 16922: 80 e5 ldi r24, 0x50 ; 80 16924: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 */ case 42: if (code_seen('S')) { uint8_t pin_status = code_value_uint8(); int8_t pin_number = LED_PIN; 16928: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 1692a: 88 23 and r24, r24 1692c: 19 f0 breq .+6 ; 0x16934 pin_number = code_value_uint8(); 1692e: 0e 94 0e 5c call 0xb81c ; 0xb81c 16932: 18 2f mov r17, r24 16934: e2 e8 ldi r30, 0x82 ; 130 16936: f8 e8 ldi r31, 0x88 ; 136 16938: 8e e9 ldi r24, 0x9E ; 158 1693a: 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) 1693c: 24 91 lpm r18, Z 1693e: 21 17 cp r18, r17 16940: 09 f4 brne .+2 ; 0x16944 16942: f3 cd rjmp .-1050 ; 0x1652a 16944: 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++) 16946: 8e 17 cp r24, r30 16948: 9f 07 cpc r25, r31 1694a: c1 f7 brne .-16 ; 0x1693c pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 1694c: 16 30 cpi r17, 0x06 ; 6 1694e: 81 f4 brne .+32 ; 0x16970 fanSpeed = pin_status; 16950: 00 93 e3 03 sts 0x03E3, r16 ; 0x8003e3 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 16954: 61 e0 ldi r22, 0x01 ; 1 16956: 81 2f mov r24, r17 16958: 0e 94 64 df call 0x1bec8 ; 0x1bec8 digitalWrite(pin_number, pin_status); 1695c: 60 2f mov r22, r16 1695e: 81 2f mov r24, r17 16960: 0e 94 36 df call 0x1be6c ; 0x1be6c analogWrite(pin_number, pin_status); 16964: 60 2f mov r22, r16 16966: 70 e0 ldi r23, 0x00 ; 0 16968: 81 2f mov r24, r17 1696a: 0e 94 95 df call 0x1bf2a ; 0x1bf2a 1696e: dd cd rjmp .-1094 ; 0x1652a } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 16970: 17 fd sbrc r17, 7 16972: db cd rjmp .-1098 ; 0x1652a 16974: ef cf rjmp .-34 ; 0x16954 ### 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); 16976: 80 e1 ldi r24, 0x10 ; 16 16978: 0e 94 11 e7 call 0x1ce22 ; 0x1ce22 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1697c: 81 ea ldi r24, 0xA1 ; 161 1697e: 9d e0 ldi r25, 0x0D ; 13 16980: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 16984: 3b e0 ldi r19, 0x0B ; 11 16986: 83 9f mul r24, r19 16988: c0 01 movw r24, r0 1698a: 11 24 eor r1, r1 1698c: 70 e0 ldi r23, 0x00 ; 0 1698e: 60 e0 ldi r22, 0x00 ; 0 16990: 80 5b subi r24, 0xB0 ; 176 16992: 92 4f sbci r25, 0xF2 ; 242 16994: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 16998: 82 e0 ldi r24, 0x02 ; 2 1699a: 0e 94 11 e7 call 0x1ce22 ; 0x1ce22 reset_bed_offset_and_skew(); 1699e: 0f 94 cf cb call 0x3979e ; 0x3979e // 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(); 169a2: 0f 94 b0 cb call 0x39760 ; 0x39760 169a6: c1 cd rjmp .-1150 ; 0x1652a */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 169a8: 8a e5 ldi r24, 0x5A ; 90 169aa: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 // 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); 169ae: 0e 94 73 e7 call 0x1cee6 ; 0x1cee6 169b2: bb cd rjmp .-1162 ; 0x1652a ### 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()) { 169b4: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 169b8: 88 23 and r24, r24 169ba: 19 f1 breq .+70 ; 0x16a02 uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 169bc: ce 01 movw r24, r28 169be: 01 96 adiw r24, 0x01 ; 1 169c0: 0f 94 84 86 call 0x30d08 ; 0x30d08 169c4: 88 23 and r24, r24 169c6: c1 f0 breq .+48 ; 0x169f8 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169c8: 89 81 ldd r24, Y+1 ; 0x01 169ca: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169ce: 8e e2 ldi r24, 0x2E ; 46 169d0: 0e 94 c2 78 call 0xf184 ; 0xf184 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169d4: 8a 81 ldd r24, Y+2 ; 0x02 169d6: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169da: 8e e2 ldi r24, 0x2E ; 46 169dc: 0e 94 c2 78 call 0xf184 ; 0xf184 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169e0: 8b 81 ldd r24, Y+3 ; 0x03 169e2: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 169e6: 8e e2 ldi r24, 0x2E ; 46 169e8: 0e 94 c2 78 call 0xf184 ; 0xf184 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 169ec: 8c 81 ldd r24, Y+4 ; 0x04 169ee: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 169f2: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 169f6: 99 cd rjmp .-1230 ; 0x1652a SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 169f8: 82 e6 ldi r24, 0x62 ; 98 169fa: 98 e8 ldi r25, 0x88 ; 136 169fc: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 16a00: 94 cd rjmp .-1240 ; 0x1652a } } else { SERIAL_PROTOCOLLNPGM("n/a"); 16a02: 8e e5 ldi r24, 0x5E ; 94 16a04: 98 e8 ldi r25, 0x88 ; 136 16a06: 0e 94 06 7b call 0xf60c ; 0xf60c 16a0a: 8f cd rjmp .-1250 ; 0x1652a 16a0c: 10 92 67 0e sts 0x0E67, r1 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 16a10: 8c cd rjmp .-1256 ; 0x1652a break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 16a12: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 16a16: 1f 92 push r1 16a18: 8f 93 push r24 16a1a: 8a eb ldi r24, 0xBA ; 186 16a1c: 99 e6 ldi r25, 0x69 ; 105 16a1e: 9f 93 push r25 16a20: 8f 93 push r24 16a22: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 16a26: 0f 90 pop r0 16a28: 0f 90 pop r0 16a2a: 0f 90 pop r0 16a2c: 0f 90 pop r0 16a2e: 7d cd rjmp .-1286 ; 0x1652a - `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(); 16a30: 80 e5 ldi r24, 0x50 ; 80 16a32: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16a36: 88 23 and r24, r24 16a38: 21 f0 breq .+8 ; 0x16a42 16a3a: 0e 94 0e 5c call 0xb81c ; 0xb81c 16a3e: 80 93 86 02 sts 0x0286, r24 ; 0x800286 if(code_seen('R')) print_time_remaining_normal = code_value(); 16a42: 82 e5 ldi r24, 0x52 ; 82 16a44: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16a48: 88 23 and r24, r24 16a4a: 41 f0 breq .+16 ; 0x16a5c 16a4c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16a50: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16a54: 70 93 8a 02 sts 0x028A, r23 ; 0x80028a 16a58: 60 93 89 02 sts 0x0289, r22 ; 0x800289 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 16a5c: 81 e5 ldi r24, 0x51 ; 81 16a5e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16a62: 88 23 and r24, r24 16a64: 21 f0 breq .+8 ; 0x16a6e 16a66: 0e 94 0e 5c call 0xb81c ; 0xb81c 16a6a: 80 93 85 02 sts 0x0285, r24 ; 0x800285 if(code_seen('S')) print_time_remaining_silent = code_value(); 16a6e: 83 e5 ldi r24, 0x53 ; 83 16a70: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16a74: 88 23 and r24, r24 16a76: 41 f0 breq .+16 ; 0x16a88 16a78: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16a7c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16a80: 70 93 8e 02 sts 0x028E, r23 ; 0x80028e 16a84: 60 93 8d 02 sts 0x028D, r22 ; 0x80028d if(code_seen('C')){ 16a88: 83 e4 ldi r24, 0x43 ; 67 16a8a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16a8e: 88 23 and r24, r24 16a90: a9 f0 breq .+42 ; 0x16abc float print_time_to_change_normal_f = code_value(); 16a92: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16a96: 6b 01 movw r12, r22 16a98: 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; 16a9a: 20 e0 ldi r18, 0x00 ; 0 16a9c: 30 e0 ldi r19, 0x00 ; 0 16a9e: a9 01 movw r20, r18 16aa0: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 16aa4: 6f ef ldi r22, 0xFF ; 255 16aa6: 7f ef ldi r23, 0xFF ; 255 16aa8: 18 16 cp r1, r24 16aaa: 24 f4 brge .+8 ; 0x16ab4 16aac: c7 01 movw r24, r14 16aae: b6 01 movw r22, r12 16ab0: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16ab4: 70 93 88 02 sts 0x0288, r23 ; 0x800288 16ab8: 60 93 87 02 sts 0x0287, r22 ; 0x800287 } if(code_seen('D')){ 16abc: 84 e4 ldi r24, 0x44 ; 68 16abe: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16ac2: 88 23 and r24, r24 16ac4: a9 f0 breq .+42 ; 0x16af0 float print_time_to_change_silent_f = code_value(); 16ac6: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16aca: 6b 01 movw r12, r22 16acc: 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; 16ace: 20 e0 ldi r18, 0x00 ; 0 16ad0: 30 e0 ldi r19, 0x00 ; 0 16ad2: a9 01 movw r20, r18 16ad4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 16ad8: 6f ef ldi r22, 0xFF ; 255 16ada: 7f ef ldi r23, 0xFF ; 255 16adc: 18 16 cp r1, r24 16ade: 24 f4 brge .+8 ; 0x16ae8 16ae0: c7 01 movw r24, r14 16ae2: b6 01 movw r22, r12 16ae4: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16ae8: 70 93 8c 02 sts 0x028C, r23 ; 0x80028c 16aec: 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); 16af0: 80 91 88 02 lds r24, 0x0288 ; 0x800288 16af4: 8f 93 push r24 16af6: 80 91 87 02 lds r24, 0x0287 ; 0x800287 16afa: 8f 93 push r24 16afc: 80 91 8a 02 lds r24, 0x028A ; 0x80028a 16b00: 8f 93 push r24 16b02: 80 91 89 02 lds r24, 0x0289 ; 0x800289 16b06: 8f 93 push r24 16b08: 80 91 86 02 lds r24, 0x0286 ; 0x800286 16b0c: 28 2f mov r18, r24 16b0e: 08 2e mov r0, r24 16b10: 00 0c add r0, r0 16b12: 33 0b sbc r19, r19 16b14: 3f 93 push r19 16b16: 8f 93 push r24 16b18: 80 e6 ldi r24, 0x60 ; 96 16b1a: 99 e6 ldi r25, 0x69 ; 105 16b1c: 9f 93 push r25 16b1e: 8f 93 push r24 16b20: 07 e6 ldi r16, 0x67 ; 103 16b22: 19 e6 ldi r17, 0x69 ; 105 16b24: 1f 93 push r17 16b26: 0f 93 push r16 16b28: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 16b2c: 80 91 8c 02 lds r24, 0x028C ; 0x80028c 16b30: 8f 93 push r24 16b32: 80 91 8b 02 lds r24, 0x028B ; 0x80028b 16b36: 8f 93 push r24 16b38: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 16b3c: 8f 93 push r24 16b3e: 80 91 8d 02 lds r24, 0x028D ; 0x80028d 16b42: 8f 93 push r24 16b44: 80 91 85 02 lds r24, 0x0285 ; 0x800285 16b48: 28 2f mov r18, r24 16b4a: 08 2e mov r0, r24 16b4c: 00 0c add r0, r0 16b4e: 33 0b sbc r19, r19 16b50: 3f 93 push r19 16b52: 8f 93 push r24 16b54: 89 e5 ldi r24, 0x59 ; 89 16b56: 99 e6 ldi r25, 0x69 ; 105 16b58: 9f 93 push r25 16b5a: 8f 93 push r24 16b5c: 1f 93 push r17 16b5e: 0f 93 push r16 16b60: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 16b64: 0f b6 in r0, 0x3f ; 63 16b66: f8 94 cli 16b68: de bf out 0x3e, r29 ; 62 16b6a: 0f be out 0x3f, r0 ; 63 16b6c: cd bf out 0x3d, r28 ; 61 16b6e: dd cc rjmp .-1606 ; 0x1652a } else return false; } bool Stopwatch::pause() { if (isRunning()) { 16b70: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 16b74: 81 30 cpi r24, 0x01 ; 1 16b76: 09 f0 breq .+2 ; 0x16b7a 16b78: d8 cc rjmp .-1616 ; 0x1652a state = PAUSED; 16b7a: 82 e0 ldi r24, 0x02 ; 2 16b7c: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 16b80: 0f 94 8b 3f call 0x27f16 ; 0x27f16 16b84: 60 93 4f 06 sts 0x064F, r22 ; 0x80064f 16b88: 70 93 50 06 sts 0x0650, r23 ; 0x800650 16b8c: 80 93 51 06 sts 0x0651, r24 ; 0x800651 16b90: 90 93 52 06 sts 0x0652, r25 ; 0x800652 16b94: ca cc rjmp .-1644 ; 0x1652a /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 16b96: 0f 94 f5 58 call 0x2b1ea ; 0x2b1ea save_statistics(); 16b9a: 0e 94 d4 66 call 0xcda8 ; 0xcda8 16b9e: c5 cc rjmp .-1654 ; 0x1652a const char *_m_fil; const char *_m_time; uint32_t _cm = 0; uint32_t _min = 0; if (printJobOngoing()) { 16ba0: 0e 94 45 68 call 0xd08a ; 0xd08a 16ba4: 88 23 and r24, r24 16ba6: c1 f1 breq .+112 ; 0x16c18 _m_fil = _O(MSG_FILAMENT_USED); _m_time = _O(MSG_PRINT_TIME); _cm = (uint32_t)total_filament_used / 1000; 16ba8: 60 91 62 06 lds r22, 0x0662 ; 0x800662 16bac: 70 91 63 06 lds r23, 0x0663 ; 0x800663 16bb0: 80 91 64 06 lds r24, 0x0664 ; 0x800664 16bb4: 90 91 65 06 lds r25, 0x0665 ; 0x800665 16bb8: 28 ee ldi r18, 0xE8 ; 232 16bba: 33 e0 ldi r19, 0x03 ; 3 16bbc: 40 e0 ldi r20, 0x00 ; 0 16bbe: 50 e0 ldi r21, 0x00 ; 0 16bc0: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 16bc4: 12 2f mov r17, r18 16bc6: 03 2f mov r16, r19 16bc8: f4 2e mov r15, r20 16bca: e5 2e mov r14, r21 _min = print_job_timer.duration() / 60; 16bcc: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce 16bd0: 2c e3 ldi r18, 0x3C ; 60 16bd2: 30 e0 ldi r19, 0x00 ; 0 16bd4: 40 e0 ldi r20, 0x00 ; 0 16bd6: 50 e0 ldi r21, 0x00 ; 0 16bd8: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 16bdc: b9 01 movw r22, r18 16bde: 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); 16be0: 46 e7 ldi r20, 0x76 ; 118 16be2: 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); 16be4: 26 e6 ldi r18, 0x66 ; 102 16be6: 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); 16be8: 9f 93 push r25 16bea: 8f 93 push r24 16bec: 7f 93 push r23 16bee: 6f 93 push r22 16bf0: 5f 93 push r21 16bf2: 4f 93 push r20 16bf4: ef 92 push r14 16bf6: ff 92 push r15 16bf8: 0f 93 push r16 16bfa: 1f 93 push r17 16bfc: 3f 93 push r19 16bfe: 2f 93 push r18 16c00: 83 e4 ldi r24, 0x43 ; 67 16c02: 99 e6 ldi r25, 0x69 ; 105 16c04: 9f 93 push r25 16c06: 8f 93 push r24 16c08: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 16c0c: 0f b6 in r0, 0x3f ; 63 16c0e: f8 94 cli 16c10: de bf out 0x3e, r29 ; 62 16c12: 0f be out 0x3f, r0 ; 63 16c14: cd bf out 0x3d, r28 ; 61 16c16: 89 cc rjmp .-1774 ; 0x1652a _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')) { 16c18: 83 e5 ldi r24, 0x53 ; 83 16c1a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16c1e: 88 23 and r24, r24 16c20: 51 f0 breq .+20 ; 0x16c36 eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, code_value()); 16c22: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16c26: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16c2a: ab 01 movw r20, r22 16c2c: 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); 16c2e: 81 ef ldi r24, 0xF1 ; 241 16c30: 9f e0 ldi r25, 0x0F ; 15 16c32: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e } if (code_seen('T')) { 16c36: 84 e5 ldi r24, 0x54 ; 84 16c38: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16c3c: 88 23 and r24, r24 16c3e: 51 f0 breq .+20 ; 0x16c54 eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, code_value()); 16c40: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16c44: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16c48: ab 01 movw r20, r22 16c4a: bc 01 movw r22, r24 16c4c: 8d ee ldi r24, 0xED ; 237 16c4e: 9f e0 ldi r25, 0x0F ; 15 16c50: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e } _m_fil = _O(MSG_TOTAL_FILAMENT); _m_time = _O(MSG_TOTAL_PRINT_TIME); _cm = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); 16c54: 81 ef ldi r24, 0xF1 ; 241 16c56: 9f e0 ldi r25, 0x0F ; 15 16c58: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 16c5c: 16 2f mov r17, r22 16c5e: 07 2f mov r16, r23 16c60: f8 2e mov r15, r24 16c62: e9 2e mov r14, r25 _min = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); 16c64: 8d ee ldi r24, 0xED ; 237 16c66: 9f e0 ldi r25, 0x0F ; 15 16c68: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 } 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); 16c6c: 43 e5 ldi r20, 0x53 ; 83 16c6e: 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); 16c70: 22 e4 ldi r18, 0x42 ; 66 16c72: 3c e4 ldi r19, 0x4C ; 76 16c74: b9 cf rjmp .-142 ; 0x16be8 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 16c76: 8e e9 ldi r24, 0x9E ; 158 16c78: 93 e0 ldi r25, 0x03 ; 3 16c7a: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 16c7e: 83 e5 ldi r24, 0x53 ; 83 16c80: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16c84: 88 23 and r24, r24 16c86: 09 f1 breq .+66 ; 0x16cca , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16c88: 62 e2 ldi r22, 0x22 ; 34 16c8a: 70 e0 ldi r23, 0x00 ; 0 16c8c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 16c90: 90 91 98 03 lds r25, 0x0398 ; 0x800398 16c94: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 16c98: 8c 01 movw r16, r24 if (!this->ptr) { 16c9a: 89 2b or r24, r25 16c9c: b1 f0 breq .+44 ; 0x16cca // First quote not found return; } // Skip the leading quote this->ptr++; 16c9e: 0f 5f subi r16, 0xFF ; 255 16ca0: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 16ca2: 62 e2 ldi r22, 0x22 ; 34 16ca4: 70 e0 ldi r23, 0x00 ; 0 16ca6: c8 01 movw r24, r16 16ca8: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 if(!pStrEnd) { 16cac: 89 2b or r24, r25 16cae: 69 f0 breq .+26 ; 0x16cca char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 16cb0: e9 e4 ldi r30, 0x49 ; 73 16cb2: f6 e0 ldi r31, 0x06 ; 6 16cb4: 83 e0 ldi r24, 0x03 ; 3 16cb6: df 01 movw r26, r30 16cb8: 1d 92 st X+, r1 16cba: 8a 95 dec r24 16cbc: e9 f7 brne .-6 ; 0x16cb8 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 16cbe: 42 e0 ldi r20, 0x02 ; 2 16cc0: 50 e0 ldi r21, 0x00 ; 0 16cc2: b8 01 movw r22, r16 16cc4: cf 01 movw r24, r30 16cc6: 0f 94 11 e4 call 0x3c822 ; 0x3c822 } #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 16cca: 8c e8 ldi r24, 0x8C ; 140 16ccc: 9f e0 ldi r25, 0x0F ; 15 16cce: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 && printer_recovering() && printingIsPaused()) { 16cd2: 81 30 cpi r24, 0x01 ; 1 16cd4: 09 f0 breq .+2 ; 0x16cd8 16cd6: 29 cc rjmp .-1966 ; 0x1652a #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() 16cd8: 0e 94 30 68 call 0xd060 ; 0xd060 16cdc: 88 23 and r24, r24 16cde: 09 f4 brne .+2 ; 0x16ce2 16ce0: 24 cc rjmp .-1976 ; 0x1652a && printingIsPaused()) { 16ce2: 0e 94 3a 68 call 0xd074 ; 0xd074 16ce6: 88 23 and r24, r24 16ce8: 09 f4 brne .+2 ; 0x16cec 16cea: 1f cc rjmp .-1986 ; 0x1652a // 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) { 16cec: 80 91 f0 04 lds r24, 0x04F0 ; 0x8004f0 <_ZL24uvlo_auto_recovery_ready.lto_priv.552> 16cf0: 88 23 and r24, r24 16cf2: 29 f0 breq .+10 ; 0x16cfe SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_AUTO_RECOVERY_READY); 16cf4: 81 e2 ldi r24, 0x21 ; 33 16cf6: 99 e6 ldi r25, 0x69 ; 105 16cf8: 0e 94 06 7b call 0xf60c ; 0xf60c 16cfc: 16 cc rjmp .-2004 ; 0x1652a } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); 16cfe: 84 e0 ldi r24, 0x04 ; 4 16d00: 99 e6 ldi r25, 0x69 ; 105 16d02: 0e 94 06 7b call 0xf60c ; 0xf60c 16d06: 11 cc rjmp .-2014 ; 0x1652a /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 16d08: 87 ee ldi r24, 0xE7 ; 231 16d0a: 98 e6 ldi r25, 0x68 ; 104 16d0c: 0e 94 95 7b call 0xf72a ; 0xf72a #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 16d10: 83 e5 ldi r24, 0x53 ; 83 16d12: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16d16: 88 23 and r24, r24 16d18: 09 f4 brne .+2 ; 0x16d1c 16d1a: 07 cc rjmp .-2034 ; 0x1652a 16d1c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 16d20: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 16d24: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 16d28: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 16d2c: fe cb rjmp .-2052 ; 0x1652a 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 "); 16d2e: 8a e5 ldi r24, 0x5A ; 90 16d30: 98 e8 ldi r25, 0x88 ; 136 16d32: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 gcode_M105(); 16d36: 0e 94 4d 7a call 0xf49a ; 0xf49a cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 16d3a: 0e 94 47 78 call 0xf08e ; 0xf08e cmdbuffer_front_already_processed = true; 16d3e: 81 e0 ldi r24, 0x01 ; 1 16d40: 80 93 80 10 sts 0x1080, r24 ; 0x801080 16d44: f2 cb rjmp .-2076 ; 0x1652a 16d46: 10 92 67 14 sts 0x1467, r1 ; 0x801467 16d4a: 0c 94 7e a9 jmp 0x152fc ; 0x152fc 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; } 16d4e: 81 e0 ldi r24, 0x01 ; 1 16d50: 80 93 65 14 sts 0x1465, r24 ; 0x801465 16d54: ea cb rjmp .-2092 ; 0x1652a #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 16d56: 82 e5 ldi r24, 0x52 ; 82 16d58: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16d5c: 81 11 cpse r24, r1 16d5e: 0c 94 0a a9 jmp 0x15214 ; 0x15214 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 16d62: 0f 94 8b 3f call 0x27f16 ; 0x27f16 16d66: 6b 01 movw r12, r22 16d68: 7c 01 movw r14, r24 }; FORCE_INLINE bool isHeatingHotend(uint8_t extruder){ return target_temperature[extruder] > current_temperature[extruder]; 16d6a: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 16d6e: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 16d72: 07 2e mov r0, r23 16d74: 00 0c add r0, r0 16d76: 88 0b sbc r24, r24 16d78: 99 0b sbc r25, r25 16d7a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 16d7e: 11 e0 ldi r17, 0x01 ; 1 16d80: 20 91 61 0e lds r18, 0x0E61 ; 0x800e61 16d84: 30 91 62 0e lds r19, 0x0E62 ; 0x800e62 16d88: 40 91 63 0e lds r20, 0x0E63 ; 0x800e63 16d8c: 50 91 64 0e lds r21, 0x0E64 ; 0x800e64 16d90: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 16d94: 18 16 cp r1, r24 16d96: 0c f0 brlt .+2 ; 0x16d9a 16d98: 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 16d9a: 10 93 60 0e sts 0x0E60, r17 ; 0x800e60 <_ZL16target_direction.lto_priv.553> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 16d9e: c7 01 movw r24, r14 16da0: b6 01 movw r22, r12 16da2: 0f 94 97 82 call 0x3052e ; 0x3052e LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 16da6: 8e ec ldi r24, 0xCE ; 206 16da8: 99 e4 ldi r25, 0x49 ; 73 16daa: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 16dae: 0f 94 ea 0b call 0x217d4 ; 0x217d4 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 16db2: 82 e0 ldi r24, 0x02 ; 2 16db4: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df prusa_statistics(2); previous_millis_cmd.start(); 16db8: 88 e8 ldi r24, 0x88 ; 136 16dba: 93 e0 ldi r25, 0x03 ; 3 16dbc: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> 16dc0: b4 cb rjmp .-2200 ; 0x1652a */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 16dc2: 80 ec ldi r24, 0xC0 ; 192 16dc4: 99 e4 ldi r25, 0x49 ; 73 16dc6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 16dca: 0f 94 ea 0b call 0x217d4 ; 0x217d4 heating_status = HeatingStatus::BED_HEATING; 16dce: 83 e0 ldi r24, 0x03 ; 3 16dd0: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df prusa_statistics(1); if (code_seen('S')) 16dd4: 83 e5 ldi r24, 0x53 ; 83 16dd6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16dda: 18 2f mov r17, r24 16ddc: 88 23 and r24, r24 16dde: 49 f0 breq .+18 ; 0x16df2 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 16de0: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 16de4: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 16de8: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 16dec: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b 16df0: 05 c0 rjmp .+10 ; 0x16dfc if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 16df2: 82 e5 ldi r24, 0x52 ; 82 16df4: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16df8: 81 11 cpse r24, r1 16dfa: f2 cf rjmp .-28 ; 0x16de0 { setTargetBed(code_value()); } codenum = _millis(); 16dfc: 0f 94 8b 3f call 0x27f16 ; 0x27f16 16e00: 6b 01 movw r12, r22 16e02: 7c 01 movw r14, r24 cancel_heatup = false; 16e04: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 <_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; 16e08: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 16e0c: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 16e10: 07 2e mov r0, r23 16e12: 00 0c add r0, r0 16e14: 88 0b sbc r24, r24 16e16: 99 0b sbc r25, r25 16e18: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 16e1c: 01 e0 ldi r16, 0x01 ; 1 16e1e: 20 91 f1 04 lds r18, 0x04F1 ; 0x8004f1 16e22: 30 91 f2 04 lds r19, 0x04F2 ; 0x8004f2 16e26: 40 91 f3 04 lds r20, 0x04F3 ; 0x8004f3 16e2a: 50 91 f4 04 lds r21, 0x04F4 ; 0x8004f4 16e2e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 16e32: 18 16 cp r1, r24 16e34: 0c f0 brlt .+2 ; 0x16e38 16e36: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 16e38: 00 93 60 0e sts 0x0E60, r16 ; 0x800e60 <_ZL16target_direction.lto_priv.553> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16e3c: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.404> 16e40: 81 11 cpse r24, r1 16e42: 1a c0 rjmp .+52 ; 0x16e78 16e44: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 16e48: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 16e4c: 07 2e mov r0, r23 16e4e: 00 0c add r0, r0 16e50: 88 0b sbc r24, r24 16e52: 99 0b sbc r25, r25 16e54: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 16e58: 20 91 f1 04 lds r18, 0x04F1 ; 0x8004f1 16e5c: 30 91 f2 04 lds r19, 0x04F2 ; 0x8004f2 16e60: 40 91 f3 04 lds r20, 0x04F3 ; 0x8004f3 16e64: 50 91 f4 04 lds r21, 0x04F4 ; 0x8004f4 16e68: e0 91 60 0e lds r30, 0x0E60 ; 0x800e60 <_ZL16target_direction.lto_priv.553> 16e6c: ee 23 and r30, r30 16e6e: 91 f0 breq .+36 ; 0x16e94 16e70: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 16e74: 18 16 cp r1, r24 16e76: a4 f0 brlt .+40 ; 0x16ea0 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 16e78: 85 eb ldi r24, 0xB5 ; 181 16e7a: 99 e4 ldi r25, 0x49 ; 73 16e7c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 16e80: 0f 94 ea 0b call 0x217d4 ; 0x217d4 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 16e84: 84 e0 ldi r24, 0x04 ; 4 16e86: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df previous_millis_cmd.start(); 16e8a: 88 e8 ldi r24, 0x88 ; 136 16e8c: 93 e0 ldi r25, 0x03 ; 3 16e8e: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> 16e92: 4b cb rjmp .-2410 ; 0x1652a codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 16e94: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 16e98: 87 ff sbrs r24, 7 16e9a: ee cf rjmp .-36 ; 0x16e78 16e9c: 11 11 cpse r17, r1 16e9e: ec cf rjmp .-40 ; 0x16e78 { if (lcd_commands_type == LcdCommands::LongPause) { 16ea0: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 16ea4: 82 30 cpi r24, 0x02 ; 2 16ea6: 41 f3 breq .-48 ; 0x16e78 // 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. 16ea8: 0f 94 8b 3f call 0x27f16 ; 0x27f16 16eac: 6c 19 sub r22, r12 16eae: 7d 09 sbc r23, r13 16eb0: 8e 09 sbc r24, r14 16eb2: 9f 09 sbc r25, r15 16eb4: 69 3e cpi r22, 0xE9 ; 233 16eb6: 73 40 sbci r23, 0x03 ; 3 16eb8: 81 05 cpc r24, r1 16eba: 91 05 cpc r25, r1 16ebc: 30 f0 brcs .+12 ; 0x16eca { if (!farm_mode) { serialecho_temperatures(); 16ebe: 0e 94 e9 78 call 0xf1d2 ; 0xf1d2 } codenum = _millis(); 16ec2: 0f 94 8b 3f call 0x27f16 ; 0x27f16 16ec6: 6b 01 movw r12, r22 16ec8: 7c 01 movw r14, r24 } manage_heater(); 16eca: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(); 16ece: 80 e0 ldi r24, 0x00 ; 0 16ed0: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_update(0); 16ed4: 80 e0 ldi r24, 0x00 ; 0 16ed6: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 16eda: b0 cf rjmp .-160 ; 0x16e3c #### 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')){ 16edc: 83 e5 ldi r24, 0x53 ; 83 16ede: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16ee2: 88 23 and r24, r24 16ee4: 29 f0 breq .+10 ; 0x16ef0 fanSpeed = code_value_uint8(); 16ee6: 0e 94 0e 5c call 0xb81c ; 0xb81c 16eea: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 16eee: 1d cb rjmp .-2502 ; 0x1652a } else { fanSpeed = 255; 16ef0: 8f ef ldi r24, 0xFF ; 255 16ef2: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 16ef6: 19 cb rjmp .-2510 ; 0x1652a /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 16ef8: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 16efc: 16 cb rjmp .-2516 ; 0x1652a /*! ### 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; 16efe: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 16f02: 88 60 ori r24, 0x08 ; 8 16f04: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 16f08: 10 cb rjmp .-2528 ; 0x1652a ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 16f0a: 83 e5 ldi r24, 0x53 ; 83 16f0c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f10: 88 23 and r24, r24 16f12: 99 f0 breq .+38 ; 0x16f3a stepper_inactive_time = code_value() * 1000; 16f14: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16f18: 20 e0 ldi r18, 0x00 ; 0 16f1a: 30 e0 ldi r19, 0x00 ; 0 16f1c: 4a e7 ldi r20, 0x7A ; 122 16f1e: 54 e4 ldi r21, 0x44 ; 68 16f20: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 16f24: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16f28: 60 93 34 02 sts 0x0234, r22 ; 0x800234 16f2c: 70 93 35 02 sts 0x0235, r23 ; 0x800235 16f30: 80 93 36 02 sts 0x0236, r24 ; 0x800236 16f34: 90 93 37 02 sts 0x0237, r25 ; 0x800237 16f38: f8 ca rjmp .-2576 ; 0x1652a } 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]))); 16f3a: 88 e5 ldi r24, 0x58 ; 88 16f3c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f40: 88 23 and r24, r24 16f42: d1 f0 breq .+52 ; 0x16f78 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 16f44: 0f 94 2c 59 call 0x2b258 ; 0x2b258 if (code_seen('X')) disable_x(); 16f48: 88 e5 ldi r24, 0x58 ; 88 16f4a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f4e: 81 11 cpse r24, r1 16f50: 28 c0 rjmp .+80 ; 0x16fa2 if (code_seen('Y')) disable_y(); 16f52: 89 e5 ldi r24, 0x59 ; 89 16f54: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f58: 88 23 and r24, r24 16f5a: 19 f0 breq .+6 ; 0x16f62 16f5c: 16 9a sbi 0x02, 6 ; 2 16f5e: 10 92 41 07 sts 0x0741, r1 ; 0x800741 if (code_seen('Z')) disable_z(); 16f62: 8a e5 ldi r24, 0x5A ; 90 16f64: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 #if (E0_ENABLE_PIN != X_ENABLE_PIN) // Only enable on boards that have seperate ENABLE_PINS if (code_seen('E')) disable_e0(); 16f68: 85 e4 ldi r24, 0x45 ; 69 16f6a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f6e: 88 23 and r24, r24 16f70: 09 f4 brne .+2 ; 0x16f74 16f72: db ca rjmp .-2634 ; 0x1652a 16f74: 14 9a sbi 0x02, 4 ; 2 16f76: d9 ca rjmp .-2638 ; 0x1652a 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]))); 16f78: 89 e5 ldi r24, 0x59 ; 89 16f7a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f7e: 81 11 cpse r24, r1 16f80: e1 cf rjmp .-62 ; 0x16f44 16f82: 8a e5 ldi r24, 0x5A ; 90 16f84: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f88: 81 11 cpse r24, r1 16f8a: dc cf rjmp .-72 ; 0x16f44 16f8c: 85 e4 ldi r24, 0x45 ; 69 16f8e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16f92: 81 11 cpse r24, r1 16f94: d7 cf rjmp .-82 ; 0x16f44 if(all_axis) { st_synchronize(); 16f96: 0f 94 2c 59 call 0x2b258 ; 0x2b258 disable_e0(); 16f9a: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 16f9c: 0e 94 93 83 call 0x10726 ; 0x10726 16fa0: c4 ca rjmp .-2680 ; 0x1652a } else { st_synchronize(); if (code_seen('X')) disable_x(); 16fa2: 17 9a sbi 0x02, 7 ; 2 16fa4: 10 92 40 07 sts 0x0740, r1 ; 0x800740 16fa8: d4 cf rjmp .-88 ; 0x16f52 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 16faa: 83 e5 ldi r24, 0x53 ; 83 16fac: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 16fb0: 88 23 and r24, r24 16fb2: 09 f4 brne .+2 ; 0x16fb6 16fb4: ba ca rjmp .-2700 ; 0x1652a safetytimer_inactive_time = code_value() * 1000; 16fb6: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 16fba: 20 e0 ldi r18, 0x00 ; 0 16fbc: 30 e0 ldi r19, 0x00 ; 0 16fbe: 4a e7 ldi r20, 0x7A ; 122 16fc0: 54 e4 ldi r21, 0x44 ; 68 16fc2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 16fc6: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 16fca: 60 93 30 02 sts 0x0230, r22 ; 0x800230 16fce: 70 93 31 02 sts 0x0231, r23 ; 0x800231 16fd2: 80 93 32 02 sts 0x0232, r24 ; 0x800232 16fd6: 90 93 33 02 sts 0x0233, r25 ; 0x800233 safetyTimer.start(); 16fda: 8b ed ldi r24, 0xDB ; 219 16fdc: 95 e0 ldi r25, 0x05 ; 5 16fde: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> 16fe2: a3 ca rjmp .-2746 ; 0x1652a 16fe4: 4d ed ldi r20, 0xDD ; 221 16fe6: c4 2e mov r12, r20 16fe8: 42 e0 ldi r20, 0x02 ; 2 16fea: d4 2e mov r13, r20 16fec: 5e e6 ldi r21, 0x6E ; 110 16fee: e5 2e mov r14, r21 16ff0: 56 e0 ldi r21, 0x06 ; 6 16ff2: 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++) 16ff4: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 16ff6: f6 01 movw r30, r12 16ff8: 81 91 ld r24, Z+ 16ffa: 6f 01 movw r12, r30 16ffc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17000: 88 23 and r24, r24 17002: 09 f4 brne .+2 ; 0x17006 17004: 65 c0 rjmp .+202 ; 0x170d0 { float value = code_value(); 17006: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1700a: 2b 01 movw r4, r22 1700c: 3c 01 movw r6, r24 if(i == E_AXIS) { // E 1700e: 13 30 cpi r17, 0x03 ; 3 17010: 09 f0 breq .+2 ; 0x17014 17012: 68 c0 rjmp .+208 ; 0x170e4 if(value < 20.0) { 17014: 20 e0 ldi r18, 0x00 ; 0 17016: 30 e0 ldi r19, 0x00 ; 0 17018: 40 ea ldi r20, 0xA0 ; 160 1701a: 51 e4 ldi r21, 0x41 ; 65 1701c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 17020: 87 ff sbrs r24, 7 17022: 4e c0 rjmp .+156 ; 0x170c0 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 17024: a3 01 movw r20, r6 17026: 92 01 movw r18, r4 17028: 60 91 7e 06 lds r22, 0x067E ; 0x80067e 1702c: 70 91 7f 06 lds r23, 0x067F ; 0x80067f 17030: 80 91 80 06 lds r24, 0x0680 ; 0x800680 17034: 90 91 81 06 lds r25, 0x0681 ; 0x800681 17038: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1703c: 4b 01 movw r8, r22 1703e: 5c 01 movw r10, r24 cs.max_jerk[E_AXIS] *= factor; 17040: ac 01 movw r20, r24 17042: 9b 01 movw r18, r22 17044: 60 91 c2 06 lds r22, 0x06C2 ; 0x8006c2 17048: 70 91 c3 06 lds r23, 0x06C3 ; 0x8006c3 1704c: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 17050: 90 91 c5 06 lds r25, 0x06C5 ; 0x8006c5 17054: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 17058: 60 93 c2 06 sts 0x06C2, r22 ; 0x8006c2 1705c: 70 93 c3 06 sts 0x06C3, r23 ; 0x8006c3 17060: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 17064: 90 93 c5 06 sts 0x06C5, r25 ; 0x8006c5 max_feedrate[E_AXIS] *= factor; 17068: 20 90 99 02 lds r2, 0x0299 ; 0x800299 1706c: 30 90 9a 02 lds r3, 0x029A ; 0x80029a 17070: a5 01 movw r20, r10 17072: 94 01 movw r18, r8 17074: d1 01 movw r26, r2 17076: 1c 96 adiw r26, 0x0c ; 12 17078: 6d 91 ld r22, X+ 1707a: 7d 91 ld r23, X+ 1707c: 8d 91 ld r24, X+ 1707e: 9c 91 ld r25, X 17080: 1f 97 sbiw r26, 0x0f ; 15 17082: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 17086: f1 01 movw r30, r2 17088: 64 87 std Z+12, r22 ; 0x0c 1708a: 75 87 std Z+13, r23 ; 0x0d 1708c: 86 87 std Z+14, r24 ; 0x0e 1708e: 97 87 std Z+15, r25 ; 0x0f max_acceleration_steps_per_s2[E_AXIS] *= factor; 17090: 60 91 fc 17 lds r22, 0x17FC ; 0x8017fc 17094: 70 91 fd 17 lds r23, 0x17FD ; 0x8017fd 17098: 80 91 fe 17 lds r24, 0x17FE ; 0x8017fe 1709c: 90 91 ff 17 lds r25, 0x17FF ; 0x8017ff 170a0: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 170a4: a5 01 movw r20, r10 170a6: 94 01 movw r18, r8 170a8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 170ac: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 170b0: 60 93 fc 17 sts 0x17FC, r22 ; 0x8017fc 170b4: 70 93 fd 17 sts 0x17FD, r23 ; 0x8017fd 170b8: 80 93 fe 17 sts 0x17FE, r24 ; 0x8017fe 170bc: 90 93 ff 17 sts 0x17FF, r25 ; 0x8017ff } cs.axis_steps_per_mm[E_AXIS] = value; 170c0: 40 92 7e 06 sts 0x067E, r4 ; 0x80067e 170c4: 50 92 7f 06 sts 0x067F, r5 ; 0x80067f 170c8: 60 92 80 06 sts 0x0680, r6 ; 0x800680 170cc: 70 92 81 06 sts 0x0681, r7 ; 0x800681 170d0: b4 e0 ldi r27, 0x04 ; 4 170d2: eb 0e add r14, r27 170d4: f1 1c adc r15, r1 170d6: 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++) 170d8: 14 30 cpi r17, 0x04 ; 4 170da: 09 f0 breq .+2 ; 0x170de 170dc: 8c cf rjmp .-232 ; 0x16ff6 } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 170de: 0f 94 85 aa call 0x3550a ; 0x3550a 170e2: 23 ca rjmp .-3002 ; 0x1652a 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; 170e4: d7 01 movw r26, r14 170e6: 14 96 adiw r26, 0x04 ; 4 170e8: 4d 92 st X+, r4 170ea: 5d 92 st X+, r5 170ec: 6d 92 st X+, r6 170ee: 7c 92 st X, r7 170f0: 17 97 sbiw r26, 0x07 ; 7 170f2: ee cf rjmp .-36 ; 0x170d0 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 170f4: 8e e4 ldi r24, 0x4E ; 78 170f6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 170fa: 88 23 and r24, r24 170fc: 09 f4 brne .+2 ; 0x17100 170fe: 15 ca rjmp .-3030 ; 0x1652a gcode_LastN = code_value_long(); 17100: 0e 94 28 5c call 0xb850 ; 0xb850 17104: 60 93 7c 03 sts 0x037C, r22 ; 0x80037c 17108: 70 93 7d 03 sts 0x037D, r23 ; 0x80037d 1710c: 80 93 7e 03 sts 0x037E, r24 ; 0x80037e 17110: 90 93 7f 03 sts 0x037F, r25 ; 0x80037f 17114: 0a ca rjmp .-3052 ; 0x1652a case 113: if (code_seen('S')) { host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; 17116: 82 ef ldi r24, 0xF2 ; 242 17118: 99 ea ldi r25, 0xA9 ; 169 1711a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 1711e: c0 90 2f 02 lds r12, 0x022F ; 0x80022f 17122: d1 2c mov r13, r1 17124: f1 2c mov r15, r1 17126: 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); } 17128: 83 e5 ldi r24, 0x53 ; 83 1712a: 98 e8 ldi r25, 0x88 ; 136 1712c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 17130: 4a e0 ldi r20, 0x0A ; 10 17132: c7 01 movw r24, r14 17134: b6 01 movw r22, r12 17136: 0f 94 80 d2 call 0x3a500 ; 0x3a500 host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 1713a: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 1713e: f5 c9 rjmp .-3094 ; 0x1652a */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 17140: 85 e5 ldi r24, 0x55 ; 85 17142: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17146: 88 23 and r24, r24 17148: 09 f4 brne .+2 ; 0x1714c 1714a: 5a c0 rjmp .+180 ; 0x17200 // 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); 1714c: 00 91 97 03 lds r16, 0x0397 ; 0x800397 17150: 10 91 98 03 lds r17, 0x0398 ; 0x800398 17154: 0f 5f subi r16, 0xFF ; 255 17156: 1f 4f sbci r17, 0xFF ; 255 17158: 10 93 98 03 sts 0x0398, r17 ; 0x800398 1715c: 00 93 97 03 sts 0x0397, r16 ; 0x800397 return false; } bool show_upgrade_dialog_if_version_newer(const char *version_string) { if(oCheckVersion == ClCheckMode::_None) 17160: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 17164: 88 23 and r24, r24 17166: 09 f4 brne .+2 ; 0x1716a 17168: e0 c9 rjmp .-3136 ; 0x1652a // 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)) 1716a: be 01 movw r22, r28 1716c: 6f 5f subi r22, 0xFF ; 255 1716e: 7f 4f sbci r23, 0xFF ; 255 17170: c8 01 movw r24, r16 17172: 0e 94 58 f9 call 0x1f2b0 ; 0x1f2b0 17176: 88 23 and r24, r24 17178: 09 f4 brne .+2 ; 0x1717c 1717a: d7 c9 rjmp .-3154 ; 0x1652a 1717c: 89 e8 ldi r24, 0x89 ; 137 1717e: 9f e8 ldi r25, 0x8F ; 143 17180: de 01 movw r26, r28 17182: 11 96 adiw r26, 0x01 ; 1 17184: be 01 movw r22, r28 17186: 67 5f subi r22, 0xF7 ; 247 17188: 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]); 1718a: fc 01 movw r30, r24 1718c: 45 91 lpm r20, Z+ 1718e: 54 91 lpm r21, Z if (ver_gcode[i] > v) 17190: 2d 91 ld r18, X+ 17192: 3d 91 ld r19, X+ 17194: 42 17 cp r20, r18 17196: 53 07 cpc r21, r19 17198: 10 f4 brcc .+4 ; 0x1719e 1719a: 0c 94 58 cf jmp 0x19eb0 ; 0x19eb0 return 1; else if (ver_gcode[i] < v) 1719e: 24 17 cp r18, r20 171a0: 35 07 cpc r19, r21 171a2: 08 f4 brcc .+2 ; 0x171a6 171a4: c2 c9 rjmp .-3196 ; 0x1652a 171a6: 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) 171a8: a6 17 cp r26, r22 171aa: b7 07 cpc r27, r23 171ac: 71 f7 brne .-36 ; 0x1718a 171ae: bd c9 rjmp .-3206 ; 0x1652a 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)); 171b0: 83 e4 ldi r24, 0x43 ; 67 171b2: 99 e3 ldi r25, 0x39 ; 57 171b4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 171b8: ac 01 movw r20, r24 171ba: 63 e0 ldi r22, 0x03 ; 3 171bc: 80 e0 ldi r24, 0x00 ; 0 171be: 0e 94 a9 6f call 0xdf52 ; 0xdf52 Sound_MakeCustom(50,1000,false); 171c2: 40 e0 ldi r20, 0x00 ; 0 171c4: 68 ee ldi r22, 0xE8 ; 232 171c6: 73 e0 ldi r23, 0x03 ; 3 171c8: 82 e3 ldi r24, 0x32 ; 50 171ca: 90 e0 ldi r25, 0x00 ; 0 171cc: 0f 94 a1 6a call 0x2d542 ; 0x2d542 delay_keep_alive(500); 171d0: 84 ef ldi r24, 0xF4 ; 244 171d2: 91 e0 ldi r25, 0x01 ; 1 171d4: 0e 94 87 8e call 0x11d0e ; 0x11d0e Sound_MakeCustom(50,1000,false); 171d8: 40 e0 ldi r20, 0x00 ; 0 171da: 68 ee ldi r22, 0xE8 ; 232 171dc: 73 e0 ldi r23, 0x03 ; 3 171de: 82 e3 ldi r24, 0x32 ; 50 171e0: 90 e0 ldi r25, 0x00 ; 0 171e2: 0f 94 a1 6a call 0x2d542 ; 0x2d542 lcd_wait_for_click_delay(30); 171e6: 8e e1 ldi r24, 0x1E ; 30 171e8: 90 e0 ldi r25, 0x00 ; 0 171ea: 0f 94 73 50 call 0x2a0e6 ; 0x2a0e6 lcd_update_enable(true); 171ee: 81 e0 ldi r24, 0x01 ; 1 171f0: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); 171f4: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_update(0); 171f8: 80 e0 ldi r24, 0x00 ; 0 171fa: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 171fe: 95 c9 rjmp .-3286 ; 0x1652a } 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); 17200: 41 e1 ldi r20, 0x11 ; 17 17202: 50 e0 ldi r21, 0x00 ; 0 17204: 60 e8 ldi r22, 0x80 ; 128 17206: 7c e0 ldi r23, 0x0C ; 12 17208: ce 01 movw r24, r28 1720a: 01 96 adiw r24, 0x01 ; 1 1720c: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 17210: 85 e3 ldi r24, 0x35 ; 53 17212: 98 e8 ldi r25, 0x88 ; 136 17214: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(FW_VERSION_STR_P()); 17218: 86 eb ldi r24, 0xB6 ; 182 1721a: 95 e8 ldi r25, 0x85 ; 133 1721c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM("+"); 17220: 83 e3 ldi r24, 0x33 ; 51 17222: 98 e8 ldi r25, 0x88 ; 136 17224: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM(STR(FW_COMMITNR)); 17228: 8e e2 ldi r24, 0x2E ; 46 1722a: 98 e8 ldi r25, 0x88 ; 136 1722c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM("_"); 17230: 8c e2 ldi r24, 0x2C ; 44 17232: 98 e8 ldi r25, 0x88 ; 136 17234: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM(FW_COMMIT_HASH); 17238: 82 e2 ldi r24, 0x22 ; 34 1723a: 98 e8 ldi r25, 0x88 ; 136 1723c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 17240: 88 ec ldi r24, 0xC8 ; 200 17242: 97 e8 ldi r25, 0x87 ; 135 17244: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM(PROTOCOL_VERSION); 17248: 84 ec ldi r24, 0xC4 ; 196 1724a: 97 e8 ldi r25, 0x87 ; 135 1724c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM(" MACHINE_TYPE:"); 17250: 85 eb ldi r24, 0xB5 ; 181 17252: 97 e8 ldi r25, 0x87 ; 135 17254: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 17258: ce 01 movw r24, r28 1725a: 01 96 adiw r24, 0x01 ; 1 1725c: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 17260: 83 ea ldi r24, 0xA3 ; 163 17262: 97 e8 ldi r25, 0x87 ; 135 17264: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 17268: 82 ea ldi r24, 0xA2 ; 162 1726a: 97 e8 ldi r25, 0x87 ; 135 1726c: 0e 94 06 7b call 0xf60c ; 0xf60c } #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'); 17270: 1f 92 push r1 17272: 31 e3 ldi r19, 0x31 ; 49 17274: f3 2e mov r15, r19 17276: ff 92 push r15 17278: 85 ea ldi r24, 0xA5 ; 165 1727a: 95 e8 ldi r25, 0x85 ; 133 1727c: 9f 93 push r25 1727e: 8f 93 push r24 17280: 0e e5 ldi r16, 0x5E ; 94 17282: 15 e8 ldi r17, 0x85 ; 133 17284: 1f 93 push r17 17286: 0f 93 push r16 17288: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1728c: 1f 92 push r1 1728e: ff 92 push r15 17290: 85 e9 ldi r24, 0x95 ; 149 17292: 95 e8 ldi r25, 0x85 ; 133 17294: 9f 93 push r25 17296: 8f 93 push r24 17298: 1f 93 push r17 1729a: 0f 93 push r16 1729c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 172a0: 1f 92 push r1 172a2: ff 92 push r15 172a4: 81 e8 ldi r24, 0x81 ; 129 172a6: 95 e8 ldi r25, 0x85 ; 133 172a8: 9f 93 push r25 172aa: 8f 93 push r24 172ac: 1f 93 push r17 172ae: 0f 93 push r16 172b0: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 172b4: 1f 92 push r1 172b6: ff 92 push r15 172b8: 84 e7 ldi r24, 0x74 ; 116 172ba: 95 e8 ldi r25, 0x85 ; 133 172bc: 9f 93 push r25 172be: 8f 93 push r24 172c0: 1f 93 push r17 172c2: 0f 93 push r16 172c4: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 172c8: 1f 92 push r1 172ca: ff 92 push r15 172cc: 89 e6 ldi r24, 0x69 ; 105 172ce: 95 e8 ldi r25, 0x85 ; 133 172d0: 9f 93 push r25 172d2: 8f 93 push r24 172d4: 1f 93 push r17 172d6: 0f 93 push r16 172d8: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 172dc: 0f b6 in r0, 0x3f ; 63 172de: f8 94 cli 172e0: de bf out 0x3e, r29 ; 62 172e2: 0f be out 0x3f, r0 ; 63 172e4: cd bf out 0x3d, r28 ; 61 172e6: 21 c9 rjmp .-3518 ; 0x1652a /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 172e8: 0e 94 d2 79 call 0xf3a4 ; 0xf3a4 172ec: 1e c9 rjmp .-3524 ; 0x1652a /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 172ee: e0 91 97 03 lds r30, 0x0397 ; 0x800397 172f2: f0 91 98 03 lds r31, 0x0398 ; 0x800398 172f6: cf 01 movw r24, r30 172f8: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 172fa: 24 81 ldd r18, Z+4 ; 0x04 172fc: 20 32 cpi r18, 0x20 ; 32 172fe: 09 f4 brne .+2 ; 0x17302 17300: 01 96 adiw r24, 0x01 ; 1 17302: 0f 94 56 15 call 0x22aac ; 0x22aac custom_message_type = CustomMsg::M117; 17306: 87 e0 ldi r24, 0x07 ; 7 17308: 80 93 75 07 sts 0x0775, r24 ; 0x800775 1730c: 0e c9 rjmp .-3556 ; 0x1652a - `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; 1730e: 00 91 97 03 lds r16, 0x0397 ; 0x800397 17312: 10 91 98 03 lds r17, 0x0398 ; 0x800398 17316: 0b 5f subi r16, 0xFB ; 251 17318: 1f 4f sbci r17, 0xFF ; 255 1731a: 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; 1731c: f1 2c mov r15, r1 1731e: 40 e0 ldi r20, 0x00 ; 0 17320: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 17322: e9 f0 breq .+58 ; 0x1735e // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 17324: d8 01 movw r26, r16 17326: 9c 91 ld r25, X 17328: 29 2f mov r18, r25 1732a: 2b 7f andi r18, 0xFB ; 251 1732c: 21 34 cpi r18, 0x41 ; 65 1732e: b9 f4 brne .+46 ; 0x1735e 17330: 11 96 adiw r26, 0x01 ; 1 17332: 2c 91 ld r18, X 17334: 21 33 cpi r18, 0x31 ; 49 17336: 99 f4 brne .+38 ; 0x1735e switch (p[0]) { 17338: 91 34 cpi r25, 0x41 ; 65 1733a: 71 f0 breq .+28 ; 0x17358 1733c: 95 34 cpi r25, 0x45 ; 69 1733e: 09 f4 brne .+2 ; 0x17342 case 'A': hasA = true; break; case 'E': hasE = true; break; 17340: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 17342: 98 01 movw r18, r16 17344: 2e 5f subi r18, 0xFE ; 254 17346: 3f 4f sbci r19, 0xFF ; 255 17348: 89 01 movw r16, r18 1734a: 2f 5f subi r18, 0xFF ; 255 1734c: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 1734e: f8 01 movw r30, r16 17350: 90 81 ld r25, Z 17352: 90 32 cpi r25, 0x20 ; 32 17354: c9 f3 breq .-14 ; 0x17348 17356: e4 cf rjmp .-56 ; 0x17320 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; 17358: ff 24 eor r15, r15 1735a: f3 94 inc r15 1735c: f2 cf rjmp .-28 ; 0x17342 } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 1735e: 44 23 and r20, r20 17360: 21 f0 breq .+8 ; 0x1736a 17362: 82 ef ldi r24, 0xF2 ; 242 17364: 99 ea ldi r25, 0xA9 ; 169 17366: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (hasA) SERIAL_ECHOPGM("//"); 1736a: ff 20 and r15, r15 1736c: 21 f0 breq .+8 ; 0x17376 1736e: 8f e9 ldi r24, 0x9F ; 159 17370: 97 e8 ldi r25, 0x87 ; 135 17372: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(p); 17376: c8 01 movw r24, r16 17378: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c 1737c: d6 c8 rjmp .-3668 ; 0x1652a /*! ### 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 1737e: 8e ec ldi r24, 0xCE ; 206 17380: 98 e6 ldi r25, 0x68 ; 104 17382: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLLN(); 17386: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 1738a: 86 ec ldi r24, 0xC6 ; 198 1738c: 98 e6 ldi r25, 0x68 ; 104 1738e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 17392: 1e 99 sbic 0x03, 6 ; 3 17394: 47 c0 rjmp .+142 ; 0x17424 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 17396: 81 ec ldi r24, 0xC1 ; 193 17398: 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); 1739a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1739e: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_max: "));////MSG_X_MAX 173a2: 8f ea ldi r24, 0xAF ; 175 173a4: 98 e6 ldi r25, 0x68 ; 104 173a6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if(READ(X_MAX_PIN)^X_MAX_ENDSTOP_INVERTING){ 173aa: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 173ae: 82 fd sbrc r24, 2 173b0: 3c c0 rjmp .+120 ; 0x1742a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173b2: 81 ec ldi r24, 0xC1 ; 193 173b4: 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); 173b6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173ba: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_min: "));////MSG_Y_MIN 173be: 87 ea ldi r24, 0xA7 ; 167 173c0: 98 e6 ldi r25, 0x68 ; 104 173c2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 173c6: 1d 99 sbic 0x03, 5 ; 3 173c8: 33 c0 rjmp .+102 ; 0x17430 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173ca: 81 ec ldi r24, 0xC1 ; 193 173cc: 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); 173ce: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173d2: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(_n("y_max: "));////MSG_Y_MAX 173d6: 8f e9 ldi r24, 0x9F ; 159 173d8: 98 e6 ldi r25, 0x68 ; 104 173da: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if(READ(Y_MAX_PIN)^Y_MAX_ENDSTOP_INVERTING){ 173de: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 173e2: 87 fd sbrc r24, 7 173e4: 28 c0 rjmp .+80 ; 0x17436 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173e6: 81 ec ldi r24, 0xC1 ; 193 173e8: 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); 173ea: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 173ee: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 173f2: 87 e9 ldi r24, 0x97 ; 151 173f4: 98 e6 ldi r25, 0x68 ; 104 173f6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 173fa: 1c 99 sbic 0x03, 4 ; 3 173fc: 1f c0 rjmp .+62 ; 0x1743c SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 173fe: 81 ec ldi r24, 0xC1 ; 193 17400: 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); 17402: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 17406: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 1740a: 8f e8 ldi r24, 0x8F ; 143 1740c: 98 e6 ldi r25, 0x68 ; 104 1740e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 17412: 01 9b sbis 0x00, 1 ; 0 17414: 16 c0 rjmp .+44 ; 0x17442 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 17416: 81 ec ldi r24, 0xC1 ; 193 17418: 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); 1741a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 1741e: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 17422: 83 c8 rjmp .-3834 ; 0x1652a 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); 17424: 87 eb ldi r24, 0xB7 ; 183 17426: 98 e6 ldi r25, 0x68 ; 104 17428: b8 cf rjmp .-144 ; 0x1739a 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); 1742a: 87 eb ldi r24, 0xB7 ; 183 1742c: 98 e6 ldi r25, 0x68 ; 104 1742e: c3 cf rjmp .-122 ; 0x173b6 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); 17430: 87 eb ldi r24, 0xB7 ; 183 17432: 98 e6 ldi r25, 0x68 ; 104 17434: cc cf rjmp .-104 ; 0x173ce 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); 17436: 87 eb ldi r24, 0xB7 ; 183 17438: 98 e6 ldi r25, 0x68 ; 104 1743a: d7 cf rjmp .-82 ; 0x173ea 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); 1743c: 87 eb ldi r24, 0xB7 ; 183 1743e: 98 e6 ldi r25, 0x68 ; 104 17440: e0 cf rjmp .-64 ; 0x17402 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); 17442: 87 eb ldi r24, 0xB7 ; 183 17444: 98 e6 ldi r25, 0x68 ; 104 17446: e9 cf rjmp .-46 ; 0x1741a E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 17448: 0e 94 39 67 call 0xce72 ; 0xce72 1744c: 6e c8 rjmp .-3876 ; 0x1652a */ 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')) { 1744e: 84 e5 ldi r24, 0x54 ; 84 17450: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17454: 88 23 and r24, r24 17456: 69 f0 breq .+26 ; 0x17472 extruder = code_value_uint8(); 17458: 0e 94 0e 5c call 0xb81c ; 0xb81c if(extruder >= EXTRUDERS) { 1745c: 88 23 and r24, r24 1745e: 49 f0 breq .+18 ; 0x17472 SERIAL_ECHO_START; 17460: 82 ef ldi r24, 0xF2 ; 242 17462: 99 ea ldi r25, 0xA9 ; 169 17464: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 17468: 88 e7 ldi r24, 0x78 ; 120 1746a: 98 e6 ldi r25, 0x68 ; 104 1746c: 0e 94 3f 89 call 0x1127e ; 0x1127e 17470: 5c c8 rjmp .-3912 ; 0x1652a SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 17472: 84 e4 ldi r24, 0x44 ; 68 17474: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17478: 88 23 and r24, r24 1747a: 09 f4 brne .+2 ; 0x1747e 1747c: 56 c8 rjmp .-3924 ; 0x1652a float diameter = code_value(); 1747e: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 if (diameter == 0.0) { 17482: 20 e0 ldi r18, 0x00 ; 0 17484: 30 e0 ldi r19, 0x00 ; 0 17486: a9 01 movw r20, r18 17488: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1748c: 81 11 cpse r24, r1 1748e: 05 c0 rjmp .+10 ; 0x1749a // 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; 17490: 10 92 05 07 sts 0x0705, r1 ; 0x800705 } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 17494: 0e 94 6e 66 call 0xccdc ; 0xccdc 17498: 48 c8 rjmp .-3952 ; 0x1652a // 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(); 1749a: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1749e: 6b 01 movw r12, r22 174a0: 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]); 174a2: 20 e0 ldi r18, 0x00 ; 0 174a4: 30 e0 ldi r19, 0x00 ; 0 174a6: a9 01 movw r20, r18 174a8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 174ac: 81 11 cpse r24, r1 174ae: 06 c0 rjmp .+12 ; 0x174bc 174b0: c1 2c mov r12, r1 174b2: d1 2c mov r13, r1 174b4: 20 ee ldi r18, 0xE0 ; 224 174b6: e2 2e mov r14, r18 174b8: 2f e3 ldi r18, 0x3F ; 63 174ba: f2 2e mov r15, r18 174bc: c0 92 06 07 sts 0x0706, r12 ; 0x800706 174c0: d0 92 07 07 sts 0x0707, r13 ; 0x800707 174c4: e0 92 08 07 sts 0x0708, r14 ; 0x800708 174c8: f0 92 09 07 sts 0x0709, r15 ; 0x800709 cs.filament_size[1] = (cs.filament_size[1] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[1]); #if EXTRUDERS > 2 cs.filament_size[2] = (cs.filament_size[2] == 0.0 ? DEFAULT_NOMINAL_FILAMENT_DIA : cs.filament_size[2]); #endif #endif cs.volumetric_enabled = true; 174cc: 81 e0 ldi r24, 0x01 ; 1 174ce: 80 93 05 07 sts 0x0705, r24 ; 0x800705 174d2: e0 cf rjmp .-64 ; 0x17494 174d4: 8d ed ldi r24, 0xDD ; 221 174d6: c8 2e mov r12, r24 174d8: 82 e0 ldi r24, 0x02 ; 2 174da: d8 2e mov r13, r24 174dc: 9e e6 ldi r25, 0x6E ; 110 174de: e9 2e mov r14, r25 174e0: 96 e0 ldi r25, 0x06 ; 6 174e2: 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++) 174e4: 10 e0 ldi r17, 0x00 ; 0 { if (code_seen(axis_codes[i])) 174e6: d6 01 movw r26, r12 174e8: 8d 91 ld r24, X+ 174ea: 6d 01 movw r12, r26 174ec: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 174f0: 88 23 and r24, r24 174f2: 41 f1 breq .+80 ; 0x17544 { unsigned long val = code_value(); 174f4: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 174f8: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> #ifdef TMC2130 unsigned long val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 174fc: 12 30 cpi r17, 0x02 ; 2 174fe: 4c f5 brge .+82 ; 0x17552 { if (val > NORMAL_MAX_ACCEL_XY) 17500: 65 3c cpi r22, 0xC5 ; 197 17502: b9 e0 ldi r27, 0x09 ; 9 17504: 7b 07 cpc r23, r27 17506: 81 05 cpc r24, r1 17508: 91 05 cpc r25, r1 1750a: 40 f5 brcc .+80 ; 0x1755c 1750c: 56 2f mov r21, r22 1750e: 47 2f mov r20, r23 17510: 38 2f mov r19, r24 17512: 29 2f mov r18, r25 17514: 61 3c cpi r22, 0xC1 ; 193 17516: e3 e0 ldi r30, 0x03 ; 3 17518: 7e 07 cpc r23, r30 1751a: 81 05 cpc r24, r1 1751c: 91 05 cpc r25, r1 1751e: 20 f0 brcs .+8 ; 0x17528 17520: 50 ec ldi r21, 0xC0 ; 192 17522: 43 e0 ldi r20, 0x03 ; 3 17524: 30 e0 ldi r19, 0x00 ; 0 17526: 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; 17528: d7 01 movw r26, r14 1752a: 94 96 adiw r26, 0x24 ; 36 1752c: 6d 93 st X+, r22 1752e: 7d 93 st X+, r23 17530: 8d 93 st X+, r24 17532: 9c 93 st X, r25 17534: 97 97 sbiw r26, 0x27 ; 39 cs.max_acceleration_mm_per_s2_silent[i] = val_silent; 17536: f7 01 movw r30, r14 17538: e4 55 subi r30, 0x54 ; 84 1753a: ff 4f sbci r31, 0xFF ; 255 1753c: 50 83 st Z, r21 1753e: 41 83 std Z+1, r20 ; 0x01 17540: 32 83 std Z+2, r19 ; 0x02 17542: 23 83 std Z+3, r18 ; 0x03 17544: b4 e0 ldi r27, 0x04 ; 4 17546: eb 0e add r14, r27 17548: f1 1c adc r15, r1 1754a: 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++) 1754c: 14 30 cpi r17, 0x04 ; 4 1754e: 59 f6 brne .-106 ; 0x174e6 17550: c6 cd rjmp .-1140 ; 0x170de { if (code_seen(axis_codes[i])) { unsigned long val = code_value(); 17552: 56 2f mov r21, r22 17554: 47 2f mov r20, r23 17556: 38 2f mov r19, r24 17558: 29 2f mov r18, r25 1755a: e6 cf rjmp .-52 ; 0x17528 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; 1755c: 50 ec ldi r21, 0xC0 ; 192 1755e: 43 e0 ldi r20, 0x03 ; 3 17560: 30 e0 ldi r19, 0x00 ; 0 17562: 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; 17564: 64 ec ldi r22, 0xC4 ; 196 17566: 79 e0 ldi r23, 0x09 ; 9 17568: 80 e0 ldi r24, 0x00 ; 0 1756a: 90 e0 ldi r25, 0x00 ; 0 1756c: dd cf rjmp .-70 ; 0x17528 1756e: 1d ed ldi r17, 0xDD ; 221 17570: a1 2e mov r10, r17 17572: 12 e0 ldi r17, 0x02 ; 2 17574: b1 2e mov r11, r17 17576: 0e e6 ldi r16, 0x6E ; 110 17578: c0 2e mov r12, r16 1757a: 06 e0 ldi r16, 0x06 ; 6 1757c: 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++) 1757e: 91 2c mov r9, r1 { if (code_seen(axis_codes[i])) 17580: f5 01 movw r30, r10 17582: 81 91 ld r24, Z+ 17584: 5f 01 movw r10, r30 17586: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1758a: 88 23 and r24, r24 1758c: 71 f1 breq .+92 ; 0x175ea { float val = code_value(); 1758e: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 17592: 7b 01 movw r14, r22 17594: 8c 01 movw r16, r24 #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) 17596: f1 e0 ldi r31, 0x01 ; 1 17598: f9 15 cp r31, r9 1759a: b8 f1 brcs .+110 ; 0x1760a { if (val > NORMAL_MAX_FEEDRATE_XY) 1759c: 20 e0 ldi r18, 0x00 ; 0 1759e: 30 e0 ldi r19, 0x00 ; 0 175a0: 48 e4 ldi r20, 0x48 ; 72 175a2: 53 e4 ldi r21, 0x43 ; 67 175a4: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 175a8: 18 16 cp r1, r24 175aa: 44 f1 brlt .+80 ; 0x175fc 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(); 175ac: 5e 2c mov r5, r14 175ae: 6f 2c mov r6, r15 175b0: 70 2e mov r7, r16 175b2: 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) 175b4: 20 e0 ldi r18, 0x00 ; 0 175b6: 30 e0 ldi r19, 0x00 ; 0 175b8: 48 ec ldi r20, 0xC8 ; 200 175ba: 52 e4 ldi r21, 0x42 ; 66 175bc: b7 01 movw r22, r14 175be: c8 01 movw r24, r16 175c0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 175c4: 18 16 cp r1, r24 175c6: 34 f1 brlt .+76 ; 0x17614 val_silent = SILENT_MAX_FEEDRATE_XY; } cs.max_feedrate_normal[i] = val; 175c8: 85 2d mov r24, r5 175ca: 96 2d mov r25, r6 175cc: a7 2d mov r26, r7 175ce: b8 2d mov r27, r8 175d0: f6 01 movw r30, r12 175d2: 84 8b std Z+20, r24 ; 0x14 175d4: 95 8b std Z+21, r25 ; 0x15 175d6: a6 8b std Z+22, r26 ; 0x16 175d8: b7 8b std Z+23, r27 ; 0x17 cs.max_feedrate_silent[i] = val_silent; 175da: c7 01 movw r24, r14 175dc: d8 01 movw r26, r16 175de: e4 56 subi r30, 0x64 ; 100 175e0: ff 4f sbci r31, 0xFF ; 255 175e2: 80 83 st Z, r24 175e4: 91 83 std Z+1, r25 ; 0x01 175e6: a2 83 std Z+2, r26 ; 0x02 175e8: 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++) 175ea: 93 94 inc r9 175ec: f4 e0 ldi r31, 0x04 ; 4 175ee: cf 0e add r12, r31 175f0: d1 1c adc r13, r1 175f2: 24 e0 ldi r18, 0x04 ; 4 175f4: 92 12 cpse r9, r18 175f6: c4 cf rjmp .-120 ; 0x17580 175f8: 0c 94 95 b2 jmp 0x1652a ; 0x1652a #ifdef TMC2130 float val_silent = val; if ((i == X_AXIS) || (i == Y_AXIS)) { if (val > NORMAL_MAX_FEEDRATE_XY) val = NORMAL_MAX_FEEDRATE_XY; 175fc: 51 2c mov r5, r1 175fe: 61 2c mov r6, r1 17600: a8 e4 ldi r26, 0x48 ; 72 17602: 7a 2e mov r7, r26 17604: b3 e4 ldi r27, 0x43 ; 67 17606: 8b 2e mov r8, r27 17608: d5 cf rjmp .-86 ; 0x175b4 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(); 1760a: 56 2e mov r5, r22 1760c: 6f 2c mov r6, r15 1760e: 78 2e mov r7, r24 17610: 81 2e mov r8, r17 17612: da cf rjmp .-76 ; 0x175c8 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; 17614: e1 2c mov r14, r1 17616: f1 2c mov r15, r1 17618: 08 ec ldi r16, 0xC8 ; 200 1761a: 12 e4 ldi r17, 0x42 ; 66 1761c: d5 cf rjmp .-86 ; 0x175c8 // 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')) 1761e: 80 e5 ldi r24, 0x50 ; 80 17620: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17624: 88 23 and r24, r24 17626: 51 f0 breq .+20 ; 0x1763c cs.acceleration = code_value(); 17628: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1762c: 60 93 a2 06 sts 0x06A2, r22 ; 0x8006a2 17630: 70 93 a3 06 sts 0x06A3, r23 ; 0x8006a3 17634: 80 93 a4 06 sts 0x06A4, r24 ; 0x8006a4 17638: 90 93 a5 06 sts 0x06A5, r25 ; 0x8006a5 if(code_seen('R')) 1763c: 82 e5 ldi r24, 0x52 ; 82 1763e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17642: 88 23 and r24, r24 17644: 51 f0 breq .+20 ; 0x1765a cs.retract_acceleration = code_value(); 17646: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1764a: 60 93 a6 06 sts 0x06A6, r22 ; 0x8006a6 1764e: 70 93 a7 06 sts 0x06A7, r23 ; 0x8006a7 17652: 80 93 a8 06 sts 0x06A8, r24 ; 0x8006a8 17656: 90 93 a9 06 sts 0x06A9, r25 ; 0x8006a9 if(code_seen('T')) 1765a: 84 e5 ldi r24, 0x54 ; 84 1765c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17660: 88 23 and r24, r24 17662: 11 f4 brne .+4 ; 0x17668 17664: 0c 94 95 b2 jmp 0x1652a ; 0x1652a cs.travel_acceleration = code_value(); 17668: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1766c: 60 93 2e 07 sts 0x072E, r22 ; 0x80072e 17670: 70 93 2f 07 sts 0x072F, r23 ; 0x80072f 17674: 80 93 30 07 sts 0x0730, r24 ; 0x800730 17678: 90 93 31 07 sts 0x0731, r25 ; 0x800731 1767c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 17680: 83 e5 ldi r24, 0x53 ; 83 17682: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17686: 88 23 and r24, r24 17688: 51 f0 breq .+20 ; 0x1769e 1768a: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1768e: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 17692: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 17696: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 1769a: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad if(code_seen('T')) cs.mintravelfeedrate = code_value(); 1769e: 84 e5 ldi r24, 0x54 ; 84 176a0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 176a4: 88 23 and r24, r24 176a6: 51 f0 breq .+20 ; 0x176bc 176a8: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 176ac: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 176b0: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 176b4: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 176b8: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 176bc: 82 e4 ldi r24, 0x42 ; 66 176be: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 176c2: 88 23 and r24, r24 176c4: 61 f0 breq .+24 ; 0x176de 176c6: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 176ca: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 176ce: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 176d2: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 176d6: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 176da: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 176de: 88 e5 ldi r24, 0x58 ; 88 176e0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 176e4: 88 23 and r24, r24 176e6: 91 f0 breq .+36 ; 0x1770c 176e8: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 176ec: 60 93 ba 06 sts 0x06BA, r22 ; 0x8006ba 176f0: 70 93 bb 06 sts 0x06BB, r23 ; 0x8006bb 176f4: 80 93 bc 06 sts 0x06BC, r24 ; 0x8006bc 176f8: 90 93 bd 06 sts 0x06BD, r25 ; 0x8006bd 176fc: 60 93 b6 06 sts 0x06B6, r22 ; 0x8006b6 17700: 70 93 b7 06 sts 0x06B7, r23 ; 0x8006b7 17704: 80 93 b8 06 sts 0x06B8, r24 ; 0x8006b8 17708: 90 93 b9 06 sts 0x06B9, r25 ; 0x8006b9 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 1770c: 89 e5 ldi r24, 0x59 ; 89 1770e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17712: 88 23 and r24, r24 17714: 51 f0 breq .+20 ; 0x1772a 17716: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1771a: 60 93 ba 06 sts 0x06BA, r22 ; 0x8006ba 1771e: 70 93 bb 06 sts 0x06BB, r23 ; 0x8006bb 17722: 80 93 bc 06 sts 0x06BC, r24 ; 0x8006bc 17726: 90 93 bd 06 sts 0x06BD, r25 ; 0x8006bd if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 1772a: 8a e5 ldi r24, 0x5A ; 90 1772c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17730: 88 23 and r24, r24 17732: 51 f0 breq .+20 ; 0x17748 17734: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 17738: 60 93 be 06 sts 0x06BE, r22 ; 0x8006be 1773c: 70 93 bf 06 sts 0x06BF, r23 ; 0x8006bf 17740: 80 93 c0 06 sts 0x06C0, r24 ; 0x8006c0 17744: 90 93 c1 06 sts 0x06C1, r25 ; 0x8006c1 if(code_seen('E')) 17748: 85 e4 ldi r24, 0x45 ; 69 1774a: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1774e: 88 23 and r24, r24 17750: 11 f4 brne .+4 ; 0x17756 17752: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { float e = code_value(); 17756: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 1775a: 0e 94 dd 82 call 0x105ba ; 0x105ba #endif cs.max_jerk[E_AXIS] = e; 1775e: 60 93 c2 06 sts 0x06C2, r22 ; 0x8006c2 17762: 70 93 c3 06 sts 0x06C3, r23 ; 0x8006c3 17766: 80 93 c4 06 sts 0x06C4, r24 ; 0x8006c4 1776a: 90 93 c5 06 sts 0x06C5, r25 ; 0x8006c5 1776e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 17772: 0d ed ldi r16, 0xDD ; 221 17774: 12 e0 ldi r17, 0x02 ; 2 17776: f6 ec ldi r31, 0xC6 ; 198 17778: ef 2e mov r14, r31 1777a: f6 e0 ldi r31, 0x06 ; 6 1777c: 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(); 1777e: d8 01 movw r26, r16 17780: 8d 91 ld r24, X+ 17782: 8d 01 movw r16, r26 17784: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17788: 88 23 and r24, r24 1778a: 39 f0 breq .+14 ; 0x1779a 1778c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 17790: f7 01 movw r30, r14 17792: 60 83 st Z, r22 17794: 71 83 std Z+1, r23 ; 0x01 17796: 82 83 std Z+2, r24 ; 0x02 17798: 93 83 std Z+3, r25 ; 0x03 1779a: f4 e0 ldi r31, 0x04 ; 4 1779c: ef 0e add r14, r31 1779e: 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++) 177a0: 22 e0 ldi r18, 0x02 ; 2 177a2: 00 3e cpi r16, 0xE0 ; 224 177a4: 12 07 cpc r17, r18 177a6: 59 f7 brne .-42 ; 0x1777e 177a8: 0c 94 95 b2 jmp 0x1652a ; 0x1652a - `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')) 177ac: 83 e5 ldi r24, 0x53 ; 83 177ae: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 177b2: 88 23 and r24, r24 177b4: 51 f0 breq .+20 ; 0x177ca { cs.retract_recover_length = code_value() ; 177b6: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 177ba: 60 93 fd 06 sts 0x06FD, r22 ; 0x8006fd 177be: 70 93 fe 06 sts 0x06FE, r23 ; 0x8006fe 177c2: 80 93 ff 06 sts 0x06FF, r24 ; 0x8006ff 177c6: 90 93 00 07 sts 0x0700, r25 ; 0x800700 } if(code_seen('F')) 177ca: 86 e4 ldi r24, 0x46 ; 70 177cc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 177d0: 88 23 and r24, r24 177d2: 11 f4 brne .+4 ; 0x177d8 177d4: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 177d8: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 177dc: 0e 94 7c 67 call 0xcef8 ; 0xcef8 177e0: 60 93 01 07 sts 0x0701, r22 ; 0x800701 177e4: 70 93 02 07 sts 0x0702, r23 ; 0x800702 177e8: 80 93 03 07 sts 0x0703, r24 ; 0x800703 177ec: 90 93 04 07 sts 0x0704, r25 ; 0x800704 177f0: 0c 94 95 b2 jmp 0x1652a ; 0x1652a #### 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')) 177f4: 83 e5 ldi r24, 0x53 ; 83 177f6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 177fa: 88 23 and r24, r24 177fc: 11 f4 brne .+4 ; 0x17802 177fe: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { switch(code_value_uint8()) 17802: 0e 94 0e 5c call 0xb81c ; 0xb81c 17806: 88 23 and r24, r24 17808: c1 f0 breq .+48 ; 0x1783a 1780a: 81 30 cpi r24, 0x01 ; 1 1780c: e1 f0 breq .+56 ; 0x17846 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 1780e: 82 ef ldi r24, 0xF2 ; 242 17810: 99 ea ldi r25, 0xA9 ; 169 17812: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 17816: 85 e6 ldi r24, 0x65 ; 101 17818: 98 e6 ldi r25, 0x68 ; 104 1781a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 1781e: 80 91 70 12 lds r24, 0x1270 ; 0x801270 17822: 90 91 71 12 lds r25, 0x1271 ; 0x801271 17826: 8a 57 subi r24, 0x7A ; 122 17828: 9f 4e sbci r25, 0xEF ; 239 1782a: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_ECHOLNPGM("\"(1)"); 1782e: 8a e9 ldi r24, 0x9A ; 154 17830: 97 e8 ldi r25, 0x87 ; 135 17832: 0e 94 06 7b call 0xf60c ; 0xf60c 17836: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 1783a: 10 92 f0 06 sts 0x06F0, r1 ; 0x8006f0 retracted[0]=false; 1783e: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f 17842: 0c 94 95 b2 jmp 0x1652a ; 0x1652a retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 17846: 80 93 f0 06 sts 0x06F0, r24 ; 0x8006f0 retracted[0]=false; 1784a: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f 1784e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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; 17852: 40 90 32 07 lds r4, 0x0732 ; 0x800732 17856: 50 90 33 07 lds r5, 0x0733 ; 0x800733 1785a: 60 90 34 07 lds r6, 0x0734 ; 0x800734 1785e: 70 90 35 07 lds r7, 0x0735 ; 0x800735 17862: 0c 94 34 aa jmp 0x15468 ; 0x15468 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 17866: 80 90 36 07 lds r8, 0x0736 ; 0x800736 1786a: 90 90 37 07 lds r9, 0x0737 ; 0x800737 1786e: a0 90 38 07 lds r10, 0x0738 ; 0x800738 17872: b0 90 39 07 lds r11, 0x0739 ; 0x800739 17876: 0c 94 3f aa jmp 0x1547e ; 0x1547e - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 1787a: 82 e4 ldi r24, 0x42 ; 66 1787c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17880: 18 2f mov r17, r24 17882: 88 23 and r24, r24 17884: 41 f0 breq .+16 ; 0x17896 { saved_feedmultiply_mm = feedmultiply; 17886: 80 91 39 02 lds r24, 0x0239 ; 0x800239 1788a: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 1788e: 90 93 2e 02 sts 0x022E, r25 ; 0x80022e 17892: 80 93 2d 02 sts 0x022D, r24 ; 0x80022d codesWereSeen = true; } if (code_seen('S')) 17896: 83 e5 ldi r24, 0x53 ; 83 17898: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1789c: 08 2f mov r16, r24 1789e: 88 23 and r24, r24 178a0: 39 f0 breq .+14 ; 0x178b0 { feedmultiply = code_value_short(); 178a2: 0e 94 1b 5c call 0xb836 ; 0xb836 178a6: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 178aa: 80 93 39 02 sts 0x0239, r24 ; 0x800239 codesWereSeen = true; 178ae: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 178b0: 82 e5 ldi r24, 0x52 ; 82 178b2: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 178b6: 88 23 and r24, r24 178b8: 51 f0 breq .+20 ; 0x178ce { feedmultiply = saved_feedmultiply_mm; 178ba: 80 91 2d 02 lds r24, 0x022D ; 0x80022d 178be: 90 91 2e 02 lds r25, 0x022E ; 0x80022e 178c2: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 178c6: 80 93 39 02 sts 0x0239, r24 ; 0x800239 178ca: 0c 94 95 b2 jmp 0x1652a ; 0x1652a codesWereSeen = true; } if (!codesWereSeen) 178ce: 11 11 cpse r17, r1 178d0: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { printf_P(PSTR("%i%%\n"), feedmultiply); 178d4: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 178d8: 8f 93 push r24 178da: 80 91 39 02 lds r24, 0x0239 ; 0x800239 178de: 8f 93 push r24 178e0: 84 e9 ldi r24, 0x94 ; 148 178e2: 97 e8 ldi r25, 0x87 ; 135 178e4: 9f 93 push r25 178e6: 8f 93 push r24 178e8: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 178ec: 0f 90 pop r0 178ee: 0f 90 pop r0 178f0: 0f 90 pop r0 178f2: 0f 90 pop r0 178f4: 0c 94 95 b2 jmp 0x1652a ; 0x1652a extrudemultiply = code_value_short(); calculate_extruder_multipliers(); } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 178f8: 80 91 95 02 lds r24, 0x0295 ; 0x800295 178fc: 8f 93 push r24 178fe: 80 91 94 02 lds r24, 0x0294 ; 0x800294 17902: 8f 93 push r24 17904: 8e e8 ldi r24, 0x8E ; 142 17906: 97 e8 ldi r25, 0x87 ; 135 17908: 9f 93 push r25 1790a: 8f 93 push r24 1790c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 17910: 0f 90 pop r0 17912: 0f 90 pop r0 17914: 0f 90 pop r0 17916: 0f 90 pop r0 17918: 0c 94 95 b2 jmp 0x1652a ; 0x1652a - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1791c: 80 e5 ldi r24, 0x50 ; 80 1791e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17922: 88 23 and r24, r24 17924: 11 f4 brne .+4 ; 0x1792a 17926: 0c 94 95 b2 jmp 0x1652a ; 0x1652a int pin_number = code_value_short(); // pin number 1792a: 0e 94 1b 5c call 0xb836 ; 0xb836 1792e: 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 17930: 83 e5 ldi r24, 0x53 ; 83 17932: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 */ case 226: { if(code_seen('P')){ int pin_number = code_value_short(); // pin number int pin_state = -1; // required pin state - default is inverted 17936: 0f ef ldi r16, 0xFF ; 255 17938: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 1793a: 88 23 and r24, r24 1793c: 19 f0 breq .+6 ; 0x17944 1793e: 0e 94 1b 5c call 0xb836 ; 0xb836 17942: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 17944: c8 01 movw r24, r16 17946: 01 96 adiw r24, 0x01 ; 1 17948: 03 97 sbiw r24, 0x03 ; 3 1794a: 10 f0 brcs .+4 ; 0x17950 1794c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 17950: e2 e8 ldi r30, 0x82 ; 130 17952: 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)) 17954: 84 91 lpm r24, Z 17956: 08 2e mov r0, r24 17958: 00 0c add r0, r0 1795a: 99 0b sbc r25, r25 1795c: e8 16 cp r14, r24 1795e: f9 06 cpc r15, r25 17960: 11 f4 brne .+4 ; 0x17966 17962: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 17966: 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++) 17968: 38 e8 ldi r19, 0x88 ; 136 1796a: ee 39 cpi r30, 0x9E ; 158 1796c: f3 07 cpc r31, r19 1796e: 91 f7 brne .-28 ; 0x17954 pin_number = -1; break; } } if (pin_number > -1) 17970: f7 fe sbrs r15, 7 17972: 02 c0 rjmp .+4 ; 0x17978 17974: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { int target = LOW; st_synchronize(); 17978: 0f 94 2c 59 call 0x2b258 ; 0x2b258 pinMode(pin_number, INPUT); 1797c: de 2c mov r13, r14 1797e: 60 e0 ldi r22, 0x00 ; 0 17980: 8e 2d mov r24, r14 17982: 0e 94 64 df call 0x1bec8 ; 0x1bec8 switch(pin_state){ 17986: 0f 3f cpi r16, 0xFF ; 255 17988: 10 07 cpc r17, r16 1798a: b1 f0 breq .+44 ; 0x179b8 1798c: 01 30 cpi r16, 0x01 ; 1 1798e: 11 05 cpc r17, r1 17990: 11 f0 breq .+4 ; 0x17996 } } if (pin_number > -1) { int target = LOW; 17992: 10 e0 ldi r17, 0x00 ; 0 17994: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 17996: 8d 2d mov r24, r13 17998: 0e 94 0d df call 0x1be1a ; 0x1be1a 1799c: 80 17 cp r24, r16 1799e: 91 07 cpc r25, r17 179a0: 11 f4 brne .+4 ; 0x179a6 179a2: 0c 94 95 b2 jmp 0x1652a ; 0x1652a manage_heater(); 179a6: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(); 179aa: 80 e0 ldi r24, 0x00 ; 0 179ac: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_update(0); 179b0: 80 e0 ldi r24, 0x00 ; 0 179b2: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 179b6: ef cf rjmp .-34 ; 0x17996 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 179b8: 8e 2d mov r24, r14 179ba: 0e 94 0d df call 0x1be1a ; 0x1be1a 179be: 31 e0 ldi r19, 0x01 ; 1 179c0: 20 e0 ldi r18, 0x00 ; 0 179c2: 89 2b or r24, r25 179c4: 09 f0 breq .+2 ; 0x179c8 179c6: 30 e0 ldi r19, 0x00 ; 0 179c8: 03 2f mov r16, r19 179ca: 12 2f mov r17, r18 179cc: e4 cf rjmp .-56 ; 0x17996 - `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; 179ce: 80 e5 ldi r24, 0x50 ; 80 179d0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 179d4: 08 ee ldi r16, 0xE8 ; 232 179d6: 13 e0 ldi r17, 0x03 ; 3 179d8: 88 23 and r24, r24 179da: 89 f0 breq .+34 ; 0x179fe 179dc: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 179e0: 20 e0 ldi r18, 0x00 ; 0 179e2: 30 ec ldi r19, 0xC0 ; 192 179e4: 4a e5 ldi r20, 0x5A ; 90 179e6: 55 e4 ldi r21, 0x45 ; 69 179e8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 179ec: 0c ea ldi r16, 0xAC ; 172 179ee: 1d e0 ldi r17, 0x0D ; 13 179f0: 87 ff sbrs r24, 7 179f2: 05 c0 rjmp .+10 ; 0x179fe 179f4: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 179f8: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 179fc: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 179fe: 83 e5 ldi r24, 0x53 ; 83 17a00: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17a04: 88 23 and r24, r24 17a06: 71 f0 breq .+28 ; 0x17a24 beepS = 0; else { beepS = code_value(); 17a08: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 17a0c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> if (!beepS) { 17a10: 61 15 cp r22, r1 17a12: 71 05 cpc r23, r1 17a14: 49 f4 brne .+18 ; 0x17a28 // handle S0 as a pause _delay(beepP); 17a16: b8 01 movw r22, r16 17a18: 90 e0 ldi r25, 0x00 ; 0 17a1a: 80 e0 ldi r24, 0x00 ; 0 17a1c: 0f 94 92 3d call 0x27b24 ; 0x27b24 17a20: 0c 94 95 b2 jmp 0x1652a ; 0x1652a case 300: // M300 { uint16_t beepP = code_seen('P') ? min(code_value(), 3500) : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 17a24: 70 e0 ldi r23, 0x00 ; 0 17a26: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 17a28: 40 e0 ldi r20, 0x00 ; 0 17a2a: c8 01 movw r24, r16 17a2c: 0f 94 a1 6a call 0x2d542 ; 0x2d542 17a30: 0c 94 95 b2 jmp 0x1652a ; 0x1652a - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 17a34: 80 e5 ldi r24, 0x50 ; 80 17a36: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17a3a: 88 23 and r24, r24 17a3c: 51 f0 breq .+20 ; 0x17a52 17a3e: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 17a42: 60 93 e2 06 sts 0x06E2, r22 ; 0x8006e2 17a46: 70 93 e3 06 sts 0x06E3, r23 ; 0x8006e3 17a4a: 80 93 e4 06 sts 0x06E4, r24 ; 0x8006e4 17a4e: 90 93 e5 06 sts 0x06E5, r25 ; 0x8006e5 if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 17a52: 89 e4 ldi r24, 0x49 ; 73 17a54: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17a58: 88 23 and r24, r24 17a5a: 81 f0 breq .+32 ; 0x17a7c 17a5c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17a60: 2c ea ldi r18, 0xAC ; 172 17a62: 35 ec ldi r19, 0xC5 ; 197 17a64: 47 e2 ldi r20, 0x27 ; 39 17a66: 5e e3 ldi r21, 0x3E ; 62 17a68: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 17a6c: 60 93 e6 06 sts 0x06E6, r22 ; 0x8006e6 17a70: 70 93 e7 06 sts 0x06E7, r23 ; 0x8006e7 17a74: 80 93 e8 06 sts 0x06E8, r24 ; 0x8006e8 17a78: 90 93 e9 06 sts 0x06E9, r25 ; 0x8006e9 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 17a7c: 84 e4 ldi r24, 0x44 ; 68 17a7e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17a82: 88 23 and r24, r24 17a84: 81 f0 breq .+32 ; 0x17aa6 17a86: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 } float unscalePID_i(float i) { return i/PID_dT; 17a8a: 2c ea ldi r18, 0xAC ; 172 17a8c: 35 ec ldi r19, 0xC5 ; 197 17a8e: 47 e2 ldi r20, 0x27 ; 39 17a90: 5e e3 ldi r21, 0x3E ; 62 17a92: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 17a96: 60 93 ea 06 sts 0x06EA, r22 ; 0x8006ea 17a9a: 70 93 eb 06 sts 0x06EB, r23 ; 0x8006eb 17a9e: 80 93 ec 06 sts 0x06EC, r24 ; 0x8006ec 17aa2: 90 93 ed 06 sts 0x06ED, r25 ; 0x8006ed updatePID(); 17aa6: 0f 94 17 51 call 0x2a22e ; 0x2a22e SERIAL_PROTOCOLRPGM(MSG_OK); 17aaa: 8a e0 ldi r24, 0x0A ; 10 17aac: 9e e6 ldi r25, 0x6E ; 110 17aae: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLPGM(" p:"); 17ab2: 8e e7 ldi r24, 0x7E ; 126 17ab4: 97 e8 ldi r25, 0x87 ; 135 17ab6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 17aba: 60 91 e2 06 lds r22, 0x06E2 ; 0x8006e2 17abe: 70 91 e3 06 lds r23, 0x06E3 ; 0x8006e3 17ac2: 80 91 e4 06 lds r24, 0x06E4 ; 0x8006e4 17ac6: 90 91 e5 06 lds r25, 0x06E5 ; 0x8006e5 17aca: 42 e0 ldi r20, 0x02 ; 2 17acc: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 17ad0: 8a e7 ldi r24, 0x7A ; 122 17ad2: 97 e8 ldi r25, 0x87 ; 135 17ad4: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 17ad8: 2c ea ldi r18, 0xAC ; 172 17ada: 35 ec ldi r19, 0xC5 ; 197 17adc: 47 e2 ldi r20, 0x27 ; 39 17ade: 5e e3 ldi r21, 0x3E ; 62 17ae0: 60 91 e6 06 lds r22, 0x06E6 ; 0x8006e6 17ae4: 70 91 e7 06 lds r23, 0x06E7 ; 0x8006e7 17ae8: 80 91 e8 06 lds r24, 0x06E8 ; 0x8006e8 17aec: 90 91 e9 06 lds r25, 0x06E9 ; 0x8006e9 17af0: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 17af4: 42 e0 ldi r20, 0x02 ; 2 17af6: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 17afa: 86 e7 ldi r24, 0x76 ; 118 17afc: 97 e8 ldi r25, 0x87 ; 135 17afe: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 17b02: 2c ea ldi r18, 0xAC ; 172 17b04: 35 ec ldi r19, 0xC5 ; 197 17b06: 47 e2 ldi r20, 0x27 ; 39 17b08: 5e e3 ldi r21, 0x3E ; 62 17b0a: 60 91 ea 06 lds r22, 0x06EA ; 0x8006ea 17b0e: 70 91 eb 06 lds r23, 0x06EB ; 0x8006eb 17b12: 80 91 ec 06 lds r24, 0x06EC ; 0x8006ec 17b16: 90 91 ed 06 lds r25, 0x06ED ; 0x8006ed 17b1a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 17b1e: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 17b22: 0c 94 95 b2 jmp 0x1652a ; 0x1652a - `T` - Brightness timeout (15 - 900), default 15 seconds */ #ifdef LCD_BL_PIN case 256: { if (backlightSupport) { 17b26: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 17b2a: 88 23 and r24, r24 17b2c: 11 f4 brne .+4 ; 0x17b32 17b2e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a if (code_seen('B') ) backlightLevel_HIGH = code_value_uint8(); 17b32: 82 e4 ldi r24, 0x42 ; 66 17b34: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17b38: 88 23 and r24, r24 17b3a: 21 f0 breq .+8 ; 0x17b44 17b3c: 0e 94 0e 5c call 0xb81c ; 0xb81c 17b40: 80 93 fd 03 sts 0x03FD, r24 ; 0x8003fd if (code_seen('D')) backlightLevel_LOW = code_value_uint8(); 17b44: 84 e4 ldi r24, 0x44 ; 68 17b46: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17b4a: 88 23 and r24, r24 17b4c: 21 f0 breq .+8 ; 0x17b56 17b4e: 0e 94 0e 5c call 0xb81c ; 0xb81c 17b52: 80 93 fc 03 sts 0x03FC, r24 ; 0x8003fc if (code_seen('S')) { 17b56: 83 e5 ldi r24, 0x53 ; 83 17b58: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17b5c: 88 23 and r24, r24 17b5e: 31 f0 breq .+12 ; 0x17b6c uint8_t mode = code_value_uint8(); 17b60: 0e 94 0e 5c call 0xb81c ; 0xb81c if (mode <= BACKLIGHT_MODE_AUTO) { 17b64: 83 30 cpi r24, 0x03 ; 3 17b66: 10 f4 brcc .+4 ; 0x17b6c backlightMode = static_cast(mode); 17b68: 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); 17b6c: 84 e5 ldi r24, 0x54 ; 84 17b6e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17b72: 88 23 and r24, r24 17b74: 79 f0 breq .+30 ; 0x17b94 17b76: 0e 94 1b 5c call 0xb836 ; 0xb836 17b7a: 0f 97 sbiw r24, 0x0f ; 15 17b7c: 64 f1 brlt .+88 ; 0x17bd6 17b7e: 0e 94 1b 5c call 0xb836 ; 0xb836 17b82: 85 38 cpi r24, 0x85 ; 133 17b84: 93 40 sbci r25, 0x03 ; 3 17b86: 54 f5 brge .+84 ; 0x17bdc 17b88: 0e 94 1b 5c call 0xb836 ; 0xb836 17b8c: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 17b90: 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); 17b94: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17b98: 8f 93 push r24 17b9a: 80 91 4d 02 lds r24, 0x024D ; 0x80024d 17b9e: 8f 93 push r24 17ba0: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 17ba4: 1f 92 push r1 17ba6: 8f 93 push r24 17ba8: 80 91 fc 03 lds r24, 0x03FC ; 0x8003fc 17bac: 1f 92 push r1 17bae: 8f 93 push r24 17bb0: 80 91 fd 03 lds r24, 0x03FD ; 0x8003fd 17bb4: 1f 92 push r1 17bb6: 8f 93 push r24 17bb8: 80 e6 ldi r24, 0x60 ; 96 17bba: 97 e8 ldi r25, 0x87 ; 135 17bbc: 9f 93 push r25 17bbe: 8f 93 push r24 17bc0: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 backlight_save(); 17bc4: 0e 94 62 8b call 0x116c4 ; 0x116c4 17bc8: 0f b6 in r0, 0x3f ; 63 17bca: f8 94 cli 17bcc: de bf out 0x3e, r29 ; 62 17bce: 0f be out 0x3f, r0 ; 63 17bd0: cd bf out 0x3d, r28 ; 61 17bd2: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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); 17bd6: 8f e0 ldi r24, 0x0F ; 15 17bd8: 90 e0 ldi r25, 0x00 ; 0 17bda: d8 cf rjmp .-80 ; 0x17b8c 17bdc: 84 e8 ldi r24, 0x84 ; 132 17bde: 93 e0 ldi r25, 0x03 ; 3 17be0: d5 cf rjmp .-86 ; 0x17b8c - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 17be2: 83 e5 ldi r24, 0x53 ; 83 17be4: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17be8: 88 23 and r24, r24 17bea: 41 f0 breq .+16 ; 0x17bfc 17bec: 0e 94 1b 5c call 0xb836 ; 0xb836 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 17bf0: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 17bf4: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 17bf8: 0c 94 95 b2 jmp 0x1652a ; 0x1652a #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 17bfc: 90 e0 ldi r25, 0x00 ; 0 17bfe: 80 e0 ldi r24, 0x00 ; 0 17c00: f7 cf rjmp .-18 ; 0x17bf0 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 17c02: 85 e4 ldi r24, 0x45 ; 69 17c04: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 17c08: 10 e0 ldi r17, 0x00 ; 0 17c0a: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 17c0c: 88 23 and r24, r24 17c0e: 59 f0 breq .+22 ; 0x17c26 17c10: 0e 94 1b 5c call 0xb836 ; 0xb836 17c14: 8c 01 movw r16, r24 if (e < 0) temp = 70; 17c16: c1 2c mov r12, r1 17c18: d1 2c mov r13, r1 17c1a: 7c e8 ldi r23, 0x8C ; 140 17c1c: e7 2e mov r14, r23 17c1e: 72 e4 ldi r23, 0x42 ; 66 17c20: 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) 17c22: 97 fd sbrc r25, 7 17c24: 06 c0 rjmp .+12 ; 0x17c32 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 17c26: c1 2c mov r12, r1 17c28: d1 2c mov r13, r1 17c2a: e6 e1 ldi r30, 0x16 ; 22 17c2c: ee 2e mov r14, r30 17c2e: e3 e4 ldi r30, 0x43 ; 67 17c30: 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(); 17c32: 83 e5 ldi r24, 0x53 ; 83 17c34: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17c38: 88 23 and r24, r24 17c3a: 21 f0 breq .+8 ; 0x17c44 17c3c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 17c40: 6b 01 movw r12, r22 17c42: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 17c44: 83 e4 ldi r24, 0x43 ; 67 17c46: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 17c4a: 88 23 and r24, r24 17c4c: 51 f0 breq .+20 ; 0x17c62 17c4e: 0e 94 1b 5c call 0xb836 ; 0xb836 PID_autotune(temp, e, c); 17c52: 9c 01 movw r18, r24 17c54: a8 01 movw r20, r16 17c56: c7 01 movw r24, r14 17c58: b6 01 movw r22, r12 17c5a: 0f 94 44 51 call 0x2a288 ; 0x2a288 17c5e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a */ case 303: { float temp = 150.0; int e = 0; int c = 5; 17c62: 85 e0 ldi r24, 0x05 ; 5 17c64: 90 e0 ldi r25, 0x00 ; 0 17c66: f5 cf rjmp .-22 ; 0x17c52 */ 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; 17c68: 9f ef ldi r25, 0xFF ; 255 17c6a: ab 96 adiw r28, 0x2b ; 43 17c6c: 9f af std Y+63, r25 ; 0x3f 17c6e: ab 97 sbiw r28, 0x2b ; 43 17c70: 0c 94 6a ab jmp 0x156d4 ; 0x156d4 - `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; 17c74: 20 e0 ldi r18, 0x00 ; 0 17c76: 30 e0 ldi r19, 0x00 ; 0 17c78: 40 ec ldi r20, 0xC0 ; 192 17c7a: 5f e7 ldi r21, 0x7F ; 127 17c7c: e2 96 adiw r28, 0x32 ; 50 17c7e: 2c af std Y+60, r18 ; 0x3c 17c80: 3d af std Y+61, r19 ; 0x3d 17c82: 4e af std Y+62, r20 ; 0x3e 17c84: 5f af std Y+63, r21 ; 0x3f 17c86: e2 97 sbiw r28, 0x32 ; 50 17c88: 0c 94 79 ab jmp 0x156f2 ; 0x156f2 17c8c: 80 e0 ldi r24, 0x00 ; 0 17c8e: 90 e0 ldi r25, 0x00 ; 0 17c90: a0 ec ldi r26, 0xC0 ; 192 17c92: bf e7 ldi r27, 0x7F ; 127 17c94: 6e 96 adiw r28, 0x1e ; 30 17c96: 8c af std Y+60, r24 ; 0x3c 17c98: 9d af std Y+61, r25 ; 0x3d 17c9a: ae af std Y+62, r26 ; 0x3e 17c9c: bf af std Y+63, r27 ; 0x3f 17c9e: 6e 97 sbiw r28, 0x1e ; 30 17ca0: 0c 94 97 ab jmp 0x1572e ; 0x1572e 17ca4: 20 e0 ldi r18, 0x00 ; 0 17ca6: 30 e0 ldi r19, 0x00 ; 0 17ca8: 40 ec ldi r20, 0xC0 ; 192 17caa: 5f e7 ldi r21, 0x7F ; 127 17cac: a2 96 adiw r28, 0x22 ; 34 17cae: 2c af std Y+60, r18 ; 0x3c 17cb0: 3d af std Y+61, r19 ; 0x3d 17cb2: 4e af std Y+62, r20 ; 0x3e 17cb4: 5f af std Y+63, r21 ; 0x3f 17cb6: a2 97 sbiw r28, 0x22 ; 34 17cb8: 0c 94 a6 ab jmp 0x1574c ; 0x1574c 17cbc: 80 e0 ldi r24, 0x00 ; 0 17cbe: 90 e0 ldi r25, 0x00 ; 0 17cc0: a0 ec ldi r26, 0xC0 ; 192 17cc2: bf e7 ldi r27, 0x7F ; 127 17cc4: 6a 96 adiw r28, 0x1a ; 26 17cc6: 8c af std Y+60, r24 ; 0x3c 17cc8: 9d af std Y+61, r25 ; 0x3d 17cca: ae af std Y+62, r26 ; 0x3e 17ccc: bf af std Y+63, r27 ; 0x3f 17cce: 6a 97 sbiw r28, 0x1a ; 26 17cd0: 0c 94 b5 ab jmp 0x1576a ; 0x1576a 17cd4: 20 e0 ldi r18, 0x00 ; 0 17cd6: 30 e0 ldi r19, 0x00 ; 0 17cd8: 40 ec ldi r20, 0xC0 ; 192 17cda: 5f e7 ldi r21, 0x7F ; 127 17cdc: aa 96 adiw r28, 0x2a ; 42 17cde: 2c af std Y+60, r18 ; 0x3c 17ce0: 3d af std Y+61, r19 ; 0x3d 17ce2: 4e af std Y+62, r20 ; 0x3e 17ce4: 5f af std Y+63, r21 ; 0x3f 17ce6: aa 97 sbiw r28, 0x2a ; 42 17ce8: 0c 94 c4 ab jmp 0x15788 ; 0x15788 int8_t I = -1, S = -1, B = -1, F = -1; 17cec: 3f ef ldi r19, 0xFF ; 255 17cee: e3 96 adiw r28, 0x33 ; 51 17cf0: 3f af std Y+63, r19 ; 0x3f 17cf2: e3 97 sbiw r28, 0x33 ; 51 17cf4: 0c 94 da ab jmp 0x157b4 ; 0x157b4 17cf8: 4f ef ldi r20, 0xFF ; 255 17cfa: e7 96 adiw r28, 0x37 ; 55 17cfc: 4f af std Y+63, r20 ; 0x3f 17cfe: e7 97 sbiw r28, 0x37 ; 55 17d00: 0c 94 e6 ab jmp 0x157cc ; 0x157cc - `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; 17d04: 80 e0 ldi r24, 0x00 ; 0 17d06: 90 e0 ldi r25, 0x00 ; 0 17d08: a0 ec ldi r26, 0xC0 ; 192 17d0a: bf e7 ldi r27, 0x7F ; 127 17d0c: a6 96 adiw r28, 0x26 ; 38 17d0e: 8c af std Y+60, r24 ; 0x3c 17d10: 9d af std Y+61, r25 ; 0x3d 17d12: ae af std Y+62, r26 ; 0x3e 17d14: bf af std Y+63, r27 ; 0x3f 17d16: a6 97 sbiw r28, 0x26 ; 38 17d18: 0c 94 f5 ab jmp 0x157ea ; 0x157ea int8_t I = -1, S = -1, B = -1, F = -1; 17d1c: 9f ef ldi r25, 0xFF ; 255 17d1e: eb 96 adiw r28, 0x3b ; 59 17d20: 9f af std Y+63, r25 ; 0x3f 17d22: eb 97 sbiw r28, 0x3b ; 59 17d24: 0c 94 2a ac jmp 0x15854 ; 0x15854 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(); 17d28: 0f 94 00 44 call 0x28800 ; 0x28800 17d2c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a break; } // update all parameters if(B >= 0) 17d30: e7 96 adiw r28, 0x37 ; 55 17d32: ff ad ldd r31, Y+63 ; 0x3f 17d34: e7 97 sbiw r28, 0x37 ; 55 17d36: f7 fd sbrc r31, 7 17d38: 09 c0 rjmp .+18 ; 0x17d4c thermal_model_set_warn_beep(B); 17d3a: 81 e0 ldi r24, 0x01 ; 1 17d3c: e7 96 adiw r28, 0x37 ; 55 17d3e: 2f ad ldd r18, Y+63 ; 0x3f 17d40: e7 97 sbiw r28, 0x37 ; 55 17d42: 21 11 cpse r18, r1 17d44: 01 c0 rjmp .+2 ; 0x17d48 17d46: 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; 17d48: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> if(!isnan(P) || !isnan(U) || !isnan(V) || !isnan(C) || !isnan(D) || (L >= 0) || !isnan(T) || !isnan(W) || !isnan(E)) 17d4c: a7 01 movw r20, r14 17d4e: 96 01 movw r18, r12 17d50: c7 01 movw r24, r14 17d52: b6 01 movw r22, r12 17d54: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17d58: 88 23 and r24, r24 17d5a: 11 f4 brne .+4 ; 0x17d60 17d5c: 0c 94 b9 ac jmp 0x15972 ; 0x15972 17d60: 6e 96 adiw r28, 0x1e ; 30 17d62: 2c ad ldd r18, Y+60 ; 0x3c 17d64: 3d ad ldd r19, Y+61 ; 0x3d 17d66: 4e ad ldd r20, Y+62 ; 0x3e 17d68: 5f ad ldd r21, Y+63 ; 0x3f 17d6a: 6e 97 sbiw r28, 0x1e ; 30 17d6c: ca 01 movw r24, r20 17d6e: b9 01 movw r22, r18 17d70: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17d74: 88 23 and r24, r24 17d76: 11 f4 brne .+4 ; 0x17d7c 17d78: 0c 94 b9 ac jmp 0x15972 ; 0x15972 17d7c: a2 96 adiw r28, 0x22 ; 34 17d7e: 2c ad ldd r18, Y+60 ; 0x3c 17d80: 3d ad ldd r19, Y+61 ; 0x3d 17d82: 4e ad ldd r20, Y+62 ; 0x3e 17d84: 5f ad ldd r21, Y+63 ; 0x3f 17d86: a2 97 sbiw r28, 0x22 ; 34 17d88: ca 01 movw r24, r20 17d8a: b9 01 movw r22, r18 17d8c: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17d90: 88 23 and r24, r24 17d92: 11 f4 brne .+4 ; 0x17d98 17d94: 0c 94 b9 ac jmp 0x15972 ; 0x15972 17d98: 6a 96 adiw r28, 0x1a ; 26 17d9a: 2c ad ldd r18, Y+60 ; 0x3c 17d9c: 3d ad ldd r19, Y+61 ; 0x3d 17d9e: 4e ad ldd r20, Y+62 ; 0x3e 17da0: 5f ad ldd r21, Y+63 ; 0x3f 17da2: 6a 97 sbiw r28, 0x1a ; 26 17da4: ca 01 movw r24, r20 17da6: b9 01 movw r22, r18 17da8: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17dac: 88 23 and r24, r24 17dae: 11 f4 brne .+4 ; 0x17db4 17db0: 0c 94 b9 ac jmp 0x15972 ; 0x15972 17db4: aa 96 adiw r28, 0x2a ; 42 17db6: 2c ad ldd r18, Y+60 ; 0x3c 17db8: 3d ad ldd r19, Y+61 ; 0x3d 17dba: 4e ad ldd r20, Y+62 ; 0x3e 17dbc: 5f ad ldd r21, Y+63 ; 0x3f 17dbe: aa 97 sbiw r28, 0x2a ; 42 17dc0: ca 01 movw r24, r20 17dc2: b9 01 movw r22, r18 17dc4: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17dc8: 88 23 and r24, r24 17dca: 11 f4 brne .+4 ; 0x17dd0 17dcc: 0c 94 b9 ac jmp 0x15972 ; 0x15972 17dd0: 17 fd sbrc r17, 7 17dd2: 02 c0 rjmp .+4 ; 0x17dd8 17dd4: 0c 94 79 cf jmp 0x19ef2 ; 0x19ef2 17dd8: a6 96 adiw r28, 0x26 ; 38 17dda: 2c ad ldd r18, Y+60 ; 0x3c 17ddc: 3d ad ldd r19, Y+61 ; 0x3d 17dde: 4e ad ldd r20, Y+62 ; 0x3e 17de0: 5f ad ldd r21, Y+63 ; 0x3f 17de2: a6 97 sbiw r28, 0x26 ; 38 17de4: ca 01 movw r24, r20 17de6: b9 01 movw r22, r18 17de8: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17dec: 88 23 and r24, r24 17dee: 11 f4 brne .+4 ; 0x17df4 17df0: 0c 94 b9 ac jmp 0x15972 ; 0x15972 17df4: a5 01 movw r20, r10 17df6: 94 01 movw r18, r8 17df8: c5 01 movw r24, r10 17dfa: b4 01 movw r22, r8 17dfc: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17e00: 88 23 and r24, r24 17e02: 11 f4 brne .+4 ; 0x17e08 17e04: 0c 94 b9 ac jmp 0x15972 ; 0x15972 17e08: a3 01 movw r20, r6 17e0a: 92 01 movw r18, r4 17e0c: c3 01 movw r24, r6 17e0e: b2 01 movw r22, r4 17e10: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17e14: 88 23 and r24, r24 17e16: 11 f4 brne .+4 ; 0x17e1c 17e18: 0c 94 b9 ac jmp 0x15972 ; 0x15972 thermal_model_set_params(P, U, V, C, D, L, T, W, E); if(I >= 0 && !isnan(R)) 17e1c: ab 96 adiw r28, 0x2b ; 43 17e1e: 9f ad ldd r25, Y+63 ; 0x3f 17e20: ab 97 sbiw r28, 0x2b ; 43 17e22: 97 fd sbrc r25, 7 17e24: 3b c0 rjmp .+118 ; 0x17e9c 17e26: e2 96 adiw r28, 0x32 ; 50 17e28: 2c ad ldd r18, Y+60 ; 0x3c 17e2a: 3d ad ldd r19, Y+61 ; 0x3d 17e2c: 4e ad ldd r20, Y+62 ; 0x3e 17e2e: 5f ad ldd r21, Y+63 ; 0x3f 17e30: e2 97 sbiw r28, 0x32 ; 50 17e32: ca 01 movw r24, r20 17e34: b9 01 movw r22, r18 17e36: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 17e3a: 81 11 cpse r24, r1 17e3c: 2f c0 rjmp .+94 ; 0x17e9c thermal_model::setup(); } void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) 17e3e: ab 96 adiw r28, 0x2b ; 43 17e40: af ad ldd r26, Y+63 ; 0x3f 17e42: ab 97 sbiw r28, 0x2b ; 43 17e44: a0 31 cpi r26, 0x10 ; 16 17e46: 54 f5 brge .+84 ; 0x17e9c 17e48: 20 e0 ldi r18, 0x00 ; 0 17e4a: 30 e0 ldi r19, 0x00 ; 0 17e4c: a9 01 movw r20, r18 17e4e: e2 96 adiw r28, 0x32 ; 50 17e50: 6c ad ldd r22, Y+60 ; 0x3c 17e52: 7d ad ldd r23, Y+61 ; 0x3d 17e54: 8e ad ldd r24, Y+62 ; 0x3e 17e56: 9f ad ldd r25, Y+63 ; 0x3f 17e58: e2 97 sbiw r28, 0x32 ; 50 17e5a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 17e5e: 18 16 cp r1, r24 17e60: ec f4 brge .+58 ; 0x17e9c return; TempMgrGuard temp_mgr_guard; 17e62: ce 01 movw r24, r28 17e64: 01 96 adiw r24, 0x01 ; 1 17e66: 0f 94 de 47 call 0x28fbc ; 0x28fbc thermal_model::data.R[index] = R; 17e6a: ab 96 adiw r28, 0x2b ; 43 17e6c: bf ad ldd r27, Y+63 ; 0x3f 17e6e: ab 97 sbiw r28, 0x2b ; 43 17e70: 24 e0 ldi r18, 0x04 ; 4 17e72: b2 02 muls r27, r18 17e74: f0 01 movw r30, r0 17e76: 11 24 eor r1, r1 17e78: e2 53 subi r30, 0x32 ; 50 17e7a: fd 4e sbci r31, 0xED ; 237 17e7c: e2 96 adiw r28, 0x32 ; 50 17e7e: 8c ad ldd r24, Y+60 ; 0x3c 17e80: 9d ad ldd r25, Y+61 ; 0x3d 17e82: ae ad ldd r26, Y+62 ; 0x3e 17e84: bf ad ldd r27, Y+63 ; 0x3f 17e86: e2 97 sbiw r28, 0x32 ; 50 17e88: 80 83 st Z, r24 17e8a: 91 83 std Z+1, r25 ; 0x01 17e8c: a2 83 std Z+2, r26 ; 0x02 17e8e: b3 83 std Z+3, r27 ; 0x03 thermal_model::setup(); 17e90: 0f 94 48 45 call 0x28a90 ; 0x28a90 void thermal_model_set_resistance(uint8_t index, float R) { if(index >= THERMAL_MODEL_R_SIZE || R <= 0) return; TempMgrGuard temp_mgr_guard; 17e94: ce 01 movw r24, r28 17e96: 01 96 adiw r24, 0x01 ; 1 17e98: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 thermal_model_set_resistance(I, R); // enable the model last, if requested if(S >= 0) thermal_model_set_enabled(S); 17e9c: e3 96 adiw r28, 0x33 ; 51 17e9e: 9f ad ldd r25, Y+63 ; 0x3f 17ea0: e3 97 sbiw r28, 0x33 ; 51 17ea2: 97 fd sbrc r25, 7 17ea4: 06 c0 rjmp .+12 ; 0x17eb2 17ea6: 81 e0 ldi r24, 0x01 ; 1 17ea8: 91 11 cpse r25, r1 17eaa: 01 c0 rjmp .+2 ; 0x17eae 17eac: 80 e0 ldi r24, 0x00 ; 0 17eae: 0f 94 81 48 call 0x29102 ; 0x29102 // run autotune if(A >= 0) thermal_model_autotune(A, F > 0); 17eb2: 37 fe sbrs r3, 7 17eb4: 02 c0 rjmp .+4 ; 0x17eba 17eb6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 17eba: 11 e0 ldi r17, 0x01 ; 1 17ebc: eb 96 adiw r28, 0x3b ; 59 17ebe: af ad ldd r26, Y+63 ; 0x3f 17ec0: eb 97 sbiw r28, 0x3b ; 59 17ec2: 1a 16 cp r1, r26 17ec4: 0c f0 brlt .+2 ; 0x17ec8 17ec6: 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; 17ec8: 81 e0 ldi r24, 0x01 ; 1 17eca: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> } //return the nr of buffered moves FORCE_INLINE uint8_t moves_planned() { return (block_buffer_head + BLOCK_BUFFER_SIZE - block_buffer_tail) & (BLOCK_BUFFER_SIZE - 1); 17ece: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 17ed2: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 17ed6: 89 1b sub r24, r25 17ed8: 8f 70 andi r24, 0x0F ; 15 char tm_message[LCD_WIDTH+1]; if(moves_planned() || (lcd_commands_type != LcdCommands::ThermalModel && printer_active())) { 17eda: 41 f4 brne .+16 ; 0x17eec 17edc: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 17ee0: 85 30 cpi r24, 0x05 ; 5 17ee2: 79 f1 breq .+94 ; 0x17f42 17ee4: 0e 94 96 68 call 0xd12c ; 0xd12c 17ee8: 88 23 and r24, r24 17eea: 59 f1 breq .+86 ; 0x17f42 sprintf_P(tm_message, PSTR("TM: Cal. NOT IDLE")); 17eec: 8c e4 ldi r24, 0x4C ; 76 17eee: 95 e8 ldi r25, 0x85 ; 133 17ef0: 9f 93 push r25 17ef2: 8f 93 push r24 17ef4: e1 e0 ldi r30, 0x01 ; 1 17ef6: f0 e0 ldi r31, 0x00 ; 0 17ef8: ec 0f add r30, r28 17efa: fd 1f adc r31, r29 17efc: ff 93 push r31 17efe: ef 93 push r30 17f00: 0f 94 a8 dc call 0x3b950 ; 0x3b950 lcd_setstatus_serial(tm_message); 17f04: ce 01 movw r24, r28 17f06: 01 96 adiw r24, 0x01 ; 1 17f08: 0f 94 d9 0b call 0x217b2 ; 0x217b2 return; 17f0c: 0f 90 pop r0 17f0e: 0f 90 pop r0 17f10: 0f 90 pop r0 17f12: 0f 90 pop r0 17f14: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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; 17f18: 20 e0 ldi r18, 0x00 ; 0 17f1a: 30 e0 ldi r19, 0x00 ; 0 17f1c: a9 01 movw r20, r18 17f1e: c7 01 movw r24, r14 17f20: b6 01 movw r22, r12 17f22: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 17f26: 18 16 cp r1, r24 17f28: 14 f0 brlt .+4 ; 0x17f2e 17f2a: 0c 94 c7 ac jmp 0x1598e ; 0x1598e 17f2e: c0 92 b8 12 sts 0x12B8, r12 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 17f32: d0 92 b9 12 sts 0x12B9, r13 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 17f36: e0 92 ba 12 sts 0x12BA, r14 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 17f3a: f0 92 bb 12 sts 0x12BB, r15 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 17f3e: 0c 94 c7 ac jmp 0x1598e ; 0x1598e lcd_setstatus_serial(tm_message); return; } // lockout the printer during calibration KEEPALIVE_STATE(IN_PROCESS); 17f42: 83 e0 ldi r24, 0x03 ; 3 17f44: 80 93 96 02 sts 0x0296, r24 ; 0x800296 menu_set_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 17f48: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 17f4c: 82 60 ori r24, 0x02 ; 2 17f4e: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 lcd_return_to_status(); 17f52: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 // save the original model data and set the model checking state during self-calibration orig_C = thermal_model::data.C; 17f56: 20 91 c4 12 lds r18, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 17f5a: 30 91 c5 12 lds r19, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 17f5e: 40 91 c6 12 lds r20, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 17f62: 50 91 c7 12 lds r21, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 17f66: 6e 96 adiw r28, 0x1e ; 30 17f68: 2c af std Y+60, r18 ; 0x3c 17f6a: 3d af std Y+61, r19 ; 0x3d 17f6c: 4e af std Y+62, r20 ; 0x3e 17f6e: 5f af std Y+63, r21 ; 0x3f 17f70: 6e 97 sbiw r28, 0x1e ; 30 memcpy(orig_R, thermal_model::data.R, sizeof(thermal_model::data.R)); 17f72: 80 e4 ldi r24, 0x40 ; 64 17f74: ee ec ldi r30, 0xCE ; 206 17f76: f2 e1 ldi r31, 0x12 ; 18 17f78: de 01 movw r26, r28 17f7a: 11 96 adiw r26, 0x01 ; 1 17f7c: 01 90 ld r0, Z+ 17f7e: 0d 92 st X+, r0 17f80: 8a 95 dec r24 17f82: e1 f7 brne .-8 ; 0x17f7c orig_enabled = thermal_model::enabled; 17f84: 30 91 20 05 lds r19, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> 17f88: 67 96 adiw r28, 0x17 ; 23 17f8a: 3f af std Y+63, r19 ; 0x3f 17f8c: 67 97 sbiw r28, 0x17 ; 23 thermal_model_reset_enabled(selftest); 17f8e: 81 2f mov r24, r17 17f90: 0f 94 a3 48 call 0x29146 ; 0x29146 // autotune SERIAL_ECHOLNPGM("TM: calibration start"); 17f94: 86 e3 ldi r24, 0x36 ; 54 17f96: 95 e8 ldi r25, 0x85 ; 133 17f98: 0e 94 06 7b call 0xf60c ; 0xf60c thermal_model_autotune_err = thermal_model_cal::autotune(temp > 0 ? temp : THERMAL_MODEL_CAL_T_high); 17f9c: 21 14 cp r2, r1 17f9e: 31 04 cpc r3, r1 17fa0: 19 f4 brne .+6 ; 0x17fa8 17fa2: 26 ee ldi r18, 0xE6 ; 230 17fa4: 22 2e mov r2, r18 17fa6: 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); 17fa8: 80 e0 ldi r24, 0x00 ; 0 17faa: 0f 94 f6 43 call 0x287ec ; 0x287ec 17fae: 82 e0 ldi r24, 0x02 ; 2 17fb0: 48 2e mov r4, r24 17fb2: 51 2c mov r5, r1 for(uint8_t i = 0; i != 2; ++i) { const char* PROGMEM verb = (i == 0? PSTR("initial"): PSTR("refine")); 17fb4: 9a e1 ldi r25, 0x1A ; 26 17fb6: 69 2e mov r6, r25 17fb8: 95 e8 ldi r25, 0x85 ; 133 17fba: 79 2e mov r7, r25 17fbc: ae 01 movw r20, r28 17fbe: 4f 5b subi r20, 0xBF ; 191 17fc0: 5f 4f sbci r21, 0xFF ; 255 17fc2: 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); 17fc4: 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; 17fc6: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 17fca: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d if(current_temperature[0] >= THERMAL_MODEL_CAL_T_low) { 17fce: 20 e0 ldi r18, 0x00 ; 0 17fd0: 30 e0 ldi r19, 0x00 ; 0 17fd2: 48 e4 ldi r20, 0x48 ; 72 17fd4: 52 e4 ldi r21, 0x42 ; 66 17fd6: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 17fda: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 17fde: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 17fe2: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 17fe6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 17fea: 87 fd sbrc r24, 7 17fec: 58 c0 rjmp .+176 ; 0x1809e sprintf_P(tm_message, PSTR("TM: cool down <%dC"), THERMAL_MODEL_CAL_T_low); 17fee: 1f 92 push r1 17ff0: 1f 93 push r17 17ff2: 80 e0 ldi r24, 0x00 ; 0 17ff4: 95 e8 ldi r25, 0x85 ; 133 17ff6: 9f 93 push r25 17ff8: 8f 93 push r24 17ffa: 9f 92 push r9 17ffc: 8f 92 push r8 17ffe: 0f 94 a8 dc call 0x3b950 ; 0x3b950 lcd_setstatus_serial(tm_message); 18002: c4 01 movw r24, r8 18004: 0f 94 d9 0b call 0x217b2 ; 0x217b2 } } static void cooldown(float temp) { uint8_t old_speed = fanSpeed; 18008: 00 91 e3 03 lds r16, 0x03E3 ; 0x8003e3 set_fan_speed(255); 1800c: 8f ef ldi r24, 0xFF ; 255 1800e: 0f 94 f6 43 call 0x287ec ; 0x287ec 18012: 0f 90 pop r0 18014: 0f 90 pop r0 18016: 0f 90 pop r0 18018: 0f 90 pop r0 1801a: 0f 90 pop r0 1801c: 0f 90 pop r0 while(current_temperature[0] >= temp) { 1801e: c0 90 61 0e lds r12, 0x0E61 ; 0x800e61 18022: d0 90 62 0e lds r13, 0x0E62 ; 0x800e62 18026: e0 90 63 0e lds r14, 0x0E63 ; 0x800e63 1802a: f0 90 64 0e lds r15, 0x0E64 ; 0x800e64 1802e: 20 e0 ldi r18, 0x00 ; 0 18030: 30 e0 ldi r19, 0x00 ; 0 18032: 48 e4 ldi r20, 0x48 ; 72 18034: 52 e4 ldi r21, 0x42 ; 66 18036: c7 01 movw r24, r14 18038: b6 01 movw r22, r12 1803a: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1803e: 87 fd sbrc r24, 7 18040: 27 c0 rjmp .+78 ; 0x18090 if(temp_error_state.v) break; 18042: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 18046: 81 11 cpse r24, r1 18048: 23 c0 rjmp .+70 ; 0x18090 float ambient = current_temperature_ambient + thermal_model::data.Ta_corr; 1804a: 20 91 53 06 lds r18, 0x0653 ; 0x800653 1804e: 30 91 54 06 lds r19, 0x0654 ; 0x800654 18052: 40 91 55 06 lds r20, 0x0655 ; 0x800655 18056: 50 91 56 06 lds r21, 0x0656 ; 0x800656 1805a: 60 91 0e 13 lds r22, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1805e: 70 91 0f 13 lds r23, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 18062: 80 91 10 13 lds r24, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 18066: 90 91 11 13 lds r25, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1806a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> if(current_temperature[0] < (ambient + TEMP_HYSTERESIS)) { 1806e: 20 e0 ldi r18, 0x00 ; 0 18070: 30 e0 ldi r19, 0x00 ; 0 18072: 40 ea ldi r20, 0xA0 ; 160 18074: 50 e4 ldi r21, 0x40 ; 64 18076: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1807a: 9b 01 movw r18, r22 1807c: ac 01 movw r20, r24 1807e: c7 01 movw r24, r14 18080: b6 01 movw r22, r12 18082: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 18086: 87 fd sbrc r24, 7 18088: 03 c0 rjmp .+6 ; 0x18090 // do not get stuck waiting very close to ambient temperature break; } waiting_handler(); 1808a: 0f 94 c8 50 call 0x2a190 ; 0x2a190 1808e: c7 cf rjmp .-114 ; 0x1801e } set_fan_speed(old_speed); 18090: 80 2f mov r24, r16 18092: 0f 94 f6 43 call 0x287ec ; 0x287ec 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); 18096: 80 e1 ldi r24, 0x10 ; 16 18098: 97 e2 ldi r25, 0x27 ; 39 1809a: 0f 94 f5 50 call 0x2a1ea ; 0x2a1ea } sprintf_P(tm_message, PSTR("TM: %S C est."), verb); 1809e: 7f 92 push r7 180a0: 6f 92 push r6 180a2: e2 ef ldi r30, 0xF2 ; 242 180a4: f4 e8 ldi r31, 0x84 ; 132 180a6: ff 93 push r31 180a8: ef 93 push r30 180aa: 9f 92 push r9 180ac: 8f 92 push r8 180ae: 0f 94 a8 dc call 0x3b950 ; 0x3b950 lcd_setstatus_serial(tm_message); 180b2: c4 01 movw r24, r8 180b4: 0f 94 d9 0b call 0x217b2 ; 0x217b2 target_temperature[0] = cal_temp; 180b8: 30 92 6e 0e sts 0x0E6E, r3 ; 0x800e6e 180bc: 20 92 6d 0e sts 0x0E6D, r2 ; 0x800e6d samples = record(); 180c0: 0f 94 09 1e call 0x23c12 ; 0x23c12 180c4: 5c 01 movw r10, r24 if(temp_error_state.v || !samples) 180c6: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 180ca: 0f 90 pop r0 180cc: 0f 90 pop r0 180ce: 0f 90 pop r0 180d0: 0f 90 pop r0 180d2: 0f 90 pop r0 180d4: 0f 90 pop r0 180d6: 81 11 cpse r24, r1 180d8: 7a c0 rjmp .+244 ; 0x181ce 180da: a1 14 cp r10, r1 180dc: b1 04 cpc r11, r1 180de: 09 f4 brne .+2 ; 0x180e2 180e0: 76 c0 rjmp .+236 ; 0x181ce return true; // we need a high R value for the initial C guess if(isnan(thermal_model::data.R[0])) 180e2: 60 91 ce 12 lds r22, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 180e6: 70 91 cf 12 lds r23, 0x12CF ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 180ea: 80 91 d0 12 lds r24, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 180ee: 90 91 d1 12 lds r25, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> 180f2: 9b 01 movw r18, r22 180f4: ac 01 movw r20, r24 180f6: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 180fa: 88 23 and r24, r24 180fc: 61 f0 breq .+24 ; 0x18116 thermal_model::data.R[0] = THERMAL_MODEL_CAL_R_high; 180fe: 80 e0 ldi r24, 0x00 ; 0 18100: 90 e0 ldi r25, 0x00 ; 0 18102: a8 e4 ldi r26, 0x48 ; 72 18104: b2 e4 ldi r27, 0x42 ; 66 18106: 80 93 ce 12 sts 0x12CE, r24 ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 1810a: 90 93 cf 12 sts 0x12CF, r25 ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 1810e: a0 93 d0 12 sts 0x12D0, r26 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 18112: b0 93 d1 12 sts 0x12D1, r27 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> e = estimate(samples, &thermal_model::data.C, 18116: c0 90 53 06 lds r12, 0x0653 ; 0x800653 1811a: d0 90 54 06 lds r13, 0x0654 ; 0x800654 1811e: e0 90 55 06 lds r14, 0x0655 ; 0x800655 18122: f0 90 56 06 lds r15, 0x0656 ; 0x800656 18126: 00 e0 ldi r16, 0x00 ; 0 18128: 20 e0 ldi r18, 0x00 ; 0 1812a: 30 e0 ldi r19, 0x00 ; 0 1812c: 40 ea ldi r20, 0xA0 ; 160 1812e: 51 e4 ldi r21, 0x41 ; 65 18130: 64 ec ldi r22, 0xC4 ; 196 18132: 72 e1 ldi r23, 0x12 ; 18 18134: c5 01 movw r24, r10 18136: 0e 94 36 dd call 0x1ba6c ; 0x1ba6c 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)) 1813a: 9b 01 movw r18, r22 1813c: ac 01 movw r20, r24 1813e: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 18142: 81 11 cpse r24, r1 18144: 44 c0 rjmp .+136 ; 0x181ce return true; wait_temp(); 18146: 0f 94 d3 50 call 0x2a1a6 ; 0x2a1a6 if(i) break; // we don't need to refine R 1814a: 4a 94 dec r4 1814c: 45 28 or r4, r5 1814e: 09 f4 brne .+2 ; 0x18152 18150: 85 c0 rjmp .+266 ; 0x1825c wait(30000); // settle PID regulation 18152: 80 e3 ldi r24, 0x30 ; 48 18154: 95 e7 ldi r25, 0x75 ; 117 18156: 0f 94 f5 50 call 0x2a1ea ; 0x2a1ea sprintf_P(tm_message, PSTR("TM: %S R %dC"), verb, cal_temp); 1815a: 3f 92 push r3 1815c: 2f 92 push r2 1815e: 7f 92 push r7 18160: 6f 92 push r6 18162: 45 ee ldi r20, 0xE5 ; 229 18164: 54 e8 ldi r21, 0x84 ; 132 18166: 5f 93 push r21 18168: 4f 93 push r20 1816a: 9f 92 push r9 1816c: 8f 92 push r8 1816e: 0f 94 a8 dc call 0x3b950 ; 0x3b950 lcd_setstatus_serial(tm_message); 18172: c4 01 movw r24, r8 18174: 0f 94 d9 0b call 0x217b2 ; 0x217b2 samples = record(); 18178: 0f 94 09 1e call 0x23c12 ; 0x23c12 if(temp_error_state.v || !samples) 1817c: 20 91 1e 05 lds r18, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 18180: 0f b6 in r0, 0x3f ; 63 18182: f8 94 cli 18184: de bf out 0x3e, r29 ; 62 18186: 0f be out 0x3f, r0 ; 63 18188: cd bf out 0x3d, r28 ; 61 1818a: 21 11 cpse r18, r1 1818c: 20 c0 rjmp .+64 ; 0x181ce 1818e: 00 97 sbiw r24, 0x00 ; 0 18190: f1 f0 breq .+60 ; 0x181ce return true; e = estimate(samples, &thermal_model::data.R[0], 18192: c0 90 53 06 lds r12, 0x0653 ; 0x800653 18196: d0 90 54 06 lds r13, 0x0654 ; 0x800654 1819a: e0 90 55 06 lds r14, 0x0655 ; 0x800655 1819e: f0 90 56 06 lds r15, 0x0656 ; 0x800656 181a2: 20 e0 ldi r18, 0x00 ; 0 181a4: 30 e0 ldi r19, 0x00 ; 0 181a6: 48 e4 ldi r20, 0x48 ; 72 181a8: 52 e4 ldi r21, 0x42 ; 66 181aa: 6e ec ldi r22, 0xCE ; 206 181ac: 72 e1 ldi r23, 0x12 ; 18 181ae: 0e 94 36 dd call 0x1ba6c ; 0x1ba6c // 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")); 181b2: b3 e1 ldi r27, 0x13 ; 19 181b4: 6b 2e mov r6, r27 181b6: b5 e8 ldi r27, 0x85 ; 133 181b8: 7b 2e mov r7, r27 181ba: 44 24 eor r4, r4 181bc: 43 94 inc r4 181be: 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)) 181c0: 9b 01 movw r18, r22 181c2: ac 01 movw r20, r24 181c4: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 181c8: 88 23 and r24, r24 181ca: 09 f4 brne .+2 ; 0x181ce 181cc: fc ce rjmp .-520 ; 0x17fc6 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; 181ce: 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); 181d0: 80 93 3c 02 sts 0x023C, r24 ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> // always reset temperature disable_heater(); 181d4: 0f 94 57 45 call 0x28aae ; 0x28aae if(thermal_model_autotune_err) { 181d8: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> 181dc: 88 23 and r24, r24 181de: 09 f4 brne .+2 ; 0x181e2 181e0: fd c0 rjmp .+506 ; 0x183dc sprintf_P(tm_message, PSTR("TM: calibr. failed!")); 181e2: 82 e2 ldi r24, 0x22 ; 34 181e4: 95 e8 ldi r25, 0x85 ; 133 181e6: 9f 93 push r25 181e8: 8f 93 push r24 181ea: 9f 92 push r9 181ec: 8f 92 push r8 181ee: 0f 94 a8 dc call 0x3b950 ; 0x3b950 lcd_setstatus_serial(tm_message); 181f2: c4 01 movw r24, r8 181f4: 0f 94 d9 0b call 0x217b2 ; 0x217b2 if(temp_error_state.v) 181f8: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 181fc: 0f 90 pop r0 181fe: 0f 90 pop r0 18200: 0f 90 pop r0 18202: 0f 90 pop r0 18204: 88 23 and r24, r24 18206: 19 f0 breq .+6 ; 0x1820e thermal_model_cal::set_fan_speed(255); 18208: 8f ef ldi r24, 0xFF ; 255 1820a: 0f 94 f6 43 call 0x287ec ; 0x287ec // show calibrated values before overwriting them thermal_model_report_settings(); 1820e: 0f 94 00 44 call 0x28800 ; 0x28800 // restore original state thermal_model::data.C = orig_C; 18212: 6e 96 adiw r28, 0x1e ; 30 18214: 2c ad ldd r18, Y+60 ; 0x3c 18216: 3d ad ldd r19, Y+61 ; 0x3d 18218: 4e ad ldd r20, Y+62 ; 0x3e 1821a: 5f ad ldd r21, Y+63 ; 0x3f 1821c: 6e 97 sbiw r28, 0x1e ; 30 1821e: 20 93 c4 12 sts 0x12C4, r18 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 18222: 30 93 c5 12 sts 0x12C5, r19 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 18226: 40 93 c6 12 sts 0x12C6, r20 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 1822a: 50 93 c7 12 sts 0x12C7, r21 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> memcpy(thermal_model::data.R, orig_R, sizeof(thermal_model::data.R)); 1822e: 80 e4 ldi r24, 0x40 ; 64 18230: fe 01 movw r30, r28 18232: 31 96 adiw r30, 0x01 ; 1 18234: ae ec ldi r26, 0xCE ; 206 18236: b2 e1 ldi r27, 0x12 ; 18 18238: 01 90 ld r0, Z+ 1823a: 0d 92 st X+, r0 1823c: 8a 95 dec r24 1823e: e1 f7 brne .-8 ; 0x18238 thermal_model_set_enabled(orig_enabled); 18240: 67 96 adiw r28, 0x17 ; 23 18242: 8f ad ldd r24, Y+63 ; 0x3f 18244: 67 97 sbiw r28, 0x17 ; 23 18246: 0f 94 81 48 call 0x29102 ; 0x29102 thermal_model_cal::set_fan_speed(0); thermal_model_set_enabled(orig_enabled); thermal_model_report_settings(); } lcd_consume_click(); 1824a: 0e 94 ad 71 call 0xe35a ; 0xe35a menu_unset_block(MENU_BLOCK_THERMAL_MODEL_AUTOTUNE); 1824e: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 18252: 8d 7f andi r24, 0xFD ; 253 18254: 80 93 d2 03 sts 0x03D2, r24 ; 0x8003d2 18258: 0c 94 95 b2 jmp 0x1652a ; 0x1652a // 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); 1825c: 8f ef ldi r24, 0xFF ; 255 1825e: 0f 94 f6 43 call 0x287ec ; 0x287ec wait(30000); 18262: 80 e3 ldi r24, 0x30 ; 48 18264: 95 e7 ldi r25, 0x75 ; 117 18266: 0f 94 f5 50 call 0x2a1ea ; 0x2a1ea 1826a: ea e0 ldi r30, 0x0A ; 10 1826c: 6e 2e mov r6, r30 1826e: e3 e1 ldi r30, 0x13 ; 19 18270: 7e 2e mov r7, r30 18272: 1f ef ldi r17, 0xFF ; 255 18274: ff e0 ldi r31, 0x0F ; 15 18276: af 2e mov r10, r31 18278: 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; 1827a: 21 2c mov r2, r1 1827c: 31 2c mov r3, r1 1827e: a0 ec ldi r26, 0xC0 ; 192 18280: 4a 2e mov r4, r26 18282: af e7 ldi r26, 0x7F ; 127 18284: 5a 2e mov r5, r26 18286: f3 01 movw r30, r6 18288: 20 82 st Z, r2 1828a: 31 82 std Z+1, r3 ; 0x01 1828c: 42 82 std Z+2, r4 ; 0x02 1828e: 53 82 std Z+3, r5 ; 0x03 uint8_t speed = 256 / THERMAL_MODEL_R_SIZE * (i + 1) - 1; set_fan_speed(speed); 18290: 81 2f mov r24, r17 18292: 0f 94 f6 43 call 0x287ec ; 0x287ec wait(10000); 18296: 80 e1 ldi r24, 0x10 ; 16 18298: 97 e2 ldi r25, 0x27 ; 39 1829a: 0f 94 f5 50 call 0x2a1ea ; 0x2a1ea sprintf_P(tm_message, PSTR("TM: R[%u] estimate."), (unsigned)i); 1829e: bf 92 push r11 182a0: af 92 push r10 182a2: 21 ed ldi r18, 0xD1 ; 209 182a4: 34 e8 ldi r19, 0x84 ; 132 182a6: 3f 93 push r19 182a8: 2f 93 push r18 182aa: 9f 92 push r9 182ac: 8f 92 push r8 182ae: 0f 94 a8 dc call 0x3b950 ; 0x3b950 lcd_setstatus_serial(tm_message); 182b2: c4 01 movw r24, r8 182b4: 0f 94 d9 0b call 0x217b2 ; 0x217b2 samples = record(); 182b8: 0f 94 09 1e call 0x23c12 ; 0x23c12 if(temp_error_state.v || !samples) 182bc: 20 91 1e 05 lds r18, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 182c0: 0f 90 pop r0 182c2: 0f 90 pop r0 182c4: 0f 90 pop r0 182c6: 0f 90 pop r0 182c8: 0f 90 pop r0 182ca: 0f 90 pop r0 182cc: 21 11 cpse r18, r1 182ce: 7f cf rjmp .-258 ; 0x181ce 182d0: 00 97 sbiw r24, 0x00 ; 0 182d2: 09 f4 brne .+2 ; 0x182d6 182d4: 7c cf rjmp .-264 ; 0x181ce 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], 182d6: c0 90 53 06 lds r12, 0x0653 ; 0x800653 182da: d0 90 54 06 lds r13, 0x0654 ; 0x800654 182de: e0 90 55 06 lds r14, 0x0655 ; 0x800655 182e2: f0 90 56 06 lds r15, 0x0656 ; 0x800656 182e6: 20 91 ce 12 lds r18, 0x12CE ; 0x8012ce <_ZN13thermal_modelL4dataE.lto_priv.396+0x40> 182ea: 30 91 cf 12 lds r19, 0x12CF ; 0x8012cf <_ZN13thermal_modelL4dataE.lto_priv.396+0x41> 182ee: 40 91 d0 12 lds r20, 0x12D0 ; 0x8012d0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x42> 182f2: 50 91 d1 12 lds r21, 0x12D1 ; 0x8012d1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x43> 182f6: 0a 2d mov r16, r10 182f8: b3 01 movw r22, r6 182fa: 0e 94 36 dd call 0x1ba6c ; 0x1ba6c 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)) 182fe: 9b 01 movw r18, r22 18300: ac 01 movw r20, r24 18302: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 18306: 81 11 cpse r24, r1 18308: 62 cf rjmp .-316 ; 0x181ce 1830a: 54 e0 ldi r21, 0x04 ; 4 1830c: a5 1a sub r10, r21 1830e: b1 08 sbc r11, r1 18310: 80 e1 ldi r24, 0x10 ; 16 18312: 68 1a sub r6, r24 18314: 71 08 sbc r7, r1 18316: 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) { 18318: 9f ef ldi r25, 0xFF ; 255 1831a: a9 16 cp r10, r25 1831c: b9 06 cpc r11, r25 1831e: 09 f0 breq .+2 ; 0x18322 18320: b2 cf rjmp .-156 ; 0x18286 18322: 66 e0 ldi r22, 0x06 ; 6 18324: e6 2e mov r14, r22 18326: 63 e1 ldi r22, 0x13 ; 19 18328: f6 2e mov r15, r22 1832a: 0e e0 ldi r16, 0x0E ; 14 1832c: 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; 1832e: 7f e0 ldi r23, 0x0F ; 15 18330: 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)) { 18332: 8f e0 ldi r24, 0x0F ; 15 18334: 90 e0 ldi r25, 0x00 ; 0 18336: 80 1b sub r24, r16 18338: 91 0b sbc r25, r17 1833a: 83 70 andi r24, 0x03 ; 3 1833c: 99 27 eor r25, r25 1833e: 89 2b or r24, r25 18340: 59 f4 brne .+22 ; 0x18358 next = i; 18342: 30 2e mov r3, r16 18344: 01 50 subi r16, 0x01 ; 1 18346: 11 09 sbc r17, r1 18348: f4 e0 ldi r31, 0x04 ; 4 1834a: ef 1a sub r14, r31 1834c: 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) { 1834e: 01 15 cp r16, r1 18350: 11 05 cpc r17, r1 18352: 79 f7 brne .-34 ; 0x18332 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; 18354: 80 e0 ldi r24, 0x00 ; 0 18356: 3c cf rjmp .-392 ; 0x181d0 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; 18358: 8c ef ldi r24, 0xFC ; 252 1835a: 83 0d add r24, r3 if(prev < 0) prev = 0; float f = (float)(i - prev) / THERMAL_MODEL_CAL_R_STEP; 1835c: 87 fd sbrc r24, 7 1835e: 80 e0 ldi r24, 0x00 ; 0 18360: 08 2e mov r0, r24 18362: 00 0c add r0, r0 18364: 99 0b sbc r25, r25 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 18366: fc 01 movw r30, r24 18368: ee 0f add r30, r30 1836a: ff 1f adc r31, r31 1836c: ee 0f add r30, r30 1836e: ff 1f adc r31, r31 18370: e2 53 subi r30, 0x32 ; 50 18372: fd 4e sbci r31, 0xED ; 237 18374: 40 80 ld r4, Z 18376: 51 80 ldd r5, Z+1 ; 0x01 18378: 62 80 ldd r6, Z+2 ; 0x02 1837a: 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; 1837c: b8 01 movw r22, r16 1837e: 68 1b sub r22, r24 18380: 79 0b sbc r23, r25 18382: 07 2e mov r0, r23 18384: 00 0c add r0, r0 18386: 88 0b sbc r24, r24 18388: 99 0b sbc r25, r25 1838a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1838e: 20 e0 ldi r18, 0x00 ; 0 18390: 30 e0 ldi r19, 0x00 ; 0 18392: 40 e8 ldi r20, 0x80 ; 128 18394: 5e e3 ldi r21, 0x3E ; 62 18396: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1839a: 5b 01 movw r10, r22 1839c: 6c 01 movw r12, r24 float d = (thermal_model::data.R[next] - thermal_model::data.R[prev]); 1839e: a3 2d mov r26, r3 183a0: b4 e0 ldi r27, 0x04 ; 4 183a2: ab 02 muls r26, r27 183a4: f0 01 movw r30, r0 183a6: 11 24 eor r1, r1 183a8: e2 53 subi r30, 0x32 ; 50 183aa: fd 4e sbci r31, 0xED ; 237 183ac: a3 01 movw r20, r6 183ae: 92 01 movw r18, r4 183b0: 60 81 ld r22, Z 183b2: 71 81 ldd r23, Z+1 ; 0x01 183b4: 82 81 ldd r24, Z+2 ; 0x02 183b6: 93 81 ldd r25, Z+3 ; 0x03 183b8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 183bc: 9b 01 movw r18, r22 183be: ac 01 movw r20, r24 thermal_model::data.R[i] = thermal_model::data.R[prev] + d * f; 183c0: c6 01 movw r24, r12 183c2: b5 01 movw r22, r10 183c4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 183c8: a3 01 movw r20, r6 183ca: 92 01 movw r18, r4 183cc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 183d0: f7 01 movw r30, r14 183d2: 60 83 st Z, r22 183d4: 71 83 std Z+1, r23 ; 0x01 183d6: 82 83 std Z+2, r24 ; 0x02 183d8: 93 83 std Z+3, r25 ; 0x03 183da: b4 cf rjmp .-152 ; 0x18344 // 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); 183dc: 88 e0 ldi r24, 0x08 ; 8 183de: 0e 94 66 e7 call 0x1cecc ; 0x1cecc lcd_setstatuspgm(MSG_WELCOME); 183e2: 8a e6 ldi r24, 0x6A ; 106 183e4: 90 e7 ldi r25, 0x70 ; 112 183e6: 0f 94 ea 0b call 0x217d4 ; 0x217d4 thermal_model_cal::set_fan_speed(0); 183ea: 80 e0 ldi r24, 0x00 ; 0 183ec: 0f 94 f6 43 call 0x287ec ; 0x287ec thermal_model_set_enabled(orig_enabled); 183f0: 67 96 adiw r28, 0x17 ; 23 183f2: 8f ad ldd r24, Y+63 ; 0x3f 183f4: 67 97 sbiw r28, 0x17 ; 23 183f6: 0f 94 81 48 call 0x29102 ; 0x29102 thermal_model_report_settings(); 183fa: 0f 94 00 44 call 0x28800 ; 0x28800 183fe: 25 cf rjmp .-438 ; 0x1824a M400 */ case 400: { st_synchronize(); 18400: 0f 94 2c 59 call 0x2b258 ; 0x2b258 18404: 0c 94 95 b2 jmp 0x1652a ; 0x1652a */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 18408: 81 e0 ldi r24, 0x01 ; 1 1840a: 0e 94 b4 75 call 0xeb68 ; 0xeb68 1840e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 18412: 0e 94 e6 80 call 0x101cc ; 0x101cc 18416: 0c 94 95 b2 jmp 0x1652a ; 0x1652a M500 */ case 500: { Config_StoreSettings(); 1841a: 0e 94 cf 83 call 0x1079e ; 0x1079e 1841e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a M501 */ case 501: { Config_RetrieveSettings(); 18422: 0e 94 59 95 call 0x12ab2 ; 0x12ab2 18426: 0c 94 95 b2 jmp 0x1652a ; 0x1652a M502 */ case 502: { Config_ResetDefault(); 1842a: 0e 94 b7 83 call 0x1076e ; 0x1076e 1842e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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); 18432: 1f 93 push r17 18434: 0f 93 push r16 18436: 81 e5 ldi r24, 0x51 ; 81 18438: 90 e8 ldi r25, 0x80 ; 128 1843a: 9f 93 push r25 1843c: 8f 93 push r24 1843e: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 18442: 0f 90 pop r0 18444: 0f 90 pop r0 18446: 0f 90 pop r0 18448: 0f 90 pop r0 1844a: 0c 94 df b0 jmp 0x161be ; 0x161be M509 */ case 509: { lang_reset(); 1844e: 0e 94 e1 71 call 0xe3c2 ; 0xe3c2 SERIAL_ECHO_START; 18452: 82 ef ldi r24, 0xF2 ; 242 18454: 99 ea ldi r25, 0xA9 ; 169 18456: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 1845a: 80 e5 ldi r24, 0x50 ; 80 1845c: 97 e8 ldi r25, 0x87 ; 135 1845e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 18462: 0c 94 95 b2 jmp 0x1652a ; 0x1652a - `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(); 18466: 0f 94 2c 59 call 0x2b258 ; 0x2b258 /// 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; 1846a: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 1846e: 81 11 cpse r24, r1 18470: 02 c0 rjmp .+4 ; 0x18476 18472: 0e 94 fe 64 call 0xc9fc ; 0xc9fc 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(); 18476: 85 e4 ldi r24, 0x45 ; 69 18478: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 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; 1847c: 81 2c mov r8, r1 1847e: 91 2c mov r9, r1 18480: a1 2c mov r10, r1 18482: 20 ec ldi r18, 0xC0 ; 192 18484: 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(); 18486: 88 23 and r24, r24 18488: 21 f0 breq .+8 ; 0x18492 1848a: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 1848e: 4b 01 movw r8, r22 18490: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 18492: 8c e4 ldi r24, 0x4C ; 76 18494: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 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; 18498: c1 2c mov r12, r1 1849a: d1 2c mov r13, r1 1849c: 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(); 1849e: 88 23 and r24, r24 184a0: 21 f0 breq .+8 ; 0x184aa 184a2: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 184a6: 6b 01 movw r12, r22 184a8: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 184aa: 8a e5 ldi r24, 0x5A ; 90 184ac: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 // 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; 184b0: 41 2c mov r4, r1 184b2: 51 2c mov r5, r1 184b4: 98 ed ldi r25, 0xD8 ; 216 184b6: 69 2e mov r6, r25 184b8: 91 e4 ldi r25, 0x41 ; 65 184ba: 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()); 184bc: 88 23 and r24, r24 184be: 31 f0 breq .+12 ; 0x184cc 184c0: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 184c4: 2b 01 movw r4, r22 184c6: 3c 01 movw r6, r24 184c8: e8 94 clt 184ca: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 184cc: 88 e5 ldi r24, 0x58 ; 88 184ce: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 184d2: 88 23 and r24, r24 184d4: 09 f4 brne .+2 ; 0x184d8 184d6: ba c1 rjmp .+884 ; 0x1884c 184d8: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 184dc: 6a 96 adiw r28, 0x1a ; 26 184de: 6c af std Y+60, r22 ; 0x3c 184e0: 7d af std Y+61, r23 ; 0x3d 184e2: 8e af std Y+62, r24 ; 0x3e 184e4: 9f af std Y+63, r25 ; 0x3f 184e6: 6a 97 sbiw r28, 0x1a ; 26 if (code_seen('Y')) y_position = code_value(); 184e8: 89 e5 ldi r24, 0x59 ; 89 184ea: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 184ee: 88 23 and r24, r24 184f0: 09 f4 brne .+2 ; 0x184f4 184f2: b7 c1 rjmp .+878 ; 0x18862 184f4: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 184f8: 6e 96 adiw r28, 0x1e ; 30 184fa: 6c af std Y+60, r22 ; 0x3c 184fc: 7d af std Y+61, r23 ; 0x3d 184fe: 8e af std Y+62, r24 ; 0x3e 18500: 9f af std Y+63, r25 ; 0x3f 18502: 6e 97 sbiw r28, 0x1e ; 30 // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 18504: 1a 82 std Y+2, r1 ; 0x02 18506: 19 82 std Y+1, r1 ; 0x01 18508: fe 01 movw r30, r28 1850a: 33 96 adiw r30, 0x03 ; 3 1850c: 83 e1 ldi r24, 0x13 ; 19 1850e: df 01 movw r26, r30 18510: 1d 92 st X+, r1 18512: 8a 95 dec r24 18514: e9 f7 brne .-6 ; 0x18510 if (code_seen('C')) { 18516: 83 e4 ldi r24, 0x43 ; 67 18518: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1851c: 88 23 and r24, r24 1851e: f9 f0 breq .+62 ; 0x1855e , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 18520: 62 e2 ldi r22, 0x22 ; 34 18522: 70 e0 ldi r23, 0x00 ; 0 18524: 80 91 97 03 lds r24, 0x0397 ; 0x800397 18528: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1852c: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 18530: 8c 01 movw r16, r24 if (!this->ptr) { 18532: 89 2b or r24, r25 18534: a1 f0 breq .+40 ; 0x1855e // First quote not found return; } // Skip the leading quote this->ptr++; 18536: 0f 5f subi r16, 0xFF ; 255 18538: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 1853a: 62 e2 ldi r22, 0x22 ; 34 1853c: 70 e0 ldi r23, 0x00 ; 0 1853e: c8 01 movw r24, r16 18540: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 if(!pStrEnd) { 18544: 00 97 sbiw r24, 0x00 ; 0 18546: 59 f0 breq .+22 ; 0x1855e // Second quote not found return; } this->len = pStrEnd - this->ptr; 18548: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 1854a: 84 31 cpi r24, 0x14 ; 20 1854c: 08 f0 brcs .+2 ; 0x18550 1854e: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 18550: 48 2f mov r20, r24 18552: 50 e0 ldi r21, 0x00 ; 0 18554: b8 01 movw r22, r16 18556: ce 01 movw r24, r28 18558: 01 96 adiw r24, 0x01 ; 1 1855a: 0f 94 ba e3 call 0x3c774 ; 0x3c774 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 1855e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 float x_position = FILAMENTCHANGE_XPOS; float y_position = FILAMENTCHANGE_YPOS; float z_shift = MIN_Z_FOR_SWAP; float e_shift_init = FILAMENTCHANGE_FIRSTRETRACT; float e_shift_late = FILAMENTCHANGE_FINALRETRACT; bool automatic = false; 18562: 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"))) 18564: 81 30 cpi r24, 0x01 ; 1 18566: 29 f4 brne .+10 ; 0x18572 18568: 8b e4 ldi r24, 0x4B ; 75 1856a: 97 e8 ldi r25, 0x87 ; 135 1856c: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 18570: 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(); 18572: 0f 94 2c 59 call 0x2b258 ; 0x2b258 uint8_t eject_slot = 0; prusa_statistics(22); // Turn off the fan fanSpeed = 0; 18576: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // Retract E if (!printingIsPaused()) 1857a: 0e 94 3a 68 call 0xd074 ; 0xd074 1857e: 81 11 cpse r24, r1 18580: 77 c1 rjmp .+750 ; 0x18870 { current_position[E_AXIS] += e_shift; 18582: a5 01 movw r20, r10 18584: 94 01 movw r18, r8 18586: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 1858a: 70 91 50 07 lds r23, 0x0750 ; 0x800750 1858e: 80 91 51 07 lds r24, 0x0751 ; 0x800751 18592: 90 91 52 07 lds r25, 0x0752 ; 0x800752 18596: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1859a: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 1859e: 70 93 50 07 sts 0x0750, r23 ; 0x800750 185a2: 80 93 51 07 sts 0x0751, r24 ; 0x800751 185a6: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 185aa: 60 e0 ldi r22, 0x00 ; 0 185ac: 70 e0 ldi r23, 0x00 ; 0 185ae: 88 ee ldi r24, 0xE8 ; 232 185b0: 92 e4 ldi r25, 0x42 ; 66 185b2: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 185b6: 0f 94 2c 59 call 0x2b258 ; 0x2b258 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 185ba: 86 e2 ldi r24, 0x26 ; 38 185bc: 9f e6 ldi r25, 0x6F ; 111 185be: 0e 94 06 7b call 0xf60c ; 0xf60c // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 185c2: c3 01 movw r24, r6 185c4: b2 01 movw r22, r4 185c6: 0e 94 96 6e call 0xdd2c ; 0xdd2c // Move XY to side current_position[X_AXIS] = x_position; 185ca: 6a 96 adiw r28, 0x1a ; 26 185cc: 2c ad ldd r18, Y+60 ; 0x3c 185ce: 3d ad ldd r19, Y+61 ; 0x3d 185d0: 4e ad ldd r20, Y+62 ; 0x3e 185d2: 5f ad ldd r21, Y+63 ; 0x3f 185d4: 6a 97 sbiw r28, 0x1a ; 26 185d6: 20 93 43 07 sts 0x0743, r18 ; 0x800743 185da: 30 93 44 07 sts 0x0744, r19 ; 0x800744 185de: 40 93 45 07 sts 0x0745, r20 ; 0x800745 185e2: 50 93 46 07 sts 0x0746, r21 ; 0x800746 current_position[Y_AXIS] = y_position; 185e6: 6e 96 adiw r28, 0x1e ; 30 185e8: 8c ad ldd r24, Y+60 ; 0x3c 185ea: 9d ad ldd r25, Y+61 ; 0x3d 185ec: ae ad ldd r26, Y+62 ; 0x3e 185ee: bf ad ldd r27, Y+63 ; 0x3f 185f0: 6e 97 sbiw r28, 0x1e ; 30 185f2: 80 93 47 07 sts 0x0747, r24 ; 0x800747 185f6: 90 93 48 07 sts 0x0748, r25 ; 0x800748 185fa: a0 93 49 07 sts 0x0749, r26 ; 0x800749 185fe: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 18602: 60 e0 ldi r22, 0x00 ; 0 18604: 70 e0 ldi r23, 0x00 ; 0 18606: 88 e4 ldi r24, 0x48 ; 72 18608: 92 e4 ldi r25, 0x42 ; 66 1860a: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1860e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 bool repeat = false; 18612: 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; 18614: 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)); 18616: 0a e9 ldi r16, 0x9A ; 154 18618: 20 2e mov r2, r16 1861a: 0f e7 ldi r16, 0x7F ; 127 1861c: 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)); 1861e: 82 ea ldi r24, 0xA2 ; 162 18620: 88 2e mov r8, r24 18622: 8f e7 ldi r24, 0x7F ; 127 18624: 98 2e mov r9, r24 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 18626: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1862a: 81 30 cpi r24, 0x01 ; 1 1862c: 09 f0 breq .+2 ; 0x18630 1862e: 23 c1 rjmp .+582 ; 0x18876 eject_slot = MMU2::mmu2.get_current_tool(); 18630: 0f 94 dd 76 call 0x2edba ; 0x2edba 18634: a8 2e mov r10, r24 mmu_M600_unload_filament(); 18636: 0e 94 cc 73 call 0xe798 ; 0xe798 } 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 1863a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1863e: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 18642: 10 92 89 17 sts 0x1789, r1 ; 0x801789 FSensorBlockRunout fsBlockRunout; if (!MMU2::mmu2.Enabled()) 18646: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1864a: 81 30 cpi r24, 0x01 ; 1 1864c: 09 f4 brne .+2 ; 0x18650 1864e: e1 c1 rjmp .+962 ; 0x18a12 { KEEPALIVE_STATE(PAUSED_FOR_USER); 18650: 84 e0 ldi r24, 0x04 ; 4 18652: 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); 18656: 81 e2 ldi r24, 0x21 ; 33 18658: 99 e3 ldi r25, 0x39 ; 57 1865a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1865e: 40 e0 ldi r20, 0x00 ; 0 18660: 60 e0 ldi r22, 0x00 ; 0 18662: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 18666: 08 2f mov r16, r24 lcd_update_enable(false); 18668: 80 e0 ldi r24, 0x00 ; 0 1866a: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 1866e: 01 30 cpi r16, 0x01 ; 1 18670: 29 f5 brne .+74 ; 0x186bc lcd_clear(); 18672: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18676: 89 e9 ldi r24, 0x99 ; 153 18678: 99 e3 ldi r25, 0x39 ; 57 1867a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1867e: ac 01 movw r20, r24 18680: 62 e0 ldi r22, 0x02 ; 2 18682: 80 e0 ldi r24, 0x00 ; 0 18684: 0e 94 a9 6f call 0xdf52 ; 0xdf52 current_position[X_AXIS] = 100; 18688: 80 e0 ldi r24, 0x00 ; 0 1868a: 90 e0 ldi r25, 0x00 ; 0 1868c: a8 ec ldi r26, 0xC8 ; 200 1868e: b2 e4 ldi r27, 0x42 ; 66 18690: 80 93 43 07 sts 0x0743, r24 ; 0x800743 18694: 90 93 44 07 sts 0x0744, r25 ; 0x800744 18698: a0 93 45 07 sts 0x0745, r26 ; 0x800745 1869c: b0 93 46 07 sts 0x0746, r27 ; 0x800746 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 186a0: 60 e0 ldi r22, 0x00 ; 0 186a2: 70 e0 ldi r23, 0x00 ; 0 186a4: 88 e4 ldi r24, 0x48 ; 72 186a6: 92 e4 ldi r25, 0x42 ; 66 186a8: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 186ac: 0f 94 2c 59 call 0x2b258 ; 0x2b258 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 186b0: 8f ee ldi r24, 0xEF ; 239 186b2: 98 e3 ldi r25, 0x38 ; 56 186b4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 186b8: 0f 94 0c 36 call 0x26c18 ; 0x26c18 preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 186bc: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 186c0: 8d e7 ldi r24, 0x7D ; 125 186c2: 98 e3 ldi r25, 0x38 ; 56 186c4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 186c8: ac 01 movw r20, r24 186ca: 60 e0 ldi r22, 0x00 ; 0 186cc: 80 e0 ldi r24, 0x00 ; 0 186ce: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(0, 1); 186d2: 61 e0 ldi r22, 0x01 ; 1 186d4: 80 e0 ldi r24, 0x00 ; 0 186d6: 0e 94 95 6f call 0xdf2a ; 0xdf2a if (filament_name[0]) { 186da: 89 81 ldd r24, Y+1 ; 0x01 186dc: 88 23 and r24, r24 186de: 41 f0 breq .+16 ; 0x186f0 lcd_print(filament_name); 186e0: ce 01 movw r24, r28 186e2: 01 96 adiw r24, 0x01 ; 1 186e4: 0e 94 9c 71 call 0xe338 ; 0xe338 lcd_set_cursor(0, 2); 186e8: 62 e0 ldi r22, 0x02 ; 2 186ea: 80 e0 ldi r24, 0x00 ; 0 186ec: 0e 94 95 6f call 0xdf2a ; 0xdf2a } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 186f0: 80 91 89 17 lds r24, 0x1789 ; 0x801789 186f4: 81 11 cpse r24, r1 186f6: 06 c0 rjmp .+12 ; 0x18704 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 186f8: 88 e6 ldi r24, 0x68 ; 104 186fa: 98 e3 ldi r25, 0x38 ; 56 186fc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18700: 0e 94 80 6f call 0xdf00 ; 0xdf00 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); 18704: 84 e0 ldi r24, 0x04 ; 4 18706: 80 93 96 02 sts 0x0296, r24 ; 0x800296 while(!lcd_clicked()) 1870a: 0e 94 b2 71 call 0xe364 ; 0xe364 1870e: 81 11 cpse r24, r1 18710: 10 c0 rjmp .+32 ; 0x18732 { manage_heater(); 18712: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 18716: 81 e0 ldi r24, 0x01 ; 1 18718: 0e 94 e2 8b call 0x117c4 ; 0x117c4 #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 1871c: 80 91 8c 17 lds r24, 0x178C ; 0x80178c 18720: 88 23 and r24, r24 18722: 99 f3 breq .-26 ; 0x1870a Sound_MakeCustom(50,1000,false); 18724: 40 e0 ldi r20, 0x00 ; 0 18726: 68 ee ldi r22, 0xE8 ; 232 18728: 73 e0 ldi r23, 0x03 ; 3 1872a: 82 e3 ldi r24, 0x32 ; 50 1872c: 90 e0 ldi r25, 0x00 ; 0 1872e: 0f 94 a1 6a call 0x2d542 ; 0x2d542 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 18732: 32 e0 ldi r19, 0x02 ; 2 18734: 30 93 96 02 sts 0x0296, r19 ; 0x800296 M600_load_filament_movements(filament_name); 18738: ce 01 movw r24, r28 1873a: 01 96 adiw r24, 0x01 ; 1 1873c: 0e 94 85 73 call 0xe70a ; 0xe70a Sound_MakeCustom(50,1000,false); 18740: 40 e0 ldi r20, 0x00 ; 0 18742: 68 ee ldi r22, 0xE8 ; 232 18744: 73 e0 ldi r23, 0x03 ; 3 18746: 82 e3 ldi r24, 0x32 ; 50 18748: 90 e0 ldi r25, 0x00 ; 0 1874a: 0f 94 a1 6a call 0x2d542 ; 0x2d542 else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); mmu_M600_load_filament(automatic); } if (!automatic) 1874e: 11 11 cpse r17, r1 18750: a6 c1 rjmp .+844 ; 0x18a9e 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); 18752: b4 e0 ldi r27, 0x04 ; 4 18754: bb 2e mov r11, r27 18756: b0 92 96 02 sts 0x0296, r11 ; 0x800296 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 1875a: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 1875e: 89 eb ldi r24, 0xB9 ; 185 18760: 98 e3 ldi r25, 0x38 ; 56 18762: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18766: ac 01 movw r20, r24 18768: 60 e0 ldi r22, 0x00 ; 0 1876a: 81 e0 ldi r24, 0x01 ; 1 1876c: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 18770: 83 ea ldi r24, 0xA3 ; 163 18772: 98 e3 ldi r25, 0x38 ; 56 18774: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18778: ac 01 movw r20, r24 1877a: 61 e0 ldi r22, 0x01 ; 1 1877c: 81 e0 ldi r24, 0x01 ; 1 1877e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 18782: 8f e8 ldi r24, 0x8F ; 143 18784: 98 e3 ldi r25, 0x38 ; 56 18786: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1878a: ac 01 movw r20, r24 1878c: 62 e0 ldi r22, 0x02 ; 2 1878e: 81 e0 ldi r24, 0x01 ; 1 18790: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 18794: 83 eb ldi r24, 0xB3 ; 179 18796: 9b e3 ldi r25, 0x3B ; 59 18798: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1879c: ac 01 movw r20, r24 1879e: 63 e0 ldi r22, 0x03 ; 3 187a0: 81 e0 ldi r24, 0x01 ; 1 187a2: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_putc_at(0, cursor_pos, '>'); 187a6: 4e e3 ldi r20, 0x3E ; 62 187a8: 60 e0 ldi r22, 0x00 ; 0 187aa: 80 e0 ldi r24, 0x00 ; 0 187ac: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_consume_click(); 187b0: 0e 94 ad 71 call 0xe35a ; 0xe35a uint8_t lcd_alright() { uint8_t cursor_pos = 0; 187b4: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 187b6: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 187ba: 81 e0 ldi r24, 0x01 ; 1 187bc: 0e 94 e2 8b call 0x117c4 ; 0x117c4 if (lcd_encoder) 187c0: 80 91 37 05 lds r24, 0x0537 ; 0x800537 187c4: 90 91 38 05 lds r25, 0x0538 ; 0x800538 187c8: 00 97 sbiw r24, 0x00 ; 0 187ca: d9 f0 breq .+54 ; 0x18802 { if (lcd_encoder < 0 ) { 187cc: 97 ff sbrs r25, 7 187ce: 2a c1 rjmp .+596 ; 0x18a24 // Rotating knob counter clockwise if (cursor_pos > 0) 187d0: 00 23 and r16, r16 187d2: 09 f4 brne .+2 ; 0x187d6 187d4: 2b c1 rjmp .+598 ; 0x18a2c cursor_pos--; 187d6: 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 ")); 187d8: 46 ea ldi r20, 0xA6 ; 166 187da: 5f e7 ldi r21, 0x7F ; 127 187dc: 60 e0 ldi r22, 0x00 ; 0 187de: 80 e0 ldi r24, 0x00 ; 0 187e0: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_putc_at(0, cursor_pos, '>'); 187e4: 4e e3 ldi r20, 0x3E ; 62 187e6: 60 2f mov r22, r16 187e8: 80 e0 ldi r24, 0x00 ; 0 187ea: 0e 94 b5 6f call 0xdf6a ; 0xdf6a // Consume rotation event and make feedback sound lcd_encoder = 0; 187ee: 10 92 38 05 sts 0x0538, r1 ; 0x800538 187f2: 10 92 37 05 sts 0x0537, r1 ; 0x800537 _delay(100); 187f6: 64 e6 ldi r22, 0x64 ; 100 187f8: 70 e0 ldi r23, 0x00 ; 0 187fa: 80 e0 ldi r24, 0x00 ; 0 187fc: 90 e0 ldi r25, 0x00 ; 0 187fe: 0f 94 92 3d call 0x27b24 ; 0x27b24 } if (lcd_clicked()) 18802: 0e 94 b2 71 call 0xe364 ; 0xe364 18806: 88 23 and r24, r24 18808: b1 f2 breq .-84 ; 0x187b6 { lcd_clear(); 1880a: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_return_to_status(); 1880e: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 18812: 42 e0 ldi r20, 0x02 ; 2 18814: 40 93 96 02 sts 0x0296, r20 ; 0x800296 switch(lcd_change_filament_state) 18818: 02 30 cpi r16, 0x02 ; 2 1881a: 09 f4 brne .+2 ; 0x1881e 1881c: 10 c1 rjmp .+544 ; 0x18a3e 1881e: 03 30 cpi r16, 0x03 ; 3 18820: 09 f4 brne .+2 ; 0x18824 18822: f7 c1 rjmp .+1006 ; 0x18c12 18824: 01 30 cpi r16, 0x01 ; 1 18826: 09 f0 breq .+2 ; 0x1882a 18828: 29 c1 rjmp .+594 ; 0x18a7c { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 1882a: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1882e: 81 30 cpi r24, 0x01 ; 1 18830: 09 f0 breq .+2 ; 0x18834 18832: 00 c1 rjmp .+512 ; 0x18a34 uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 18834: 0f 94 dd 76 call 0x2edba ; 0x2edba 18838: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 1883a: 0e 94 cc 73 call 0xe798 ; 0xe798 // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 1883e: 80 2f mov r24, r16 18840: 0e 94 aa 8e call 0x11d54 ; 0x11d54 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 18844: 80 e0 ldi r24, 0x00 ; 0 18846: 0e 94 99 79 call 0xf332 ; 0xf332 1884a: 85 cf rjmp .-246 ; 0x18756 // 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; 1884c: 20 e0 ldi r18, 0x00 ; 0 1884e: 30 e0 ldi r19, 0x00 ; 0 18850: 43 e5 ldi r20, 0x53 ; 83 18852: 53 e4 ldi r21, 0x43 ; 67 18854: 6a 96 adiw r28, 0x1a ; 26 18856: 2c af std Y+60, r18 ; 0x3c 18858: 3d af std Y+61, r19 ; 0x3d 1885a: 4e af std Y+62, r20 ; 0x3e 1885c: 5f af std Y+63, r21 ; 0x3f 1885e: 6a 97 sbiw r28, 0x1a ; 26 18860: 43 ce rjmp .-890 ; 0x184e8 float y_position = FILAMENTCHANGE_YPOS; 18862: 6e 96 adiw r28, 0x1e ; 30 18864: 1c ae std Y+60, r1 ; 0x3c 18866: 1d ae std Y+61, r1 ; 0x3d 18868: 1e ae std Y+62, r1 ; 0x3e 1886a: 1f ae std Y+63, r1 ; 0x3f 1886c: 6e 97 sbiw r28, 0x1e ; 30 1886e: 4a ce rjmp .-876 ; 0x18504 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(); 18870: 0e 94 7e 65 call 0xcafc ; 0xcafc 18874: a6 ce rjmp .-692 ; 0x185c2 //! //! 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); 18876: 84 e0 ldi r24, 0x04 ; 4 18878: 80 93 96 02 sts 0x0296, r24 ; 0x800296 unsigned long waiting_start_time = _millis(); 1887c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 18880: 2b 01 movw r4, r22 18882: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 18884: 8d e3 ldi r24, 0x3D ; 61 18886: 98 e3 ldi r25, 0x38 ; 56 18888: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1888c: 0f 94 85 35 call 0x26b0a ; 0x26b0a while (!(wait_for_user_state == 0 && lcd_clicked())){ 18890: 0e 94 b2 71 call 0xe364 ; 0xe364 18894: 08 2f mov r16, r24 18896: 81 11 cpse r24, r1 18898: 38 c0 rjmp .+112 ; 0x1890a 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) { 1889a: a3 01 movw r20, r6 1889c: 92 01 movw r18, r4 1889e: 20 54 subi r18, 0x40 ; 64 188a0: 38 4d sbci r19, 0xD8 ; 216 188a2: 46 4f sbci r20, 0xF6 ; 246 188a4: 5f 4f sbci r21, 0xFF ; 255 188a6: 6a 96 adiw r28, 0x1a ; 26 188a8: 2c af std Y+60, r18 ; 0x3c 188aa: 3d af std Y+61, r19 ; 0x3d 188ac: 4e af std Y+62, r20 ; 0x3e 188ae: 5f af std Y+63, r21 ; 0x3f 188b0: 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(); 188b2: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 188b6: 81 e0 ldi r24, 0x01 ; 1 188b8: 0e 94 e2 8b call 0x117c4 ; 0x117c4 if (wait_for_user_state != 2) sound_wait_for_user(); 188bc: 02 30 cpi r16, 0x02 ; 2 188be: 09 f4 brne .+2 ; 0x188c2 188c0: 67 c0 rjmp .+206 ; 0x18990 188c2: 0f 94 45 6b call 0x2d68a ; 0x2d68a 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); 188c6: 84 e0 ldi r24, 0x04 ; 4 188c8: 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) { 188ca: 01 30 cpi r16, 0x01 ; 1 188cc: 39 f1 breq .+78 ; 0x1891c case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 188ce: 0e 94 87 8e call 0x11d0e ; 0x11d0e if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 188d2: 0f 94 8b 3f call 0x27f16 ; 0x27f16 188d6: 6a 96 adiw r28, 0x1a ; 26 188d8: 2c ad ldd r18, Y+60 ; 0x3c 188da: 3d ad ldd r19, Y+61 ; 0x3d 188dc: 4e ad ldd r20, Y+62 ; 0x3e 188de: 5f ad ldd r21, Y+63 ; 0x3f 188e0: 6a 97 sbiw r28, 0x1a ; 26 188e2: 26 17 cp r18, r22 188e4: 37 07 cpc r19, r23 188e6: 48 07 cpc r20, r24 188e8: 59 07 cpc r21, r25 188ea: 90 f6 brcc .-92 ; 0x18890 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 188ec: 8c e0 ldi r24, 0x0C ; 12 188ee: 98 e3 ldi r25, 0x38 ; 56 188f0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 188f4: 0f 94 85 35 call 0x26b0a ; 0x26b0a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 188f8: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 188fc: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 18900: 0f 94 2c 59 call 0x2b258 ; 0x2b258 disable_e0(); 18904: 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; 18906: 01 e0 ldi r16, 0x01 ; 1 18908: d4 cf rjmp .-88 ; 0x188b2 1890a: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL10beep_timer.lto_priv.513> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 1890e: 10 92 6f 05 sts 0x056F, r1 ; 0x80056f <_ZL6bFirst.lto_priv.514> eject_slot = MMU2::mmu2.get_current_tool(); mmu_M600_unload_filament(); } else { // Beep, manage nozzle heater and wait for user to start unload filament M600_wait_for_user(); unload_filament(e_shift_late); 18912: c7 01 movw r24, r14 18914: b6 01 movw r22, r12 18916: 0f 94 d7 16 call 0x22dae ; 0x22dae 1891a: 8f ce rjmp .-738 ; 0x1863a 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); 1891c: 0e 94 87 8e call 0x11d0e ; 0x11d0e if (lcd_clicked()) { 18920: 0e 94 b2 71 call 0xe364 ; 0xe364 18924: 88 23 and r24, r24 18926: 29 f2 breq .-118 ; 0x188b2 18928: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad 1892c: 90 91 ae 05 lds r25, 0x05AE ; 0x8005ae 18930: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 18934: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d return target_temp_reached; } #endif //PINDA_THERMISTOR void lcd_wait_for_heater() { lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 18938: 8c e6 ldi r24, 0x6C ; 108 1893a: 9f e4 ldi r25, 0x4F ; 79 1893c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18940: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 18944: 42 e8 ldi r20, 0x82 ; 130 18946: 64 e0 ldi r22, 0x04 ; 4 18948: 80 e0 ldi r24, 0x00 ; 0 1894a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 1894e: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 18952: 8f 93 push r24 18954: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 18958: 8f 93 push r24 1895a: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 1895e: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 18962: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 18966: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 1896a: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 1896e: 7f 93 push r23 18970: 6f 93 push r22 18972: 3f 92 push r3 18974: 2f 92 push r2 18976: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(LCD_STR_DEGREE[0]); 1897a: 81 e8 ldi r24, 0x81 ; 129 1897c: 0e 94 84 6f call 0xdf08 ; 0xdf08 18980: 0f 90 pop r0 18982: 0f 90 pop r0 18984: 0f 90 pop r0 18986: 0f 90 pop r0 18988: 0f 90 pop r0 1898a: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 1898c: 02 e0 ldi r16, 0x02 ; 2 1898e: 91 cf rjmp .-222 ; 0x188b2 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 18990: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 18994: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 18998: 07 2e mov r0, r23 1899a: 00 0c add r0, r0 1899c: 88 0b sbc r24, r24 1899e: 99 0b sbc r25, r25 189a0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 189a4: 20 91 61 0e lds r18, 0x0E61 ; 0x800e61 189a8: 30 91 62 0e lds r19, 0x0E62 ; 0x800e62 189ac: 40 91 63 0e lds r20, 0x0E63 ; 0x800e63 189b0: 50 91 64 0e lds r21, 0x0E64 ; 0x800e64 189b4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 189b8: 9f 77 andi r25, 0x7F ; 127 189ba: 20 e0 ldi r18, 0x00 ; 0 189bc: 30 e0 ldi r19, 0x00 ; 0 189be: 40 ea ldi r20, 0xA0 ; 160 189c0: 50 e4 ldi r21, 0x40 ; 64 189c2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 189c6: 87 ff sbrs r24, 7 189c8: 0b c0 rjmp .+22 ; 0x189e0 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 189ca: 8d e3 ldi r24, 0x3D ; 61 189cc: 98 e3 ldi r25, 0x38 ; 56 189ce: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 189d2: 0f 94 85 35 call 0x26b0a ; 0x26b0a waiting_start_time = _millis(); 189d6: 0f 94 8b 3f call 0x27f16 ; 0x27f16 189da: 2b 01 movw r4, r22 189dc: 3c 01 movw r6, r24 189de: 58 cf rjmp .-336 ; 0x18890 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 189e0: 64 e0 ldi r22, 0x04 ; 4 189e2: 81 e0 ldi r24, 0x01 ; 1 189e4: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 189e8: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 189ec: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 189f0: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 189f4: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 189f8: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 189fc: 7f 93 push r23 189fe: 6f 93 push r22 18a00: 9f 92 push r9 18a02: 8f 92 push r8 18a04: 0e 94 6e 6f call 0xdedc ; 0xdedc 18a08: 0f 90 pop r0 18a0a: 0f 90 pop r0 18a0c: 0f 90 pop r0 18a0e: 0f 90 pop r0 18a10: 50 cf rjmp .-352 ; 0x188b2 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 18a12: 11 11 cpse r17, r1 18a14: 03 c0 rjmp .+6 ; 0x18a1c 18a16: 8a 2d mov r24, r10 18a18: 0e 94 aa 8e call 0x11d54 ; 0x11d54 mmu_M600_load_filament(automatic); 18a1c: 81 2f mov r24, r17 18a1e: 0e 94 99 79 call 0xf332 ; 0xf332 18a22: 95 ce rjmp .-726 ; 0x1874e cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 18a24: 03 30 cpi r16, 0x03 ; 3 18a26: 10 f4 brcc .+4 ; 0x18a2c cursor_pos++; 18a28: 0f 5f subi r16, 0xFF ; 255 18a2a: d6 ce rjmp .-596 ; 0x187d8 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 18a2c: 87 e0 ldi r24, 0x07 ; 7 18a2e: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe 18a32: d2 ce rjmp .-604 ; 0x187d8 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); 18a34: ce 01 movw r24, r28 18a36: 01 96 adiw r24, 0x01 ; 1 18a38: 0e 94 85 73 call 0xe70a ; 0xe70a 18a3c: 8c ce rjmp .-744 ; 0x18756 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 18a3e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 load_filament_final_feed(); 18a42: 0e 94 48 65 call 0xca90 ; 0xca90 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(); 18a46: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 18a4a: 8d ec ldi r24, 0xCD ; 205 18a4c: 98 e3 ldi r25, 0x38 ; 56 18a4e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18a52: ac 01 movw r20, r24 18a54: 60 e0 ldi r22, 0x00 ; 0 18a56: 80 e0 ldi r24, 0x00 ; 0 18a58: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 18a5c: 89 e9 ldi r24, 0x99 ; 153 18a5e: 99 e3 ldi r25, 0x39 ; 57 18a60: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18a64: ac 01 movw r20, r24 18a66: 62 e0 ldi r22, 0x02 ; 2 18a68: 80 e0 ldi r24, 0x00 ; 0 18a6a: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 18a6e: 87 e9 ldi r24, 0x97 ; 151 18a70: 9d e1 ldi r25, 0x1D ; 29 18a72: 0f 94 d0 36 call 0x26da0 ; 0x26da0 lcd_loading_color(); st_synchronize(); 18a76: 0f 94 2c 59 call 0x2b258 ; 0x2b258 18a7a: 6d ce rjmp .-806 ; 0x18756 } void lcd_change_success() { lcd_clear(); 18a7c: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 18a80: 8d ed ldi r24, 0xDD ; 221 18a82: 98 e3 ldi r25, 0x38 ; 56 18a84: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18a88: ac 01 movw r20, r24 18a8a: 62 e0 ldi r22, 0x02 ; 2 18a8c: 80 e0 ldi r24, 0x00 ; 0 18a8e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 //! @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) 18a92: 00 23 and r16, r16 18a94: 19 f0 breq .+6 ; 0x18a9c 18a96: 03 30 cpi r16, 0x03 ; 3 18a98: 09 f0 breq .+2 ; 0x18a9c 18a9a: 5d ce rjmp .-838 ; 0x18756 default: lcd_change_success(); break; } } return false; 18a9c: 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(); } 18a9e: 88 e8 ldi r24, 0x88 ; 136 18aa0: 97 e1 ldi r25, 0x17 ; 23 18aa2: 0e 94 84 75 call 0xeb08 ; 0xeb08 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 18aa6: b1 10 cpse r11, r1 18aa8: be cd rjmp .-1156 ; 0x18626 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 18aaa: 81 e0 ldi r24, 0x01 ; 1 18aac: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 // Not let's go back to print fanSpeed = saved_fan_speed; 18ab0: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 18ab4: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 // Feed a little of filament to stabilize pressure if (!automatic) { 18ab8: 11 11 cpse r17, r1 18aba: 27 c0 rjmp .+78 ; 0x18b0a if (printingIsPaused()) 18abc: 0e 94 3a 68 call 0xd074 ; 0xd074 18ac0: c0 90 4f 07 lds r12, 0x074F ; 0x80074f 18ac4: d0 90 50 07 lds r13, 0x0750 ; 0x800750 18ac8: e0 90 51 07 lds r14, 0x0751 ; 0x800751 18acc: f0 90 52 07 lds r15, 0x0752 ; 0x800752 18ad0: 88 23 and r24, r24 18ad2: 09 f4 brne .+2 ; 0x18ad6 18ad4: a1 c0 rjmp .+322 ; 0x18c18 { // 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; 18ad6: 20 e0 ldi r18, 0x00 ; 0 18ad8: 30 e0 ldi r19, 0x00 ; 0 18ada: 40 e8 ldi r20, 0x80 ; 128 18adc: 5f e3 ldi r21, 0x3F ; 63 18ade: c7 01 movw r24, r14 18ae0: b6 01 movw r22, r12 18ae2: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 18ae6: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 18aea: 70 93 50 07 sts 0x0750, r23 ; 0x800750 18aee: 80 93 51 07 sts 0x0751, r24 ; 0x800751 18af2: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 18af6: 60 e0 ldi r22, 0x00 ; 0 18af8: 70 e0 ldi r23, 0x00 ; 0 18afa: 88 ee ldi r24, 0xE8 ; 232 18afc: 92 e4 ldi r25, 0x42 ; 66 18afe: 0f 94 93 ba call 0x37526 ; 0x37526 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 18b02: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 18b06: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); } } // Move XY back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_XYFEED); 18b0a: e0 90 4b 07 lds r14, 0x074B ; 0x80074b 18b0e: f0 90 4c 07 lds r15, 0x074C ; 0x80074c 18b12: 00 91 4d 07 lds r16, 0x074D ; 0x80074d 18b16: 10 91 4e 07 lds r17, 0x074E ; 0x80074e 18b1a: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18b1e: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18b22: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 18b26: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18b2a: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18b2e: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18b32: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 18b36: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 18b3a: 1f 92 push r1 18b3c: 1f 92 push r1 18b3e: 1f 92 push r1 18b40: 1f 92 push r1 18b42: 81 2c mov r8, r1 18b44: 91 2c mov r9, r1 18b46: e8 e4 ldi r30, 0x48 ; 72 18b48: ae 2e mov r10, r30 18b4a: e2 e4 ldi r30, 0x42 ; 66 18b4c: be 2e mov r11, r30 18b4e: ff e4 ldi r31, 0x4F ; 79 18b50: cf 2e mov r12, r31 18b52: f7 e0 ldi r31, 0x07 ; 7 18b54: df 2e mov r13, r31 18b56: 0f 94 3e ab call 0x3567c ; 0x3567c st_synchronize(); 18b5a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 18b5e: e0 90 a3 02 lds r14, 0x02A3 ; 0x8002a3 18b62: f0 90 a4 02 lds r15, 0x02A4 ; 0x8002a4 18b66: 00 91 a5 02 lds r16, 0x02A5 ; 0x8002a5 18b6a: 10 91 a6 02 lds r17, 0x02A6 ; 0x8002a6 18b6e: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 18b72: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 18b76: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 18b7a: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 18b7e: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 18b82: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 18b86: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 18b8a: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 18b8e: 1f 92 push r1 18b90: 1f 92 push r1 18b92: 1f 92 push r1 18b94: 1f 92 push r1 18b96: 81 2c mov r8, r1 18b98: 91 2c mov r9, r1 18b9a: a0 e7 ldi r26, 0x70 ; 112 18b9c: aa 2e mov r10, r26 18b9e: a1 e4 ldi r26, 0x41 ; 65 18ba0: ba 2e mov r11, r26 18ba2: 0f 94 3e ab call 0x3567c ; 0x3567c st_synchronize(); 18ba6: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 18baa: 87 ea ldi r24, 0xA7 ; 167 18bac: 92 e0 ldi r25, 0x02 ; 2 18bae: 0f 94 e4 aa call 0x355c8 ; 0x355c8 memcpy(current_position, saved_pos, sizeof(saved_pos)); 18bb2: 80 e1 ldi r24, 0x10 ; 16 18bb4: eb e9 ldi r30, 0x9B ; 155 18bb6: f2 e0 ldi r31, 0x02 ; 2 18bb8: a3 e4 ldi r26, 0x43 ; 67 18bba: b7 e0 ldi r27, 0x07 ; 7 18bbc: 01 90 ld r0, Z+ 18bbe: 0d 92 st X+, r0 18bc0: 8a 95 dec r24 18bc2: e1 f7 brne .-8 ; 0x18bbc set_destination_to_current(); 18bc4: 0e 94 ef 68 call 0xd1de ; 0xd1de // Recover feed rate feedmultiply = saved_feedmultiply2; 18bc8: 80 91 73 03 lds r24, 0x0373 ; 0x800373 18bcc: 90 91 74 03 lds r25, 0x0374 ; 0x800374 18bd0: 80 93 39 02 sts 0x0239, r24 ; 0x800239 18bd4: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a enquecommandf_P(MSG_M220, saved_feedmultiply2); 18bd8: 9f 93 push r25 18bda: 8f 93 push r24 18bdc: 8e e9 ldi r24, 0x9E ; 158 18bde: 91 e7 ldi r25, 0x71 ; 113 18be0: 9f 93 push r25 18be2: 8f 93 push r24 18be4: 0e 94 e9 89 call 0x113d2 ; 0x113d2 if (printingIsPaused()) { 18be8: 0e 94 3a 68 call 0xd074 ; 0xd074 18bec: 0f b6 in r0, 0x3f ; 63 18bee: f8 94 cli 18bf0: de bf out 0x3e, r29 ; 62 18bf2: 0f be out 0x3f, r0 ; 63 18bf4: cd bf out 0x3d, r28 ; 61 18bf6: 88 23 and r24, r24 18bf8: 31 f1 breq .+76 ; 0x18c46 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 18bfa: 8c e8 ldi r24, 0x8C ; 140 18bfc: 90 e4 ldi r25, 0x40 ; 64 18bfe: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 18c02: 0f 94 ea 0b call 0x217d4 ; 0x217d4 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 18c06: 10 92 75 07 sts 0x0775, r1 ; 0x800775 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 18c0a: 10 92 53 07 sts 0x0753, r1 ; 0x800753 18c0e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a st_synchronize(); break; // Unload filament case 3: return true; 18c12: bb 24 eor r11, r11 18c14: b3 94 inc r11 18c16: 43 cf rjmp .-378 ; 0x18a9e setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 18c18: 20 e0 ldi r18, 0x00 ; 0 18c1a: 30 e0 ldi r19, 0x00 ; 0 18c1c: 40 ea ldi r20, 0xA0 ; 160 18c1e: 50 e4 ldi r21, 0x40 ; 64 18c20: c7 01 movw r24, r14 18c22: b6 01 movw r22, r12 18c24: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 18c28: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 18c2c: 70 93 50 07 sts 0x0750, r23 ; 0x800750 18c30: 80 93 51 07 sts 0x0751, r24 ; 0x800751 18c34: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 18c38: 60 e0 ldi r22, 0x00 ; 0 18c3a: 70 e0 ldi r23, 0x00 ; 0 18c3c: 80 e0 ldi r24, 0x00 ; 0 18c3e: 90 e4 ldi r25, 0x40 ; 64 18c40: 0f 94 93 ba call 0x37526 ; 0x37526 18c44: 62 cf rjmp .-316 ; 0x18b0a if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 18c46: 8a e6 ldi r24, 0x6A ; 106 18c48: 90 e7 ldi r25, 0x70 ; 112 18c4a: 0f 94 ea 0b call 0x217d4 ; 0x217d4 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 18c4e: 84 e2 ldi r24, 0x24 ; 36 18c50: 9b e6 ldi r25, 0x6B ; 107 18c52: 0e 94 06 7b call 0xf60c ; 0xf60c 18c56: d7 cf rjmp .-82 ; 0x18c06 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 18c58: 0e 94 3a 68 call 0xd074 ; 0xd074 18c5c: 81 11 cpse r24, r1 18c5e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a st_synchronize(); 18c62: 0f 94 2c 59 call 0x2b258 ; 0x2b258 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 18c66: 0e 94 b5 80 call 0x1016a ; 0x1016a cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 18c6a: 0e 94 47 78 call 0xf08e ; 0xf08e lcd_pause_print(); 18c6e: 0f 94 97 3f call 0x27f2e ; 0x27f2e 18c72: 0c 94 95 b2 jmp 0x1652a ; 0x1652a /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 18c76: 0e 94 3a 68 call 0xd074 ; 0xd074 18c7a: 88 23 and r24, r24 18c7c: 11 f4 brne .+4 ; 0x18c82 18c7e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 18c82: 0c 94 5d b3 jmp 0x166ba ; 0x166ba /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 18c86: 60 e0 ldi r22, 0x00 ; 0 18c88: 80 e0 ldi r24, 0x00 ; 0 18c8a: 0f 94 17 16 call 0x22c2e ; 0x22c2e 18c8e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 18c92: 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')) { 18c94: 83 e5 ldi r24, 0x53 ; 83 18c96: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18c9a: 88 23 and r24, r24 18c9c: b1 f0 breq .+44 ; 0x18cca iSel = code_value_uint8(); 18c9e: 0e 94 0e 5c call 0xb81c ; 0xb81c 18ca2: 18 2f mov r17, r24 if (iSel>=max_sheets) 18ca4: 88 30 cpi r24, 0x08 ; 8 18ca6: b0 f0 brcs .+44 ; 0x18cd4 { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 18ca8: 8c e2 ldi r24, 0x2C ; 44 18caa: 97 e8 ldi r25, 0x87 ; 135 18cac: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 18cb0: 4a e0 ldi r20, 0x0A ; 10 18cb2: 67 e0 ldi r22, 0x07 ; 7 18cb4: 70 e0 ldi r23, 0x00 ; 0 18cb6: 80 e0 ldi r24, 0x00 ; 0 18cb8: 90 e0 ldi r25, 0x00 ; 0 18cba: 0f 94 80 d2 call 0x3a500 ; 0x3a500 SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 18cbe: 84 ef ldi r24, 0xF4 ; 244 18cc0: 92 e0 ldi r25, 0x02 ; 2 18cc2: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c 18cc6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 18cca: 81 ea ldi r24, 0xA1 ; 161 18ccc: 9d e0 ldi r25, 0x0D ; 13 18cce: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 18cd2: 18 2f mov r17, r24 } if (code_seen('Z')){ 18cd4: 8a e5 ldi r24, 0x5A ; 90 18cd6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18cda: 88 23 and r24, r24 18cdc: 09 f4 brne .+2 ; 0x18ce0 18cde: d7 c0 rjmp .+430 ; 0x18e8e z_val = code_value(); 18ce0: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 18ce4: 2b 01 movw r4, r22 18ce6: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 18ce8: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 18cec: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 18cf0: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 18cf4: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 18cf8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 18cfc: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 18d00: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 18d02: 9b 01 movw r18, r22 18d04: 21 56 subi r18, 0x61 ; 97 18d06: 30 4f sbci r19, 0xF0 ; 240 18d08: 20 3a cpi r18, 0xA0 ; 160 18d0a: 3f 40 sbci r19, 0x0F ; 15 18d0c: 30 f0 brcs .+12 ; 0x18d1a { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 18d0e: 86 e1 ldi r24, 0x16 ; 22 18d10: 97 e8 ldi r25, 0x87 ; 135 18d12: 0e 94 06 7b call 0xf60c ; 0xf60c 18d16: 0c 94 95 b2 jmp 0x1652a ; 0x1652a break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 18d1a: 5b e0 ldi r21, 0x0B ; 11 18d1c: 15 9f mul r17, r21 18d1e: 90 01 movw r18, r0 18d20: 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); 18d22: c9 01 movw r24, r18 18d24: 80 5b subi r24, 0xB0 ; 176 18d26: 92 4f sbci r25, 0xF2 ; 242 18d28: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 { 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')) 18d2c: 8c e4 ldi r24, 0x4C ; 76 18d2e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18d32: bb e0 ldi r27, 0x0B ; 11 18d34: 1b 9f mul r17, r27 18d36: 70 01 movw r14, r0 18d38: 11 24 eor r1, r1 18d3a: 57 01 movw r10, r14 18d3c: e7 eb ldi r30, 0xB7 ; 183 18d3e: ae 1a sub r10, r30 18d40: e2 ef ldi r30, 0xF2 ; 242 18d42: be 0a sbc r11, r30 18d44: 88 23 and r24, r24 18d46: 09 f4 brne .+2 ; 0x18d4a 18d48: be c0 rjmp .+380 ; 0x18ec6 { char *src = strchr_pointer + 1; 18d4a: e0 91 97 03 lds r30, 0x0397 ; 0x800397 18d4e: f0 91 98 03 lds r31, 0x0398 ; 0x800398 18d52: 31 96 adiw r30, 0x01 ; 1 18d54: bf 01 movw r22, r30 while (*src == ' ') ++src; 18d56: 81 91 ld r24, Z+ 18d58: 80 32 cpi r24, 0x20 ; 32 18d5a: e1 f3 breq .-8 ; 0x18d54 if (*src != '\0') 18d5c: 88 23 and r24, r24 18d5e: 31 f0 breq .+12 ; 0x18d6c { strncpy(strLabel,src,7); 18d60: 47 e0 ldi r20, 0x07 ; 7 18d62: 50 e0 ldi r21, 0x00 ; 0 18d64: ce 01 movw r24, r28 18d66: 01 96 adiw r24, 0x01 ; 1 18d68: 0f 94 11 e4 call 0x3c822 ; 0x3c822 #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); 18d6c: 47 e0 ldi r20, 0x07 ; 7 18d6e: 50 e0 ldi r21, 0x00 ; 0 18d70: b5 01 movw r22, r10 18d72: ce 01 movw r24, r28 18d74: 01 96 adiw r24, 0x01 ; 1 18d76: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 18d7a: 82 e4 ldi r24, 0x42 ; 66 18d7c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18d80: 57 01 movw r10, r14 18d82: fe ea ldi r31, 0xAE ; 174 18d84: af 1a sub r10, r31 18d86: f2 ef ldi r31, 0xF2 ; 242 18d88: bf 0a sbc r11, r31 18d8a: 88 23 and r24, r24 18d8c: 09 f4 brne .+2 ; 0x18d90 18d8e: a3 c0 rjmp .+326 ; 0x18ed6 { iBedC = code_value_uint8(); 18d90: 0e 94 0e 5c call 0xb81c ; 0xb81c 18d94: 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); 18d96: 68 2f mov r22, r24 18d98: c5 01 movw r24, r10 18d9a: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 18d9e: 80 e5 ldi r24, 0x50 ; 80 18da0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18da4: 2d ea ldi r18, 0xAD ; 173 18da6: e2 1a sub r14, r18 18da8: 22 ef ldi r18, 0xF2 ; 242 18daa: f2 0a sbc r15, r18 18dac: 88 23 and r24, r24 18dae: 09 f4 brne .+2 ; 0x18db2 18db0: 97 c0 rjmp .+302 ; 0x18ee0 { iPindaC = code_value_uint8(); 18db2: 0e 94 0e 5c call 0xb81c ; 0xb81c 18db6: b8 2e mov r11, r24 18db8: 68 2f mov r22, r24 18dba: c7 01 movw r24, r14 18dbc: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 18dc0: 81 e4 ldi r24, 0x41 ; 65 18dc2: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18dc6: 88 23 and r24, r24 18dc8: 09 f4 brne .+2 ; 0x18dcc 18dca: 8f c0 rjmp .+286 ; 0x18eea { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18dcc: 0e 94 0e 5c call 0xb81c ; 0xb81c 18dd0: 81 11 cpse r24, r1 18dd2: 06 c0 rjmp .+12 ; 0x18de0 18dd4: 81 ea ldi r24, 0xA1 ; 161 18dd6: 9d e0 ldi r25, 0x0D ; 13 18dd8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 18ddc: 18 13 cpse r17, r24 18dde: 8d c0 rjmp .+282 ; 0x18efa if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 18de0: 81 2f mov r24, r17 18de2: 0e 94 cc 77 call 0xef98 ; 0xef98 18de6: 08 2f mov r16, r24 18de8: 88 23 and r24, r24 18dea: 29 f0 breq .+10 ; 0x18df6 18dec: 61 2f mov r22, r17 18dee: 81 ea ldi r24, 0xA1 ; 161 18df0: 9d e0 ldi r25, 0x0D ; 13 18df2: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 18df6: 8f e0 ldi r24, 0x0F ; 15 18df8: 97 e8 ldi r25, 0x87 ; 135 18dfa: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18dfe: 61 2f mov r22, r17 18e00: 70 e0 ldi r23, 0x00 ; 0 18e02: 90 e0 ldi r25, 0x00 ; 0 18e04: 80 e0 ldi r24, 0x00 ; 0 18e06: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 18e0a: 81 2f mov r24, r17 18e0c: 0e 94 cc 77 call 0xef98 ; 0xef98 18e10: 81 11 cpse r24, r1 18e12: 04 c0 rjmp .+8 ; 0x18e1c SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 18e14: 8e ef ldi r24, 0xFE ; 254 18e16: 96 e8 ldi r25, 0x86 ; 134 18e18: 0e 94 06 7b call 0xf60c ; 0xf60c SERIAL_PROTOCOLPGM(" Z"); 18e1c: 8b ef ldi r24, 0xFB ; 251 18e1e: 96 e8 ldi r25, 0x86 ; 134 18e20: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18e24: 44 e0 ldi r20, 0x04 ; 4 18e26: c3 01 movw r24, r6 18e28: b2 01 movw r22, r4 18e2a: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 18e2e: 88 ef ldi r24, 0xF8 ; 248 18e30: 96 e8 ldi r25, 0x86 ; 134 18e32: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 18e36: b6 01 movw r22, r12 18e38: dd 0c add r13, r13 18e3a: 88 0b sbc r24, r24 18e3c: 99 0b sbc r25, r25 18e3e: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 18e42: 85 ef ldi r24, 0xF5 ; 245 18e44: 96 e8 ldi r25, 0x86 ; 134 18e46: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 18e4a: ce 01 movw r24, r28 18e4c: 01 96 adiw r24, 0x01 ; 1 18e4e: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 18e52: 82 ef ldi r24, 0xF2 ; 242 18e54: 96 e8 ldi r25, 0x86 ; 134 18e56: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 18e5a: 69 2d mov r22, r9 18e5c: 70 e0 ldi r23, 0x00 ; 0 18e5e: 90 e0 ldi r25, 0x00 ; 0 18e60: 80 e0 ldi r24, 0x00 ; 0 18e62: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 18e66: 8f ee ldi r24, 0xEF ; 239 18e68: 96 e8 ldi r25, 0x86 ; 134 18e6a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 18e6e: 6b 2d mov r22, r11 18e70: 70 e0 ldi r23, 0x00 ; 0 18e72: 90 e0 ldi r25, 0x00 ; 0 18e74: 80 e0 ldi r24, 0x00 ; 0 18e76: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 18e7a: 8c ee ldi r24, 0xEC ; 236 18e7c: 96 e8 ldi r25, 0x86 ; 134 18e7e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLLN((int)bIsActive); 18e82: 80 2f mov r24, r16 18e84: 90 e0 ldi r25, 0x00 ; 0 18e86: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 18e8a: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } 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))); 18e8e: ab e0 ldi r26, 0x0B ; 11 18e90: 1a 9f mul r17, r26 18e92: c0 01 movw r24, r0 18e94: 11 24 eor r1, r1 18e96: 80 5b subi r24, 0xB0 ; 176 18e98: 92 4f sbci r25, 0xF2 ; 242 18e9a: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 18e9e: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 18ea0: bc 01 movw r22, r24 18ea2: 99 0f add r25, r25 18ea4: 88 0b sbc r24, r24 18ea6: 99 0b sbc r25, r25 18ea8: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 18eac: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 18eb0: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 18eb4: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 18eb8: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 18ebc: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 18ec0: 2b 01 movw r4, r22 18ec2: 3c 01 movw r6, r24 18ec4: 33 cf rjmp .-410 ; 0x18d2c } 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)); 18ec6: 47 e0 ldi r20, 0x07 ; 7 18ec8: 50 e0 ldi r21, 0x00 ; 0 18eca: b5 01 movw r22, r10 18ecc: ce 01 movw r24, r28 18ece: 01 96 adiw r24, 0x01 ; 1 18ed0: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 18ed4: 52 cf rjmp .-348 ; 0x18d7a 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); 18ed6: c5 01 movw r24, r10 18ed8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 18edc: 98 2e mov r9, r24 18ede: 5f cf rjmp .-322 ; 0x18d9e 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); 18ee0: c7 01 movw r24, r14 18ee2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 18ee6: b8 2e mov r11, r24 18ee8: 6b cf rjmp .-298 ; 0x18dc0 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 18eea: 81 ea ldi r24, 0xA1 ; 161 18eec: 9d e0 ldi r25, 0x0D ; 13 18eee: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 18ef2: 01 e0 ldi r16, 0x01 ; 1 18ef4: 18 17 cp r17, r24 18ef6: 09 f4 brne .+2 ; 0x18efa 18ef8: 7e cf rjmp .-260 ; 0x18df6 { 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; 18efa: 00 e0 ldi r16, 0x00 ; 0 18efc: 7c cf rjmp .-264 ; 0x18df6 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)) ) { 18efe: c3 01 movw r24, r6 18f00: b2 01 movw r22, r4 18f02: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 18f06: 20 91 99 03 lds r18, 0x0399 ; 0x800399 18f0a: 30 91 9a 03 lds r19, 0x039A ; 0x80039a 18f0e: 40 91 9b 03 lds r20, 0x039B ; 0x80039b 18f12: 50 91 9c 03 lds r21, 0x039C ; 0x80039c 18f16: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 18f1a: 87 fd sbrc r24, 7 18f1c: 02 c0 rjmp .+4 ; 0x18f22 18f1e: 0c 94 7e b2 jmp 0x164fc ; 0x164fc if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 18f22: 0f 94 8b 3f call 0x27f16 ; 0x27f16 18f26: 68 19 sub r22, r8 18f28: 79 09 sbc r23, r9 18f2a: 8a 09 sbc r24, r10 18f2c: 9b 09 sbc r25, r11 18f2e: 69 3e cpi r22, 0xE9 ; 233 18f30: 73 40 sbci r23, 0x03 ; 3 18f32: 81 05 cpc r24, r1 18f34: 91 05 cpc r25, r1 18f36: c8 f0 brcs .+50 ; 0x18f6a { SERIAL_PROTOCOLPGM("P:"); 18f38: 86 ec ldi r24, 0xC6 ; 198 18f3a: 96 e8 ldi r25, 0x86 ; 134 18f3c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 18f40: 60 91 99 03 lds r22, 0x0399 ; 0x800399 18f44: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 18f48: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 18f4c: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 18f50: 41 e0 ldi r20, 0x01 ; 1 18f52: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 18f56: 8f e2 ldi r24, 0x2F ; 47 18f58: 0e 94 c2 78 call 0xf184 ; 0xf184 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 18f5c: c8 01 movw r24, r16 18f5e: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 codenum = _millis(); 18f62: 0f 94 8b 3f call 0x27f16 ; 0x27f16 18f66: 4b 01 movw r8, r22 18f68: 5c 01 movw r10, r24 } manage_heater(); 18f6a: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(); 18f6e: 80 e0 ldi r24, 0x00 ; 0 18f70: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_update(0); 18f74: 80 e0 ldi r24, 0x00 ; 0 18f76: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 18f7a: 0c 94 65 b2 jmp 0x164ca ; 0x164ca - `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 18f7e: 8f e3 ldi r24, 0x3F ; 63 18f80: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18f84: 88 23 and r24, r24 18f86: c9 f0 breq .+50 ; 0x18fba SERIAL_PROTOCOLPGM("PINDA cal status: "); 18f88: 83 eb ldi r24, 0xB3 ; 179 18f8a: 96 e8 ldi r25, 0x86 ; 134 18f8c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 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); } 18f90: 86 ea ldi r24, 0xA6 ; 166 18f92: 9f e0 ldi r25, 0x0F ; 15 18f94: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 18f98: 21 e0 ldi r18, 0x01 ; 1 18f9a: 30 e0 ldi r19, 0x00 ; 0 18f9c: 81 11 cpse r24, r1 18f9e: 02 c0 rjmp .+4 ; 0x18fa4 18fa0: 30 e0 ldi r19, 0x00 ; 0 18fa2: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 18fa4: c9 01 movw r24, r18 18fa6: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 SERIAL_PROTOCOLLNRPGM(_header); 18faa: 8c e9 ldi r24, 0x9C ; 156 18fac: 96 e8 ldi r25, 0x86 ; 134 18fae: 0e 94 06 7b call 0xf60c ; 0xf60c gcode_M861_print_pinda_cal_eeprom(); 18fb2: 0e 94 13 79 call 0xf226 ; 0xf226 18fb6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else if (code_seen('!')) { // ! - Set factory default values 18fba: 81 e2 ldi r24, 0x21 ; 33 18fbc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 18fc0: 88 23 and r24, r24 18fc2: 49 f1 breq .+82 ; 0x19016 18fc4: 61 e0 ldi r22, 0x01 ; 1 18fc6: 86 ea ldi r24, 0xA6 ; 166 18fc8: 9f e0 ldi r25, 0x0F ; 15 18fca: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 18fce: 68 e0 ldi r22, 0x08 ; 8 18fd0: 70 e0 ldi r23, 0x00 ; 0 18fd2: 80 eb ldi r24, 0xB0 ; 176 18fd4: 9f e0 ldi r25, 0x0F ; 15 18fd6: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 18fda: 68 e1 ldi r22, 0x18 ; 24 18fdc: 70 e0 ldi r23, 0x00 ; 0 18fde: 82 eb ldi r24, 0xB2 ; 178 18fe0: 9f e0 ldi r25, 0x0F ; 15 18fe2: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 18fe6: 60 e3 ldi r22, 0x30 ; 48 18fe8: 70 e0 ldi r23, 0x00 ; 0 18fea: 84 eb ldi r24, 0xB4 ; 180 18fec: 9f e0 ldi r25, 0x0F ; 15 18fee: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 18ff2: 60 e5 ldi r22, 0x50 ; 80 18ff4: 70 e0 ldi r23, 0x00 ; 0 18ff6: 86 eb ldi r24, 0xB6 ; 182 18ff8: 9f e0 ldi r25, 0x0F ; 15 18ffa: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 18ffe: 68 e7 ldi r22, 0x78 ; 120 19000: 70 e0 ldi r23, 0x00 ; 0 19002: 88 eb ldi r24, 0xB8 ; 184 19004: 9f e0 ldi r25, 0x0F ; 15 19006: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 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"); 1900a: 8b e8 ldi r24, 0x8B ; 139 1900c: 96 e8 ldi r25, 0x86 ; 134 1900e: 0e 94 06 7b call 0xf60c ; 0xf60c 19012: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 19016: 8a e5 ldi r24, 0x5A ; 90 19018: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1901c: 88 23 and r24, r24 1901e: c1 f0 breq .+48 ; 0x19050 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 19020: 61 e0 ldi r22, 0x01 ; 1 19022: 86 ea ldi r24, 0xA6 ; 166 19024: 9f e0 ldi r25, 0x0F ; 15 19026: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 1902a: 00 eb ldi r16, 0xB0 ; 176 1902c: 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); 1902e: 70 e0 ldi r23, 0x00 ; 0 19030: 60 e0 ldi r22, 0x00 ; 0 19032: c8 01 movw r24, r16 19034: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 19038: 0e 5f subi r16, 0xFE ; 254 1903a: 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++) { 1903c: 0a 3b cpi r16, 0xBA ; 186 1903e: 4f e0 ldi r20, 0x0F ; 15 19040: 14 07 cpc r17, r20 19042: a9 f7 brne .-22 ; 0x1902e eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 19044: 81 e8 ldi r24, 0x81 ; 129 19046: 96 e8 ldi r25, 0x86 ; 134 19048: 0e 94 06 7b call 0xf60c ; 0xf60c 1904c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 19050: 83 e5 ldi r24, 0x53 ; 83 19052: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19056: 88 23 and r24, r24 19058: 21 f1 breq .+72 ; 0x190a2 int16_t usteps = code_value_short(); 1905a: 0e 94 1b 5c call 0xb836 ; 0xb836 1905e: 8c 01 movw r16, r24 if (code_seen('I')) { 19060: 89 e4 ldi r24, 0x49 ; 73 19062: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19066: 88 23 and r24, r24 19068: 11 f4 brne .+4 ; 0x1906e 1906a: 0c 94 95 b2 jmp 0x1652a ; 0x1652a uint8_t index = code_value_uint8(); 1906e: 0e 94 0e 5c call 0xb81c ; 0xb81c if (index < 5) { 19072: 85 30 cpi r24, 0x05 ; 5 19074: 10 f0 brcs .+4 ; 0x1907a 19076: 0c 94 95 b2 jmp 0x1652a ; 0x1652a eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 1907a: 90 e0 ldi r25, 0x00 ; 0 1907c: 88 52 subi r24, 0x28 ; 40 1907e: 98 4f sbci r25, 0xF8 ; 248 19080: b8 01 movw r22, r16 19082: 88 0f add r24, r24 19084: 99 1f adc r25, r25 19086: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 SERIAL_PROTOCOLLNRPGM(MSG_OK); 1908a: 8a e0 ldi r24, 0x0A ; 10 1908c: 9e e6 ldi r25, 0x6E ; 110 1908e: 0e 94 06 7b call 0xf60c ; 0xf60c SERIAL_PROTOCOLLNRPGM(_header); 19092: 8c e9 ldi r24, 0x9C ; 156 19094: 96 e8 ldi r25, 0x86 ; 134 19096: 0e 94 06 7b call 0xf60c ; 0xf60c gcode_M861_print_pinda_cal_eeprom(); 1909a: 0e 94 13 79 call 0xf226 ; 0xf226 1909e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 190a2: 80 e7 ldi r24, 0x70 ; 112 190a4: 96 e8 ldi r25, 0x86 ; 134 190a6: 0e 94 06 7b call 0xf60c ; 0xf60c 190aa: 0c 94 95 b2 jmp 0x1652a ; 0x1652a */ 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); 190ae: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 190b2: 20 e0 ldi r18, 0x00 ; 0 190b4: 30 e0 ldi r19, 0x00 ; 0 190b6: 40 e2 ldi r20, 0x20 ; 32 190b8: 51 e4 ldi r21, 0x41 ; 65 190ba: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 190be: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 190c2: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 190c4: 63 30 cpi r22, 0x03 ; 3 190c6: 09 f4 brne .+2 ; 0x190ca 190c8: a2 c0 rjmp .+324 ; 0x1920e 190ca: 98 f5 brcc .+102 ; 0x19132 190cc: 61 30 cpi r22, 0x01 ; 1 190ce: 09 f4 brne .+2 ; 0x190d2 190d0: 59 c0 rjmp .+178 ; 0x19184 190d2: 62 30 cpi r22, 0x02 ; 2 190d4: 11 f0 breq .+4 ; 0x190da 190d6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 190da: 80 91 98 13 lds r24, 0x1398 ; 0x801398 return pgm_read_word(&_nPrinterMmuType); 190de: e6 e9 ldi r30, 0x96 ; 150 190e0: ff e7 ldi r31, 0x7F ; 127 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 190e2: 81 30 cpi r24, 0x01 ; 1 190e4: 11 f0 breq .+4 ; 0x190ea return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 190e6: e8 e9 ldi r30, 0x98 ; 152 190e8: ff e7 ldi r31, 0x7F ; 127 190ea: 05 91 lpm r16, Z+ 190ec: 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')) 190ee: 80 e5 ldi r24, 0x50 ; 80 190f0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 190f4: 88 23 and r24, r24 190f6: 09 f4 brne .+2 ; 0x190fa 190f8: 79 c0 rjmp .+242 ; 0x191ec { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 190fa: 0e 94 28 5c call 0xb850 ; 0xb850 menu_submenu(lcd_hw_setup_menu); } } void printer_model_check(uint16_t nPrinterModel, uint16_t actualPrinterModel) { if (oCheckModel == ClCheckMode::_None) 190fe: f0 90 ed 04 lds r15, 0x04ED ; 0x8004ed 19102: ff 20 and r15, r15 19104: 11 f4 brne .+4 ; 0x1910a 19106: 0c 94 95 b2 jmp 0x1652a ; 0x1652a return; if (nPrinterModel == actualPrinterModel) 1910a: 60 17 cp r22, r16 1910c: 71 07 cpc r23, r17 1910e: 11 f4 brne .+4 ; 0x19114 19110: 0c 94 95 b2 jmp 0x1652a ; 0x1652a // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 19114: 8d eb ldi r24, 0xBD ; 189 19116: 97 e3 ldi r25, 0x37 ; 55 19118: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1911c: 8c 01 movw r16, r24 1911e: 8f e8 ldi r24, 0x8F ; 143 19120: 97 e3 ldi r25, 0x37 ; 55 19122: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19126: 4f 2d mov r20, r15 19128: b8 01 movw r22, r16 1912a: 0f 94 6e 16 call 0x22cdc ; 0x22cdc 1912e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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) 19132: 64 30 cpi r22, 0x04 ; 4 19134: 09 f4 brne .+2 ; 0x19138 19136: be c0 rjmp .+380 ; 0x192b4 19138: 65 30 cpi r22, 0x05 ; 5 1913a: 11 f0 breq .+4 ; 0x19140 1913c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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')) 19140: 80 e5 ldi r24, 0x50 ; 80 19142: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19146: 88 23 and r24, r24 19148: 09 f4 brne .+2 ; 0x1914c 1914a: 3a c1 rjmp .+628 ; 0x193c0 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 1914c: 0e 94 28 5c call 0xb850 ; 0xb850 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 19150: 10 91 eb 04 lds r17, 0x04EB ; 0x8004eb 19154: 11 23 and r17, r17 19156: 11 f4 brne .+4 ; 0x1915c 19158: 0c 94 95 b2 jmp 0x1652a ; 0x1652a return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 1915c: 62 30 cpi r22, 0x02 ; 2 1915e: 71 05 cpc r23, r1 19160: 10 f4 brcc .+4 ; 0x19166 19162: 0c 94 95 b2 jmp 0x1652a ; 0x1652a // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 19166: 8f ed ldi r24, 0xDF ; 223 19168: 96 e3 ldi r25, 0x36 ; 54 1916a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1916e: 7c 01 movw r14, r24 19170: 88 eb ldi r24, 0xB8 ; 184 19172: 96 e3 ldi r25, 0x36 ; 54 19174: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19178: 41 2f mov r20, r17 1917a: b7 01 movw r22, r14 1917c: 0f 94 6e 16 call 0x22cdc ; 0x22cdc 19180: 0c 94 95 b2 jmp 0x1652a ; 0x1652a ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 19184: 80 e5 ldi r24, 0x50 ; 80 19186: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1918a: 88 23 and r24, r24 1918c: a9 f0 breq .+42 ; 0x191b8 { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 1918e: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 19192: 20 e0 ldi r18, 0x00 ; 0 19194: 30 e0 ldi r19, 0x00 ; 0 19196: 4a e7 ldi r20, 0x7A ; 122 19198: 54 e4 ldi r21, 0x44 ; 68 1919a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1919e: 20 e0 ldi r18, 0x00 ; 0 191a0: 30 e0 ldi r19, 0x00 ; 0 191a2: 40 e0 ldi r20, 0x00 ; 0 191a4: 5f e3 ldi r21, 0x3F ; 63 191a6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 191aa: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> nozzle_diameter_check(nDiameter); 191ae: cb 01 movw r24, r22 191b0: 0f 94 ad 16 call 0x22d5a ; 0x22d5a 191b4: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } else if(code_seen('Q')) 191b8: 81 e5 ldi r24, 0x51 ; 81 191ba: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 191be: 88 23 and r24, r24 191c0: 11 f4 brne .+4 ; 0x191c6 191c2: 0c 94 95 b2 jmp 0x1652a ; 0x1652a SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 191c6: 85 ea ldi r24, 0xA5 ; 165 191c8: 9d e0 ldi r25, 0x0D ; 13 191ca: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 191ce: bc 01 movw r22, r24 191d0: 90 e0 ldi r25, 0x00 ; 0 191d2: 80 e0 ldi r24, 0x00 ; 0 191d4: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 191d8: 20 e0 ldi r18, 0x00 ; 0 191da: 30 e0 ldi r19, 0x00 ; 0 191dc: 4a e7 ldi r20, 0x7A ; 122 191de: 54 e4 ldi r21, 0x44 ; 68 191e0: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 191e4: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 191e8: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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')) 191ec: 81 e5 ldi r24, 0x51 ; 81 191ee: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 191f2: 88 23 and r24, r24 191f4: 11 f4 brne .+4 ; 0x191fa 191f6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 191fa: b8 01 movw r22, r16 191fc: 90 e0 ldi r25, 0x00 ; 0 191fe: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 19200: 4a e0 ldi r20, 0x0A ; 10 19202: 0f 94 80 d2 call 0x3a500 ; 0x3a500 } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 19206: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 1920a: 0c 94 95 b2 jmp 0x1652a ; 0x1652a return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1920e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 return _sPrinterMmuName; 19212: 6d e8 ldi r22, 0x8D ; 141 19214: e6 2e mov r14, r22 19216: 6f e7 ldi r22, 0x7F ; 127 19218: f6 2e mov r15, r22 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 1921a: 81 30 cpi r24, 0x01 ; 1 1921c: 21 f0 breq .+8 ; 0x19226 return _sPrinterMmuName; } else { return _sPrinterName; 1921e: 58 e8 ldi r21, 0x88 ; 136 19220: e5 2e mov r14, r21 19222: 5f e7 ldi r21, 0x7F ; 127 19224: f5 2e mov r15, r21 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 19226: 80 e5 ldi r24, 0x50 ; 80 19228: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 1922c: 88 23 and r24, r24 1922e: b1 f1 breq .+108 ; 0x1929c , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 19230: 62 e2 ldi r22, 0x22 ; 34 19232: 70 e0 ldi r23, 0x00 ; 0 19234: 80 91 97 03 lds r24, 0x0397 ; 0x800397 19238: 90 91 98 03 lds r25, 0x0398 ; 0x800398 1923c: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 19240: 8c 01 movw r16, r24 if (!this->ptr) { 19242: 89 2b or r24, r25 19244: d1 f0 breq .+52 ; 0x1927a // First quote not found return; } // Skip the leading quote this->ptr++; 19246: 0f 5f subi r16, 0xFF ; 255 19248: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 1924a: 62 e2 ldi r22, 0x22 ; 34 1924c: 70 e0 ldi r23, 0x00 ; 0 1924e: c8 01 movw r24, r16 19250: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 if(!pStrEnd) { 19254: 00 97 sbiw r24, 0x00 ; 0 19256: 89 f0 breq .+34 ; 0x1927a // Second quote not found return; } this->len = pStrEnd - this->ptr; 19258: d8 2e mov r13, r24 1925a: d0 1a sub r13, r16 1925c: c7 01 movw r24, r14 1925e: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 19262: d8 12 cpse r13, r24 19264: 0a c0 rjmp .+20 ; 0x1927a if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 19266: ac 01 movw r20, r24 19268: 55 27 eor r21, r21 1926a: b7 01 movw r22, r14 1926c: c8 01 movw r24, r16 1926e: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 19272: 89 2b or r24, r25 19274: 11 f4 brne .+4 ; 0x1927a 19276: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } } render_M862_warnings( 1927a: f0 90 ed 04 lds r15, 0x04ED ; 0x8004ed 1927e: 8d eb ldi r24, 0xBD ; 189 19280: 97 e3 ldi r25, 0x37 ; 55 19282: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19286: 8c 01 movw r16, r24 19288: 8f e8 ldi r24, 0x8F ; 143 1928a: 97 e3 ldi r25, 0x37 ; 55 1928c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19290: 4f 2d mov r20, r15 19292: b8 01 movw r22, r16 19294: 0f 94 6e 16 call 0x22cdc ; 0x22cdc 19298: 0c 94 95 b2 jmp 0x1652a ; 0x1652a { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 1929c: 81 e5 ldi r24, 0x51 ; 81 1929e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 192a2: 88 23 and r24, r24 192a4: 11 f4 brne .+4 ; 0x192aa 192a6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a SERIAL_PROTOCOLLNRPGM(type); 192aa: c7 01 movw r24, r14 192ac: 0e 94 06 7b call 0xf60c ; 0xf60c 192b0: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 192b4: 80 e5 ldi r24, 0x50 ; 80 192b6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 192ba: 88 23 and r24, r24 192bc: 09 f4 brne .+2 ; 0x192c0 192be: 77 c0 rjmp .+238 ; 0x193ae fw_version_check(++strchr_pointer); 192c0: 80 91 97 03 lds r24, 0x0397 ; 0x800397 192c4: 90 91 98 03 lds r25, 0x0398 ; 0x800398 192c8: 01 96 adiw r24, 0x01 ; 1 192ca: 90 93 98 03 sts 0x0398, r25 ; 0x800398 192ce: 80 93 97 03 sts 0x0397, r24 ; 0x800397 return ((uint8_t)ClCompareValue::_Less); return ((uint8_t)ClCompareValue::_Equal); } void fw_version_check(const char *pVersion) { if (oCheckVersion == ClCheckMode::_None) 192d2: 20 91 ec 04 lds r18, 0x04EC ; 0x8004ec 192d6: 22 23 and r18, r18 192d8: 11 f4 brne .+4 ; 0x192de 192da: 0c 94 95 b2 jmp 0x1652a ; 0x1652a return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 192de: be 01 movw r22, r28 192e0: 6f 5f subi r22, 0xFF ; 255 192e2: 7f 4f sbci r23, 0xFF ; 255 192e4: 0e 94 58 f9 call 0x1f2b0 ; 0x1f2b0 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 192e8: 8a e0 ldi r24, 0x0A ; 10 192ea: 90 e0 ldi r25, 0x00 ; 0 192ec: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 192f0: 29 81 ldd r18, Y+1 ; 0x01 192f2: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 192f4: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 192f6: 82 17 cp r24, r18 192f8: 93 07 cpc r25, r19 192fa: 28 f0 brcs .+10 ; 0x19306 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 192fc: 11 e0 ldi r17, 0x01 ; 1 192fe: 28 17 cp r18, r24 19300: 39 07 cpc r19, r25 19302: 08 f4 brcc .+2 ; 0x19306 19304: 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; 19306: 12 95 swap r17 19308: 11 0f add r17, r17 1930a: 11 0f add r17, r17 1930c: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 1930e: 8c e0 ldi r24, 0x0C ; 12 19310: 90 e0 ldi r25, 0x00 ; 0 19312: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 19316: ac 01 movw r20, r24 19318: 2b 81 ldd r18, Y+3 ; 0x03 1931a: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 1931c: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 1931e: 42 17 cp r20, r18 19320: 53 07 cpc r21, r19 19322: 28 f0 brcs .+10 ; 0x1932e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19324: 81 e0 ldi r24, 0x01 ; 1 19326: 24 17 cp r18, r20 19328: 35 07 cpc r19, r21 1932a: 08 f4 brcc .+2 ; 0x1932e 1932c: 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; 1932e: 50 e1 ldi r21, 0x10 ; 16 19330: 85 9f mul r24, r21 19332: c0 01 movw r24, r0 19334: 11 24 eor r1, r1 19336: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 19338: 8e e0 ldi r24, 0x0E ; 14 1933a: 90 e0 ldi r25, 0x00 ; 0 1933c: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 19340: ac 01 movw r20, r24 19342: 2d 81 ldd r18, Y+5 ; 0x05 19344: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19346: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19348: 42 17 cp r20, r18 1934a: 53 07 cpc r21, r19 1934c: 28 f0 brcs .+10 ; 0x19358 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 1934e: 81 e0 ldi r24, 0x01 ; 1 19350: 24 17 cp r18, r20 19352: 35 07 cpc r19, r21 19354: 08 f4 brcc .+2 ; 0x19358 19356: 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; 19358: a4 e0 ldi r26, 0x04 ; 4 1935a: 8a 9f mul r24, r26 1935c: c0 01 movw r24, r0 1935e: 11 24 eor r1, r1 19360: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 19362: 80 e1 ldi r24, 0x10 ; 16 19364: 90 e0 ldi r25, 0x00 ; 0 19366: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 1936a: ac 01 movw r20, r24 1936c: 2f 81 ldd r18, Y+7 ; 0x07 1936e: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 19370: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 19372: 42 17 cp r20, r18 19374: 53 07 cpc r21, r19 19376: 28 f0 brcs .+10 ; 0x19382 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 19378: 91 e0 ldi r25, 0x01 ; 1 1937a: 24 17 cp r18, r20 1937c: 35 07 cpc r19, r21 1937e: 08 f4 brcc .+2 ; 0x19382 19380: 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)); 19382: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 19384: 16 35 cpi r17, 0x56 ; 86 19386: 10 f4 brcc .+4 ; 0x1938c 19388: 0c 94 95 b2 jmp 0x1652a ; 0x1652a SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 1938c: f0 90 ec 04 lds r15, 0x04EC ; 0x8004ec 19390: 8d e4 ldi r24, 0x4D ; 77 19392: 97 e3 ldi r25, 0x37 ; 55 19394: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19398: 8c 01 movw r16, r24 1939a: 87 e2 ldi r24, 0x27 ; 39 1939c: 97 e3 ldi r25, 0x37 ; 55 1939e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 193a2: 4f 2d mov r20, r15 193a4: b8 01 movw r22, r16 193a6: 0f 94 6e 16 call 0x22cdc ; 0x22cdc 193aa: 0c 94 95 b2 jmp 0x1652a ; 0x1652a else if(code_seen('Q')) 193ae: 81 e5 ldi r24, 0x51 ; 81 193b0: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 193b4: 88 23 and r24, r24 193b6: 11 f4 brne .+4 ; 0x193bc 193b8: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 193bc: 0c 94 49 a9 jmp 0x15292 ; 0x15292 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 193c0: 81 e5 ldi r24, 0x51 ; 81 193c2: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 193c6: 88 23 and r24, r24 193c8: 11 f4 brne .+4 ; 0x193ce 193ca: 0c 94 95 b2 jmp 0x1652a ; 0x1652a SERIAL_PROTOCOLLN(GCODE_LEVEL); 193ce: 81 e0 ldi r24, 0x01 ; 1 193d0: 90 e0 ldi r25, 0x00 ; 0 193d2: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 193d6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a * 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; 193da: 8b e4 ldi r24, 0x4B ; 75 193dc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 193e0: c1 2c mov r12, r1 193e2: d1 2c mov r13, r1 193e4: e1 2c mov r14, r1 193e6: 40 ec ldi r20, 0xC0 ; 192 193e8: f4 2e mov r15, r20 193ea: 88 23 and r24, r24 193ec: 49 f1 breq .+82 ; 0x19440 193ee: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 193f2: 6b 01 movw r12, r22 193f4: 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) 193f6: 20 e0 ldi r18, 0x00 ; 0 193f8: 30 e0 ldi r19, 0x00 ; 0 193fa: a9 01 movw r20, r18 193fc: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 19400: 81 11 cpse r24, r1 19402: 1e c0 rjmp .+60 ; 0x19440 { extruder_advance_K = 0; 19404: 10 92 07 18 sts 0x1807, r1 ; 0x801807 19408: 10 92 08 18 sts 0x1808, r1 ; 0x801808 1940c: 10 92 09 18 sts 0x1809, r1 ; 0x801809 19410: 10 92 0a 18 sts 0x180A, r1 ; 0x80180a 19414: 0e 94 42 83 call 0x10684 ; 0x10684 else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 19418: 82 ef ldi r24, 0xF2 ; 242 1941a: 99 ea ldi r25, 0xA9 ; 169 1941c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM("Advance K="); 19420: 85 e6 ldi r24, 0x65 ; 101 19422: 9f e7 ldi r25, 0x7F ; 127 19424: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(extruder_advance_K); 19428: 60 91 07 18 lds r22, 0x1807 ; 0x801807 1942c: 70 91 08 18 lds r23, 0x1808 ; 0x801808 19430: 80 91 09 18 lds r24, 0x1809 ; 0x801809 19434: 90 91 0a 18 lds r25, 0x180A ; 0x80180a 19438: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 1943c: 0c 94 95 b2 jmp 0x1652a ; 0x1652a } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 19440: 80 91 72 03 lds r24, 0x0372 ; 0x800372 19444: 81 11 cpse r24, r1 19446: 1b c0 rjmp .+54 ; 0x1947e { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 19448: 20 e0 ldi r18, 0x00 ; 0 1944a: 30 e0 ldi r19, 0x00 ; 0 1944c: a9 01 movw r20, r18 1944e: c7 01 movw r24, r14 19450: b6 01 movw r22, r12 19452: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 19456: 87 ff sbrs r24, 7 19458: 05 c0 rjmp .+10 ; 0x19464 } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 1945a: 80 e7 ldi r24, 0x70 ; 112 1945c: 9f e7 ldi r25, 0x7F ; 127 1945e: 0e 94 06 7b call 0xf60c ; 0xf60c 19462: da cf rjmp .-76 ; 0x19418 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 19464: 20 e0 ldi r18, 0x00 ; 0 19466: 30 e0 ldi r19, 0x00 ; 0 19468: 40 e2 ldi r20, 0x20 ; 32 1946a: 51 e4 ldi r21, 0x41 ; 65 1946c: c7 01 movw r24, r14 1946e: b6 01 movw r22, r12 19470: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 19474: 87 ff sbrs r24, 7 19476: 2c c0 rjmp .+88 ; 0x194d0 19478: 81 e0 ldi r24, 0x01 ; 1 1947a: 0e 94 42 83 call 0x10684 ; 0x10684 } if(la10c_mode == LA10C_LA15) 1947e: 80 91 72 03 lds r24, 0x0372 ; 0x800372 return (k >= 0 && k < LA_K_MAX? k: -1); 19482: 20 e0 ldi r18, 0x00 ; 0 19484: 30 e0 ldi r19, 0x00 ; 0 19486: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 19488: 81 30 cpi r24, 0x01 ; 1 1948a: 21 f5 brne .+72 ; 0x194d4 return (k >= 0 && k < LA_K_MAX? k: -1); 1948c: c7 01 movw r24, r14 1948e: b6 01 movw r22, r12 19490: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 19494: 87 fd sbrc r24, 7 19496: e1 cf rjmp .-62 ; 0x1945a 19498: 20 e0 ldi r18, 0x00 ; 0 1949a: 30 e0 ldi r19, 0x00 ; 0 1949c: 40 e2 ldi r20, 0x20 ; 32 1949e: 51 e4 ldi r21, 0x41 ; 65 194a0: c7 01 movw r24, r14 194a2: b6 01 movw r22, r12 194a4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 194a8: 87 ff sbrs r24, 7 194aa: d7 cf rjmp .-82 ; 0x1945a la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 194ac: 20 e0 ldi r18, 0x00 ; 0 194ae: 30 e0 ldi r19, 0x00 ; 0 194b0: a9 01 movw r20, r18 194b2: c7 01 movw r24, r14 194b4: b6 01 movw r22, r12 194b6: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 194ba: 87 fd sbrc r24, 7 194bc: ce cf rjmp .-100 ; 0x1945a SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 194be: c0 92 07 18 sts 0x1807, r12 ; 0x801807 194c2: d0 92 08 18 sts 0x1808, r13 ; 0x801808 194c6: e0 92 09 18 sts 0x1809, r14 ; 0x801809 194ca: f0 92 0a 18 sts 0x180A, r15 ; 0x80180a 194ce: a4 cf rjmp .-184 ; 0x19418 if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 194d0: 82 e0 ldi r24, 0x02 ; 2 194d2: d3 cf rjmp .-90 ; 0x1947a } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 194d4: c7 01 movw r24, r14 194d6: b6 01 movw r22, r12 194d8: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 194dc: 87 fd sbrc r24, 7 194de: bd cf rjmp .-134 ; 0x1945a // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 194e0: 2f e6 ldi r18, 0x6F ; 111 194e2: 32 e1 ldi r19, 0x12 ; 18 194e4: 43 e0 ldi r20, 0x03 ; 3 194e6: 5b e3 ldi r21, 0x3B ; 59 194e8: c7 01 movw r24, r14 194ea: b6 01 movw r22, r12 194ec: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 194f0: 2a e0 ldi r18, 0x0A ; 10 194f2: 37 ed ldi r19, 0xD7 ; 215 194f4: 43 e2 ldi r20, 0x23 ; 35 194f6: 5c e3 ldi r21, 0x3C ; 60 194f8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 194fc: 6b 01 movw r12, r22 194fe: 7c 01 movw r14, r24 return new_K < 0? 0: 19500: 20 e0 ldi r18, 0x00 ; 0 19502: 30 e0 ldi r19, 0x00 ; 0 19504: a9 01 movw r20, r18 19506: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1950a: 87 fd sbrc r24, 7 1950c: 11 c0 rjmp .+34 ; 0x19530 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 1950e: 20 e0 ldi r18, 0x00 ; 0 19510: 30 e0 ldi r19, 0x00 ; 0 19512: 40 e2 ldi r20, 0x20 ; 32 19514: 51 e4 ldi r21, 0x41 ; 65 19516: c7 01 movw r24, r14 19518: b6 01 movw r22, r12 1951a: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1951e: 18 16 cp r1, r24 19520: 2c f6 brge .-118 ; 0x194ac 19522: c1 2c mov r12, r1 19524: d1 2c mov r13, r1 19526: 30 e2 ldi r19, 0x20 ; 32 19528: e3 2e mov r14, r19 1952a: 31 e4 ldi r19, 0x41 ; 65 1952c: f3 2e mov r15, r19 1952e: c7 cf rjmp .-114 ; 0x194be // 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: 19530: c1 2c mov r12, r1 19532: d1 2c mov r13, r1 19534: 76 01 movw r14, r12 19536: c3 cf rjmp .-122 ; 0x194be 19538: 9d ed ldi r25, 0xDD ; 221 1953a: 89 2e mov r8, r25 1953c: 92 e0 ldi r25, 0x02 ; 2 1953e: 99 2e mov r9, r25 19540: 0d e5 ldi r16, 0x5D ; 93 19542: 12 e0 ldi r17, 0x02 ; 2 19544: 28 ef ldi r18, 0xF8 ; 248 19546: a2 2e mov r10, r18 19548: 24 e0 ldi r18, 0x04 ; 4 1954a: 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++){ 1954c: 71 2c mov r7, r1 if(code_seen(axis_codes[i])){ 1954e: f4 01 movw r30, r8 19550: 81 91 ld r24, Z+ 19552: 4f 01 movw r8, r30 19554: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19558: 88 23 and r24, r24 1955a: 09 f4 brne .+2 ; 0x1955e 1955c: 45 c0 rjmp .+138 ; 0x195e8 if( i == E_AXIS && FarmOrUserECool() ){ 1955e: f3 e0 ldi r31, 0x03 ; 3 19560: 7f 12 cpse r7, r31 19562: 04 c0 rjmp .+8 ; 0x1956c 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(); 19564: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 19568: 81 11 cpse r24, r1 1956a: 61 c0 rjmp .+194 ; 0x1962e SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); SERIAL_ECHOLNPGM(", M907 E ignored"); continue; } float cur_mA = code_value(); 1956c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 19570: 6b 01 movw r12, r22 19572: 7c 01 movw r14, r24 //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 19574: 20 e0 ldi r18, 0x00 ; 0 19576: 30 e0 ldi r19, 0x00 ; 0 19578: a9 01 movw r20, r18 1957a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1957e: 87 fd sbrc r24, 7 19580: 46 c0 rjmp .+140 ; 0x1960e if (cur > 1029) cur = 1029; //limit max 19582: 20 e0 ldi r18, 0x00 ; 0 19584: 30 ea ldi r19, 0xA0 ; 160 19586: 40 e8 ldi r20, 0x80 ; 128 19588: 54 e4 ldi r21, 0x44 ; 68 1958a: c7 01 movw r24, r14 1958c: b6 01 movw r22, r12 1958e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 19592: 18 16 cp r1, r24 19594: a4 f1 brlt .+104 ; 0x195fe //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; 19596: 20 e0 ldi r18, 0x00 ; 0 19598: 30 e0 ldi r19, 0x00 ; 0 1959a: 47 e0 ldi r20, 0x07 ; 7 1959c: 54 e4 ldi r21, 0x44 ; 68 1959e: c7 01 movw r24, r14 195a0: b6 01 movw r22, r12 195a2: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 195a6: 87 fd sbrc r24, 7 195a8: 35 c0 rjmp .+106 ; 0x19614 195aa: 20 e0 ldi r18, 0x00 ; 0 195ac: 30 e0 ldi r19, 0x00 ; 0 195ae: 4c e7 ldi r20, 0x7C ; 124 195b0: 52 e4 ldi r21, 0x42 ; 66 195b2: c7 01 movw r24, r14 195b4: b6 01 movw r22, r12 195b6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 195ba: 20 e0 ldi r18, 0x00 ; 0 195bc: 30 ea ldi r19, 0xA0 ; 160 195be: 40 e8 ldi r20, 0x80 ; 128 195c0: 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); 195c2: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 195c6: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 195ca: f6 2e mov r15, r22 uint8_t val = tmc2130_cur2val(cur_mA); currents[i].setiHold(val); 195cc: c8 01 movw r24, r16 195ce: 0e 94 b3 68 call 0xd166 ; 0xd166 currents[i].setiRun(val); 195d2: 6f 2d mov r22, r15 195d4: c8 01 movw r24, r16 195d6: 0e 94 bb 68 call 0xd176 ; 0xd176 tmc2130_setup_chopper(i, tmc2130_mres[i]); 195da: 50 e0 ldi r21, 0x00 ; 0 195dc: 40 e0 ldi r20, 0x00 ; 0 195de: d5 01 movw r26, r10 195e0: 6c 91 ld r22, X 195e2: 87 2d mov r24, r7 195e4: 0f 94 4a 3a call 0x27494 ; 0x27494 */ case 907: { #ifdef TMC2130 // See tmc2130_cur2val() for translation to 0 .. 63 range for (uint_least8_t i = 0; i < NUM_AXIS; i++){ 195e8: 73 94 inc r7 195ea: 0d 5f subi r16, 0xFD ; 253 195ec: 1f 4f sbci r17, 0xFF ; 255 195ee: bf ef ldi r27, 0xFF ; 255 195f0: ab 1a sub r10, r27 195f2: bb 0a sbc r11, r27 195f4: e4 e0 ldi r30, 0x04 ; 4 195f6: 7e 12 cpse r7, r30 195f8: aa cf rjmp .-172 ; 0x1954e 195fa: 0c 94 95 b2 jmp 0x1652a ; 0x1652a //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min if (cur > 1029) cur = 1029; //limit max 195fe: c1 2c mov r12, r1 19600: 80 ea ldi r24, 0xA0 ; 160 19602: d8 2e mov r13, r24 19604: 80 e8 ldi r24, 0x80 ; 128 19606: e8 2e mov r14, r24 19608: 84 e4 ldi r24, 0x44 ; 68 1960a: f8 2e mov r15, r24 1960c: ce cf rjmp .-100 ; 0x195aa //! | 1020 | 62 | | //! | 1029 | 63 | | uint8_t tmc2130_cur2val(float cur) { if (cur < 0) cur = 0; //limit min 1960e: c1 2c mov r12, r1 19610: d1 2c mov r13, r1 19612: 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); 19614: 20 e0 ldi r18, 0x00 ; 0 19616: 30 e0 ldi r19, 0x00 ; 0 19618: 4c e7 ldi r20, 0x7C ; 124 1961a: 52 e4 ldi r21, 0x42 ; 66 1961c: c7 01 movw r24, r14 1961e: b6 01 movw r22, r12 19620: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 19624: 20 e0 ldi r18, 0x00 ; 0 19626: 34 eb ldi r19, 0xB4 ; 180 19628: 40 e9 ldi r20, 0x90 ; 144 1962a: 54 e4 ldi r21, 0x44 ; 68 1962c: ca cf rjmp .-108 ; 0x195c2 if(code_seen(axis_codes[i])){ if( i == E_AXIS && FarmOrUserECool() ){ SERIAL_ECHORPGM(eMotorCurrentScalingEnabled); 1962e: 83 ec ldi r24, 0xC3 ; 195 19630: 9f e9 ldi r25, 0x9F ; 159 19632: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM(", M907 E ignored"); 19636: 8f e5 ldi r24, 0x5F ; 95 19638: 96 e8 ldi r25, 0x86 ; 134 1963a: 0e 94 06 7b call 0xf60c ; 0xf60c 1963e: d4 cf rjmp .-88 ; 0x195e8 19640: 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; } 19644: 80 91 66 02 lds r24, 0x0266 ; 0x800266 19648: 81 11 cpse r24, r1 1964a: 01 c0 rjmp .+2 ; 0x1964e 1964c: 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"), 1964e: 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() 19650: 86 e6 ldi r24, 0x66 ; 102 19652: 92 e0 ldi r25, 0x02 ; 2 19654: 0f 94 55 3d call 0x27aaa ; 0x27aaa 19658: 88 2e mov r8, r24 1965a: c0 90 64 02 lds r12, 0x0264 ; 0x800264 1965e: 80 91 63 02 lds r24, 0x0263 ; 0x800263 19662: 81 11 cpse r24, r1 19664: 01 c0 rjmp .+2 ; 0x19668 19666: 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"), 19668: d1 2c mov r13, r1 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), currents[2].getOriginaliHold(), currents[2].getOriginaliRun(), 1966a: 83 e6 ldi r24, 0x63 ; 99 1966c: 92 e0 ldi r25, 0x02 ; 2 1966e: 0f 94 55 3d call 0x27aaa ; 0x27aaa 19672: 98 2e mov r9, r24 19674: 00 91 61 02 lds r16, 0x0261 ; 0x800261 19678: 80 91 60 02 lds r24, 0x0260 ; 0x800260 1967c: 81 11 cpse r24, r1 1967e: 01 c0 rjmp .+2 ; 0x19682 19680: 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"), 19682: 10 e0 ldi r17, 0x00 ; 0 currents[0].getOriginaliHold(), currents[0].getOriginaliRun(), currents[1].getOriginaliHold(), currents[1].getOriginaliRun(), 19684: 80 e6 ldi r24, 0x60 ; 96 19686: 92 e0 ldi r25, 0x02 ; 2 19688: 0f 94 55 3d call 0x27aaa ; 0x27aaa 1968c: e8 2e mov r14, r24 1968e: f0 90 5e 02 lds r15, 0x025E ; 0x80025e 19692: 80 91 5d 02 lds r24, 0x025D ; 0x80025d 19696: 81 11 cpse r24, r1 19698: 01 c0 rjmp .+2 ; 0x1969c 1969a: 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(), 1969c: 8d e5 ldi r24, 0x5D ; 93 1969e: 92 e0 ldi r25, 0x02 ; 2 196a0: 0f 94 55 3d call 0x27aaa ; 0x27aaa 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"), 196a4: bf 92 push r11 196a6: af 92 push r10 196a8: 1f 92 push r1 196aa: 8f 92 push r8 196ac: df 92 push r13 196ae: cf 92 push r12 196b0: 1f 92 push r1 196b2: 9f 92 push r9 196b4: 1f 93 push r17 196b6: 0f 93 push r16 196b8: 1f 92 push r1 196ba: ef 92 push r14 196bc: 1f 92 push r1 196be: ff 92 push r15 196c0: 1f 92 push r1 196c2: 8f 93 push r24 196c4: 84 e1 ldi r24, 0x14 ; 20 196c6: 98 e6 ldi r25, 0x68 ; 104 196c8: 9f 93 push r25 196ca: 8f 93 push r24 196cc: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 196d0: 0f b6 in r0, 0x3f ; 63 196d2: f8 94 cli 196d4: de bf out 0x3e, r29 ; 62 196d6: 0f be out 0x3f, r0 ; 63 196d8: cd bf out 0x3d, r28 ; 61 196da: 0c 94 95 b2 jmp 0x1652a ; 0x1652a - `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; 196de: 11 e0 ldi r17, 0x01 ; 1 196e0: 82 39 cpi r24, 0x92 ; 146 196e2: 93 40 sbci r25, 0x03 ; 3 196e4: 09 f4 brne .+2 ; 0x196e8 196e6: 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')) 196e8: 82 e5 ldi r24, 0x52 ; 82 196ea: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 196ee: 88 23 and r24, r24 196f0: 81 f0 breq .+32 ; 0x19712 { newMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 196f2: 8f ef ldi r24, 0xFF ; 255 196f4: 9f e0 ldi r25, 0x0F ; 15 196f6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 196fa: 18 2f mov r17, r24 tmc2130_mode == TMC2130_MODE_NORMAL ? _O(MSG_NORMAL) : _O(MSG_SILENT) ); } if (tmc2130_mode != newMode 196fc: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 19700: 81 17 cp r24, r17 19702: 11 f4 brne .+4 ; 0x19708 19704: 0c 94 95 b2 jmp 0x1652a ; 0x1652a ) { #ifdef PSU_Delta enable_force_z(); #endif change_power_mode_live(newMode); 19708: 81 2f mov r24, r17 1970a: 0e 94 3e 61 call 0xc27c ; 0xc27c 1970e: 0c 94 95 b2 jmp 0x1652a ; 0x1652a //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')) 19712: 80 e5 ldi r24, 0x50 ; 80 19714: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19718: 88 23 and r24, r24 1971a: 89 f0 breq .+34 ; 0x1973e { uint8_t newMenuMode = (mcode_in_progress==914) ? SILENT_MODE_NORMAL : SILENT_MODE_STEALTH; 1971c: 01 e0 ldi r16, 0x01 ; 1 1971e: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.551> 19722: 90 91 5c 0e lds r25, 0x0E5C ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.551+0x1> 19726: 82 39 cpi r24, 0x92 ; 146 19728: 93 40 sbci r25, 0x03 ; 3 1972a: 09 f4 brne .+2 ; 0x1972e 1972c: 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); 1972e: 60 2f mov r22, r16 19730: 8f ef ldi r24, 0xFF ; 255 19732: 9f e0 ldi r25, 0x0F ; 15 19734: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, newMenuMode); SilentModeMenu = newMenuMode; 19738: 00 93 a4 03 sts 0x03A4, r16 ; 0x8003a4 1973c: df cf rjmp .-66 ; 0x196fc //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')) 1973e: 81 e5 ldi r24, 0x51 ; 81 19740: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19744: 88 23 and r24, r24 19746: d1 f2 breq .-76 ; 0x196fc { printf_P(PSTR("%S: %S\n"), _O(MSG_MODE), 19748: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 1974c: 81 11 cpse r24, r1 1974e: 15 c0 rjmp .+42 ; 0x1977a 19750: 8e e7 ldi r24, 0x7E ; 126 19752: 97 e5 ldi r25, 0x57 ; 87 19754: 9f 93 push r25 19756: 8f 93 push r24 19758: 8e e2 ldi r24, 0x2E ; 46 1975a: 9d e3 ldi r25, 0x3D ; 61 1975c: 9f 93 push r25 1975e: 8f 93 push r24 19760: 87 e5 ldi r24, 0x57 ; 87 19762: 96 e8 ldi r25, 0x86 ; 134 19764: 9f 93 push r25 19766: 8f 93 push r24 19768: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1976c: 0f 90 pop r0 1976e: 0f 90 pop r0 19770: 0f 90 pop r0 19772: 0f 90 pop r0 19774: 0f 90 pop r0 19776: 0f 90 pop r0 19778: c1 cf rjmp .-126 ; 0x196fc 1977a: 8b ea ldi r24, 0xAB ; 171 1977c: 9c e3 ldi r25, 0x3C ; 60 1977e: ea cf rjmp .-44 ; 0x19754 19780: 8d ed ldi r24, 0xDD ; 221 19782: 92 e0 ldi r25, 0x02 ; 2 19784: 6c 96 adiw r28, 0x1c ; 28 19786: 9f af std Y+63, r25 ; 0x3f 19788: 8e af std Y+62, r24 ; 0x3e 1978a: 6c 97 sbiw r28, 0x1c ; 28 1978c: ee e6 ldi r30, 0x6E ; 110 1978e: ce 2e mov r12, r30 19790: e6 e0 ldi r30, 0x06 ; 6 19792: de 2e mov r13, r30 19794: f4 e5 ldi r31, 0x54 ; 84 19796: ef 2e mov r14, r31 19798: f7 e0 ldi r31, 0x07 ; 7 1979a: ff 2e mov r15, r31 1979c: a8 ef ldi r26, 0xF8 ; 248 1979e: 2a 2e mov r2, r26 197a0: a4 e0 ldi r26, 0x04 ; 4 197a2: 3a 2e mov r3, r26 197a4: ba e2 ldi r27, 0x2A ; 42 197a6: 8b 2e mov r8, r27 197a8: b7 e0 ldi r27, 0x07 ; 7 197aa: 9b 2e mov r9, r27 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 197c8: b8 2e mov r11, r24 197ca: 88 23 and r24, r24 197cc: 09 f4 brne .+2 ; 0x197d0 197ce: 75 c0 rjmp .+234 ; 0x198ba { uint16_t res_new = code_value(); 197d0: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 197d4: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 197d8: 2b 01 movw r4, r22 197da: 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 197dc: 68 30 cpi r22, 0x08 ; 8 197de: 71 05 cpc r23, r1 197e0: 09 f4 brne .+2 ; 0x197e4 197e2: 59 c3 rjmp .+1714 ; 0x19e96 197e4: 60 31 cpi r22, 0x10 ; 16 197e6: 71 05 cpc r23, r1 197e8: 09 f4 brne .+2 ; 0x197ec 197ea: 55 c3 rjmp .+1706 ; 0x19e96 197ec: 81 e0 ldi r24, 0x01 ; 1 197ee: 00 32 cpi r16, 0x20 ; 32 197f0: 11 05 cpc r17, r1 197f2: 09 f0 breq .+2 ; 0x197f6 197f4: 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 197f6: 67 96 adiw r28, 0x17 ; 23 197f8: bf ad ldd r27, Y+63 ; 0x3f 197fa: 67 97 sbiw r28, 0x17 ; 23 197fc: b3 30 cpi r27, 0x03 ; 3 197fe: 09 f4 brne .+2 ; 0x19802 19800: 55 c3 rjmp .+1706 ; 0x19eac 19802: 92 01 movw r18, r4 19804: 21 50 subi r18, 0x01 ; 1 19806: 31 09 sbc r19, r1 19808: 22 30 cpi r18, 0x02 ; 2 1980a: 31 05 cpc r19, r1 1980c: 08 f0 brcs .+2 ; 0x19810 1980e: 49 c3 rjmp .+1682 ; 0x19ea2 19810: 9b 2d mov r25, r11 19812: 89 2b or r24, r25 res_valid |= (i == E_AXIS) && ((res_new == 64) || (res_new == 128)); // resolutions valid for E only 19814: 67 96 adiw r28, 0x17 ; 23 19816: ef ad ldd r30, Y+63 ; 0x3f 19818: 67 97 sbiw r28, 0x17 ; 23 1981a: e3 30 cpi r30, 0x03 ; 3 1981c: 41 f4 brne .+16 ; 0x1982e 1981e: 00 34 cpi r16, 0x40 ; 64 19820: 11 05 cpc r17, r1 19822: 31 f0 breq .+12 ; 0x19830 19824: bb 24 eor r11, r11 19826: b3 94 inc r11 19828: 00 38 cpi r16, 0x80 ; 128 1982a: 11 05 cpc r17, r1 1982c: 09 f0 breq .+2 ; 0x19830 1982e: b1 2c mov r11, r1 #endif if (res_valid) 19830: 81 11 cpse r24, r1 19832: 03 c0 rjmp .+6 ; 0x1983a 19834: bb 20 and r11, r11 19836: 09 f4 brne .+2 ; 0x1983a 19838: 40 c0 rjmp .+128 ; 0x198ba { st_synchronize(); 1983a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 1983e: d1 01 movw r26, r2 19840: 8c 91 ld r24, X 19842: a1 2c mov r10, r1 19844: bb 24 eor r11, r11 19846: b3 94 inc r11 19848: 02 c0 rjmp .+4 ; 0x1984e 1984a: b6 94 lsr r11 1984c: a7 94 ror r10 1984e: 8a 95 dec r24 19850: e2 f7 brpl .-8 ; 0x1984a uint16_t res = tmc2130_get_res(i); tmc2130_set_res(i, res_new); 19852: b2 01 movw r22, r4 19854: 67 96 adiw r28, 0x17 ; 23 19856: 8f ad ldd r24, Y+63 ; 0x3f 19858: 67 97 sbiw r28, 0x17 ; 23 1985a: 0f 94 b5 3a call 0x2756a ; 0x2756a cs.axis_ustep_resolution[i] = res_new; 1985e: f4 01 movw r30, r8 19860: 40 82 st Z, r4 if (res_new > res) 19862: a0 16 cp r10, r16 19864: b1 06 cpc r11, r17 19866: 08 f0 brcs .+2 ; 0x1986a 19868: 40 c0 rjmp .+128 ; 0x198ea { uint16_t fac = (res_new / res); 1986a: c8 01 movw r24, r16 1986c: b5 01 movw r22, r10 1986e: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> cs.axis_steps_per_mm[i] *= fac; 19872: 2b 01 movw r4, r22 19874: 71 2c mov r7, r1 19876: 61 2c mov r6, r1 19878: c3 01 movw r24, r6 1987a: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 1987e: 9b 01 movw r18, r22 19880: ac 01 movw r20, r24 19882: d6 01 movw r26, r12 19884: 14 96 adiw r26, 0x04 ; 4 19886: 6d 91 ld r22, X+ 19888: 7d 91 ld r23, X+ 1988a: 8d 91 ld r24, X+ 1988c: 9c 91 ld r25, X 1988e: 17 97 sbiw r26, 0x07 ; 7 19890: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 19894: f6 01 movw r30, r12 19896: 64 83 std Z+4, r22 ; 0x04 19898: 75 83 std Z+5, r23 ; 0x05 1989a: 86 83 std Z+6, r24 ; 0x06 1989c: 97 83 std Z+7, r25 ; 0x07 position[i] *= fac; 1989e: d7 01 movw r26, r14 198a0: 2d 91 ld r18, X+ 198a2: 3d 91 ld r19, X+ 198a4: 4d 91 ld r20, X+ 198a6: 5c 91 ld r21, X 198a8: c3 01 movw r24, r6 198aa: b2 01 movw r22, r4 198ac: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__mulsi3> 198b0: f7 01 movw r30, r14 198b2: 60 83 st Z, r22 198b4: 71 83 std Z+1, r23 ; 0x01 198b6: 82 83 std Z+2, r24 ; 0x02 198b8: 93 83 std Z+3, r25 ; 0x03 - `S` - All axes new resolution */ case 350: { #ifdef TMC2130 for (uint_least8_t i=0; i 198e4: 66 cf rjmp .-308 ; 0x197b2 198e6: 0c 94 6f b8 jmp 0x170de ; 0x170de cs.axis_steps_per_mm[i] *= fac; position[i] *= fac; } else { uint16_t fac = (res / res_new); 198ea: c5 01 movw r24, r10 198ec: b8 01 movw r22, r16 198ee: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> cs.axis_steps_per_mm[i] /= fac; 198f2: 2b 01 movw r4, r22 198f4: 71 2c mov r7, r1 198f6: 61 2c mov r6, r1 198f8: c3 01 movw r24, r6 198fa: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 198fe: 9b 01 movw r18, r22 19900: ac 01 movw r20, r24 19902: d6 01 movw r26, r12 19904: 14 96 adiw r26, 0x04 ; 4 19906: 6d 91 ld r22, X+ 19908: 7d 91 ld r23, X+ 1990a: 8d 91 ld r24, X+ 1990c: 9c 91 ld r25, X 1990e: 17 97 sbiw r26, 0x07 ; 7 19910: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 19914: f6 01 movw r30, r12 19916: 64 83 std Z+4, r22 ; 0x04 19918: 75 83 std Z+5, r23 ; 0x05 1991a: 86 83 std Z+6, r24 ; 0x06 1991c: 97 83 std Z+7, r25 ; 0x07 position[i] /= fac; 1991e: d7 01 movw r26, r14 19920: 6d 91 ld r22, X+ 19922: 7d 91 ld r23, X+ 19924: 8d 91 ld r24, X+ 19926: 9c 91 ld r25, X 19928: a3 01 movw r20, r6 1992a: 92 01 movw r18, r4 1992c: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__divmodsi4> 19930: f7 01 movw r30, r14 19932: 20 83 st Z, r18 19934: 31 83 std Z+1, r19 ; 0x01 19936: 42 83 std Z+2, r20 ; 0x02 19938: 53 83 std Z+3, r21 ; 0x03 1993a: bf cf rjmp .-130 ; 0x198ba 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') ) { 1993c: 80 e5 ldi r24, 0x50 ; 80 1993e: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19942: 88 23 and r24, r24 19944: 29 f0 breq .+10 ; 0x19950 mmuSlotIndex = code_value_uint8(); 19946: 0e 94 0e 5c call 0xb81c ; 0xb81c 1994a: 18 2f mov r17, r24 1994c: 0c 94 93 b1 jmp 0x16326 ; 0x16326 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') ) { 19950: 84 e5 ldi r24, 0x54 ; 84 19952: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19956: 81 11 cpse r24, r1 19958: f6 cf rjmp .-20 ; 0x19946 1995a: 0c 94 92 b1 jmp 0x16324 ; 0x16324 */ case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; 1995e: 60 e0 ldi r22, 0x00 ; 0 19960: 70 e0 ldi r23, 0x00 ; 0 19962: cb 01 movw r24, r22 19964: 0c 94 ac b1 jmp 0x16358 ; 0x16358 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; 19968: 82 e0 ldi r24, 0x02 ; 2 1996a: 80 93 75 07 sts 0x0775, r24 ; 0x800775 lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 1996e: 86 e7 ldi r24, 0x76 ; 118 19970: 9c e5 ldi r25, 0x5C ; 92 19972: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19976: 0f 94 ea 0b call 0x217d4 ; 0x217d4 current_position[E_AXIS] += fastLoadLength; 1997a: a7 01 movw r20, r14 1997c: 96 01 movw r18, r12 1997e: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 19982: 70 91 50 07 lds r23, 0x0750 ; 0x800750 19986: 80 91 51 07 lds r24, 0x0751 ; 0x800751 1998a: 90 91 52 07 lds r25, 0x0752 ; 0x800752 1998e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 19992: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 19996: 70 93 50 07 sts 0x0750, r23 ; 0x800750 1999a: 80 93 51 07 sts 0x0751, r24 ; 0x800751 1999e: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 199a2: 60 e0 ldi r22, 0x00 ; 0 199a4: 70 e0 ldi r23, 0x00 ; 0 199a6: 80 ea ldi r24, 0xA0 ; 160 199a8: 91 e4 ldi r25, 0x41 ; 65 199aa: 0f 94 93 ba call 0x37526 ; 0x37526 if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 199ae: 01 11 cpse r16, r1 199b0: 06 c0 rjmp .+12 ; 0x199be raise_z_above(MIN_Z_FOR_LOAD); 199b2: 60 e0 ldi r22, 0x00 ; 0 199b4: 70 e0 ldi r23, 0x00 ; 0 199b6: 8c e0 ldi r24, 0x0C ; 12 199b8: 92 e4 ldi r25, 0x42 ; 66 199ba: 0e 94 15 6f call 0xde2a ; 0xde2a } load_filament_final_feed(); // slow sequence 199be: 0e 94 48 65 call 0xca90 ; 0xca90 st_synchronize(); 199c2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 Sound_MakeCustom(50, 500, false); 199c6: 40 e0 ldi r20, 0x00 ; 0 199c8: 64 ef ldi r22, 0xF4 ; 244 199ca: 71 e0 ldi r23, 0x01 ; 1 199cc: 82 e3 ldi r24, 0x32 ; 50 199ce: 90 e0 ldi r25, 0x00 ; 0 199d0: 0f 94 a1 6a call 0x2d542 ; 0x2d542 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 199d4: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 199d8: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 199da: 0f 94 b7 68 call 0x2d16e ; 0x2d16e #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 199de: 81 e0 ldi r24, 0x01 ; 1 199e0: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_update(2); 199e4: 82 e0 ldi r24, 0x02 ; 2 199e6: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 lcd_setstatuspgm(MSG_WELCOME); 199ea: 8a e6 ldi r24, 0x6A ; 106 199ec: 90 e7 ldi r25, 0x70 ; 112 199ee: 0f 94 ea 0b call 0x217d4 ; 0x217d4 custom_message_type = CustomMsg::Status; 199f2: 10 92 75 07 sts 0x0775, r1 ; 0x800775 199f6: 0c 94 c3 b1 jmp 0x16386 ; 0x16386 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 199fa: 85 e5 ldi r24, 0x55 ; 85 199fc: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 - `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; 19a00: c1 2c mov r12, r1 19a02: d1 2c mov r13, r1 19a04: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 19a06: 88 23 and r24, r24 19a08: 21 f0 breq .+8 ; 0x19a12 19a0a: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 19a0e: 6b 01 movw r12, r22 19a10: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 19a12: 8a e5 ldi r24, 0x5A ; 90 19a14: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19a18: 88 23 and r24, r24 19a1a: a1 f0 breq .+40 ; 0x19a44 19a1c: 0e 94 52 61 call 0xc2a4 ; 0xc2a4 19a20: 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); 19a22: 0e 94 96 6e call 0xdd2c ; 0xdd2c 19a26: 4b 01 movw r8, r22 19a28: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 19a2a: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19a2e: 81 30 cpi r24, 0x01 ; 1 19a30: 99 f4 brne .+38 ; 0x19a58 19a32: 0f 94 6d a0 call 0x340da ; 0x340da else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 19a36: c5 01 movw r24, r10 19a38: b4 01 movw r22, r8 19a3a: 90 58 subi r25, 0x80 ; 128 19a3c: 0e 94 96 6e call 0xdd2c ; 0xdd2c 19a40: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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 19a44: 60 e0 ldi r22, 0x00 ; 0 19a46: 70 e0 ldi r23, 0x00 ; 0 19a48: 8c e0 ldi r24, 0x0C ; 12 19a4a: 92 e4 ldi r25, 0x42 ; 66 19a4c: 0e 94 15 6f call 0xde2a ; 0xde2a - `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; 19a50: 60 e0 ldi r22, 0x00 ; 0 19a52: 70 e0 ldi r23, 0x00 ; 0 19a54: cb 01 movw r24, r22 19a56: e5 cf rjmp .-54 ; 0x19a22 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 19a58: c7 01 movw r24, r14 19a5a: b6 01 movw r22, r12 19a5c: 0f 94 d7 16 call 0x22dae ; 0x22dae 19a60: ea cf rjmp .-44 ; 0x19a36 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 19a62: 81 ec ldi r24, 0xC1 ; 193 19a64: 92 e0 ldi r25, 0x02 ; 2 19a66: 0e 94 04 61 call 0xc208 ; 0xc208 19a6a: 0c 94 95 b2 jmp 0x1652a ; 0x1652a #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 19a6e: 82 ec ldi r24, 0xC2 ; 194 19a70: 92 e0 ldi r25, 0x02 ; 2 19a72: 0e 94 04 61 call 0xc208 ; 0xc208 19a76: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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() ) { 19a7a: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19a7e: 81 30 cpi r24, 0x01 ; 1 19a80: 11 f0 breq .+4 ; 0x19a86 19a82: 0c 94 95 b2 jmp 0x1652a ; 0x1652a if( code_seen('A') ) { 19a86: 81 e4 ldi r24, 0x41 ; 65 19a88: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19a8c: 88 23 and r24, r24 19a8e: 11 f4 brne .+4 ; 0x19a94 19a90: 0c 94 95 b2 jmp 0x1652a ; 0x1652a MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 19a94: 80 91 97 03 lds r24, 0x0397 ; 0x800397 19a98: 90 91 98 03 lds r25, 0x0398 ; 0x800398 19a9c: 40 e1 ldi r20, 0x10 ; 16 19a9e: 50 e0 ldi r21, 0x00 ; 0 19aa0: 70 e0 ldi r23, 0x00 ; 0 19aa2: 60 e0 ldi r22, 0x00 ; 0 19aa4: 01 96 adiw r24, 0x01 ; 1 19aa6: 0f 94 1c d9 call 0x3b238 ; 0x3b238 19aaa: 86 2f mov r24, r22 19aac: 0f 94 d8 1d call 0x23bb0 ; 0x23bb0 19ab0: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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() ){ 19ab4: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19ab8: 81 30 cpi r24, 0x01 ; 1 19aba: 11 f0 breq .+4 ; 0x19ac0 19abc: 0c 94 95 b2 jmp 0x1652a ; 0x1652a uint8_t addr = 0; if( code_seen('A') ) { 19ac0: 81 e4 ldi r24, 0x41 ; 65 19ac2: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 Does nothing if A parameter is missing or if MMU is not enabled. */ case 708: { if ( MMU2::mmu2.Enabled() ){ uint8_t addr = 0; 19ac6: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 19ac8: 88 23 and r24, r24 19aca: 61 f0 breq .+24 ; 0x19ae4 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 19acc: 80 91 97 03 lds r24, 0x0397 ; 0x800397 19ad0: 90 91 98 03 lds r25, 0x0398 ; 0x800398 19ad4: 40 e1 ldi r20, 0x10 ; 16 19ad6: 50 e0 ldi r21, 0x00 ; 0 19ad8: 70 e0 ldi r23, 0x00 ; 0 19ada: 60 e0 ldi r22, 0x00 ; 0 19adc: 01 96 adiw r24, 0x01 ; 1 19ade: 0f 94 1c d9 call 0x3b238 ; 0x3b238 19ae2: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 19ae4: 88 e5 ldi r24, 0x58 ; 88 19ae6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19aea: 88 23 and r24, r24 19aec: 61 f0 breq .+24 ; 0x19b06 data = code_value_short(); 19aee: 0e 94 1b 5c call 0xb836 ; 0xb836 } if(addr){ 19af2: 11 23 and r17, r17 19af4: 11 f4 brne .+4 ; 0x19afa 19af6: 0c 94 95 b2 jmp 0x1652a ; 0x1652a MMU2::mmu2.WriteRegister(addr, data); 19afa: bc 01 movw r22, r24 19afc: 81 2f mov r24, r17 19afe: 0e 94 c3 de call 0x1bd86 ; 0x1bd86 19b02: 0c 94 95 b2 jmp 0x1652a ; 0x1652a 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; 19b06: 90 e0 ldi r25, 0x00 ; 0 19b08: 80 e0 ldi r24, 0x00 ; 0 19b0a: f3 cf rjmp .-26 ; 0x19af2 19b0c: 60 e0 ldi r22, 0x00 ; 0 19b0e: 8c ea ldi r24, 0xAC ; 172 19b10: 9c e0 ldi r25, 0x0C ; 12 19b12: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 19b16: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 19b1a: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 19b1e: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b 19b22: 0c 94 0b b2 jmp 0x16416 ; 0x16416 19b26: 61 e0 ldi r22, 0x01 ; 1 19b28: 8c ea ldi r24, 0xAC ; 172 19b2a: 9c e0 ldi r25, 0x0C ; 12 19b2c: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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(); 19b30: 0e 94 23 db call 0x1b646 ; 0x1b646 19b34: 0c 94 0b b2 jmp 0x16416 ; 0x16416 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19b38: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 19b3a: 0f 94 bc 1d call 0x23b78 ; 0x23b78 19b3e: 0c 94 21 b2 jmp 0x16442 ; 0x16442 } void MMU2::TriggerResetPin() { reset(); 19b42: 0f 94 19 c3 call 0x38632 ; 0x38632 19b46: 0c 94 21 b2 jmp 0x16442 ; 0x16442 void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset } void MMU2::ResetX42() { logic.ResetMMU(42); 19b4a: 8a e2 ldi r24, 0x2A ; 42 19b4c: f6 cf rjmp .-20 ; 0x19b3a 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') { 19b4e: 84 35 cpi r24, 0x54 ; 84 19b50: 09 f0 breq .+2 ; 0x19b54 19b52: 79 c0 rjmp .+242 ; 0x19c46 strchr_pointer = CMDBUFFER_CURRENT_STRING; 19b54: 10 93 98 03 sts 0x0398, r17 ; 0x800398 19b58: 00 93 97 03 sts 0x0397, r16 ; 0x800397 processing_tcode = true; 19b5c: 81 e0 ldi r24, 0x01 ; 1 19b5e: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 TCodes(strchr_pointer, code_value_uint8()); 19b62: 0e 94 0e 5c call 0xb81c ; 0xb81c 19b66: 18 2f mov r17, r24 19b68: 20 91 97 03 lds r18, 0x0397 ; 0x800397 19b6c: 30 91 98 03 lds r19, 0x0398 ; 0x800398 inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); } void TCodes(char *const strchr_pointer, const uint8_t codeValue) { uint8_t index = 1; 19b70: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 19b72: 79 01 movw r14, r18 19b74: e9 0e add r14, r25 19b76: f1 1c adc r15, r1 19b78: d7 01 movw r26, r14 19b7a: 8c 91 ld r24, X 19b7c: 80 32 cpi r24, 0x20 ; 32 19b7e: 11 f0 breq .+4 ; 0x19b84 19b80: 89 30 cpi r24, 0x09 ; 9 19b82: 11 f4 brne .+4 ; 0x19b88 19b84: 9f 5f subi r25, 0xFF ; 255 19b86: f5 cf rjmp .-22 ; 0x19b72 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 19b88: 08 2e mov r0, r24 19b8a: 00 0c add r0, r0 19b8c: 99 0b sbc r25, r25 19b8e: 0f 94 a5 e3 call 0x3c74a ; 0x3c74a 19b92: f7 01 movw r30, r14 19b94: 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'); 19b96: 90 ed ldi r25, 0xD0 ; 208 19b98: 98 0f add r25, r24 19b9a: 95 30 cpi r25, 0x05 ; 5 19b9c: 58 f0 brcs .+22 ; 0x19bb4 19b9e: 8f 33 cpi r24, 0x3F ; 63 19ba0: 59 f0 breq .+22 ; 0x19bb8 19ba2: 88 37 cpi r24, 0x78 ; 120 19ba4: 49 f0 breq .+18 ; 0x19bb8 19ba6: 83 36 cpi r24, 0x63 ; 99 19ba8: f1 f0 breq .+60 ; 0x19be6 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 19baa: 8b e3 ldi r24, 0x3B ; 59 19bac: 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 19bae: 0e 94 06 7b call 0xf60c ; 0xf60c 19bb2: 13 c0 rjmp .+38 ; 0x19bda strchr_pointer[index] = tolower(strchr_pointer[index]); if (IsInvalidTCode(strchr_pointer, index)){ TCodeInvalid(); } else if (strchr_pointer[index] == 'x' || strchr_pointer[index] == '?'){ 19bb4: 8f 33 cpi r24, 0x3F ; 63 19bb6: a9 f4 brne .+42 ; 0x19be2 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 19bb8: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19bbc: 81 30 cpi r24, 0x01 ; 1 19bbe: 69 f4 brne .+26 ; 0x19bda MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 19bc0: 8e e1 ldi r24, 0x1E ; 30 19bc2: 9f e3 ldi r25, 0x3F ; 63 19bc4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19bc8: 70 e0 ldi r23, 0x00 ; 0 19bca: 60 e0 ldi r22, 0x00 ; 0 19bcc: 0e 94 ba d9 call 0x1b374 ; 0x1b374 19bd0: 68 2f mov r22, r24 19bd2: d7 01 movw r26, r14 19bd4: 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()); 19bd6: 0f 94 71 1d call 0x23ae2 ; 0x23ae2 processing_tcode = false; 19bda: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 19bde: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc } 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'){ 19be2: 83 36 cpi r24, 0x63 ; 99 19be4: 49 f4 brne .+18 ; 0x19bf8 // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 19be6: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19bea: 81 30 cpi r24, 0x01 ; 1 19bec: b1 f7 brne .-20 ; 0x19bda MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 19bee: 0f 94 dd 76 call 0x2edba ; 0x2edba 19bf2: 68 2f mov r22, r24 19bf4: 83 e6 ldi r24, 0x63 ; 99 19bf6: ef cf rjmp .-34 ; 0x19bd6 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 19bf8: 80 91 98 13 lds r24, 0x1398 ; 0x801398 19bfc: 81 30 cpi r24, 0x01 ; 1 19bfe: 69 f4 brne .+26 ; 0x19c1a if (codeValue == MMU2::mmu2.get_current_tool()){ 19c00: 0f 94 dd 76 call 0x2edba ; 0x2edba 19c04: 18 13 cpse r17, r24 19c06: 05 c0 rjmp .+10 ; 0x19c12 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 19c08: 8b e4 ldi r24, 0x4B ; 75 19c0a: 9f e7 ldi r25, 0x7F ; 127 19c0c: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 19c10: e4 cf rjmp .-56 ; 0x19bda #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); 19c12: 81 2f mov r24, r17 19c14: 0f 94 55 1a call 0x234aa ; 0x234aa 19c18: e0 cf rjmp .-64 ; 0x19bda } } else { SERIAL_ECHO_START; 19c1a: 82 ef ldi r24, 0xF2 ; 242 19c1c: 99 ea ldi r25, 0xA9 ; 169 19c1e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (codeValue >= EXTRUDERS) { 19c22: 11 23 and r17, r17 19c24: 59 f0 breq .+22 ; 0x19c3c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 19c26: 84 e5 ldi r24, 0x54 ; 84 19c28: 0e 94 c2 78 call 0xf184 ; 0xf184 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 19c2c: 81 2f mov r24, r17 19c2e: 90 e0 ldi r25, 0x00 ; 0 19c30: c0 96 adiw r24, 0x30 ; 48 19c32: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 19c36: 83 e0 ldi r24, 0x03 ; 3 19c38: 98 e6 ldi r25, 0x68 ; 104 19c3a: b9 cf rjmp .-142 ; 0x19bae // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 19c3c: 80 ef ldi r24, 0xF0 ; 240 19c3e: 97 e6 ldi r25, 0x67 ; 103 19c40: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 19c44: ca cf rjmp .-108 ; 0x19bda /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 19c46: 84 34 cpi r24, 0x44 ; 68 19c48: 09 f0 breq .+2 ; 0x19c4c 19c4a: ee c0 rjmp .+476 ; 0x19e28 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 19c4c: 10 93 98 03 sts 0x0398, r17 ; 0x800398 19c50: 00 93 97 03 sts 0x0397, r16 ; 0x800397 switch(code_value_short()) 19c54: 0e 94 1b 5c call 0xb836 ; 0xb836 19c58: 86 30 cpi r24, 0x06 ; 6 19c5a: 91 05 cpc r25, r1 19c5c: 09 f4 brne .+2 ; 0x19c60 19c5e: 79 c0 rjmp .+242 ; 0x19d52 19c60: 9c f4 brge .+38 ; 0x19c88 19c62: 82 30 cpi r24, 0x02 ; 2 19c64: 91 05 cpc r25, r1 19c66: 09 f4 brne .+2 ; 0x19c6a 19c68: 52 c0 rjmp .+164 ; 0x19d0e 19c6a: 83 30 cpi r24, 0x03 ; 3 19c6c: 91 05 cpc r25, r1 19c6e: 09 f4 brne .+2 ; 0x19c72 19c70: 61 c0 rjmp .+194 ; 0x19d34 19c72: 01 96 adiw r24, 0x01 ; 1 19c74: 89 f4 brne .+34 ; 0x19c98 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 19c76: 8c ed ldi r24, 0xDC ; 220 19c78: 97 e6 ldi r25, 0x67 ; 103 19c7a: 9f 93 push r25 19c7c: 8f 93 push r24 19c7e: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 19c82: 0f 90 pop r0 19c84: 0f 90 pop r0 19c86: ff cf rjmp .-2 ; 0x19c86 19c88: 85 31 cpi r24, 0x15 ; 21 19c8a: 91 05 cpc r25, r1 19c8c: 09 f4 brne .+2 ; 0x19c90 19c8e: 8d c0 rjmp .+282 ; 0x19daa 19c90: 94 f4 brge .+36 ; 0x19cb6 19c92: 44 97 sbiw r24, 0x14 ; 20 19c94: 09 f4 brne .+2 ; 0x19c98 19c96: 69 c0 rjmp .+210 ; 0x19d6a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 19c98: 80 91 70 12 lds r24, 0x1270 ; 0x801270 19c9c: 90 91 71 12 lds r25, 0x1271 ; 0x801271 19ca0: 8a 57 subi r24, 0x7A ; 122 19ca2: 9f 4e sbci r25, 0xEF ; 239 19ca4: 9f 93 push r25 19ca6: 8f 93 push r24 19ca8: 1f 92 push r1 19caa: 84 e4 ldi r24, 0x44 ; 68 19cac: 8f 93 push r24 19cae: 8a ee ldi r24, 0xEA ; 234 19cb0: 99 e6 ldi r25, 0x69 ; 105 19cb2: 0c 94 81 99 jmp 0x13302 ; 0x13302 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 19cb6: 86 31 cpi r24, 0x16 ; 22 19cb8: 91 05 cpc r25, r1 19cba: 09 f4 brne .+2 ; 0x19cbe 19cbc: 9b c0 rjmp .+310 ; 0x19df4 19cbe: 86 34 cpi r24, 0x46 ; 70 19cc0: 91 05 cpc r25, r1 19cc2: 51 f7 brne .-44 ; 0x19c98 #### Parameters - `S` - Enable 0-1 (default 0) */ case 70: { if(code_seen('S')) 19cc4: 83 e5 ldi r24, 0x53 ; 83 19cc6: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19cca: 88 23 and r24, r24 19ccc: 11 f4 brne .+4 ; 0x19cd2 19cce: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc thermal_model_log_enable(code_value_short()); 19cd2: 0e 94 1b 5c call 0xb836 ; 0xb836 19cd6: 11 e0 ldi r17, 0x01 ; 1 19cd8: 00 97 sbiw r24, 0x00 ; 0 19cda: 09 f4 brne .+2 ; 0x19cde 19cdc: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { 19cde: 89 2b or r24, r25 19ce0: 91 f0 breq .+36 ; 0x19d06 TempMgrGuard temp_mgr_guard; 19ce2: ce 01 movw r24, r28 19ce4: 01 96 adiw r24, 0x01 ; 1 19ce6: 0f 94 de 47 call 0x28fbc ; 0x28fbc thermal_model::log_buf.entry.stamp = _millis(); 19cea: 0f 94 8b 3f call 0x27f16 ; 0x27f16 19cee: 60 93 21 06 sts 0x0621, r22 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.558> 19cf2: 70 93 22 06 sts 0x0622, r23 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x1> 19cf6: 80 93 23 06 sts 0x0623, r24 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x2> 19cfa: 90 93 24 06 sts 0x0624, r25 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x3> #ifdef THERMAL_MODEL_DEBUG void thermal_model_log_enable(bool enable) { if(enable) { TempMgrGuard temp_mgr_guard; 19cfe: ce 01 movw r24, r28 19d00: 01 96 adiw r24, 0x01 ; 1 19d02: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 thermal_model::log_buf.entry.stamp = _millis(); } thermal_model::log_buf.enabled = enable; 19d06: 10 93 31 06 sts 0x0631, r17 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x10> 19d0a: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 19d0e: 47 ed ldi r20, 0xD7 ; 215 19d10: c4 2e mov r12, r20 19d12: 47 e6 ldi r20, 0x67 ; 103 19d14: d4 2e mov r13, r20 19d16: 52 e0 ldi r21, 0x02 ; 2 19d18: e5 2e mov r14, r21 19d1a: 00 e0 ldi r16, 0x00 ; 0 19d1c: 20 e0 ldi r18, 0x00 ; 0 19d1e: 32 e2 ldi r19, 0x22 ; 34 19d20: 40 e0 ldi r20, 0x00 ; 0 19d22: 50 e0 ldi r21, 0x00 ; 0 19d24: 60 e0 ldi r22, 0x00 ; 0 19d26: 72 e0 ldi r23, 0x02 ; 2 19d28: 80 e0 ldi r24, 0x00 ; 0 19d2a: 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")); 19d2c: 0e 94 58 63 call 0xc6b0 ; 0xc6b0 19d30: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc - The hex data needs to be lowercase */ void dcode_3() { dcode_core(0, EEPROM_SIZE, dcode_mem_t::eeprom, 3, _N("EEPROM")); 19d34: 20 ed ldi r18, 0xD0 ; 208 19d36: c2 2e mov r12, r18 19d38: 27 e6 ldi r18, 0x67 ; 103 19d3a: d2 2e mov r13, r18 19d3c: 33 e0 ldi r19, 0x03 ; 3 19d3e: e3 2e mov r14, r19 19d40: 01 e0 ldi r16, 0x01 ; 1 19d42: 20 e0 ldi r18, 0x00 ; 0 19d44: 30 e1 ldi r19, 0x10 ; 16 19d46: 40 e0 ldi r20, 0x00 ; 0 19d48: 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")); 19d4a: 60 e0 ldi r22, 0x00 ; 0 19d4c: 70 e0 ldi r23, 0x00 ; 0 19d4e: cb 01 movw r24, r22 19d50: ed cf rjmp .-38 ; 0x19d2c 19d52: 89 ec ldi r24, 0xC9 ; 201 19d54: c8 2e mov r12, r24 19d56: 87 e6 ldi r24, 0x67 ; 103 19d58: d8 2e mov r13, r24 19d5a: 96 e0 ldi r25, 0x06 ; 6 19d5c: e9 2e mov r14, r25 19d5e: 03 e0 ldi r16, 0x03 ; 3 19d60: 20 e0 ldi r18, 0x00 ; 0 19d62: 30 e0 ldi r19, 0x00 ; 0 19d64: 44 e0 ldi r20, 0x04 ; 4 19d66: 50 e0 ldi r21, 0x00 ; 0 19d68: f0 cf rjmp .-32 ; 0x19d4a #ifdef XFLASH_DUMP #include "xflash_dump.h" void dcode_20() { if(code_seen('E')) 19d6a: 85 e4 ldi r24, 0x45 ; 69 19d6c: 0e 94 7c 5c call 0xb8f8 ; 0xb8f8 19d70: 88 23 and r24, r24 19d72: 29 f0 breq .+10 ; 0x19d7e xfdump_full_dump_and_reset(); 19d74: 80 e0 ldi r24, 0x00 ; 0 19d76: 0e 94 3b e4 call 0x1c876 ; 0x1c876 19d7a: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc else { unsigned long ts = _millis(); 19d7e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 19d82: 6b 01 movw r12, r22 19d84: 7c 01 movw r14, r24 xfdump_dump(); 19d86: 0e 94 69 e4 call 0x1c8d2 ; 0x1c8d2 ts = _millis() - ts; 19d8a: 0f 94 8b 3f call 0x27f16 ; 0x27f16 19d8e: dc 01 movw r26, r24 19d90: cb 01 movw r24, r22 19d92: 8c 19 sub r24, r12 19d94: 9d 09 sbc r25, r13 19d96: ae 09 sbc r26, r14 19d98: bf 09 sbc r27, r15 DBG(_N("dump completed in %lums\n"), ts); 19d9a: bf 93 push r27 19d9c: af 93 push r26 19d9e: 9f 93 push r25 19da0: 8f 93 push r24 19da2: 80 eb ldi r24, 0xB0 ; 176 19da4: 97 e6 ldi r25, 0x67 ; 103 19da6: 0c 94 81 99 jmp 0x13302 ; 0x13302 } } void dcode_21() { if(!xfdump_check_state()) 19daa: 90 e0 ldi r25, 0x00 ; 0 19dac: 80 e0 ldi r24, 0x00 ; 0 19dae: 0e 94 87 e3 call 0x1c70e ; 0x1c70e 19db2: 81 11 cpse r24, r1 19db4: 07 c0 rjmp .+14 ; 0x19dc4 DBG(_N("no dump available\n")); 19db6: 8d e9 ldi r24, 0x9D ; 157 19db8: 97 e6 ldi r25, 0x67 ; 103 if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19dba: 9f 93 push r25 19dbc: 8f 93 push r24 19dbe: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 19dc2: 14 c0 rjmp .+40 ; 0x19dec { if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { KEEPALIVE_STATE(NOT_BUSY); 19dc4: 81 e0 ldi r24, 0x01 ; 1 19dc6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 DBG(_N("D21 - read crash dump\n")); 19dca: 86 e8 ldi r24, 0x86 ; 134 19dcc: 97 e6 ldi r25, 0x67 ; 103 19dce: 9f 93 push r25 19dd0: 8f 93 push r24 19dd2: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 print_mem(DUMP_OFFSET, sizeof(dump_t), dcode_mem_t::xflash); 19dd6: 03 e0 ldi r16, 0x03 ; 3 19dd8: 20 e0 ldi r18, 0x00 ; 0 19dda: 33 e2 ldi r19, 0x23 ; 35 19ddc: 40 e0 ldi r20, 0x00 ; 0 19dde: 50 e0 ldi r21, 0x00 ; 0 19de0: 60 e0 ldi r22, 0x00 ; 0 19de2: 70 ed ldi r23, 0xD0 ; 208 19de4: 83 e0 ldi r24, 0x03 ; 3 19de6: 90 e0 ldi r25, 0x00 ; 0 19de8: 0f 94 df 86 call 0x30dbe ; 0x30dbe if(!xfdump_check_state()) DBG(_N("no dump available\n")); else { xfdump_reset(); DBG(_N("dump cleared\n")); 19dec: 0f 90 pop r0 19dee: 0f 90 pop r0 19df0: 0c 94 e6 97 jmp 0x12fcc ; 0x12fcc } } void dcode_22() { if(!xfdump_check_state()) 19df4: 90 e0 ldi r25, 0x00 ; 0 19df6: 80 e0 ldi r24, 0x00 ; 0 19df8: 0e 94 87 e3 call 0x1c70e ; 0x1c70e 19dfc: 81 11 cpse r24, r1 19dfe: 03 c0 rjmp .+6 ; 0x19e06 DBG(_N("no dump available\n")); 19e00: 83 e7 ldi r24, 0x73 ; 115 19e02: 97 e6 ldi r25, 0x67 ; 103 19e04: da cf rjmp .-76 ; 0x19dba SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 19e06: 8c e5 ldi r24, 0x5C ; 92 19e08: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 19e0a: 1d bc out 0x2d, r1 ; 45 void xfdump_reset() { XFLASH_SPI_ENTER(); xflash_enable_wr(); 19e0c: 0e 94 bf e3 call 0x1c77e ; 0x1c77e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 19e10: 40 e0 ldi r20, 0x00 ; 0 19e12: 50 ed ldi r21, 0xD0 ; 208 19e14: 63 e0 ldi r22, 0x03 ; 3 19e16: 70 e0 ldi r23, 0x00 ; 0 19e18: 80 e2 ldi r24, 0x20 ; 32 19e1a: 0e 94 41 e3 call 0x1c682 ; 0x1c682 xflash_sector_erase(DUMP_OFFSET + offsetof(dump_t, header.magic)); xflash_wait_busy(); 19e1e: 0e 94 23 e3 call 0x1c646 ; 0x1c646 else { xfdump_reset(); DBG(_N("dump cleared\n")); 19e22: 85 e6 ldi r24, 0x65 ; 101 19e24: 97 e6 ldi r25, 0x67 ; 103 19e26: c9 cf rjmp .-110 ; 0x19dba } } else { SERIAL_ECHO_START; 19e28: 82 ef ldi r24, 0xF2 ; 242 19e2a: 99 ea ldi r25, 0xA9 ; 169 19e2c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 19e30: 85 e6 ldi r24, 0x65 ; 101 19e32: 98 e6 ldi r25, 0x68 ; 104 19e34: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 19e38: 80 91 70 12 lds r24, 0x1270 ; 0x801270 19e3c: 90 91 71 12 lds r25, 0x1271 ; 0x801271 19e40: 8a 57 subi r24, 0x7A ; 122 19e42: 9f 4e sbci r25, 0xEF ; 239 19e44: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_ECHOLNPGM("\"(2)"); 19e48: 82 e5 ldi r24, 0x52 ; 82 19e4a: 96 e8 ldi r25, 0x86 ; 134 19e4c: 0c 94 f1 99 jmp 0x133e2 ; 0x133e2 #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 19e50: 2d ec ldi r18, 0xCD ; 205 19e52: 3c ec ldi r19, 0xCC ; 204 19e54: 4c ec ldi r20, 0xCC ; 204 19e56: 5d e3 ldi r21, 0x3D ; 61 19e58: c7 01 movw r24, r14 19e5a: b6 01 movw r22, r12 19e5c: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 19e60: 18 16 cp r1, r24 19e62: 14 f4 brge .+4 ; 0x19e68 19e64: 0c 94 2e 9b jmp 0x1365c ; 0x1365c 19e68: 0c 94 9c 9c jmp 0x13938 ; 0x13938 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; 19e6c: a3 01 movw r20, r6 19e6e: 92 01 movw r18, r4 19e70: 62 2d mov r22, r2 19e72: 73 2d mov r23, r3 19e74: 8e 2d mov r24, r14 19e76: 9f 2d mov r25, r15 19e78: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 19e7c: 18 16 cp r1, r24 19e7e: 14 f0 brlt .+4 ; 0x19e84 19e80: 0c 94 7d a4 jmp 0x148fa ; 0x148fa 19e84: e5 e0 ldi r30, 0x05 ; 5 19e86: ce 0e add r12, r30 19e88: d1 1c adc r13, r1 19e8a: f2 e0 ldi r31, 0x02 ; 2 19e8c: 8f 0e add r8, r31 19e8e: 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; 19e90: 85 01 movw r16, r10 19e92: 0c 94 44 a4 jmp 0x14888 ; 0x14888 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 19e96: 67 96 adiw r28, 0x17 ; 23 19e98: 2f ad ldd r18, Y+63 ; 0x3f 19e9a: 67 97 sbiw r28, 0x17 ; 23 19e9c: 8b 2d mov r24, r11 19e9e: 23 30 cpi r18, 0x03 ; 3 19ea0: 29 f0 breq .+10 ; 0x19eac 19ea2: 91 e0 ldi r25, 0x01 ; 1 19ea4: 04 30 cpi r16, 0x04 ; 4 19ea6: 11 05 cpc r17, r1 19ea8: 09 f4 brne .+2 ; 0x19eac 19eaa: b3 cc rjmp .-1690 ; 0x19812 19eac: 90 e0 ldi r25, 0x00 ; 0 19eae: b1 cc rjmp .-1694 ; 0x19812 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)); 19eb0: 85 e5 ldi r24, 0x55 ; 85 19eb2: 99 e3 ldi r25, 0x39 ; 57 19eb4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 19eb8: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_puts_at_P(0, 2, PSTR("")); 19ebc: 45 eb ldi r20, 0xB5 ; 181 19ebe: 55 e8 ldi r21, 0x85 ; 133 19ec0: 62 e0 ldi r22, 0x02 ; 2 19ec2: 80 e0 ldi r24, 0x00 ; 0 19ec4: 0e 94 a9 6f call 0xdf52 ; 0xdf52 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 19ec8: f8 01 movw r30, r16 19eca: 81 91 ld r24, Z+ 19ecc: 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'; 19ece: 98 2f mov r25, r24 19ed0: 9f 7d andi r25, 0xDF ; 223 19ed2: 11 f4 brne .+4 ; 0x19ed8 19ed4: 0c 94 d8 b8 jmp 0x171b0 ; 0x171b0 19ed8: 97 ef ldi r25, 0xF7 ; 247 19eda: 98 0f add r25, r24 19edc: 92 30 cpi r25, 0x02 ; 2 19ede: 10 f4 brcc .+4 ; 0x19ee4 19ee0: 0c 94 d8 b8 jmp 0x171b0 ; 0x171b0 19ee4: 8d 30 cpi r24, 0x0D ; 13 19ee6: 11 f4 brne .+4 ; 0x19eec 19ee8: 0c 94 d8 b8 jmp 0x171b0 ; 0x171b0 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); 19eec: 0e 94 84 6f call 0xdf08 ; 0xdf08 19ef0: eb cf rjmp .-42 ; 0x19ec8 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; 19ef2: ce 01 movw r24, r28 19ef4: 01 96 adiw r24, 0x01 ; 1 19ef6: 0f 94 de 47 call 0x28fbc ; 0x28fbc 19efa: 0c 94 c7 ac jmp 0x1598e ; 0x1598e 00019efe : uint8_t check_pinda_0() { return _PINDA?0:1; } 19efe: 80 91 f9 03 lds r24, 0x03F9 ; 0x8003f9 19f02: 90 91 fa 03 lds r25, 0x03FA ; 0x8003fa 19f06: 08 95 ret 00019f08 : 19f08: 81 50 subi r24, 0x01 ; 1 19f0a: 82 31 cpi r24, 0x12 ; 18 19f0c: 08 f0 brcs .+2 ; 0x19f10 19f0e: 5a c0 rjmp .+180 ; 0x19fc4 19f10: e8 2f mov r30, r24 19f12: f0 e0 ldi r31, 0x00 ; 0 19f14: 88 27 eor r24, r24 19f16: e0 57 subi r30, 0x70 ; 112 19f18: f0 43 sbci r31, 0x30 ; 48 19f1a: 8f 4f sbci r24, 0xFF ; 255 19f1c: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 19f20: b0 cf rjmp .-160 ; 0x19e82 19f22: b4 cf rjmp .-152 ; 0x19e8c 19f24: a2 cf rjmp .-188 ; 0x19e6a 19f26: a8 cf rjmp .-176 ; 0x19e78 19f28: ac cf rjmp .-168 ; 0x19e82 19f2a: e2 cf rjmp .-60 ; 0x19ef0 19f2c: b7 cf rjmp .-146 ; 0x19e9c 19f2e: bd cf rjmp .-134 ; 0x19eaa 19f30: c1 cf rjmp .-126 ; 0x19eb4 19f32: c7 cf rjmp .-114 ; 0x19ec2 19f34: cb cf rjmp .-106 ; 0x19ecc 19f36: cf cf rjmp .-98 ; 0x19ed6 19f38: d5 cf rjmp .-86 ; 0x19ee4 19f3a: d9 cf rjmp .-78 ; 0x19eee 19f3c: e2 cf rjmp .-60 ; 0x19f02 19f3e: dd cf rjmp .-70 ; 0x19efa 19f40: e3 cf rjmp .-58 ; 0x19f08 19f42: e7 cf rjmp .-50 ; 0x19f12 19f44: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f48: 8f 77 andi r24, 0x7F ; 127 19f4a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f4e: 08 95 ret 19f50: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f54: 8f 7d andi r24, 0xDF ; 223 19f56: f9 cf rjmp .-14 ; 0x19f4a 19f58: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 19f5c: 87 7f andi r24, 0xF7 ; 247 19f5e: f5 cf rjmp .-22 ; 0x19f4a 19f60: 84 b5 in r24, 0x24 ; 36 19f62: 8f 77 andi r24, 0x7F ; 127 19f64: 84 bd out 0x24, r24 ; 36 19f66: 08 95 ret 19f68: 84 b5 in r24, 0x24 ; 36 19f6a: 8f 7d andi r24, 0xDF ; 223 19f6c: fb cf rjmp .-10 ; 0x19f64 19f6e: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f72: 8f 77 andi r24, 0x7F ; 127 19f74: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f78: 08 95 ret 19f7a: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 19f7e: 8f 7d andi r24, 0xDF ; 223 19f80: f9 cf rjmp .-14 ; 0x19f74 19f82: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f86: 8f 77 andi r24, 0x7F ; 127 19f88: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f8c: 08 95 ret 19f8e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f92: 8f 7d andi r24, 0xDF ; 223 19f94: f9 cf rjmp .-14 ; 0x19f88 19f96: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 19f9a: 87 7f andi r24, 0xF7 ; 247 19f9c: f5 cf rjmp .-22 ; 0x19f88 19f9e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fa2: 8f 77 andi r24, 0x7F ; 127 19fa4: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fa8: 08 95 ret 19faa: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fae: 8f 7d andi r24, 0xDF ; 223 19fb0: f9 cf rjmp .-14 ; 0x19fa4 19fb2: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 19fb6: 87 7f andi r24, 0xF7 ; 247 19fb8: f5 cf rjmp .-22 ; 0x19fa4 19fba: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fbe: 8f 77 andi r24, 0x7F ; 127 19fc0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fc4: 08 95 ret 19fc6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fca: 8f 7d andi r24, 0xDF ; 223 19fcc: f9 cf rjmp .-14 ; 0x19fc0 19fce: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 19fd2: 87 7f andi r24, 0xF7 ; 247 19fd4: f5 cf rjmp .-22 ; 0x19fc0 00019fd6 : 19fd6: 83 b1 in r24, 0x03 ; 3 19fd8: 82 95 swap r24 19fda: 81 70 andi r24, 0x01 ; 1 19fdc: 08 95 ret 00019fde : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 19fde: cf 92 push r12 19fe0: df 92 push r13 19fe2: ef 92 push r14 19fe4: 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; 19fe6: 20 91 fb 03 lds r18, 0x03FB ; 0x8003fb 19fea: b0 e0 ldi r27, 0x00 ; 0 19fec: a0 e0 ldi r26, 0x00 ; 0 19fee: c0 90 64 07 lds r12, 0x0764 ; 0x800764 19ff2: d0 90 65 07 lds r13, 0x0765 ; 0x800765 19ff6: e0 90 66 07 lds r14, 0x0766 ; 0x800766 19ffa: f0 90 67 07 lds r15, 0x0767 ; 0x800767 19ffe: 20 ff sbrs r18, 0 1a000: 42 c0 rjmp .+132 ; 0x1a086 1a002: c8 1a sub r12, r24 1a004: d9 0a sbc r13, r25 1a006: ea 0a sbc r14, r26 1a008: fb 0a sbc r15, r27 1a00a: c0 92 64 07 sts 0x0764, r12 ; 0x800764 1a00e: d0 92 65 07 sts 0x0765, r13 ; 0x800765 1a012: e0 92 66 07 sts 0x0766, r14 ; 0x800766 1a016: f0 92 67 07 sts 0x0767, r15 ; 0x800767 1a01a: cb 01 movw r24, r22 1a01c: b0 e0 ldi r27, 0x00 ; 0 1a01e: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1a020: c0 90 68 07 lds r12, 0x0768 ; 0x800768 1a024: d0 90 69 07 lds r13, 0x0769 ; 0x800769 1a028: e0 90 6a 07 lds r14, 0x076A ; 0x80076a 1a02c: f0 90 6b 07 lds r15, 0x076B ; 0x80076b 1a030: 21 ff sbrs r18, 1 1a032: 36 c0 rjmp .+108 ; 0x1a0a0 1a034: c8 1a sub r12, r24 1a036: d9 0a sbc r13, r25 1a038: ea 0a sbc r14, r26 1a03a: fb 0a sbc r15, r27 1a03c: c0 92 68 07 sts 0x0768, r12 ; 0x800768 1a040: d0 92 69 07 sts 0x0769, r13 ; 0x800769 1a044: e0 92 6a 07 sts 0x076A, r14 ; 0x80076a 1a048: f0 92 6b 07 sts 0x076B, r15 ; 0x80076b 1a04c: 70 e0 ldi r23, 0x00 ; 0 1a04e: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1a050: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 1a054: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 1a058: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 1a05c: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 1a060: 22 ff sbrs r18, 2 1a062: 2b c0 rjmp .+86 ; 0x1a0ba 1a064: 84 1b sub r24, r20 1a066: 95 0b sbc r25, r21 1a068: a6 0b sbc r26, r22 1a06a: b7 0b sbc r27, r23 1a06c: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 1a070: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 1a074: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 1a078: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f // DBG(_n(" after xyzcal_update_pos x=%ld y=%ld z=%ld\n"), count_position[0], count_position[1], count_position[2]); } 1a07c: ff 90 pop r15 1a07e: ef 90 pop r14 1a080: df 90 pop r13 1a082: cf 90 pop r12 1a084: 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; 1a086: 8c 0d add r24, r12 1a088: 9d 1d adc r25, r13 1a08a: ae 1d adc r26, r14 1a08c: bf 1d adc r27, r15 1a08e: 80 93 64 07 sts 0x0764, r24 ; 0x800764 1a092: 90 93 65 07 sts 0x0765, r25 ; 0x800765 1a096: a0 93 66 07 sts 0x0766, r26 ; 0x800766 1a09a: b0 93 67 07 sts 0x0767, r27 ; 0x800767 1a09e: bd cf rjmp .-134 ; 0x1a01a if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1a0a0: 8c 0d add r24, r12 1a0a2: 9d 1d adc r25, r13 1a0a4: ae 1d adc r26, r14 1a0a6: bf 1d adc r27, r15 1a0a8: 80 93 68 07 sts 0x0768, r24 ; 0x800768 1a0ac: 90 93 69 07 sts 0x0769, r25 ; 0x800769 1a0b0: a0 93 6a 07 sts 0x076A, r26 ; 0x80076a 1a0b4: b0 93 6b 07 sts 0x076B, r27 ; 0x80076b 1a0b8: c9 cf rjmp .-110 ; 0x1a04c if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 1a0ba: 84 0f add r24, r20 1a0bc: 95 1f adc r25, r21 1a0be: a6 1f adc r26, r22 1a0c0: b7 1f adc r27, r23 1a0c2: d4 cf rjmp .-88 ; 0x1a06c 0001a0c4 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 1a0c4: fb 01 movw r30, r22 *v = 0; 1a0c6: 11 82 std Z+1, r1 ; 0x01 1a0c8: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 1a0ca: 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'; 1a0cc: dc 01 movw r26, r24 1a0ce: 2c 91 ld r18, X 1a0d0: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 1a0d2: 2a 30 cpi r18, 0x0A ; 10 1a0d4: a0 f4 brcc .+40 ; 0x1a0fe *v *= 10; 1a0d6: 40 81 ld r20, Z 1a0d8: 51 81 ldd r21, Z+1 ; 0x01 1a0da: 64 9f mul r22, r20 1a0dc: 90 01 movw r18, r0 1a0de: 65 9f mul r22, r21 1a0e0: 30 0d add r19, r0 1a0e2: 11 24 eor r1, r1 1a0e4: 31 83 std Z+1, r19 ; 0x01 1a0e6: 20 83 st Z, r18 *v += *str - '0'; 1a0e8: 4d 91 ld r20, X+ 1a0ea: cd 01 movw r24, r26 1a0ec: 20 53 subi r18, 0x30 ; 48 1a0ee: 31 09 sbc r19, r1 1a0f0: 24 0f add r18, r20 1a0f2: 31 1d adc r19, r1 1a0f4: 47 fd sbrc r20, 7 1a0f6: 3a 95 dec r19 1a0f8: 31 83 std Z+1, r19 ; 0x01 1a0fa: 20 83 st Z, r18 1a0fc: e7 cf rjmp .-50 ; 0x1a0cc ++str; } return str; } 1a0fe: 08 95 ret 0001a100 : } #ifdef THERMAL_MODEL void lcd_thermal_model_cal() { lcd_commands_type = LcdCommands::ThermalModel; 1a100: 85 e0 ldi r24, 0x05 ; 5 1a102: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 lcd_return_to_status(); 1a106: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 0001a10a : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 1a10a: 85 e0 ldi r24, 0x05 ; 5 1a10c: 9c e6 ldi r25, 0x6C ; 108 1a10e: 0e 94 06 7b call 0xf60c ; 0xf60c lcd_return_to_status(); 1a112: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 0001a116 : //! 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) { 1a116: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 1a11a: 81 30 cpi r24, 0x01 ; 1 1a11c: 21 f4 brne .+8 ; 0x1a126 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 1a11e: 84 e5 ldi r24, 0x54 ; 84 1a120: 9b e6 ldi r25, 0x6B ; 107 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 1a122: 0c 94 06 7b jmp 0xf60c ; 0xf60c 1a126: 85 e4 ldi r24, 0x45 ; 69 1a128: 9b e6 ldi r25, 0x6B ; 107 1a12a: fb cf rjmp .-10 ; 0x1a122 0001a12c : } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1a12c: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1a130: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 #endif manage_heater(); 1a134: 0d 94 a0 4e jmp 0x29d40 ; 0x29d40 0001a138 : 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, 1a138: 1f 93 push r17 1a13a: cf 93 push r28 1a13c: df 93 push r29 1a13e: c8 2f mov r28, r24 1a140: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 1a142: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 1a146: 8d eb ldi r24, 0xBD ; 189 1a148: 93 e4 ldi r25, 0x43 ; 67 1a14a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a14e: ac 01 movw r20, r24 1a150: 60 e0 ldi r22, 0x00 ; 0 1a152: 80 e0 ldi r24, 0x00 ; 0 1a154: 0e 94 a9 6f call 0xdf52 ; 0xdf52 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)); 1a158: 83 e5 ldi r24, 0x53 ; 83 1a15a: 94 e4 ldi r25, 0x44 ; 68 1a15c: c1 11 cpse r28, r1 1a15e: 02 c0 rjmp .+4 ; 0x1a164 1a160: 86 e6 ldi r24, 0x66 ; 102 1a162: 94 e4 ldi r25, 0x44 ; 68 1a164: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a168: ac 01 movw r20, r24 1a16a: 61 e0 ldi r22, 0x01 ; 1 1a16c: 80 e0 ldi r24, 0x00 ; 0 1a16e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_selftest_setfan(255); 1a172: 8f ef ldi r24, 0xFF ; 255 1a174: 0e 94 96 d0 call 0x1a12c ; 0x1a12c break; } _delay(500); 1a178: 64 ef ldi r22, 0xF4 ; 244 1a17a: 71 e0 ldi r23, 0x01 ; 1 1a17c: 80 e0 ldi r24, 0x00 ; 0 1a17e: 90 e0 ldi r25, 0x00 ; 0 1a180: 0f 94 92 3d call 0x27b24 ; 0x27b24 lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 1a184: 82 eb ldi r24, 0xB2 ; 178 1a186: 93 e4 ldi r25, 0x43 ; 67 1a188: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a18c: ac 01 movw r20, r24 1a18e: 62 e0 ldi r22, 0x02 ; 2 1a190: 81 e0 ldi r24, 0x01 ; 1 1a192: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_putc_at(0, 3, '>'); 1a196: 4e e3 ldi r20, 0x3E ; 62 1a198: 63 e0 ldi r22, 0x03 ; 3 1a19a: 80 e0 ldi r24, 0x00 ; 0 1a19c: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 1a1a0: 83 ea ldi r24, 0xA3 ; 163 1a1a2: 93 e4 ldi r25, 0x43 ; 67 1a1a4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a1a8: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_encoder = _default; 1a1ac: 6d 2f mov r22, r29 1a1ae: 70 e0 ldi r23, 0x00 ; 0 1a1b0: 70 93 38 05 sts 0x0538, r23 ; 0x800538 1a1b4: 60 93 37 05 sts 0x0537, r22 ; 0x800537 KEEPALIVE_STATE(PAUSED_FOR_USER); 1a1b8: 84 e0 ldi r24, 0x04 ; 4 1a1ba: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_consume_click(); 1a1be: 0e 94 ad 71 call 0xe35a ; 0xe35a 1a1c2: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 1a1c4: 11 e0 ldi r17, 0x01 ; 1 1a1c6: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 1a1c8: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1a1cc: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1a1d0: 00 97 sbiw r24, 0x00 ; 0 1a1d2: 19 f1 breq .+70 ; 0x1a21a if (lcd_encoder < 0) { 1a1d4: 97 ff sbrs r25, 7 1a1d6: 0b c0 rjmp .+22 ; 0x1a1ee _result = !check_opposite; 1a1d8: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 1a1da: 4e e3 ldi r20, 0x3E ; 62 1a1dc: 62 e0 ldi r22, 0x02 ; 2 1a1de: 80 e0 ldi r24, 0x00 ; 0 1a1e0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_putc_at(0, 3, ' '); 1a1e4: 40 e2 ldi r20, 0x20 ; 32 1a1e6: 63 e0 ldi r22, 0x03 ; 3 1a1e8: 80 e0 ldi r24, 0x00 ; 0 1a1ea: 0e 94 b5 6f call 0xdf6a ; 0xdf6a } if (lcd_encoder > 0) { 1a1ee: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1a1f2: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1a1f6: 18 16 cp r1, r24 1a1f8: 19 06 cpc r1, r25 1a1fa: 5c f4 brge .+22 ; 0x1a212 _result = check_opposite; lcd_putc_at(0, 2, ' '); 1a1fc: 40 e2 ldi r20, 0x20 ; 32 1a1fe: 62 e0 ldi r22, 0x02 ; 2 1a200: 80 e0 ldi r24, 0x00 ; 0 1a202: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_putc_at(0, 3, '>'); 1a206: 4e e3 ldi r20, 0x3E ; 62 1a208: 63 e0 ldi r22, 0x03 ; 3 1a20a: 80 e0 ldi r24, 0x00 ; 0 1a20c: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 1a210: dc 2f mov r29, r28 } lcd_encoder = 0; 1a212: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1a216: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } manage_heater(); 1a21a: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 1a21e: 81 e0 ldi r24, 0x01 ; 1 1a220: 0e 94 e2 8b call 0x117c4 ; 0x117c4 _delay(100); 1a224: 64 e6 ldi r22, 0x64 ; 100 1a226: 70 e0 ldi r23, 0x00 ; 0 1a228: 80 e0 ldi r24, 0x00 ; 0 1a22a: 90 e0 ldi r25, 0x00 ; 0 1a22c: 0f 94 92 3d call 0x27b24 ; 0x27b24 } while (!lcd_clicked()); 1a230: 0e 94 b2 71 call 0xe364 ; 0xe364 1a234: 88 23 and r24, r24 1a236: 41 f2 breq .-112 ; 0x1a1c8 KEEPALIVE_STATE(IN_HANDLER); 1a238: 82 e0 ldi r24, 0x02 ; 2 1a23a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 setExtruderAutoFanState(0); // Turn off hotend fan 1a23e: 80 e0 ldi r24, 0x00 ; 0 1a240: 0e 94 d1 76 call 0xeda2 ; 0xeda2 lcd_selftest_setfan(0); // Turn off print fan 1a244: 80 e0 ldi r24, 0x00 ; 0 1a246: 0e 94 96 d0 call 0x1a12c ; 0x1a12c return _result; } 1a24a: 8d 2f mov r24, r29 1a24c: df 91 pop r29 1a24e: cf 91 pop r28 1a250: 1f 91 pop r17 1a252: 08 95 ret 0001a254 : #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) { 1a254: cf 93 push r28 1a256: df 93 push r29 1a258: c8 2f mov r28, r24 1a25a: d6 2f mov r29, r22 // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { 1a25c: c1 50 subi r28, 0x01 ; 1 1a25e: 98 f0 brcs .+38 ; 0x1a286 for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1a260: 4d e2 ldi r20, 0x2D ; 45 1a262: 6d 2f mov r22, r29 1a264: 82 e1 ldi r24, 0x12 ; 18 1a266: 0e 94 b5 6f call 0xdf6a ; 0xdf6a delay_keep_alive(1000 / sizeof(symbols)); 1a26a: 84 ef ldi r24, 0xF4 ; 244 1a26c: 91 e0 ldi r25, 0x01 ; 1 1a26e: 0e 94 87 8e call 0x11d0e ; 0x11d0e // 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]); 1a272: 4c e7 ldi r20, 0x7C ; 124 1a274: 6d 2f mov r22, r29 1a276: 82 e1 ldi r24, 0x12 ; 18 1a278: 0e 94 b5 6f call 0xdf6a ; 0xdf6a delay_keep_alive(1000 / sizeof(symbols)); 1a27c: 84 ef ldi r24, 0xF4 ; 244 1a27e: 91 e0 ldi r25, 0x01 ; 1 1a280: 0e 94 87 8e call 0x11d0e ; 0x11d0e 1a284: eb cf rjmp .-42 ; 0x1a25c } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1a286: 0f 94 8b 3f call 0x27f16 ; 0x27f16 1a28a: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 1a28e: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 1a292: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 1a296: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f #endif fan_measuring = true; 1a29a: 81 e0 ldi r24, 0x01 ; 1 1a29c: 80 93 36 05 sts 0x0536, r24 ; 0x800536 while(fan_measuring) { 1a2a0: 80 91 36 05 lds r24, 0x0536 ; 0x800536 1a2a4: 88 23 and r24, r24 1a2a6: 29 f0 breq .+10 ; 0x1a2b2 delay_keep_alive(100); 1a2a8: 84 e6 ldi r24, 0x64 ; 100 1a2aa: 90 e0 ldi r25, 0x00 ; 0 1a2ac: 0e 94 87 8e call 0x11d0e ; 0x11d0e 1a2b0: f7 cf rjmp .-18 ; 0x1a2a0 } gcode_M123(); } 1a2b2: df 91 pop r29 1a2b4: cf 91 pop r28 fan_measuring = true; while(fan_measuring) { delay_keep_alive(100); } gcode_M123(); 1a2b6: 0c 94 39 67 jmp 0xce72 ; 0xce72 0001a2ba : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 1a2ba: cf 93 push r28 1a2bc: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1a2be: 0f 94 2c 59 call 0x2b258 ; 0x2b258 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 1a2c2: c3 e4 ldi r28, 0x43 ; 67 1a2c4: 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)); 1a2c6: 60 91 75 13 lds r22, 0x1375 ; 0x801375 1a2ca: 70 e0 ldi r23, 0x00 ; 0 1a2cc: 90 e0 ldi r25, 0x00 ; 0 1a2ce: 80 e0 ldi r24, 0x00 ; 0 1a2d0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1a2d4: 9b 01 movw r18, r22 1a2d6: ac 01 movw r20, r24 1a2d8: 6c 85 ldd r22, Y+12 ; 0x0c 1a2da: 7d 85 ldd r23, Y+13 ; 0x0d 1a2dc: 8e 85 ldd r24, Y+14 ; 0x0e 1a2de: 9f 85 ldd r25, Y+15 ; 0x0f 1a2e0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1a2e4: 6c 87 std Y+12, r22 ; 0x0c 1a2e6: 7d 87 std Y+13, r23 ; 0x0d 1a2e8: 8e 87 std Y+14, r24 ; 0x0e 1a2ea: 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])); 1a2ec: 62 e0 ldi r22, 0x02 ; 2 1a2ee: 87 e7 ldi r24, 0x77 ; 119 1a2f0: 90 e9 ldi r25, 0x90 ; 144 } 1a2f2: df 91 pop r29 1a2f4: 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])); 1a2f6: 0d 94 2d 88 jmp 0x3105a ; 0x3105a 0001a2fa : 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) { 1a2fa: 0f 93 push r16 1a2fc: 1f 93 push r17 1a2fe: cf 93 push r28 1a300: df 93 push r29 1a302: 98 2f mov r25, r24 1a304: 86 2f mov r24, r22 1a306: 14 2f mov r17, r20 1a308: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 1a30a: 69 2f mov r22, r25 1a30c: 0e 94 95 6f call 0xdf2a ; 0xdf2a switch (_state) 1a310: 11 30 cpi r17, 0x01 ; 1 1a312: 21 f0 breq .+8 ; 0x1a31c 1a314: 12 30 cpi r17, 0x02 ; 2 1a316: 79 f0 breq .+30 ; 0x1a336 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a318: ce 01 movw r24, r28 1a31a: 15 c0 rjmp .+42 ; 0x1a346 { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 1a31c: ce 01 movw r24, r28 1a31e: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_putc(':'); 1a322: 8a e3 ldi r24, 0x3A ; 58 1a324: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_putc(_indicator); 1a328: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 1a32a: df 91 pop r29 1a32c: cf 91 pop r28 1a32e: 1f 91 pop r17 1a330: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 1a332: 0c 94 84 6f jmp 0xdf08 ; 0xdf08 break; case 2: lcd_puts_P(_name_PROGMEM); 1a336: ce 01 movw r24, r28 1a338: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_putc(':'); 1a33c: 8a e3 ldi r24, 0x3A ; 58 1a33e: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_puts_P(MSG_OK_CAPS); 1a342: 83 eb ldi r24, 0xB3 ; 179 1a344: 9b e6 ldi r25, 0x6B ; 107 break; default: lcd_puts_P(_name_PROGMEM); } } 1a346: df 91 pop r29 1a348: cf 91 pop r28 1a34a: 1f 91 pop r17 1a34c: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 1a34e: 0c 94 80 6f jmp 0xdf00 ; 0xdf00 0001a352 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 1a352: df 92 push r13 1a354: ef 92 push r14 1a356: ff 92 push r15 1a358: 0f 93 push r16 1a35a: 1f 93 push r17 1a35c: cf 93 push r28 1a35e: df 93 push r29 1a360: cd b7 in r28, 0x3d ; 61 1a362: de b7 in r29, 0x3e ; 62 1a364: 63 97 sbiw r28, 0x13 ; 19 1a366: 0f b6 in r0, 0x3f ; 63 1a368: f8 94 cli 1a36a: de bf out 0x3e, r29 ; 62 1a36c: 0f be out 0x3f, r0 ; 63 1a36e: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1a370: 30 91 18 05 lds r19, 0x0518 ; 0x800518 1a374: 20 91 17 05 lds r18, 0x0517 ; 0x800517 1a378: 32 13 cpse r19, r18 1a37a: 73 c0 rjmp .+230 ; 0x1a462 1a37c: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1a37e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 1a382: 88 23 and r24, r24 1a384: 09 f4 brne .+2 ; 0x1a388 1a386: 45 c0 rjmp .+138 ; 0x1a412 //! //! @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)); 1a388: 8b e9 ldi r24, 0x9B ; 155 1a38a: 93 e4 ldi r25, 0x43 ; 67 1a38c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a390: 9f 93 push r25 1a392: 8f 93 push r24 1a394: 86 e3 ldi r24, 0x36 ; 54 1a396: 90 e9 ldi r25, 0x90 ; 144 1a398: 9f 93 push r25 1a39a: 8f 93 push r24 1a39c: 8e 01 movw r16, r28 1a39e: 0f 5f subi r16, 0xFF ; 255 1a3a0: 1f 4f sbci r17, 0xFF ; 255 1a3a2: 1f 93 push r17 1a3a4: 0f 93 push r16 1a3a6: 0f 94 a8 dc call 0x3b950 ; 0x3b950 1a3aa: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1a3ac: 47 e0 ldi r20, 0x07 ; 7 1a3ae: 50 e0 ldi r21, 0x00 ; 0 1a3b0: b7 01 movw r22, r14 1a3b2: 80 0f add r24, r16 1a3b4: 91 2f mov r25, r17 1a3b6: 91 1d adc r25, r1 1a3b8: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 1a3bc: 0f 90 pop r0 1a3be: 0f 90 pop r0 1a3c0: 0f 90 pop r0 1a3c2: 0f 90 pop r0 1a3c4: 0f 90 pop r0 1a3c6: 0f 90 pop r0 1a3c8: 20 e0 ldi r18, 0x00 ; 0 1a3ca: 82 2f mov r24, r18 1a3cc: 8d 0d add r24, r13 1a3ce: 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) 1a3d0: 27 30 cpi r18, 0x07 ; 7 1a3d2: 39 f0 breq .+14 ; 0x1a3e2 1a3d4: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 1a3d6: f8 01 movw r30, r16 1a3d8: e8 0f add r30, r24 1a3da: f9 1f adc r31, r25 1a3dc: 30 81 ld r19, Z 1a3de: 31 11 cpse r19, r1 1a3e0: f4 cf rjmp .-24 ; 0x1a3ca } buffer.c[index] = ']'; 1a3e2: f8 01 movw r30, r16 1a3e4: e8 0f add r30, r24 1a3e6: f9 1f adc r31, r25 1a3e8: 2d e5 ldi r18, 0x5D ; 93 1a3ea: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 1a3ec: 8c 0f add r24, r28 1a3ee: 9d 1f adc r25, r29 1a3f0: fc 01 movw r30, r24 1a3f2: 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()); 1a3f4: 0f 94 d2 cd call 0x39ba4 ; 0x39ba4 1a3f8: 48 2f mov r20, r24 1a3fa: 60 91 15 05 lds r22, 0x0515 ; 0x800515 1a3fe: 80 e0 ldi r24, 0x00 ; 0 1a400: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_pad(buffer.c, LCD_WIDTH - 2); 1a404: 62 e1 ldi r22, 0x12 ; 18 1a406: c8 01 movw r24, r16 1a408: 0e 94 84 71 call 0xe308 ; 0xe308 lcd_putc(type_char); 1a40c: 80 e2 ldi r24, 0x20 ; 32 1a40e: 0e 94 84 6f call 0xdf08 ; 0xdf08 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)) 1a412: 80 91 16 05 lds r24, 0x0516 ; 0x800516 1a416: 88 23 and r24, r24 1a418: 21 f1 breq .+72 ; 0x1a462 1a41a: 20 91 18 05 lds r18, 0x0518 ; 0x800518 1a41e: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1a422: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1a426: 28 17 cp r18, r24 1a428: 19 06 cpc r1, r25 1a42a: d9 f4 brne .+54 ; 0x1a462 { lcd_update_enabled = 0; 1a42c: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 1a430: 8e ee ldi r24, 0xEE ; 238 1a432: 97 e7 ldi r25, 0x77 ; 119 1a434: 89 2b or r24, r25 1a436: 11 f0 breq .+4 ; 0x1a43c 1a438: 0e 94 ee 77 call 0xefdc ; 0xefdc lcd_update_enabled = 1; 1a43c: 81 e0 ldi r24, 0x01 ; 1 1a43e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); 1a442: 0f 94 f6 cd call 0x39bec ; 0x39bec return; } } menu_item++; } 1a446: 63 96 adiw r28, 0x13 ; 19 1a448: 0f b6 in r0, 0x3f ; 63 1a44a: f8 94 cli 1a44c: de bf out 0x3e, r29 ; 62 1a44e: 0f be out 0x3f, r0 ; 63 1a450: cd bf out 0x3d, r28 ; 61 1a452: df 91 pop r29 1a454: cf 91 pop r28 1a456: 1f 91 pop r17 1a458: 0f 91 pop r16 1a45a: ff 90 pop r15 1a45c: ef 90 pop r14 1a45e: df 90 pop r13 1a460: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 1a462: 80 91 18 05 lds r24, 0x0518 ; 0x800518 1a466: 8f 5f subi r24, 0xFF ; 255 1a468: 80 93 18 05 sts 0x0518, r24 ; 0x800518 1a46c: ec cf rjmp .-40 ; 0x1a446 0001a46e : bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 1a46e: cf 92 push r12 1a470: df 92 push r13 1a472: ef 92 push r14 1a474: ff 92 push r15 1a476: 0f 93 push r16 1a478: 1f 93 push r17 1a47a: cf 93 push r28 1a47c: df 93 push r29 1a47e: 6c 01 movw r12, r24 1a480: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 1a482: c4 2f mov r28, r20 1a484: d0 e0 ldi r29, 0x00 ; 0 1a486: ae 01 movw r20, r28 1a488: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 1a48c: 89 2b or r24, r25 1a48e: b9 f4 brne .+46 ; 0x1a4be Number(str + tagSize, v); 1a490: b8 01 movw r22, r16 1a492: c6 01 movw r24, r12 1a494: 8c 0f add r24, r28 1a496: 9d 1f adc r25, r29 1a498: 0e 94 62 d0 call 0x1a0c4 ; 0x1a0c4 *v |= tagMask; 1a49c: f8 01 movw r30, r16 1a49e: 20 81 ld r18, Z 1a4a0: 31 81 ldd r19, Z+1 ; 0x01 1a4a2: 2e 29 or r18, r14 1a4a4: 3f 29 or r19, r15 1a4a6: 31 83 std Z+1, r19 ; 0x01 1a4a8: 20 83 st Z, r18 return true; 1a4aa: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1a4ac: df 91 pop r29 1a4ae: cf 91 pop r28 1a4b0: 1f 91 pop r17 1a4b2: 0f 91 pop r16 1a4b4: ff 90 pop r15 1a4b6: ef 90 pop r14 1a4b8: df 90 pop r13 1a4ba: cf 90 pop r12 1a4bc: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 1a4be: 80 e0 ldi r24, 0x00 ; 0 1a4c0: f5 cf rjmp .-22 ; 0x1a4ac 0001a4c2 : } #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); 1a4c2: 87 ea ldi r24, 0xA7 ; 167 1a4c4: 9c e0 ldi r25, 0x0C ; 12 1a4c6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (value > 1) value = 1; 1a4ca: 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) 1a4cc: 82 30 cpi r24, 0x02 ; 2 1a4ce: 08 f4 brcc .+2 ; 0x1a4d2 1a4d0: 68 27 eor r22, r24 1a4d2: 87 ea ldi r24, 0xA7 ; 167 1a4d4: 9c e0 ldi r25, 0x0C ; 12 1a4d6: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0001a4da : bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); } #ifdef PRUSA_SN_SUPPORT void WorkaroundPrusaSN() { 1a4da: cf 93 push r28 1a4dc: df 93 push r29 1a4de: c5 e1 ldi r28, 0x15 ; 21 1a4e0: 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++)); 1a4e2: fe 01 movw r30, r28 1a4e4: e6 5e subi r30, 0xE6 ; 230 1a4e6: f0 48 sbci r31, 0x80 ; 128 1a4e8: 64 91 lpm r22, Z 1a4ea: ce 01 movw r24, r28 1a4ec: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 1a4f0: 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++) { 1a4f2: c9 32 cpi r28, 0x29 ; 41 1a4f4: 8d e0 ldi r24, 0x0D ; 13 1a4f6: d8 07 cpc r29, r24 1a4f8: a1 f7 brne .-24 ; 0x1a4e2 eeprom_update_byte_notify((uint8_t*)EEPROM_PRUSA_SN + i, pgm_read_byte(SN++)); } } 1a4fa: df 91 pop r29 1a4fc: cf 91 pop r28 1a4fe: 08 95 ret 0001a500 : 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); 1a500: 8a ea ldi r24, 0xAA ; 170 1a502: 9d e0 ldi r25, 0x0D ; 13 1a504: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 1a508: 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) { 1a50a: 83 30 cpi r24, 0x03 ; 3 1a50c: 21 f0 breq .+8 ; 0x1a516 case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 1a50e: 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) { 1a510: 85 30 cpi r24, 0x05 ; 5 1a512: 09 f0 breq .+2 ; 0x1a516 case 1: mbl_z_probe_nr = 3; break; 1a514: 63 e0 ldi r22, 0x03 ; 3 1a516: 8a ea ldi r24, 0xAA ; 170 1a518: 9d e0 ldi r25, 0x0D ; 13 1a51a: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0001a51e : 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); 1a51e: 8b ea ldi r24, 0xAB ; 171 1a520: 9d e0 ldi r25, 0x0D ; 13 1a522: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 1a526: 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; 1a528: 83 30 cpi r24, 0x03 ; 3 1a52a: 09 f4 brne .+2 ; 0x1a52e 1a52c: 67 e0 ldi r22, 0x07 ; 7 1a52e: 8b ea ldi r24, 0xAB ; 171 1a530: 9d e0 ldi r25, 0x0D ; 13 1a532: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0001a536 : #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); 1a536: 8c ea ldi r24, 0xAC ; 172 1a538: 9d e0 ldi r25, 0x0D ; 13 1a53a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 magnet_elimination = !magnet_elimination; 1a53e: 61 e0 ldi r22, 0x01 ; 1 1a540: 81 11 cpse r24, r1 1a542: 60 e0 ldi r22, 0x00 ; 0 1a544: 8c ea ldi r24, 0xAC ; 172 1a546: 9d e0 ldi r25, 0x0D ; 13 1a548: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0001a54c : 1a54c: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1a550: 81 ea ldi r24, 0xA1 ; 161 1a552: 9d e0 ldi r25, 0x0D ; 13 1a554: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a //! @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(); 1a558: 0d 94 89 2a jmp 0x25512 ; 0x25512 0001a55c : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 1a55c: 0f 93 push r16 1a55e: 1f 93 push r17 1a560: cf 93 push r28 1a562: df 93 push r29 1a564: 00 d0 rcall .+0 ; 0x1a566 1a566: 00 d0 rcall .+0 ; 0x1a568 1a568: 1f 92 push r1 1a56a: 1f 92 push r1 1a56c: cd b7 in r28, 0x3d ; 61 1a56e: de b7 in r29, 0x3e ; 62 1a570: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 1a572: 8a e0 ldi r24, 0x0A ; 10 1a574: 90 e0 ldi r25, 0x00 ; 0 1a576: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 1a57a: 9a 83 std Y+2, r25 ; 0x02 1a57c: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 1a57e: 8c e0 ldi r24, 0x0C ; 12 1a580: 90 e0 ldi r25, 0x00 ; 0 1a582: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 1a586: 9c 83 std Y+4, r25 ; 0x04 1a588: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 1a58a: 8e e0 ldi r24, 0x0E ; 14 1a58c: 90 e0 ldi r25, 0x00 ; 0 1a58e: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 1a592: 9e 83 std Y+6, r25 ; 0x06 1a594: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 1a596: 80 e1 ldi r24, 0x10 ; 16 1a598: 90 e0 ldi r25, 0x00 ; 0 1a59a: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 1a59e: 98 87 std Y+8, r25 ; 0x08 1a5a0: 8f 83 std Y+7, r24 ; 0x07 1a5a2: c8 01 movw r24, r16 1a5a4: de 01 movw r26, r28 1a5a6: 11 96 adiw r26, 0x01 ; 1 1a5a8: be 01 movw r22, r28 1a5aa: 67 5f subi r22, 0xF7 ; 247 1a5ac: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 1a5ae: fc 01 movw r30, r24 1a5b0: 25 91 lpm r18, Z+ 1a5b2: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 1a5b4: 4d 91 ld r20, X+ 1a5b6: 5d 91 ld r21, X+ 1a5b8: 42 17 cp r20, r18 1a5ba: 53 07 cpc r21, r19 1a5bc: 48 f0 brcs .+18 ; 0x1a5d0 return true; else if (v < ver_eeprom[i]) 1a5be: 24 17 cp r18, r20 1a5c0: 35 07 cpc r19, r21 1a5c2: 20 f0 brcs .+8 ; 0x1a5cc 1a5c4: 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) { 1a5c6: a6 17 cp r26, r22 1a5c8: b7 07 cpc r27, r23 1a5ca: 89 f7 brne .-30 ; 0x1a5ae return true; else if (v < ver_eeprom[i]) break; } return false; 1a5cc: 80 e0 ldi r24, 0x00 ; 0 1a5ce: 01 c0 rjmp .+2 ; 0x1a5d2 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; 1a5d0: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 1a5d2: 28 96 adiw r28, 0x08 ; 8 1a5d4: 0f b6 in r0, 0x3f ; 63 1a5d6: f8 94 cli 1a5d8: de bf out 0x3e, r29 ; 62 1a5da: 0f be out 0x3f, r0 ; 63 1a5dc: cd bf out 0x3d, r28 ; 61 1a5de: df 91 pop r29 1a5e0: cf 91 pop r28 1a5e2: 1f 91 pop r17 1a5e4: 0f 91 pop r16 1a5e6: 08 95 ret 0001a5e8 : value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { restore_file_from_sd(); 1a5e8: 0e 94 0e 8a call 0x1141c ; 0x1141c // M24: Start/resume SD print enquecommand_P(MSG_M24); 1a5ec: 61 e0 ldi r22, 0x01 ; 1 1a5ee: 89 ee ldi r24, 0xE9 ; 233 1a5f0: 90 e7 ldi r25, 0x70 ; 112 1a5f2: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_return_to_status(); 1a5f6: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 0001a5fa : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1a5fa: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1a5fc: 8d e7 ldi r24, 0x7D ; 125 1a5fe: 9d e3 ldi r25, 0x3D ; 61 1a600: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a604: ac 01 movw r20, r24 1a606: 60 e0 ldi r22, 0x00 ; 0 1a608: 80 e0 ldi r24, 0x00 ; 0 1a60a: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_putc_at(0, 1, '\n'); 1a60e: 4a e0 ldi r20, 0x0A ; 10 1a610: 61 e0 ldi r22, 0x01 ; 1 1a612: 80 e0 ldi r24, 0x00 ; 0 1a614: 0e 94 b5 6f call 0xdf6a ; 0xdf6a MENU_BEGIN(); 1a618: 0f 94 10 cf call 0x39e20 ; 0x39e20 1a61c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a620: 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(); 1a622: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a626: 84 30 cpi r24, 0x04 ; 4 1a628: 18 f5 brcc .+70 ; 0x1a670 1a62a: 10 92 18 05 sts 0x0518, r1 ; 0x800518 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 1a62e: 81 11 cpse r24, r1 1a630: 02 c0 rjmp .+4 ; 0x1a636 1a632: c0 93 15 05 sts 0x0515, r28 ; 0x800515 // Show No options first, the default selection MENU_ITEM_FUNCTION_P(_T(MSG_NO), lcd_return_to_status); 1a636: 88 e7 ldi r24, 0x78 ; 120 1a638: 9d e3 ldi r25, 0x3D ; 61 1a63a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a63e: 62 ec ldi r22, 0xC2 ; 194 1a640: 79 e3 ldi r23, 0x39 ; 57 1a642: 0f 94 8d ce call 0x39d1a ; 0x39d1a MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 1a646: 82 e7 ldi r24, 0x72 ; 114 1a648: 9d e3 ldi r25, 0x3D ; 61 1a64a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a64e: 68 ea ldi r22, 0xA8 ; 168 1a650: 7a e3 ldi r23, 0x3A ; 58 1a652: 0f 94 8d ce call 0x39d1a ; 0x39d1a MENU_END(); 1a656: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1a65a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a65e: 8f 5f subi r24, 0xFF ; 255 1a660: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a664: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a668: 8f 5f subi r24, 0xFF ; 255 1a66a: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a66e: d9 cf rjmp .-78 ; 0x1a622 // 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(); } 1a670: cf 91 pop r28 1a672: 08 95 ret 0001a674 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 1a674: cf 93 push r28 1a676: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 1a678: 88 ed ldi r24, 0xD8 ; 216 1a67a: 93 e0 ldi r25, 0x03 ; 3 1a67c: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 1a680: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 1a684: 81 11 cpse r24, r1 1a686: 18 c0 rjmp .+48 ; 0x1a6b8 1a688: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 1a68c: 81 11 cpse r24, r1 1a68e: 14 c0 rjmp .+40 ; 0x1a6b8 1a690: c0 91 69 0e lds r28, 0x0E69 ; 0x800e69 1a694: d0 91 6a 0e lds r29, 0x0E6A ; 0x800e6a 1a698: 89 e3 ldi r24, 0x39 ; 57 1a69a: c4 3e cpi r28, 0xE4 ; 228 1a69c: d8 07 cpc r29, r24 1a69e: 61 f0 breq .+24 ; 0x1a6b8 1a6a0: 89 e3 ldi r24, 0x39 ; 57 1a6a2: c0 38 cpi r28, 0x80 ; 128 1a6a4: d8 07 cpc r29, r24 1a6a6: 41 f0 breq .+16 ; 0x1a6b8 1a6a8: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 1a6ac: 81 11 cpse r24, r1 1a6ae: 04 c0 rjmp .+8 ; 0x1a6b8 1a6b0: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1a6b4: 88 23 and r24, r24 1a6b6: 31 f0 breq .+12 ; 0x1a6c4 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 1a6b8: 82 e0 ldi r24, 0x02 ; 2 1a6ba: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a6be: df 91 pop r29 1a6c0: cf 91 pop r28 1a6c2: 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) 1a6c4: 8b e3 ldi r24, 0x3B ; 59 1a6c6: cc 30 cpi r28, 0x0C ; 12 1a6c8: d8 07 cpc r29, r24 1a6ca: 49 f4 brne .+18 ; 0x1a6de { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 1a6cc: 82 e0 ldi r24, 0x02 ; 2 1a6ce: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d eeprom_toggle((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY); 1a6d2: 8a e2 ldi r24, 0x2A ; 42 1a6d4: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a6d6: df 91 pop r29 1a6d8: 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); 1a6da: 0c 94 bf 77 jmp 0xef7e ; 0xef7e 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); 1a6de: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 1a6e2: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 return; } // explicitely listed menus which are allowed to rise the move-z or live-adj-z functions // The lists are not the same for both functions, so first decide which function is to be performed if (blocks_queued() || printJobOngoing()){ // long press as live-adj-z 1a6e6: 98 13 cpse r25, r24 1a6e8: 04 c0 rjmp .+8 ; 0x1a6f2 1a6ea: 0e 94 45 68 call 0xd08a ; 0xd08a 1a6ee: 88 23 and r24, r24 1a6f0: 61 f0 breq .+24 ; 0x1a70a if ( babystep_allowed_strict() 1a6f2: 0e 94 80 68 call 0xd100 ; 0xd100 && (menu_menu == lcd_status_screen // and in listed menus... 1a6f6: 81 11 cpse r24, r1 1a6f8: 10 c0 rjmp .+32 ; 0x1a71a Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 1a6fa: 82 e0 ldi r24, 0x02 ; 2 1a6fc: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1a700: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a702: df 91 pop r29 1a704: cf 91 pop r28 1a706: 0d 94 7f 64 jmp 0x2c8fe ; 0x2c8fe menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 1a70a: 8a e3 ldi r24, 0x3A ; 58 1a70c: cc 33 cpi r28, 0x3C ; 60 1a70e: d8 07 cpc r29, r24 1a710: e1 f4 brne .+56 ; 0x1a74a #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a712: 60 e0 ldi r22, 0x00 ; 0 1a714: 80 e8 ldi r24, 0x80 ; 128 1a716: 99 e3 ldi r25, 0x39 ; 57 1a718: 14 c0 rjmp .+40 ; 0x1a742 // 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... 1a71a: 8a e3 ldi r24, 0x3A ; 58 1a71c: cc 33 cpi r28, 0x3C ; 60 1a71e: d8 07 cpc r29, r24 1a720: 59 f0 breq .+22 ; 0x1a738 || menu_menu == lcd_main_menu 1a722: 84 ee ldi r24, 0xE4 ; 228 1a724: c1 3c cpi r28, 0xC1 ; 193 1a726: d8 07 cpc r29, r24 1a728: 39 f0 breq .+14 ; 0x1a738 || menu_menu == lcd_tune_menu 1a72a: 84 ed ldi r24, 0xD4 ; 212 1a72c: cb 3e cpi r28, 0xEB ; 235 1a72e: d8 07 cpc r29, r24 1a730: 19 f0 breq .+6 ; 0x1a738 || menu_menu == lcd_support_menu 1a732: ce 58 subi r28, 0x8E ; 142 1a734: d9 43 sbci r29, 0x39 ; 57 1a736: 09 f7 brne .-62 ; 0x1a6fa ) ){ lcd_clear(); 1a738: 0e 94 c8 6f call 0xdf90 ; 0xdf90 menu_submenu(lcd_babystep_z); 1a73c: 60 e0 ldi r22, 0x00 ; 0 1a73e: 84 ee ldi r24, 0xE4 ; 228 1a740: 99 e3 ldi r25, 0x39 ; 57 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 1a742: df 91 pop r29 1a744: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 1a746: 0d 94 7d d0 jmp 0x3a0fa ; 0x3a0fa } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 1a74a: 84 ee ldi r24, 0xE4 ; 228 1a74c: c1 3c cpi r28, 0xC1 ; 193 1a74e: d8 07 cpc r29, r24 1a750: 01 f3 breq .-64 ; 0x1a712 || menu_menu == lcd_preheat_menu 1a752: 8a e3 ldi r24, 0x3A ; 58 1a754: cc 30 cpi r28, 0x0C ; 12 1a756: d8 07 cpc r29, r24 1a758: e1 f2 breq .-72 ; 0x1a712 || menu_menu == lcd_sdcard_menu 1a75a: 89 e3 ldi r24, 0x39 ; 57 1a75c: cc 36 cpi r28, 0x6C ; 108 1a75e: d8 07 cpc r29, r24 1a760: c1 f2 breq .-80 ; 0x1a712 || menu_menu == lcd_settings_menu 1a762: 89 e3 ldi r24, 0x39 ; 57 1a764: c6 3a cpi r28, 0xA6 ; 166 1a766: d8 07 cpc r29, r24 1a768: a1 f2 breq .-88 ; 0x1a712 || menu_menu == lcd_control_temperature_menu 1a76a: 84 ed ldi r24, 0xD4 ; 212 1a76c: cb 3c cpi r28, 0xCB ; 203 1a76e: d8 07 cpc r29, r24 1a770: 81 f2 breq .-96 ; 0x1a712 #if (LANG_MODE != 0) || menu_menu == lcd_language 1a772: 8a e3 ldi r24, 0x3A ; 58 1a774: c8 30 cpi r28, 0x08 ; 8 1a776: d8 07 cpc r29, r24 1a778: 61 f2 breq .-104 ; 0x1a712 #endif || menu_menu == lcd_support_menu 1a77a: ce 58 subi r28, 0x8E ; 142 1a77c: d9 43 sbci r29, 0x39 ; 57 1a77e: 09 f0 breq .+2 ; 0x1a782 1a780: bc cf rjmp .-136 ; 0x1a6fa 1a782: c7 cf rjmp .-114 ; 0x1a712 0001a784 : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a784: 0f 94 10 cf call 0x39e20 ; 0x39e20 1a788: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1a78c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a790: 84 30 cpi r24, 0x04 ; 4 1a792: 08 f0 brcs .+2 ; 0x1a796 1a794: 3f c0 rjmp .+126 ; 0x1a814 1a796: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 1a79a: 8d e3 ldi r24, 0x3D ; 61 1a79c: 9b e3 ldi r25, 0x3B ; 59 1a79e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a7a2: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 if(eeprom_is_sheet_initialized(selected_sheet)){ 1a7a6: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1a7aa: 0e 94 cc 77 call 0xef98 ; 0xef98 1a7ae: 88 23 and r24, r24 1a7b0: 41 f0 breq .+16 ; 0x1a7c2 MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1a7b2: 84 e3 ldi r24, 0x34 ; 52 1a7b4: 9b e3 ldi r25, 0x3B ; 59 1a7b6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a7ba: 6b ef ldi r22, 0xFB ; 251 1a7bc: 78 ed ldi r23, 0xD8 ; 216 1a7be: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } if (lcd_commands_type == LcdCommands::Idle) 1a7c2: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1a7c6: 81 11 cpse r24, r1 1a7c8: 08 c0 rjmp .+16 ; 0x1a7da { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 1a7ca: 81 e2 ldi r24, 0x21 ; 33 1a7cc: 9b e3 ldi r25, 0x3B ; 59 1a7ce: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a7d2: 66 ea ldi r22, 0xA6 ; 166 1a7d4: 72 ed ldi r23, 0xD2 ; 210 1a7d6: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 1a7da: 88 e1 ldi r24, 0x18 ; 24 1a7dc: 9b e3 ldi r25, 0x3B ; 59 1a7de: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a7e2: 6e eb ldi r22, 0xBE ; 190 1a7e4: 76 ed ldi r23, 0xD6 ; 214 1a7e6: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 1a7ea: 80 e1 ldi r24, 0x10 ; 16 1a7ec: 9b e3 ldi r25, 0x3B ; 59 1a7ee: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a7f2: 6f e1 ldi r22, 0x1F ; 31 1a7f4: 77 ee ldi r23, 0xE7 ; 231 1a7f6: 0f 94 8d ce call 0x39d1a ; 0x39d1a MENU_END(); 1a7fa: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1a7fe: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a802: 8f 5f subi r24, 0xFF ; 255 1a804: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a808: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a80c: 8f 5f subi r24, 0xFF ; 255 1a80e: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a812: bc cf rjmp .-136 ; 0x1a78c } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 1a814: 08 95 ret 0001a816 () [clone .lto_priv.454]>: } template static void select_sheet_menu() { selected_sheet = number; 1a816: 87 e0 ldi r24, 0x07 ; 7 1a818: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a81c: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a820 () [clone .lto_priv.453]>: } template static void select_sheet_menu() { selected_sheet = number; 1a820: 86 e0 ldi r24, 0x06 ; 6 1a822: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a826: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a82a () [clone .lto_priv.452]>: } template static void select_sheet_menu() { selected_sheet = number; 1a82a: 85 e0 ldi r24, 0x05 ; 5 1a82c: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a830: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a834 () [clone .lto_priv.451]>: } template static void select_sheet_menu() { selected_sheet = number; 1a834: 84 e0 ldi r24, 0x04 ; 4 1a836: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a83a: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a83e () [clone .lto_priv.450]>: } template static void select_sheet_menu() { selected_sheet = number; 1a83e: 83 e0 ldi r24, 0x03 ; 3 1a840: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a844: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a848 () [clone .lto_priv.449]>: } template static void select_sheet_menu() { selected_sheet = number; 1a848: 82 e0 ldi r24, 0x02 ; 2 1a84a: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a84e: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a852 () [clone .lto_priv.448]>: } template static void select_sheet_menu() { selected_sheet = number; 1a852: 81 e0 ldi r24, 0x01 ; 1 1a854: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_sheet_menu(); 1a858: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a85c () [clone .lto_priv.447]>: } template static void select_sheet_menu() { selected_sheet = number; 1a85c: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_sheet_menu(); 1a860: 0c 94 c2 d3 jmp 0x1a784 ; 0x1a784 0001a864 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a864: 0f 94 10 cf call 0x39e20 ; 0x39e20 1a868: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1a86c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a870: 84 30 cpi r24, 0x04 ; 4 1a872: 08 f0 brcs .+2 ; 0x1a876 1a874: 8f c0 rjmp .+286 ; 0x1a994 1a876: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1a87a: 88 eb ldi r24, 0xB8 ; 184 1a87c: 9d e3 ldi r25, 0x3D ; 61 1a87e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a882: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 1a886: 82 ec ldi r24, 0xC2 ; 194 1a888: 9a e3 ldi r25, 0x3A ; 58 1a88a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a88e: 60 ed ldi r22, 0xD0 ; 208 1a890: 79 e3 ldi r23, 0x39 ; 57 1a892: 0f 94 8d ce call 0x39d1a ; 0x39d1a if (lcd_commands_type == LcdCommands::Idle) 1a896: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1a89a: 81 11 cpse r24, r1 1a89c: 08 c0 rjmp .+16 ; 0x1a8ae { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1a89e: 81 e2 ldi r24, 0x21 ; 33 1a8a0: 9b e3 ldi r25, 0x3B ; 59 1a8a2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a8a6: 66 ec ldi r22, 0xC6 ; 198 1a8a8: 79 e3 ldi r23, 0x39 ; 57 1a8aa: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1a8ae: 83 e5 ldi r24, 0x53 ; 83 1a8b0: 99 e4 ldi r25, 0x49 ; 73 1a8b2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a8b6: 61 e2 ldi r22, 0x21 ; 33 1a8b8: 7c e6 ldi r23, 0x6C ; 108 1a8ba: 0f 94 06 ce call 0x39c0c ; 0x39c0c #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); 1a8be: 86 eb ldi r24, 0xB6 ; 182 1a8c0: 9a e3 ldi r25, 0x3A ; 58 1a8c2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a8c6: 60 ef ldi r22, 0xF0 ; 240 1a8c8: 7a e3 ldi r23, 0x3A ; 58 1a8ca: 0f 94 8d ce call 0x39d1a ; 0x39d1a #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 1a8ce: 8b ea ldi r24, 0xAB ; 171 1a8d0: 9a e3 ldi r25, 0x3A ; 58 1a8d2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a8d6: 66 ea ldi r22, 0xA6 ; 166 1a8d8: 7a e3 ldi r23, 0x3A ; 58 1a8da: 0f 94 8d ce call 0x39d1a ; 0x39d1a // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 1a8de: 8b e9 ldi r24, 0x9B ; 155 1a8e0: 9a e3 ldi r25, 0x3A ; 58 1a8e2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a8e6: 60 ea ldi r22, 0xA0 ; 160 1a8e8: 7a e3 ldi r23, 0x3A ; 58 1a8ea: 0f 94 8d ce call 0x39d1a ; 0x39d1a // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 1a8ee: 8d e8 ldi r24, 0x8D ; 141 1a8f0: 9a e3 ldi r25, 0x3A ; 58 1a8f2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a8f6: 60 e7 ldi r22, 0x70 ; 112 1a8f8: 7a e3 ldi r23, 0x3A ; 58 1a8fa: 0f 94 8d ce call 0x39d1a ; 0x39d1a MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 1a8fe: 89 e7 ldi r24, 0x79 ; 121 1a900: 9a e3 ldi r25, 0x3A ; 58 1a902: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a906: 6e ef ldi r22, 0xFE ; 254 1a908: 79 e3 ldi r23, 0x39 ; 57 1a90a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 1a90e: 85 e6 ldi r24, 0x65 ; 101 1a910: 9a e3 ldi r25, 0x3A ; 58 1a912: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a916: 66 e2 ldi r22, 0x26 ; 38 1a918: 7b e3 ldi r23, 0x3B ; 59 1a91a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 1a91e: 83 e5 ldi r24, 0x53 ; 83 1a920: 9a e3 ldi r25, 0x3A ; 58 1a922: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a926: 6c e5 ldi r22, 0x5C ; 92 1a928: 7a e3 ldi r23, 0x3A ; 58 1a92a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #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")); 1a92e: 8f e3 ldi r24, 0x3F ; 63 1a930: 9a e3 ldi r25, 0x3A ; 58 1a932: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a936: 6f e1 ldi r22, 0x1F ; 31 1a938: 7b e8 ldi r23, 0x8B ; 139 1a93a: 0f 94 06 ce call 0x39c0c ; 0x39c0c #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1a93e: 20 e0 ldi r18, 0x00 ; 0 1a940: 30 e0 ldi r19, 0x00 ; 0 1a942: 40 e2 ldi r20, 0x20 ; 32 1a944: 51 e4 ldi r21, 0x41 ; 65 1a946: 60 91 99 03 lds r22, 0x0399 ; 0x800399 1a94a: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 1a94e: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1a952: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1a956: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1a95a: 87 fd sbrc r24, 7 1a95c: 08 c0 rjmp .+16 ; 0x1a96e MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 1a95e: 82 e3 ldi r24, 0x32 ; 50 1a960: 9a e3 ldi r25, 0x3A ; 58 1a962: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a966: 66 ed ldi r22, 0xD6 ; 214 1a968: 79 e3 ldi r23, 0x39 ; 57 1a96a: 0f 94 8d ce call 0x39d1a ; 0x39d1a #endif #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); 1a96e: 60 e8 ldi r22, 0x80 ; 128 1a970: 70 ed ldi r23, 0xD0 ; 208 1a972: 88 ee ldi r24, 0xE8 ; 232 1a974: 9a e6 ldi r25, 0x6A ; 106 1a976: 0f 94 8d ce call 0x39d1a ; 0x39d1a #endif //THERMAL_MODEL MENU_END(); 1a97a: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 1a97e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a982: 8f 5f subi r24, 0xFF ; 255 1a984: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a988: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a98c: 8f 5f subi r24, 0xFF ; 255 1a98e: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a992: 6c cf rjmp .-296 ; 0x1a86c #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1a994: 08 95 ret 0001a996 : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a996: 0f 94 10 cf call 0x39e20 ; 0x39e20 1a99a: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1a99e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a9a2: 84 30 cpi r24, 0x04 ; 4 1a9a4: b8 f4 brcc .+46 ; 0x1a9d4 1a9a6: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 1a9aa: 87 e6 ldi r24, 0x67 ; 103 1a9ac: 9d e3 ldi r25, 0x3D ; 61 1a9ae: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1a9b2: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 menuitems_temperature_common(); 1a9b6: 0f 94 db 32 call 0x265b6 ; 0x265b6 MENU_END(); 1a9ba: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1a9be: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1a9c2: 8f 5f subi r24, 0xFF ; 255 1a9c4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1a9c8: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1a9cc: 8f 5f subi r24, 0xFF ; 255 1a9ce: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1a9d2: e5 cf rjmp .-54 ; 0x1a99e MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 1a9d4: 08 95 ret 0001a9d6 : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1a9d6: ef 92 push r14 1a9d8: ff 92 push r15 1a9da: 0f 93 push r16 1a9dc: 1f 93 push r17 1a9de: cf 93 push r28 1a9e0: df 93 push r29 1a9e2: 80 91 94 02 lds r24, 0x0294 ; 0x800294 1a9e6: 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) 1a9ea: 20 91 b6 03 lds r18, 0x03B6 ; 0x8003b6 1a9ee: 21 11 cpse r18, r1 1a9f0: 97 c0 rjmp .+302 ; 0x1ab20 { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1a9f2: 21 e0 ldi r18, 0x01 ; 1 1a9f4: 20 93 b6 03 sts 0x03B6, r18 ; 0x8003b6 _md->extrudemultiply = extrudemultiply; 1a9f8: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1a9fc: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 1aa00: 8f ef ldi r24, 0xFF ; 255 1aa02: 9f e0 ldi r25, 0x0F ; 15 1aa04: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1aa08: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 1aa0c: 0f 94 10 cf call 0x39e20 ; 0x39e20 1aa10: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1aa14: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1aa18: 84 30 cpi r24, 0x04 ; 4 1aa1a: 08 f0 brcs .+2 ; 0x1aa1e 1aa1c: 99 c0 rjmp .+306 ; 0x1ab50 1aa1e: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1aa22: 0f 94 90 cd call 0x39b20 ; 0x39b20 1aa26: 81 11 cpse r24, r1 1aa28: 0e 94 98 65 call 0xcb30 ; 0xcb30 refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1aa2c: 88 eb ldi r24, 0xB8 ; 184 1aa2e: 9d e3 ldi r25, 0x3D ; 61 1aa30: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aa34: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 1aa38: 8f ee ldi r24, 0xEF ; 239 1aa3a: 9c e3 ldi r25, 0x3C ; 60 1aa3c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aa40: f1 2c mov r15, r1 1aa42: e1 2c mov r14, r1 1aa44: 07 ee ldi r16, 0xE7 ; 231 1aa46: 13 e0 ldi r17, 0x03 ; 3 1aa48: 2a e0 ldi r18, 0x0A ; 10 1aa4a: 30 e0 ldi r19, 0x00 ; 0 1aa4c: 40 e1 ldi r20, 0x10 ; 16 1aa4e: 69 e3 ldi r22, 0x39 ; 57 1aa50: 72 e0 ldi r23, 0x02 ; 2 1aa52: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 menuitems_temperature_common(); 1aa56: 0f 94 db 32 call 0x265b6 ; 0x265b6 MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 1aa5a: 88 ee ldi r24, 0xE8 ; 232 1aa5c: 9c e3 ldi r25, 0x3C ; 60 1aa5e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aa62: 2a e0 ldi r18, 0x0A ; 10 1aa64: 30 e0 ldi r19, 0x00 ; 0 1aa66: 40 e1 ldi r20, 0x10 ; 16 1aa68: 64 e9 ldi r22, 0x94 ; 148 1aa6a: 72 e0 ldi r23, 0x02 ; 2 1aa6c: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 #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); 1aa70: 86 ed ldi r24, 0xD6 ; 214 1aa72: 9c e3 ldi r25, 0x3C ; 60 1aa74: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aa78: 6c ed ldi r22, 0xDC ; 220 1aa7a: 79 e3 ldi r23, 0x39 ; 57 1aa7c: 0f 94 8d ce call 0x39d1a ; 0x39d1a #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 1aa80: 0e 94 3a 68 call 0xd074 ; 0xd074 1aa84: 88 23 and r24, r24 1aa86: 41 f0 breq .+16 ; 0x1aa98 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 1aa88: 83 e5 ldi r24, 0x53 ; 83 1aa8a: 99 e4 ldi r25, 0x49 ; 73 1aa8c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aa90: 67 e3 ldi r22, 0x37 ; 55 1aa92: 7b e8 ldi r23, 0x8B ; 139 1aa94: 0f 94 06 ce call 0x39c0c ; 0x39c0c } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 1aa98: 88 ec ldi r24, 0xC8 ; 200 1aa9a: 9c e3 ldi r25, 0x3C ; 60 1aa9c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aaa0: 6a ed ldi r22, 0xDA ; 218 1aaa2: 7a e3 ldi r23, 0x3A ; 58 1aaa4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 1aaa8: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1aaac: 81 30 cpi r24, 0x01 ; 1 1aaae: 11 f4 brne .+4 ; 0x1aab4 { menuitems_MMU_settings_common(); 1aab0: 0f 94 78 33 call 0x266f0 ; 0x266f0 } SETTINGS_FANS_CHECK(); 1aab4: 0f 94 c1 32 call 0x26582 ; 0x26582 SETTINGS_SILENT_MODE(); 1aab8: 0f 94 14 33 call 0x26628 ; 0x26628 SETTINGS_SOUND; 1aabc: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 1aac0: 82 30 cpi r24, 0x02 ; 2 1aac2: 09 f4 brne .+2 ; 0x1aac6 1aac4: 3f c0 rjmp .+126 ; 0x1ab44 1aac6: 83 30 cpi r24, 0x03 ; 3 1aac8: 09 f4 brne .+2 ; 0x1aacc 1aaca: 3f c0 rjmp .+126 ; 0x1ab4a 1aacc: 81 30 cpi r24, 0x01 ; 1 1aace: b9 f1 breq .+110 ; 0x1ab3e 1aad0: 81 ec ldi r24, 0xC1 ; 193 1aad2: 9c e3 ldi r25, 0x3C ; 60 1aad4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aad8: ec 01 movw r28, r24 1aada: 89 eb ldi r24, 0xB9 ; 185 1aadc: 9c e3 ldi r25, 0x3C ; 60 1aade: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aae2: 22 e0 ldi r18, 0x02 ; 2 1aae4: 46 e6 ldi r20, 0x66 ; 102 1aae6: 59 e3 ldi r21, 0x39 ; 57 1aae8: be 01 movw r22, r28 1aaea: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #ifdef LCD_BL_PIN if (backlightSupport) 1aaee: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 1aaf2: 88 23 and r24, r24 1aaf4: 41 f0 breq .+16 ; 0x1ab06 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 1aaf6: 83 e9 ldi r24, 0x93 ; 147 1aaf8: 9c e3 ldi r25, 0x3C ; 60 1aafa: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1aafe: 6b e9 ldi r22, 0x9B ; 155 1ab00: 77 ed ldi r23, 0xD7 ; 215 1ab02: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } #endif //LCD_BL_PIN MENU_END(); 1ab06: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 1ab0a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1ab0e: 8f 5f subi r24, 0xFF ; 255 1ab10: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1ab14: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1ab18: 8f 5f subi r24, 0xFF ; 255 1ab1a: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1ab1e: 7a cf rjmp .-268 ; 0x1aa14 { // 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) 1ab20: 20 91 b7 03 lds r18, 0x03B7 ; 0x8003b7 1ab24: 30 91 b8 03 lds r19, 0x03B8 ; 0x8003b8 1ab28: 28 17 cp r18, r24 1ab2a: 39 07 cpc r19, r25 1ab2c: 09 f4 brne .+2 ; 0x1ab30 1ab2e: 68 cf rjmp .-304 ; 0x1aa00 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1ab30: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 1ab34: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 calculate_extruder_multipliers(); 1ab38: 0e 94 6e 66 call 0xccdc ; 0xccdc 1ab3c: 61 cf rjmp .-318 ; 0x1aa00 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1ab3e: 82 eb ldi r24, 0xB2 ; 178 1ab40: 9c e3 ldi r25, 0x3C ; 60 1ab42: c8 cf rjmp .-112 ; 0x1aad4 1ab44: 89 ea ldi r24, 0xA9 ; 169 1ab46: 9c e3 ldi r25, 0x3C ; 60 1ab48: c5 cf rjmp .-118 ; 0x1aad4 1ab4a: 80 ea ldi r24, 0xA0 ; 160 1ab4c: 9c e3 ldi r25, 0x3C ; 60 1ab4e: c2 cf rjmp .-124 ; 0x1aad4 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1ab50: df 91 pop r29 1ab52: cf 91 pop r28 1ab54: 1f 91 pop r17 1ab56: 0f 91 pop r16 1ab58: ff 90 pop r15 1ab5a: ef 90 pop r14 1ab5c: 08 95 ret 0001ab5e : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 1ab5e: bf 92 push r11 1ab60: cf 92 push r12 1ab62: df 92 push r13 1ab64: ef 92 push r14 1ab66: ff 92 push r15 1ab68: 0f 93 push r16 1ab6a: 1f 93 push r17 1ab6c: cf 93 push r28 1ab6e: df 93 push r29 1ab70: c8 2f mov r28, r24 1ab72: f6 2e mov r15, r22 1ab74: e4 2e mov r14, r20 1ab76: b2 2e mov r11, r18 1ab78: 68 01 movw r12, r16 lcd_update_enable(false); 1ab7a: 80 e0 ldi r24, 0x00 ; 0 1ab7c: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 1ab80: dc e7 ldi r29, 0x7C ; 124 1ab82: fe 14 cp r15, r14 1ab84: 08 f0 brcs .+2 ; 0x1ab88 1ab86: dd e2 ldi r29, 0x2D ; 45 if (_clear) 1ab88: bb 20 and r11, r11 1ab8a: 09 f1 breq .+66 ; 0x1abce lcd_clear(); 1ab8c: 0e 94 c8 6f call 0xdf90 ; 0xdf90 else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1ab90: c1 11 cpse r28, r1 1ab92: 20 c0 rjmp .+64 ; 0x1abd4 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1ab94: 8d eb ldi r24, 0xBD ; 189 1ab96: 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)); 1ab98: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ab9c: 0e 94 80 6f call 0xdf00 ; 0xdf00 if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1aba0: 88 ef ldi r24, 0xF8 ; 248 1aba2: 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 1aba4: 82 30 cpi r24, 0x02 ; 2 1aba6: 78 f5 brcc .+94 ; 0x1ac06 || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1aba8: 8f e9 ldi r24, 0x9F ; 159 1abaa: 9f e3 ldi r25, 0x3F ; 63 1abac: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1abb0: 0e 94 80 6f call 0xdf00 ; 0xdf00 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)); 1abb4: 8e e7 ldi r24, 0x7E ; 126 1abb6: 9f e3 ldi r25, 0x3F ; 63 1abb8: cc 30 cpi r28, 0x0C ; 12 1abba: 49 f1 breq .+82 ; 0x1ac0e if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 1abbc: 88 ec ldi r24, 0xC8 ; 200 1abbe: 93 e4 ldi r25, 0x43 ; 67 1abc0: cd 30 cpi r28, 0x0D ; 13 1abc2: 29 f1 breq .+74 ; 0x1ac0e if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 1abc4: ce 30 cpi r28, 0x0E ; 14 1abc6: 39 f5 brne .+78 ; 0x1ac16 1abc8: 8b e6 ldi r24, 0x6B ; 107 1abca: 9f e3 ldi r25, 0x3F ; 63 1abcc: 20 c0 rjmp .+64 ; 0x1ac0e lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 1abce: 0e 94 c1 6f call 0xdf82 ; 0xdf82 1abd2: de cf rjmp .-68 ; 0x1ab90 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abd4: c1 30 cpi r28, 0x01 ; 1 1abd6: f1 f2 breq .-68 ; 0x1ab94 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1abd8: c2 30 cpi r28, 0x02 ; 2 1abda: e1 f2 breq .-72 ; 0x1ab94 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 1abdc: 86 ef ldi r24, 0xF6 ; 246 1abde: 9f e3 ldi r25, 0x3F ; 63 1abe0: c3 30 cpi r28, 0x03 ; 3 1abe2: d1 f2 breq .-76 ; 0x1ab98 if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 1abe4: 84 ee ldi r24, 0xE4 ; 228 1abe6: 9f e3 ldi r25, 0x3F ; 63 1abe8: c4 30 cpi r28, 0x04 ; 4 1abea: b1 f2 breq .-84 ; 0x1ab98 if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 1abec: 82 ed ldi r24, 0xD2 ; 210 1abee: 9f e3 ldi r25, 0x3F ; 63 1abf0: c5 30 cpi r28, 0x05 ; 5 1abf2: 91 f2 breq .-92 ; 0x1ab98 if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 1abf4: 80 ec ldi r24, 0xC0 ; 192 1abf6: 9f e3 ldi r25, 0x3F ; 63 1abf8: c6 30 cpi r28, 0x06 ; 6 1abfa: 71 f2 breq .-100 ; 0x1ab98 if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 1abfc: c7 30 cpi r28, 0x07 ; 7 1abfe: 81 f6 brne .-96 ; 0x1aba0 1ac00: 81 eb ldi r24, 0xB1 ; 177 1ac02: 9f e3 ldi r25, 0x3F ; 63 1ac04: c9 cf rjmp .-110 ; 0x1ab98 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)); 1ac06: ca 30 cpi r28, 0x0A ; 10 1ac08: 99 f5 brne .+102 ; 0x1ac70 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1ac0a: 8c e8 ldi r24, 0x8C ; 140 1ac0c: 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)); 1ac0e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ac12: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_puts_at_P(0, 1, STR_SEPARATOR); 1ac16: 4a e1 ldi r20, 0x1A ; 26 1ac18: 5c e8 ldi r21, 0x8C ; 140 1ac1a: 61 e0 ldi r22, 0x01 ; 1 1ac1c: 80 e0 ldi r24, 0x00 ; 0 1ac1e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 1ac22: c3 30 cpi r28, 0x03 ; 3 1ac24: 70 f5 brcc .+92 ; 0x1ac82 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1ac26: 8d e5 ldi r24, 0x5D ; 93 1ac28: 9f e3 ldi r25, 0x3F ; 63 1ac2a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ac2e: ac 01 movw r20, r24 1ac30: 62 e0 ldi r22, 0x02 ; 2 1ac32: 80 e0 ldi r24, 0x00 ; 0 1ac34: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(18, 2); 1ac38: 62 e0 ldi r22, 0x02 ; 2 1ac3a: 82 e1 ldi r24, 0x12 ; 18 1ac3c: 0e 94 95 6f call 0xdf2a ; 0xdf2a (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ac40: c1 11 cpse r28, r1 1ac42: 1a c0 rjmp .+52 ; 0x1ac78 1ac44: 8d 2f mov r24, r29 1ac46: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 1ac4a: 80 e5 ldi r24, 0x50 ; 80 1ac4c: 9f e3 ldi r25, 0x3F ; 63 1ac4e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ac52: ac 01 movw r20, r24 1ac54: 63 e0 ldi r22, 0x03 ; 3 1ac56: 80 e0 ldi r24, 0x00 ; 0 1ac58: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(18, 3); 1ac5c: 63 e0 ldi r22, 0x03 ; 3 1ac5e: 82 e1 ldi r24, 0x12 ; 18 1ac60: 0e 94 95 6f call 0xdf2a ; 0xdf2a (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1ac64: c2 30 cpi r28, 0x02 ; 2 1ac66: 19 f1 breq .+70 ; 0x1acae 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); 1ac68: 8d 2f mov r24, r29 1ac6a: 0e 94 84 6f call 0xdf08 ; 0xdf08 1ac6e: 23 c0 rjmp .+70 ; 0x1acb6 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)); 1ac70: cb 30 cpi r28, 0x0B ; 11 1ac72: 09 f0 breq .+2 ; 0x1ac76 1ac74: 9f cf rjmp .-194 ; 0x1abb4 1ac76: c9 cf rjmp .-110 ; 0x1ac0a 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); 1ac78: 83 eb ldi r24, 0xB3 ; 179 1ac7a: 9b e6 ldi r25, 0x6B ; 107 1ac7c: 0e 94 80 6f call 0xdf00 ; 0xdf00 1ac80: e4 cf rjmp .-56 ; 0x1ac4a 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) 1ac82: 86 ef ldi r24, 0xF6 ; 246 1ac84: 8c 0f add r24, r28 1ac86: 82 30 cpi r24, 0x02 ; 2 1ac88: 80 f5 brcc .+96 ; 0x1acea { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1ac8a: 81 e0 ldi r24, 0x01 ; 1 1ac8c: 94 e4 ldi r25, 0x44 ; 68 1ac8e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ac92: ac 01 movw r20, r24 1ac94: 62 e0 ldi r22, 0x02 ; 2 1ac96: 80 e0 ldi r24, 0x00 ; 0 1ac98: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_putc(':'); 1ac9c: 8a e3 ldi r24, 0x3A ; 58 1ac9e: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_set_cursor(18, 2); 1aca2: 62 e0 ldi r22, 0x02 ; 2 1aca4: 82 e1 ldi r24, 0x12 ; 18 1aca6: 0e 94 95 6f call 0xdf2a ; 0xdf2a (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1acaa: ca 30 cpi r28, 0x0A ; 10 1acac: e9 f2 breq .-70 ; 0x1ac68 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); 1acae: 83 eb ldi r24, 0xB3 ; 179 1acb0: 9b e6 ldi r25, 0x6B ; 107 1acb2: 0e 94 80 6f call 0xdf00 ; 0xdf00 _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); 1acb6: c1 14 cp r12, r1 1acb8: d1 04 cpc r13, r1 1acba: 19 f0 breq .+6 ; 0x1acc2 1acbc: c6 01 movw r24, r12 1acbe: 0e 94 87 8e call 0x11d0e ; 0x11d0e _progress++; 1acc2: 81 e0 ldi r24, 0x01 ; 1 1acc4: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1acc6: 4e 2d mov r20, r14 1acc8: 50 e0 ldi r21, 0x00 ; 0 1acca: 44 0f add r20, r20 1accc: 55 1f adc r21, r21 1acce: 84 17 cp r24, r20 1acd0: 15 06 cpc r1, r21 1acd2: 0c f0 brlt .+2 ; 0x1acd6 1acd4: 80 e0 ldi r24, 0x00 ; 0 } 1acd6: df 91 pop r29 1acd8: cf 91 pop r28 1acda: 1f 91 pop r17 1acdc: 0f 91 pop r16 1acde: ff 90 pop r15 1ace0: ef 90 pop r14 1ace2: df 90 pop r13 1ace4: cf 90 pop r12 1ace6: bf 90 pop r11 1ace8: 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) 1acea: ca 30 cpi r28, 0x0A ; 10 1acec: 20 f7 brcc .-56 ; 0x1acb6 { //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); 1acee: 41 e0 ldi r20, 0x01 ; 1 1acf0: c4 30 cpi r28, 0x04 ; 4 1acf2: 21 f0 breq .+8 ; 0x1acfc 1acf4: 42 e0 ldi r20, 0x02 ; 2 1acf6: c3 30 cpi r28, 0x03 ; 3 1acf8: 09 f4 brne .+2 ; 0x1acfc 1acfa: 40 e0 ldi r20, 0x00 ; 0 1acfc: 0d 2f mov r16, r29 1acfe: 28 e1 ldi r18, 0x18 ; 24 1ad00: 3c e8 ldi r19, 0x8C ; 140 1ad02: 62 e0 ldi r22, 0x02 ; 2 1ad04: 82 e0 ldi r24, 0x02 ; 2 1ad06: 0e 94 7d d1 call 0x1a2fa ; 0x1a2fa _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 1ad0a: 41 e0 ldi r20, 0x01 ; 1 1ad0c: c5 30 cpi r28, 0x05 ; 5 1ad0e: 21 f0 breq .+8 ; 0x1ad18 1ad10: 42 e0 ldi r20, 0x02 ; 2 1ad12: c5 30 cpi r28, 0x05 ; 5 1ad14: 08 f4 brcc .+2 ; 0x1ad18 1ad16: 40 e0 ldi r20, 0x00 ; 0 1ad18: 0d 2f mov r16, r29 1ad1a: 26 e1 ldi r18, 0x16 ; 22 1ad1c: 3c e8 ldi r19, 0x8C ; 140 1ad1e: 68 e0 ldi r22, 0x08 ; 8 1ad20: 82 e0 ldi r24, 0x02 ; 2 1ad22: 0e 94 7d d1 call 0x1a2fa ; 0x1a2fa _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 1ad26: 41 e0 ldi r20, 0x01 ; 1 1ad28: c6 30 cpi r28, 0x06 ; 6 1ad2a: 21 f0 breq .+8 ; 0x1ad34 1ad2c: 42 e0 ldi r20, 0x02 ; 2 1ad2e: c6 30 cpi r28, 0x06 ; 6 1ad30: 08 f4 brcc .+2 ; 0x1ad34 1ad32: 40 e0 ldi r20, 0x00 ; 0 1ad34: 0d 2f mov r16, r29 1ad36: 24 e1 ldi r18, 0x14 ; 20 1ad38: 3c e8 ldi r19, 0x8C ; 140 1ad3a: 6e e0 ldi r22, 0x0E ; 14 1ad3c: 82 e0 ldi r24, 0x02 ; 2 1ad3e: 0e 94 7d d1 call 0x1a2fa ; 0x1a2fa _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 1ad42: 41 e0 ldi r20, 0x01 ; 1 1ad44: c7 30 cpi r28, 0x07 ; 7 1ad46: 21 f0 breq .+8 ; 0x1ad50 1ad48: 42 e0 ldi r20, 0x02 ; 2 1ad4a: c7 30 cpi r28, 0x07 ; 7 1ad4c: 08 f4 brcc .+2 ; 0x1ad50 1ad4e: 40 e0 ldi r20, 0x00 ; 0 1ad50: 0d 2f mov r16, r29 1ad52: 20 e1 ldi r18, 0x10 ; 16 1ad54: 3c e8 ldi r19, 0x8C ; 140 1ad56: 60 e0 ldi r22, 0x00 ; 0 1ad58: 83 e0 ldi r24, 0x03 ; 3 1ad5a: 0e 94 7d d1 call 0x1a2fa ; 0x1a2fa _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 1ad5e: 41 e0 ldi r20, 0x01 ; 1 1ad60: c8 30 cpi r28, 0x08 ; 8 1ad62: 21 f0 breq .+8 ; 0x1ad6c 1ad64: 42 e0 ldi r20, 0x02 ; 2 1ad66: c8 30 cpi r28, 0x08 ; 8 1ad68: 08 f4 brcc .+2 ; 0x1ad6c 1ad6a: 40 e0 ldi r20, 0x00 ; 0 1ad6c: 0d 2f mov r16, r29 1ad6e: 29 e0 ldi r18, 0x09 ; 9 1ad70: 3c e8 ldi r19, 0x8C ; 140 1ad72: 69 e0 ldi r22, 0x09 ; 9 1ad74: 83 e0 ldi r24, 0x03 ; 3 1ad76: 0e 94 7d d1 call 0x1a2fa ; 0x1a2fa 1ad7a: 9d cf rjmp .-198 ; 0x1acb6 0001ad7c : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 1ad7c: cf 93 push r28 1ad7e: 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) 1ad80: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 1ad84: 81 11 cpse r24, r1 1ad86: 18 c0 rjmp .+48 ; 0x1adb8 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 1ad88: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1ad8c: 8b e0 ldi r24, 0x0B ; 11 1ad8e: 68 9f mul r22, r24 1ad90: b0 01 movw r22, r0 1ad92: 11 24 eor r1, r1 1ad94: 67 5b subi r22, 0xB7 ; 183 1ad96: 72 4f sbci r23, 0xF2 ; 242 1ad98: 47 e0 ldi r20, 0x07 ; 7 1ad9a: 50 e0 ldi r21, 0x00 ; 0 1ad9c: 8b ea ldi r24, 0xAB ; 171 1ad9e: 93 e0 ldi r25, 0x03 ; 3 1ada0: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 lcd_encoder = menuData->name[0]; 1ada4: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 1ada8: 90 e0 ldi r25, 0x00 ; 0 1adaa: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1adae: 80 93 37 05 sts 0x0537, r24 ; 0x800537 menuData->initialized = true; 1adb2: 81 e0 ldi r24, 0x01 ; 1 1adb4: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 1adb8: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1adbc: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1adc0: 80 97 sbiw r24, 0x20 ; 32 1adc2: 34 f4 brge .+12 ; 0x1add0 1adc4: 80 e2 ldi r24, 0x20 ; 32 1adc6: 90 e0 ldi r25, 0x00 ; 0 1adc8: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1adcc: 80 93 37 05 sts 0x0537, r24 ; 0x800537 if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1add0: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1add4: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1add8: 8f 3f cpi r24, 0xFF ; 255 1adda: 91 05 cpc r25, r1 1addc: 39 f0 breq .+14 ; 0x1adec 1adde: 34 f0 brlt .+12 ; 0x1adec 1ade0: 8f ef ldi r24, 0xFF ; 255 1ade2: 90 e0 ldi r25, 0x00 ; 0 1ade4: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1ade8: 80 93 37 05 sts 0x0537, r24 ; 0x800537 menuData->name[menuData->selected] = lcd_encoder; 1adec: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1adf0: f0 e0 ldi r31, 0x00 ; 0 1adf2: e7 55 subi r30, 0x57 ; 87 1adf4: fc 4f sbci r31, 0xFC ; 252 1adf6: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1adfa: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1adfc: 0e 94 c1 6f call 0xdf82 ; 0xdf82 1ae00: cb ea ldi r28, 0xAB ; 171 1ae02: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 1ae04: 89 91 ld r24, Y+ 1ae06: 0e 94 84 6f call 0xdf08 ; 0xdf08 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) 1ae0a: 83 e0 ldi r24, 0x03 ; 3 1ae0c: c2 3b cpi r28, 0xB2 ; 178 1ae0e: d8 07 cpc r29, r24 1ae10: c9 f7 brne .-14 ; 0x1ae04 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 1ae12: 4e e5 ldi r20, 0x5E ; 94 1ae14: 61 e0 ldi r22, 0x01 ; 1 1ae16: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1ae1a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a if (menuData->selected > 0) 1ae1e: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 1ae22: 88 23 and r24, r24 1ae24: 29 f0 breq .+10 ; 0x1ae30 { lcd_putc_at(menuData->selected-1, 1, ' '); 1ae26: 40 e2 ldi r20, 0x20 ; 32 1ae28: 61 e0 ldi r22, 0x01 ; 1 1ae2a: 81 50 subi r24, 0x01 ; 1 1ae2c: 0e 94 b5 6f call 0xdf6a ; 0xdf6a } if (lcd_clicked()) 1ae30: 0e 94 b2 71 call 0xe364 ; 0xe364 1ae34: 88 23 and r24, r24 1ae36: 99 f0 breq .+38 ; 0x1ae5e { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 1ae38: e0 91 aa 03 lds r30, 0x03AA ; 0x8003aa 1ae3c: 8e 2f mov r24, r30 1ae3e: 90 e0 ldi r25, 0x00 ; 0 1ae40: 01 96 adiw r24, 0x01 ; 1 1ae42: 07 97 sbiw r24, 0x07 ; 7 1ae44: 78 f4 brcc .+30 ; 0x1ae64 { lcd_encoder = menuData->name[++(menuData->selected)]; 1ae46: ef 5f subi r30, 0xFF ; 255 1ae48: e0 93 aa 03 sts 0x03AA, r30 ; 0x8003aa 1ae4c: f0 e0 ldi r31, 0x00 ; 0 1ae4e: e7 55 subi r30, 0x57 ; 87 1ae50: fc 4f sbci r31, 0xFC ; 252 1ae52: 82 81 ldd r24, Z+2 ; 0x02 1ae54: 90 e0 ldi r25, 0x00 ; 0 1ae56: 90 93 38 05 sts 0x0538, r25 ; 0x800538 1ae5a: 80 93 37 05 sts 0x0537, r24 ; 0x800537 EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1ae5e: df 91 pop r29 1ae60: cf 91 pop r28 1ae62: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 1ae64: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1ae68: 8b e0 ldi r24, 0x0B ; 11 1ae6a: 68 9f mul r22, r24 1ae6c: b0 01 movw r22, r0 1ae6e: 11 24 eor r1, r1 1ae70: 67 5b subi r22, 0xB7 ; 183 1ae72: 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); 1ae74: 47 e0 ldi r20, 0x07 ; 7 1ae76: 50 e0 ldi r21, 0x00 ; 0 1ae78: 8b ea ldi r24, 0xAB ; 171 1ae7a: 93 e0 ldi r25, 0x03 ; 3 1ae7c: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 1ae80: df 91 pop r29 1ae82: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 1ae84: 0d 94 d8 d1 jmp 0x3a3b0 ; 0x3a3b0 0001ae88 : return(_result); } #ifdef TMC2130 static void reset_crash_det(uint8_t axis) { 1ae88: cf 93 push r28 1ae8a: df 93 push r29 current_position[axis] += 10; 1ae8c: 94 e0 ldi r25, 0x04 ; 4 1ae8e: 89 9f mul r24, r25 1ae90: e0 01 movw r28, r0 1ae92: 11 24 eor r1, r1 1ae94: cd 5b subi r28, 0xBD ; 189 1ae96: d8 4f sbci r29, 0xF8 ; 248 1ae98: 20 e0 ldi r18, 0x00 ; 0 1ae9a: 30 e0 ldi r19, 0x00 ; 0 1ae9c: 40 e2 ldi r20, 0x20 ; 32 1ae9e: 51 e4 ldi r21, 0x41 ; 65 1aea0: 68 81 ld r22, Y 1aea2: 79 81 ldd r23, Y+1 ; 0x01 1aea4: 8a 81 ldd r24, Y+2 ; 0x02 1aea6: 9b 81 ldd r25, Y+3 ; 0x03 1aea8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1aeac: 68 83 st Y, r22 1aeae: 79 83 std Y+1, r23 ; 0x01 1aeb0: 8a 83 std Y+2, r24 ; 0x02 1aeb2: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1aeb4: 60 e0 ldi r22, 0x00 ; 0 1aeb6: 70 e0 ldi r23, 0x00 ; 0 1aeb8: 84 e3 ldi r24, 0x34 ; 52 1aeba: 92 e4 ldi r25, 0x42 ; 66 1aebc: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1aec0: 0f 94 2c 59 call 0x2b258 ; 0x2b258 crashdet_use_eeprom_setting(); } 1aec4: df 91 pop r29 1aec6: 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(); 1aec8: 0d 94 10 3c jmp 0x27820 ; 0x27820 0001aecc : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 1aecc: 0f 94 48 7d call 0x2fa90 ; 0x2fa90 #endif menu_top = 0; 1aed0: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1aed4: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1aed8: 10 92 37 05 sts 0x0537, r1 ; 0x800537 menu_data_reset(); //Forces reloading of cached variables. 1aedc: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 0001aee0 : } } void CardReader::updir() { if(workDirDepth > 0) 1aee0: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 1aee4: 88 23 and r24, r24 1aee6: f9 f0 breq .+62 ; 0x1af26 { --workDirDepth; 1aee8: 81 50 subi r24, 0x01 ; 1 1aeea: 80 93 0e 16 sts 0x160E, r24 ; 0x80160e workDir = workDirParents[0]; 1aeee: 93 e2 ldi r25, 0x23 ; 35 1aef0: ec e3 ldi r30, 0x3C ; 60 1aef2: f5 e1 ldi r31, 0x15 ; 21 1aef4: a9 e1 ldi r26, 0x19 ; 25 1aef6: b5 e1 ldi r27, 0x15 ; 21 1aef8: 01 90 ld r0, Z+ 1aefa: 0d 92 st X+, r0 1aefc: 9a 95 dec r25 1aefe: e1 f7 brne .-8 ; 0x1aef8 1af00: 2c e3 ldi r18, 0x3C ; 60 1af02: 35 e1 ldi r19, 0x15 ; 21 for (uint8_t d = 0; d < workDirDepth; d++) 1af04: 90 e0 ldi r25, 0x00 ; 0 1af06: 98 17 cp r25, r24 1af08: 60 f4 brcc .+24 ; 0x1af22 { workDirParents[d] = workDirParents[d+1]; 1af0a: 43 e2 ldi r20, 0x23 ; 35 1af0c: f9 01 movw r30, r18 1af0e: b3 96 adiw r30, 0x23 ; 35 1af10: d9 01 movw r26, r18 1af12: 01 90 ld r0, Z+ 1af14: 0d 92 st X+, r0 1af16: 4a 95 dec r20 1af18: e1 f7 brne .-8 ; 0x1af12 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 1af1a: 9f 5f subi r25, 0xFF ; 255 1af1c: 2d 5d subi r18, 0xDD ; 221 1af1e: 3f 4f sbci r19, 0xFF ; 255 1af20: f2 cf rjmp .-28 ; 0x1af06 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 1af22: 0f 94 48 7d call 0x2fa90 ; 0x2fa90 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 1af26: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_encoder = 0; 1af2a: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1af2e: 10 92 37 05 sts 0x0537, r1 ; 0x800537 menu_data_reset(); //Forces reloading of cached variables. 1af32: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 0001af36 : } backlight_save(); } static void lcd_backlight_menu() { 1af36: ef 92 push r14 1af38: ff 92 push r15 1af3a: 0f 93 push r16 1af3c: 1f 93 push r17 1af3e: cf 93 push r28 1af40: df 93 push r29 MENU_BEGIN(); 1af42: 0f 94 10 cf call 0x39e20 ; 0x39e20 1af46: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1af4a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1af4e: 84 30 cpi r24, 0x04 ; 4 1af50: 08 f0 brcs .+2 ; 0x1af54 1af52: 63 c0 rjmp .+198 ; 0x1b01a 1af54: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1af58: 0f 94 90 cd call 0x39b20 ; 0x39b20 1af5c: 81 11 cpse r24, r1 1af5e: 0e 94 62 8b call 0x116c4 ; 0x116c4 backlight_save(); ); MENU_ITEM_BACK_P(_T(MSG_BACK)); 1af62: 89 e1 ldi r24, 0x19 ; 25 1af64: 90 e4 ldi r25, 0x40 ; 64 1af66: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1af6a: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_HIGH), &backlightLevel_HIGH, backlightLevel_LOW, 255); 1af6e: c0 91 fc 03 lds r28, 0x03FC ; 0x8003fc 1af72: d0 e0 ldi r29, 0x00 ; 0 1af74: 88 e5 ldi r24, 0x58 ; 88 1af76: 9d e3 ldi r25, 0x3D ; 61 1af78: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1af7c: f1 2c mov r15, r1 1af7e: e1 2c mov r14, r1 1af80: 0f ef ldi r16, 0xFF ; 255 1af82: 10 e0 ldi r17, 0x00 ; 0 1af84: 9e 01 movw r18, r28 1af86: 48 e0 ldi r20, 0x08 ; 8 1af88: 6d ef ldi r22, 0xFD ; 253 1af8a: 73 e0 ldi r23, 0x03 ; 3 1af8c: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 MENU_ITEM_EDIT_int3_P(_T(MSG_BL_LOW), &backlightLevel_LOW, 0, backlightLevel_HIGH); 1af90: 00 91 fd 03 lds r16, 0x03FD ; 0x8003fd 1af94: 10 e0 ldi r17, 0x00 ; 0 1af96: 89 e4 ldi r24, 0x49 ; 73 1af98: 9d e3 ldi r25, 0x3D ; 61 1af9a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1af9e: 30 e0 ldi r19, 0x00 ; 0 1afa0: 20 e0 ldi r18, 0x00 ; 0 1afa2: 48 e0 ldi r20, 0x08 ; 8 1afa4: 6c ef ldi r22, 0xFC ; 252 1afa6: 73 e0 ldi r23, 0x03 ; 3 1afa8: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 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); 1afac: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1afb0: 81 30 cpi r24, 0x01 ; 1 1afb2: 59 f5 brne .+86 ; 0x1b00a 1afb4: 80 e4 ldi r24, 0x40 ; 64 1afb6: 9d e3 ldi r25, 0x3D ; 61 1afb8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1afbc: ec 01 movw r28, r24 1afbe: 8c e2 ldi r24, 0x2C ; 44 1afc0: 9d e3 ldi r25, 0x3D ; 61 1afc2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1afc6: 22 e0 ldi r18, 0x02 ; 2 1afc8: 44 e1 ldi r20, 0x14 ; 20 1afca: 58 ed ldi r21, 0xD8 ; 216 1afcc: be 01 movw r22, r28 1afce: 0f 94 9f d0 call 0x3a13e ; 0x3a13e MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); 1afd2: 82 e2 ldi r24, 0x22 ; 34 1afd4: 9d e3 ldi r25, 0x3D ; 61 1afd6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1afda: f1 2c mov r15, r1 1afdc: e1 2c mov r14, r1 1afde: 04 e8 ldi r16, 0x84 ; 132 1afe0: 13 e0 ldi r17, 0x03 ; 3 1afe2: 2f e0 ldi r18, 0x0F ; 15 1afe4: 30 e0 ldi r19, 0x00 ; 0 1afe6: 40 e1 ldi r20, 0x10 ; 16 1afe8: 6d e4 ldi r22, 0x4D ; 77 1afea: 72 e0 ldi r23, 0x02 ; 2 1afec: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 MENU_END(); 1aff0: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 backlight_save(); } static void lcd_backlight_menu() { MENU_BEGIN(); 1aff4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1aff8: 8f 5f subi r24, 0xFF ; 255 1affa: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1affe: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1b002: 8f 5f subi r24, 0xFF ; 255 1b004: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1b008: a0 cf rjmp .-192 ; 0x1af4a ); 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); 1b00a: 81 11 cpse r24, r1 1b00c: 03 c0 rjmp .+6 ; 0x1b014 1b00e: 8a e3 ldi r24, 0x3A ; 58 1b010: 9d e3 ldi r25, 0x3D ; 61 1b012: d2 cf rjmp .-92 ; 0x1afb8 1b014: 83 e3 ldi r24, 0x33 ; 51 1b016: 9d e3 ldi r25, 0x3D ; 61 1b018: cf cf rjmp .-98 ; 0x1afb8 MENU_ITEM_EDIT_int3_P(_T(MSG_TIMEOUT), &backlightTimer_period, LCD_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT*60); MENU_END(); } 1b01a: df 91 pop r29 1b01c: cf 91 pop r28 1b01e: 1f 91 pop r17 1b020: 0f 91 pop r16 1b022: ff 90 pop r15 1b024: ef 90 pop r14 1b026: 08 95 ret 0001b028 : } #ifdef LCD_BL_PIN static void backlight_mode_toggle() { switch (backlightMode) 1b028: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1b02c: 88 23 and r24, r24 1b02e: 31 f0 breq .+12 ; 0x1b03c 1b030: 81 30 cpi r24, 0x01 ; 1 1b032: 41 f4 brne .+16 ; 0x1b044 { case BACKLIGHT_MODE_BRIGHT: backlightMode = BACKLIGHT_MODE_DIM; break; 1b034: 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(); 1b038: 0c 94 62 8b jmp 0x116c4 ; 0x116c4 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; 1b03c: 82 e0 ldi r24, 0x02 ; 2 case BACKLIGHT_MODE_AUTO: backlightMode = BACKLIGHT_MODE_BRIGHT; break; 1b03e: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f 1b042: fa cf rjmp .-12 ; 0x1b038 1b044: 81 e0 ldi r24, 0x01 ; 1 1b046: fb cf rjmp .-10 ; 0x1b03e 0001b048 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1b048: bf 92 push r11 1b04a: cf 92 push r12 1b04c: df 92 push r13 1b04e: ef 92 push r14 1b050: ff 92 push r15 1b052: 0f 93 push r16 1b054: 1f 93 push r17 1b056: cf 93 push r28 1b058: df 93 push r29 1b05a: 00 d0 rcall .+0 ; 0x1b05c 1b05c: 1f 92 push r1 1b05e: cd b7 in r28, 0x3d ; 61 1b060: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1b062: 8c ea ldi r24, 0xAC ; 172 1b064: 9d e0 ldi r25, 0x0D ; 13 1b066: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1b06a: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1b06c: 8b ea ldi r24, 0xAB ; 171 1b06e: 9d e0 ldi r25, 0x0D ; 13 1b070: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1b074: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1b076: 8a ea ldi r24, 0xAA ; 170 1b078: 9d e0 ldi r25, 0x0D ; 13 1b07a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1b07e: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1b080: 0f 94 10 cf call 0x39e20 ; 0x39e20 1b084: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (points_nr == 7) { lcd_z_calibration_prompt(true); } ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); sToggle[0] = points_nr + '0'; 1b088: 80 e3 ldi r24, 0x30 ; 48 1b08a: d8 2e mov r13, r24 1b08c: df 0c add r13, r15 sToggle[1] = 'x'; 1b08e: 98 e7 ldi r25, 0x78 ; 120 1b090: 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'; 1b092: 20 e3 ldi r18, 0x30 ; 48 1b094: e2 2e mov r14, r18 1b096: 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(); 1b098: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b09c: 84 30 cpi r24, 0x04 ; 4 1b09e: 08 f0 brcs .+2 ; 0x1b0a2 1b0a0: 56 c0 rjmp .+172 ; 0x1b14e 1b0a2: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1b0a6: 0f 94 90 cd call 0x39b20 ; 0x39b20 1b0aa: 88 23 and r24, r24 1b0ac: 31 f0 breq .+12 ; 0x1b0ba 1b0ae: 87 e0 ldi r24, 0x07 ; 7 1b0b0: f8 12 cpse r15, r24 1b0b2: 03 c0 rjmp .+6 ; 0x1b0ba 1b0b4: 81 e0 ldi r24, 0x01 ; 1 1b0b6: 0f 94 d9 67 call 0x2cfb2 ; 0x2cfb2 // 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)); 1b0ba: 87 e6 ldi r24, 0x67 ; 103 1b0bc: 9d e3 ldi r25, 0x3D ; 61 1b0be: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b0c2: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 sToggle[0] = points_nr + '0'; 1b0c6: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1b0c8: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1b0ca: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1b0cc: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1b0ce: 8b e1 ldi r24, 0x1B ; 27 1b0d0: 9d e3 ldi r25, 0x3D ; 61 1b0d2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b0d6: 20 e0 ldi r18, 0x00 ; 0 1b0d8: 4f e8 ldi r20, 0x8F ; 143 1b0da: 52 ed ldi r21, 0xD2 ; 210 1b0dc: be 01 movw r22, r28 1b0de: 6f 5f subi r22, 0xFF ; 255 1b0e0: 7f 4f sbci r23, 0xFF ; 255 1b0e2: 0f 94 9f d0 call 0x3a13e ; 0x3a13e sToggle[0] = mbl_z_probe_nr + '0'; 1b0e6: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1b0e8: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1b0ea: 8d e0 ldi r24, 0x0D ; 13 1b0ec: 9d e3 ldi r25, 0x3D ; 61 1b0ee: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b0f2: 20 e0 ldi r18, 0x00 ; 0 1b0f4: 40 e8 ldi r20, 0x80 ; 128 1b0f6: 52 ed ldi r21, 0xD2 ; 210 1b0f8: be 01 movw r22, r28 1b0fa: 6f 5f subi r22, 0xFF ; 255 1b0fc: 7f 4f sbci r23, 0xFF ; 255 1b0fe: 0f 94 9f d0 call 0x3a13e ; 0x3a13e 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); 1b102: 87 e0 ldi r24, 0x07 ; 7 1b104: f8 12 cpse r15, r24 1b106: 20 c0 rjmp .+64 ; 0x1b148 1b108: 88 e4 ldi r24, 0x48 ; 72 1b10a: 9d e5 ldi r25, 0x5D ; 93 1b10c: c1 10 cpse r12, r1 1b10e: 02 c0 rjmp .+4 ; 0x1b114 1b110: 82 e4 ldi r24, 0x42 ; 66 1b112: 9d e5 ldi r25, 0x5D ; 93 1b114: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b118: 8c 01 movw r16, r24 1b11a: 87 ef ldi r24, 0xF7 ; 247 1b11c: 9c e3 ldi r25, 0x3C ; 60 1b11e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b122: 22 e0 ldi r18, 0x02 ; 2 1b124: 4b e9 ldi r20, 0x9B ; 155 1b126: 52 ed ldi r21, 0xD2 ; 210 1b128: b8 01 movw r22, r16 1b12a: 0f 94 9f d0 call 0x3a13e ; 0x3a13e MENU_END(); 1b12e: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 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(); 1b132: 90 91 15 05 lds r25, 0x0515 ; 0x800515 1b136: 9f 5f subi r25, 0xFF ; 255 1b138: 90 93 15 05 sts 0x0515, r25 ; 0x800515 1b13c: 90 91 17 05 lds r25, 0x0517 ; 0x800517 1b140: 9f 5f subi r25, 0xFF ; 255 1b142: 90 93 17 05 sts 0x0517, r25 ; 0x800517 1b146: a8 cf rjmp .-176 ; 0x1b098 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); 1b148: 87 e0 ldi r24, 0x07 ; 7 1b14a: 9d e3 ldi r25, 0x3D ; 61 1b14c: e3 cf rjmp .-58 ; 0x1b114 MENU_END(); } 1b14e: 0f 90 pop r0 1b150: 0f 90 pop r0 1b152: 0f 90 pop r0 1b154: 0f 90 pop r0 1b156: df 91 pop r29 1b158: cf 91 pop r28 1b15a: 1f 91 pop r17 1b15c: 0f 91 pop r16 1b15e: ff 90 pop r15 1b160: ef 90 pop r14 1b162: df 90 pop r13 1b164: cf 90 pop r12 1b166: bf 90 pop r11 1b168: 08 95 ret 0001b16a : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 1b16a: cf 93 push r28 MENU_BEGIN(); 1b16c: 0f 94 10 cf call 0x39e20 ; 0x39e20 1b170: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1b174: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b178: 84 30 cpi r24, 0x04 ; 4 1b17a: 60 f5 brcc .+88 ; 0x1b1d4 1b17c: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b180: 88 eb ldi r24, 0xB8 ; 184 1b182: 9d e3 ldi r25, 0x3D ; 61 1b184: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b188: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 1b18c: 8e ed ldi r24, 0xDE ; 222 1b18e: 9a e3 ldi r25, 0x3A ; 58 1b190: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b194: 69 ea ldi r22, 0xA9 ; 169 1b196: 79 ed ldi r23, 0xD9 ; 217 1b198: 0f 94 8d ce call 0x39d1a ; 0x39d1a for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b19c: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 1b19e: 83 ea ldi r24, 0xA3 ; 163 1b1a0: 9b e3 ldi r25, 0x3B ; 59 1b1a2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b1a6: 61 e3 ldi r22, 0x31 ; 49 1b1a8: 6c 0f add r22, r28 1b1aa: 2c 2f mov r18, r28 1b1ac: 48 eb ldi r20, 0xB8 ; 184 1b1ae: 59 ed ldi r21, 0xD9 ; 217 1b1b0: 0f 94 36 ce call 0x39c6c ; 0x39c6c 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++) 1b1b4: cf 5f subi r28, 0xFF ; 255 1b1b6: c5 30 cpi r28, 0x05 ; 5 1b1b8: 91 f7 brne .-28 ; 0x1b19e MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 1b1ba: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 1b1be: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b1c2: 8f 5f subi r24, 0xFF ; 255 1b1c4: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b1c8: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1b1cc: 8f 5f subi r24, 0xFF ; 255 1b1ce: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1b1d2: d0 cf rjmp .-96 ; 0x1b174 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(); } 1b1d4: cf 91 pop r28 1b1d6: 08 95 ret 0001b1d8 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 1b1d8: 84 e0 ldi r24, 0x04 ; 4 1b1da: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0001b1de : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 1b1de: 85 e0 ldi r24, 0x05 ; 5 1b1e0: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0001b1e4 : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 1b1e4: 86 e0 ldi r24, 0x06 ; 6 1b1e6: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0001b1ea : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 1b1ea: 87 e0 ldi r24, 0x07 ; 7 1b1ec: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0001b1f0 : 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); 1b1f0: 88 e0 ldi r24, 0x08 ; 8 1b1f2: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0001b1f6 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1b1f6: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1b1fa: 81 ea ldi r24, 0xA1 ; 161 1b1fc: 9d e0 ldi r25, 0x0D ; 13 1b1fe: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 1b202: 83 e0 ldi r24, 0x03 ; 3 1b204: 0d 94 bc d1 jmp 0x3a378 ; 0x3a378 0001b208 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 1b208: cf 93 push r28 MENU_BEGIN(); 1b20a: 0f 94 10 cf call 0x39e20 ; 0x39e20 1b20e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1b212: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b216: 84 30 cpi r24, 0x04 ; 4 1b218: 88 f5 brcc .+98 ; 0x1b27c 1b21a: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1b21e: 0f 94 90 cd call 0x39b20 ; 0x39b20 1b222: 81 11 cpse r24, r1 1b224: 0f 94 f4 36 call 0x26de8 ; 0x26de8 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b228: 88 eb ldi r24, 0xB8 ; 184 1b22a: 9d e3 ldi r25, 0x3D ; 61 1b22c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b230: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 1b234: 8e ed ldi r24, 0xDE ; 222 1b236: 9a e3 ldi r25, 0x3A ; 58 1b238: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b23c: 60 ec ldi r22, 0xC0 ; 192 1b23e: 7a e3 ldi r23, 0x3A ; 58 1b240: 0f 94 8d ce call 0x39d1a ; 0x39d1a for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b244: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 1b246: 83 ea ldi r24, 0xA3 ; 163 1b248: 9b e3 ldi r25, 0x3B ; 59 1b24a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b24e: 61 e3 ldi r22, 0x31 ; 49 1b250: 6c 0f add r22, r28 1b252: 2c 2f mov r18, r28 1b254: 4a e1 ldi r20, 0x1A ; 26 1b256: 5b e3 ldi r21, 0x3B ; 59 1b258: 0f 94 36 ce call 0x39c6c ; 0x39c6c 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++) 1b25c: cf 5f subi r28, 0xFF ; 255 1b25e: c5 30 cpi r28, 0x05 ; 5 1b260: 91 f7 brne .-28 ; 0x1b246 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 1b262: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 1b266: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b26a: 8f 5f subi r24, 0xFF ; 255 1b26c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b270: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1b274: 8f 5f subi r24, 0xFF ; 255 1b276: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1b27a: cb cf rjmp .-106 ; 0x1b212 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(); } 1b27c: cf 91 pop r28 1b27e: 08 95 ret 0001b280 : } // 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)) { 1b280: ef 92 push r14 1b282: ff 92 push r15 1b284: 0f 93 push r16 1b286: 1f 93 push r17 1b288: cf 93 push r28 1b28a: 8c 01 movw r16, r24 1b28c: 7b 01 movw r14, r22 MENU_BEGIN(); 1b28e: 0f 94 10 cf call 0x39e20 ; 0x39e20 1b292: 10 92 15 05 sts 0x0515, r1 ; 0x800515 1b296: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b29a: 84 30 cpi r24, 0x04 ; 4 1b29c: 28 f5 brcc .+74 ; 0x1b2e8 1b29e: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 1b2a2: 0f 94 90 cd call 0x39b20 ; 0x39b20 1b2a6: 81 11 cpse r24, r1 1b2a8: 0f 94 f4 36 call 0x26de8 ; 0x26de8 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 1b2ac: 88 eb ldi r24, 0xB8 ; 184 1b2ae: 9d e3 ldi r25, 0x3D ; 61 1b2b0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b2b4: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b2b8: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 1b2ba: 61 e3 ldi r22, 0x31 ; 49 1b2bc: 6c 0f add r22, r28 1b2be: 2c 2f mov r18, r28 1b2c0: a7 01 movw r20, r14 1b2c2: c8 01 movw r24, r16 1b2c4: 0f 94 36 ce call 0x39c6c ; 0x39c6c MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 1b2c8: cf 5f subi r28, 0xFF ; 255 1b2ca: c5 30 cpi r28, 0x05 ; 5 1b2cc: b1 f7 brne .-20 ; 0x1b2ba MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 1b2ce: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 // 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(); 1b2d2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1b2d6: 8f 5f subi r24, 0xFF ; 255 1b2d8: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1b2dc: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1b2e0: 8f 5f subi r24, 0xFF ; 255 1b2e2: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1b2e6: d7 cf rjmp .-82 ; 0x1b296 ); 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(); } 1b2e8: cf 91 pop r28 1b2ea: 1f 91 pop r17 1b2ec: 0f 91 pop r16 1b2ee: ff 90 pop r15 1b2f0: ef 90 pop r14 1b2f2: 08 95 ret 0001b2f4 : 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); 1b2f4: 86 e5 ldi r24, 0x56 ; 86 1b2f6: 9c e5 ldi r25, 0x5C ; 92 1b2f8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b2fc: 62 e9 ldi r22, 0x92 ; 146 1b2fe: 79 ed ldi r23, 0xD9 ; 217 1b300: 0c 94 40 d9 jmp 0x1b280 ; 0x1b280 0001b304 : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 1b304: 85 e6 ldi r24, 0x65 ; 101 1b306: 9c e5 ldi r25, 0x5C ; 92 1b308: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b30c: 6e e9 ldi r22, 0x9E ; 158 1b30e: 79 ed ldi r23, 0xD9 ; 217 1b310: 0c 94 40 d9 jmp 0x1b280 ; 0x1b280 0001b314 : 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); 1b314: 83 ea ldi r24, 0xA3 ; 163 1b316: 9b e3 ldi r25, 0x3B ; 59 1b318: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1b31c: 60 e5 ldi r22, 0x50 ; 80 1b31e: 7b e3 ldi r23, 0x3B ; 59 1b320: 0c 94 40 d9 jmp 0x1b280 ; 0x1b280 0001b324 : 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){ 1b324: cf 93 push r28 1b326: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 1b328: 0f 94 56 88 call 0x310ac ; 0x310ac 1b32c: 88 23 and r24, r24 1b32e: 21 f0 breq .+8 ; 0x1b338 1b330: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 1b332: cf 91 pop r28 1b334: 0d 94 45 a1 jmp 0x3428a ; 0x3428a 1b338: cf 91 pop r28 1b33a: 08 95 ret 0001b33c : 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) { 1b33c: cf 93 push r28 1b33e: c8 2f mov r28, r24 menu_back(); 1b340: 0f 94 d8 d1 call 0x3a3b0 ; 0x3a3b0 MMU2::mmu2.eject_filament(filament, true); 1b344: 61 e0 ldi r22, 0x01 ; 1 1b346: 8c 2f mov r24, r28 1b348: 0f 94 c8 a0 call 0x34190 ; 0x34190 // Clear the filament action clearFilamentAction(); } 1b34c: 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(); 1b34e: 0d 94 f4 36 jmp 0x26de8 ; 0x26de8 0001b352 : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.load_filament(i); 1b352: 80 e0 ldi r24, 0x00 ; 0 1b354: 0f 94 85 a0 call 0x3410a ; 0x3410a 1b358: 81 e0 ldi r24, 0x01 ; 1 1b35a: 0f 94 85 a0 call 0x3410a ; 0x3410a 1b35e: 82 e0 ldi r24, 0x02 ; 2 1b360: 0f 94 85 a0 call 0x3410a ; 0x3410a 1b364: 83 e0 ldi r24, 0x03 ; 3 1b366: 0f 94 85 a0 call 0x3410a ; 0x3410a 1b36a: 84 e0 ldi r24, 0x04 ; 4 1b36c: 0d 94 85 a0 jmp 0x3410a ; 0x3410a 0001b370 : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 1b370: 0d 94 85 a0 jmp 0x3410a ; 0x3410a 0001b374 : //! //! @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) 1b374: 4f 92 push r4 1b376: 5f 92 push r5 1b378: 6f 92 push r6 1b37a: 7f 92 push r7 1b37c: 8f 92 push r8 1b37e: 9f 92 push r9 1b380: af 92 push r10 1b382: bf 92 push r11 1b384: cf 92 push r12 1b386: df 92 push r13 1b388: ef 92 push r14 1b38a: ff 92 push r15 1b38c: 0f 93 push r16 1b38e: 1f 93 push r17 1b390: cf 93 push r28 1b392: df 93 push r29 1b394: 6c 01 movw r12, r24 1b396: 7b 01 movw r14, r22 1b398: 80 91 98 13 lds r24, 0x1398 ; 0x801398 { //following code should handle 3 to 127 number of items well const int8_t items_no = last_item?(MMU2::mmu2.Enabled()?6:5):(MMU2::mmu2.Enabled()?5:4); 1b39c: 67 2b or r22, r23 1b39e: 29 f0 breq .+10 ; 0x1b3aa 1b3a0: 06 e0 ldi r16, 0x06 ; 6 1b3a2: 81 30 cpi r24, 0x01 ; 1 1b3a4: 29 f0 breq .+10 ; 0x1b3b0 1b3a6: 05 e0 ldi r16, 0x05 ; 5 1b3a8: 03 c0 rjmp .+6 ; 0x1b3b0 1b3aa: 04 e0 ldi r16, 0x04 ; 4 1b3ac: 81 30 cpi r24, 0x01 ; 1 1b3ae: d9 f3 breq .-10 ; 0x1b3a6 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 1b3b0: 0e 94 c8 6f call 0xdf90 ; 0xdf90 KEEPALIVE_STATE(PAUSED_FOR_USER); 1b3b4: 84 e0 ldi r24, 0x04 ; 4 1b3b6: 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; 1b3ba: 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; 1b3bc: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 1b3be: 03 50 subi r16, 0x03 ; 3 1b3c0: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 1b3c2: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 1b3c6: 81 e0 ldi r24, 0x01 ; 1 1b3c8: 0e 94 e2 8b call 0x117c4 ; 0x117c4 if (lcd_encoder) 1b3cc: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1b3d0: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1b3d4: 00 97 sbiw r24, 0x00 ; 0 1b3d6: 09 f4 brne .+2 ; 0x1b3da 1b3d8: 9d c0 rjmp .+314 ; 0x1b514 { if (lcd_encoder < 0) 1b3da: 97 ff sbrs r25, 7 1b3dc: 88 c0 rjmp .+272 ; 0x1b4ee { cursor_pos--; 1b3de: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 1b3e0: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1b3e4: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } if (cursor_pos > 3) 1b3e8: c4 30 cpi r28, 0x04 ; 4 1b3ea: 0c f4 brge .+2 ; 0x1b3ee 1b3ec: 86 c0 rjmp .+268 ; 0x1b4fa { cursor_pos = 3; if (first < items_no - 3) 1b3ee: 88 2d mov r24, r8 1b3f0: 08 2c mov r0, r8 1b3f2: 00 0c add r0, r0 1b3f4: 99 0b sbc r25, r25 1b3f6: 80 17 cp r24, r16 1b3f8: 91 07 cpc r25, r17 1b3fa: 0c f0 brlt .+2 ; 0x1b3fe 1b3fc: 7a c0 rjmp .+244 ; 0x1b4f2 { first++; 1b3fe: 83 94 inc r8 lcd_clear(); 1b400: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 1b404: 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); 1b406: c1 14 cp r12, r1 1b408: d1 04 cpc r13, r1 1b40a: 29 f0 breq .+10 ; 0x1b416 1b40c: a6 01 movw r20, r12 1b40e: 60 e0 ldi r22, 0x00 ; 0 1b410: 80 e0 ldi r24, 0x00 ; 0 1b412: 0e 94 a9 6f call 0xdf52 ; 0xdf52 const bool last_visible = (first == items_no - 3); 1b416: a8 2c mov r10, r8 1b418: 08 2c mov r0, r8 1b41a: 00 0c add r0, r0 1b41c: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1b41e: e1 14 cp r14, r1 1b420: f1 04 cpc r15, r1 1b422: 29 f0 breq .+10 ; 0x1b42e 1b424: 82 e0 ldi r24, 0x02 ; 2 1b426: 98 2e mov r9, r24 1b428: a0 16 cp r10, r16 1b42a: b1 06 cpc r11, r17 1b42c: 11 f0 breq .+4 ; 0x1b432 1b42e: 93 e0 ldi r25, 0x03 ; 3 1b430: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1b432: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1b434: df 5f subi r29, 0xFF ; 255 1b436: 4d e0 ldi r20, 0x0D ; 13 1b438: 5e e6 ldi r21, 0x6E ; 110 1b43a: 6d 2f mov r22, r29 1b43c: 81 e0 ldi r24, 0x01 ; 1 1b43e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 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++) 1b442: 9d 12 cpse r9, r29 1b444: f7 cf rjmp .-18 ; 0x1b434 1b446: 48 2c mov r4, r8 1b448: 08 2c mov r0, r8 1b44a: 00 0c add r0, r0 1b44c: 55 08 sbc r5, r5 1b44e: 66 08 sbc r6, r6 1b450: 77 08 sbc r7, r7 1b452: 8f ef ldi r24, 0xFF ; 255 1b454: 48 1a sub r4, r24 1b456: 58 0a sbc r5, r24 1b458: 68 0a sbc r6, r24 1b45a: 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++) 1b45c: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1b45e: 93 94 inc r9 1b460: 69 2d mov r22, r9 1b462: 8a e0 ldi r24, 0x0A ; 10 1b464: 0e 94 95 6f call 0xdf2a ; 0xdf2a 1b468: c3 01 movw r24, r6 1b46a: b2 01 movw r22, r4 1b46c: 0e 94 4e 71 call 0xe29c ; 0xe29c 1b470: 8f ef ldi r24, 0xFF ; 255 1b472: 48 1a sub r4, r24 1b474: 58 0a sbc r5, r24 1b476: 68 0a sbc r6, r24 1b478: 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++) 1b47a: d9 11 cpse r29, r9 1b47c: f0 cf rjmp .-32 ; 0x1b45e { 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); 1b47e: e1 14 cp r14, r1 1b480: f1 04 cpc r15, r1 1b482: 41 f0 breq .+16 ; 0x1b494 1b484: a0 16 cp r10, r16 1b486: b1 06 cpc r11, r17 1b488: 29 f4 brne .+10 ; 0x1b494 1b48a: a7 01 movw r20, r14 1b48c: 63 e0 ldi r22, 0x03 ; 3 1b48e: 81 e0 ldi r24, 0x01 ; 1 1b490: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1b494: 47 e8 ldi r20, 0x87 ; 135 1b496: 50 e9 ldi r21, 0x90 ; 144 1b498: 61 e0 ldi r22, 0x01 ; 1 1b49a: 80 e0 ldi r24, 0x00 ; 0 1b49c: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_putc_at(0, cursor_pos, '>'); 1b4a0: 4e e3 ldi r20, 0x3E ; 62 1b4a2: 6c 2f mov r22, r28 1b4a4: 80 e0 ldi r24, 0x00 ; 0 1b4a6: 0e 94 b5 6f call 0xdf6a ; 0xdf6a _delay(100); 1b4aa: 64 e6 ldi r22, 0x64 ; 100 1b4ac: 70 e0 ldi r23, 0x00 ; 0 1b4ae: 80 e0 ldi r24, 0x00 ; 0 1b4b0: 90 e0 ldi r25, 0x00 ; 0 1b4b2: 0f 94 92 3d call 0x27b24 ; 0x27b24 if (lcd_clicked()) 1b4b6: 0e 94 b2 71 call 0xe364 ; 0xe364 1b4ba: 88 23 and r24, r24 1b4bc: 09 f4 brne .+2 ; 0x1b4c0 1b4be: 81 cf rjmp .-254 ; 0x1b3c2 { KEEPALIVE_STATE(IN_HANDLER); 1b4c0: 82 e0 ldi r24, 0x02 ; 2 1b4c2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(cursor_pos + first - 1); 1b4c6: 8f ef ldi r24, 0xFF ; 255 1b4c8: 8c 0f add r24, r28 1b4ca: 88 0d add r24, r8 } } } 1b4cc: df 91 pop r29 1b4ce: cf 91 pop r28 1b4d0: 1f 91 pop r17 1b4d2: 0f 91 pop r16 1b4d4: ff 90 pop r15 1b4d6: ef 90 pop r14 1b4d8: df 90 pop r13 1b4da: cf 90 pop r12 1b4dc: bf 90 pop r11 1b4de: af 90 pop r10 1b4e0: 9f 90 pop r9 1b4e2: 8f 90 pop r8 1b4e4: 7f 90 pop r7 1b4e6: 6f 90 pop r6 1b4e8: 5f 90 pop r5 1b4ea: 4f 90 pop r4 1b4ec: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1b4ee: cf 5f subi r28, 0xFF ; 255 1b4f0: 77 cf rjmp .-274 ; 0x1b3e0 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); 1b4f2: 87 e0 ldi r24, 0x07 ; 7 1b4f4: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe 1b4f8: 85 cf rjmp .-246 ; 0x1b404 } } if (cursor_pos < 1) 1b4fa: c1 11 cpse r28, r1 1b4fc: 84 cf rjmp .-248 ; 0x1b406 { cursor_pos = 1; if (first > 0) 1b4fe: 18 14 cp r1, r8 1b500: 2c f4 brge .+10 ; 0x1b50c { first--; 1b502: 8a 94 dec r8 lcd_clear(); 1b504: 0e 94 c8 6f call 0xdf90 ; 0xdf90 } } if (cursor_pos < 1) { cursor_pos = 1; 1b508: c1 e0 ldi r28, 0x01 ; 1 1b50a: 7d cf rjmp .-262 ; 0x1b406 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1b50c: 87 e0 ldi r24, 0x07 ; 7 1b50e: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe 1b512: fa cf rjmp .-12 ; 0x1b508 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1b514: c4 30 cpi r28, 0x04 ; 4 1b516: 0c f0 brlt .+2 ; 0x1b51a 1b518: 6a cf rjmp .-300 ; 0x1b3ee 1b51a: 75 cf rjmp .-278 ; 0x1b406 0001b51c : } #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) { 1b51c: 4f 92 push r4 1b51e: 5f 92 push r5 1b520: 6f 92 push r6 1b522: 7f 92 push r7 1b524: af 92 push r10 1b526: bf 92 push r11 1b528: cf 92 push r12 1b52a: df 92 push r13 1b52c: ef 92 push r14 1b52e: ff 92 push r15 1b530: 0f 93 push r16 1b532: 1f 93 push r17 1b534: cf 93 push r28 1b536: df 93 push r29 1b538: 24 e0 ldi r18, 0x04 ; 4 1b53a: 30 e0 ldi r19, 0x00 ; 0 1b53c: 41 e0 ldi r20, 0x01 ; 1 1b53e: 50 e0 ldi r21, 0x00 ; 0 1b540: d9 01 movw r26, r18 1b542: a1 56 subi r26, 0x61 ; 97 1b544: b5 47 sbci r27, 0x75 ; 117 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 1b546: fd 01 movw r30, r26 1b548: 65 91 lpm r22, Z+ 1b54a: 74 91 lpm r23, Z 1b54c: 86 17 cp r24, r22 1b54e: 97 07 cpc r25, r23 1b550: 0c f0 brlt .+2 ; 0x1b554 1b552: 66 c0 rjmp .+204 ; 0x1b620 { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b554: 41 50 subi r20, 0x01 ; 1 1b556: 51 09 sbc r21, r1 1b558: 44 0f add r20, r20 1b55a: 55 1f adc r21, r21 1b55c: 44 0f add r20, r20 1b55e: 55 1f adc r21, r21 1b560: ea 01 movw r28, r20 1b562: cf 55 subi r28, 0x5F ; 95 1b564: d5 47 sbci r29, 0x75 ; 117 1b566: fe 01 movw r30, r28 1b568: 05 91 lpm r16, Z+ 1b56a: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 1b56c: 41 56 subi r20, 0x61 ; 97 1b56e: 55 47 sbci r21, 0x75 ; 117 1b570: fa 01 movw r30, r20 1b572: 65 91 lpm r22, Z+ 1b574: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b576: f9 01 movw r30, r18 1b578: ef 55 subi r30, 0x5F ; 95 1b57a: f5 47 sbci r31, 0x75 ; 117 1b57c: e5 90 lpm r14, Z+ 1b57e: f4 90 lpm r15, Z 1b580: fe 01 movw r30, r28 1b582: c5 90 lpm r12, Z+ 1b584: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 1b586: fd 01 movw r30, r26 1b588: c5 91 lpm r28, Z+ 1b58a: d4 91 lpm r29, Z 1b58c: fa 01 movw r30, r20 1b58e: a5 90 lpm r10, Z+ 1b590: 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])) * 1b592: 86 1b sub r24, r22 1b594: 97 0b sbc r25, r23 1b596: bc 01 movw r22, r24 1b598: 99 0f add r25, r25 1b59a: 88 0b sbc r24, r24 1b59c: 99 0b sbc r25, r25 1b59e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1b5a2: 2b 01 movw r4, r22 1b5a4: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 1b5a6: b7 01 movw r22, r14 1b5a8: 6c 19 sub r22, r12 1b5aa: 7d 09 sbc r23, r13 1b5ac: 07 2e mov r0, r23 1b5ae: 00 0c add r0, r0 1b5b0: 88 0b sbc r24, r24 1b5b2: 99 0b sbc r25, r25 1b5b4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1b5b8: 9b 01 movw r18, r22 1b5ba: 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])) * 1b5bc: c3 01 movw r24, r6 1b5be: b2 01 movw r22, r4 1b5c0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b5c4: 6b 01 movw r12, r22 1b5c6: 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])); 1b5c8: be 01 movw r22, r28 1b5ca: 6a 19 sub r22, r10 1b5cc: 7b 09 sbc r23, r11 1b5ce: 07 2e mov r0, r23 1b5d0: 00 0c add r0, r0 1b5d2: 88 0b sbc r24, r24 1b5d4: 99 0b sbc r25, r25 1b5d6: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1b5da: 9b 01 movw r18, r22 1b5dc: 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])) / 1b5de: c7 01 movw r24, r14 1b5e0: b6 01 movw r22, r12 1b5e2: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1b5e6: 6b 01 movw r12, r22 1b5e8: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 1b5ea: b8 01 movw r22, r16 1b5ec: 11 0f add r17, r17 1b5ee: 88 0b sbc r24, r24 1b5f0: 99 0b sbc r25, r25 1b5f2: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1b5f6: 9b 01 movw r18, r22 1b5f8: ac 01 movw r20, r24 1b5fa: c7 01 movw r24, r14 1b5fc: b6 01 movw r22, r12 1b5fe: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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; } 1b602: df 91 pop r29 1b604: cf 91 pop r28 1b606: 1f 91 pop r17 1b608: 0f 91 pop r16 1b60a: ff 90 pop r15 1b60c: ef 90 pop r14 1b60e: df 90 pop r13 1b610: cf 90 pop r12 1b612: bf 90 pop r11 1b614: af 90 pop r10 1b616: 7f 90 pop r7 1b618: 6f 90 pop r6 1b61a: 5f 90 pop r5 1b61c: 4f 90 pop r4 1b61e: 08 95 ret 1b620: 4f 5f subi r20, 0xFF ; 255 1b622: 5f 4f sbci r21, 0xFF ; 255 1b624: 2c 5f subi r18, 0xFC ; 252 1b626: 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 1b62e: 88 cf rjmp .-240 ; 0x1b540 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 1b630: ed e1 ldi r30, 0x1D ; 29 1b632: fb e8 ldi r31, 0x8B ; 139 1b634: 65 91 lpm r22, Z+ 1b636: 74 91 lpm r23, Z 1b638: 07 2e mov r0, r23 1b63a: 00 0c add r0, r0 1b63c: 88 0b sbc r24, r24 1b63e: 99 0b sbc r25, r25 1b640: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1b644: de cf rjmp .-68 ; 0x1b602 0001b646 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 1b646: 1f 93 push r17 1b648: cf 93 push r28 1b64a: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 1b64c: e1 e0 ldi r30, 0x01 ; 1 1b64e: f1 e0 ldi r31, 0x01 ; 1 1b650: 80 81 ld r24, Z 1b652: 8e 7f andi r24, 0xFE ; 254 1b654: 80 83 st Z, r24 PORTH |= 0x01; 1b656: e2 e0 ldi r30, 0x02 ; 2 1b658: f1 e0 ldi r31, 0x01 ; 1 1b65a: 80 81 ld r24, Z 1b65c: 81 60 ori r24, 0x01 ; 1 1b65e: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 1b660: e2 e2 ldi r30, 0x22 ; 34 1b662: f5 e0 ldi r31, 0x05 ; 5 1b664: 90 e1 ldi r25, 0x10 ; 16 1b666: 90 83 st Z, r25 ptr[1] = 0; 1b668: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 1b66a: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 1b66c: e0 ed ldi r30, 0xD0 ; 208 1b66e: f0 e0 ldi r31, 0x00 ; 0 1b670: 80 81 ld r24, Z 1b672: 82 60 ori r24, 0x02 ; 2 1b674: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 1b676: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 1b67a: e1 ed ldi r30, 0xD1 ; 209 1b67c: f0 e0 ldi r31, 0x00 ; 0 1b67e: 88 e1 ldi r24, 0x18 ; 24 1b680: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 1b682: 80 81 ld r24, Z 1b684: 80 68 ori r24, 0x80 ; 128 1b686: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 1b688: e2 e7 ldi r30, 0x72 ; 114 1b68a: f2 e1 ldi r31, 0x12 ; 18 1b68c: 8a e8 ldi r24, 0x8A ; 138 1b68e: 9a e3 ldi r25, 0x3A ; 58 1b690: 91 87 std Z+9, r25 ; 0x09 1b692: 80 87 std Z+8, r24 ; 0x08 1b694: 80 e6 ldi r24, 0x60 ; 96 1b696: 99 e3 ldi r25, 0x39 ; 57 1b698: 93 87 std Z+11, r25 ; 0x0b 1b69a: 82 87 std Z+10, r24 ; 0x0a 1b69c: 13 e0 ldi r17, 0x03 ; 3 1b69e: 13 83 std Z+3, r17 ; 0x03 1b6a0: 15 86 std Z+13, r1 ; 0x0d 1b6a2: 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); 1b6a4: 9f b7 in r25, 0x3f ; 63 1b6a6: f8 94 cli 1b6a8: e5 e0 ldi r30, 0x05 ; 5 1b6aa: f1 e0 ldi r31, 0x01 ; 1 1b6ac: 80 81 ld r24, Z 1b6ae: 80 62 ori r24, 0x20 ; 32 1b6b0: 80 83 st Z, r24 1b6b2: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(MMU_RST_PIN); // setup reset pin 1b6b4: e4 e0 ldi r30, 0x04 ; 4 1b6b6: f1 e0 ldi r31, 0x01 ; 1 1b6b8: 80 81 ld r24, Z 1b6ba: 80 62 ori r24, 0x20 ; 32 1b6bc: 80 83 st Z, r24 #endif //MMU_HWRESET reset(); 1b6be: 0f 94 19 c3 call 0x38632 ; 0x38632 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 1b6c2: 83 e6 ldi r24, 0x63 ; 99 1b6c4: 0f 94 d5 87 call 0x30faa ; 0x30faa retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 1b6c8: 84 e1 ldi r24, 0x14 ; 20 1b6ca: 96 ea ldi r25, 0xA6 ; 166 1b6cc: 0e 94 06 7b call 0xf60c ; 0xf60c retryAttempts = MAX_RETRIES; 1b6d0: c9 e2 ldi r28, 0x29 ; 41 1b6d2: d3 e1 ldi r29, 0x13 ; 19 1b6d4: 10 93 7d 13 sts 0x137D, r17 ; 0x80137d } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 1b6d8: 85 e9 ldi r24, 0x95 ; 149 1b6da: 99 ea ldi r25, 0xA9 ; 169 1b6dc: 0e 94 06 7b call 0xf60c ; 0xf60c /// @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; } 1b6e0: 8a e0 ldi r24, 0x0A ; 10 1b6e2: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 1b6e4: 82 e0 ldi r24, 0x02 ; 2 1b6e6: 80 93 98 13 sts 0x1398, r24 ; 0x801398 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 1b6ea: 81 e0 ldi r24, 0x01 ; 1 1b6ec: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 1b6ee: 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; 1b6f0: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 1b6f2: 86 e0 ldi r24, 0x06 ; 6 1b6f4: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 1b6f6: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 1b6f8: df 91 pop r29 1b6fa: cf 91 pop r28 1b6fc: 1f 91 pop r17 1b6fe: 0d 94 a8 98 jmp 0x33150 ; 0x33150 0001b702 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 1b702: 22 e0 ldi r18, 0x02 ; 2 1b704: 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; 1b708: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 1b70c: 90 e1 ldi r25, 0x10 ; 16 1b70e: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 1b712: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b716: 80 61 ori r24, 0x10 ; 16 1b718: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 1b71c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b720: 88 60 ori r24, 0x08 ; 8 1b722: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 1b726: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 1b72a: 80 68 ori r24, 0x80 ; 128 1b72c: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 1b730: 80 91 21 05 lds r24, 0x0521 ; 0x800521 1b734: 81 30 cpi r24, 0x01 ; 1 1b736: a9 f4 brne .+42 ; 0x1b762 if (useU2X) { UCSR1A = 1 << U2X1; 1b738: 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; 1b73c: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 1b740: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 1b744: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b748: 80 61 ori r24, 0x10 ; 16 1b74a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 1b74e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b752: 88 60 ori r24, 0x08 ; 8 1b754: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 1b758: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 1b75c: 80 68 ori r24, 0x80 ; 128 1b75e: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 1b762: 08 95 ret 0001b764 : { 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) 1b764: 2f 92 push r2 1b766: 3f 92 push r3 1b768: 4f 92 push r4 1b76a: 5f 92 push r5 1b76c: 6f 92 push r6 1b76e: 7f 92 push r7 1b770: 8f 92 push r8 1b772: 9f 92 push r9 1b774: af 92 push r10 1b776: bf 92 push r11 1b778: cf 92 push r12 1b77a: df 92 push r13 1b77c: ef 92 push r14 1b77e: ff 92 push r15 1b780: 0f 93 push r16 1b782: 1f 93 push r17 1b784: cf 93 push r28 1b786: df 93 push r29 1b788: 00 d0 rcall .+0 ; 0x1b78a 1b78a: 00 d0 rcall .+0 ; 0x1b78c 1b78c: 1f 92 push r1 1b78e: cd b7 in r28, 0x3d ; 61 1b790: de b7 in r29, 0x3e ; 62 1b792: 69 83 std Y+1, r22 ; 0x01 1b794: 49 01 movw r8, r18 1b796: 5a 01 movw r10, r20 1b798: 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; 1b79a: 68 2f mov r22, r24 1b79c: 70 e0 ldi r23, 0x00 ; 0 1b79e: 90 e0 ldi r25, 0x00 ; 0 1b7a0: 80 e0 ldi r24, 0x00 ; 0 1b7a2: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1b7a6: 24 e0 ldi r18, 0x04 ; 4 1b7a8: 32 e0 ldi r19, 0x02 ; 2 1b7aa: 41 e0 ldi r20, 0x01 ; 1 1b7ac: 5c e3 ldi r21, 0x3C ; 60 1b7ae: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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] 1b7b2: 20 91 b8 12 lds r18, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 1b7b6: 30 91 b9 12 lds r19, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 1b7ba: 40 91 ba 12 lds r20, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 1b7be: 50 91 bb 12 lds r21, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 1b7c2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b7c6: 6b 01 movw r12, r22 1b7c8: 7c 01 movw r14, r24 dP *= (cur_heater_temp * U) + V; // linear temp. correction 1b7ca: 20 91 bc 12 lds r18, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 1b7ce: 30 91 bd 12 lds r19, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 1b7d2: 40 91 be 12 lds r20, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 1b7d6: 50 91 bf 12 lds r21, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 1b7da: c5 01 movw r24, r10 1b7dc: b4 01 movw r22, r8 1b7de: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b7e2: 20 91 c0 12 lds r18, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 1b7e6: 30 91 c1 12 lds r19, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 1b7ea: 40 91 c2 12 lds r20, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 1b7ee: 50 91 c3 12 lds r21, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 1b7f2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1b7f6: a7 01 movw r20, r14 1b7f8: 96 01 movw r18, r12 1b7fa: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b7fe: 6b 01 movw r12, r22 1b800: 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; 1b802: 20 91 0e 13 lds r18, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 1b806: 30 91 0f 13 lds r19, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 1b80a: 40 91 10 13 lds r20, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 1b80e: 50 91 11 13 lds r21, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 1b812: c8 01 movw r24, r16 1b814: b2 01 movw r22, r4 1b816: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1b81a: 9b 01 movw r18, r22 1b81c: 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 1b81e: c5 01 movw r24, r10 1b820: b4 01 movw r22, r8 1b822: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__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) 1b826: 39 81 ldd r19, Y+1 ; 0x01 1b828: 24 e0 ldi r18, 0x04 ; 4 1b82a: 32 9f mul r19, r18 1b82c: f0 01 movw r30, r0 1b82e: 11 24 eor r1, r1 1b830: e2 53 subi r30, 0x32 ; 50 1b832: 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 1b834: 20 81 ld r18, Z 1b836: 31 81 ldd r19, Z+1 ; 0x01 1b838: 42 81 ldd r20, Z+2 ; 0x02 1b83a: 53 81 ldd r21, Z+3 ; 0x03 1b83c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1b840: 9b 01 movw r18, r22 1b842: ac 01 movw r20, r24 float dT = (dP - dPl) * C_i; // expected temperature difference (K) 1b844: c7 01 movw r24, r14 1b846: b6 01 movw r22, r12 1b848: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1b84c: 20 91 1b 13 lds r18, 0x131B ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 1b850: 30 91 1c 13 lds r19, 0x131C ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 1b854: 40 91 1d 13 lds r20, 0x131D ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 1b858: 50 91 1e 13 lds r21, 0x131E ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> 1b85c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b860: 6f 83 std Y+7, r22 ; 0x07 1b862: 79 83 std Y+1, r23 ; 0x01 1b864: 18 2f mov r17, r24 1b866: 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); 1b868: 20 91 af 12 lds r18, 0x12AF ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> 1b86c: e2 2f mov r30, r18 1b86e: f0 e0 ldi r31, 0x00 ; 0 1b870: 80 91 ae 12 lds r24, 0x12AE ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 1b874: 81 50 subi r24, 0x01 ; 1 1b876: 99 0b sbc r25, r25 1b878: e8 17 cp r30, r24 1b87a: f9 07 cpc r31, r25 1b87c: 09 f4 brne .+2 ; 0x1b880 1b87e: f4 c0 rjmp .+488 ; 0x1ba68 1b880: 2f 5f subi r18, 0xFF ; 255 1b882: 2e 83 std Y+6, r18 ; 0x06 float dT_lag = dT_lag_buf[dT_next_idx]; 1b884: 5e 81 ldd r21, Y+6 ; 0x06 1b886: 44 e0 ldi r20, 0x04 ; 4 1b888: 54 9f mul r21, r20 1b88a: 10 01 movw r2, r0 1b88c: 11 24 eor r1, r1 1b88e: d1 01 movw r26, r2 1b890: a2 57 subi r26, 0x72 ; 114 1b892: bd 4e sbci r27, 0xED ; 237 1b894: 2d 91 ld r18, X+ 1b896: 3d 91 ld r19, X+ 1b898: 4d 91 ld r20, X+ 1b89a: 5c 91 ld r21, X 1b89c: 2a 83 std Y+2, r18 ; 0x02 1b89e: 3b 83 std Y+3, r19 ; 0x03 1b8a0: 4c 83 std Y+4, r20 ; 0x04 1b8a2: 5d 83 std Y+5, r21 ; 0x05 float dT_lag_prev = dT_lag_buf[dT_lag_idx]; 1b8a4: ee 0f add r30, r30 1b8a6: ff 1f adc r31, r31 1b8a8: ee 0f add r30, r30 1b8aa: ff 1f adc r31, r31 1b8ac: e2 57 subi r30, 0x72 ; 114 1b8ae: fd 4e sbci r31, 0xED ; 237 1b8b0: 40 80 ld r4, Z 1b8b2: 51 80 ldd r5, Z+1 ; 0x01 1b8b4: 62 80 ldd r6, Z+2 ; 0x02 1b8b6: 73 80 ldd r7, Z+3 ; 0x03 float dT_f = iir_mul(dT_lag_prev, dT, fS, dT); 1b8b8: c0 90 c8 12 lds r12, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 1b8bc: d0 90 c9 12 lds r13, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 1b8c0: e0 90 ca 12 lds r14, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 1b8c4: f0 90 cb 12 lds r15, 0x12CB ; 0x8012cb <_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; 1b8c8: 92 01 movw r18, r4 1b8ca: a3 01 movw r20, r6 1b8cc: b2 01 movw r22, r4 1b8ce: c3 01 movw r24, r6 1b8d0: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 1b8d4: 88 23 and r24, r24 1b8d6: 21 f0 breq .+8 ; 0x1b8e0 1b8d8: 4f 80 ldd r4, Y+7 ; 0x07 1b8da: 59 80 ldd r5, Y+1 ; 0x01 1b8dc: 61 2e mov r6, r17 1b8de: 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; 1b8e0: a1 01 movw r20, r2 1b8e2: 42 57 subi r20, 0x72 ; 114 1b8e4: 5d 4e sbci r21, 0xED ; 237 1b8e6: 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); 1b8e8: a7 01 movw r20, r14 1b8ea: 96 01 movw r18, r12 1b8ec: 60 e0 ldi r22, 0x00 ; 0 1b8ee: 70 e0 ldi r23, 0x00 ; 0 1b8f0: 80 e8 ldi r24, 0x80 ; 128 1b8f2: 9f e3 ldi r25, 0x3F ; 63 1b8f4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1b8f8: 92 01 movw r18, r4 1b8fa: a3 01 movw r20, r6 1b8fc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b900: 2b 01 movw r4, r22 1b902: 3c 01 movw r6, r24 1b904: a7 01 movw r20, r14 1b906: 96 01 movw r18, r12 1b908: 6f 81 ldd r22, Y+7 ; 0x07 1b90a: 79 81 ldd r23, Y+1 ; 0x01 1b90c: 81 2f mov r24, r17 1b90e: 90 2f mov r25, r16 1b910: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b914: 9b 01 movw r18, r22 1b916: ac 01 movw r20, r24 1b918: c3 01 movw r24, r6 1b91a: b2 01 movw r22, r4 1b91c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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; 1b920: f1 01 movw r30, r2 1b922: 60 83 st Z, r22 1b924: 71 83 std Z+1, r23 ; 0x01 1b926: 82 83 std Z+2, r24 ; 0x02 1b928: 93 83 std Z+3, r25 ; 0x03 dT_lag_idx = dT_next_idx; 1b92a: fe 81 ldd r31, Y+6 ; 0x06 1b92c: f0 93 af 12 sts 0x12AF, r31 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> // calculate and filter dT_err float dT_err = (cur_heater_temp - T_prev) - dT_lag; 1b930: 20 91 b4 12 lds r18, 0x12B4 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 1b934: 30 91 b5 12 lds r19, 0x12B5 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 1b938: 40 91 b6 12 lds r20, 0x12B6 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 1b93c: 50 91 b7 12 lds r21, 0x12B7 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> 1b940: c5 01 movw r24, r10 1b942: b4 01 movw r22, r8 1b944: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1b948: 2a 81 ldd r18, Y+2 ; 0x02 1b94a: 3b 81 ldd r19, Y+3 ; 0x03 1b94c: 4c 81 ldd r20, Y+4 ; 0x04 1b94e: 5d 81 ldd r21, Y+5 ; 0x05 1b950: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1b954: 2b 01 movw r4, r22 1b956: 3c 01 movw r6, r24 float dT_err_f = iir_mul(dT_err_prev, dT_err, THERMAL_MODEL_fE, 0.); 1b958: c0 90 b0 12 lds r12, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 1b95c: d0 90 b1 12 lds r13, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 1b960: e0 90 b2 12 lds r14, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 1b964: f0 90 b3 12 lds r15, 0x12B3 ; 0x8012b3 <_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; 1b968: a7 01 movw r20, r14 1b96a: 96 01 movw r18, r12 1b96c: c7 01 movw r24, r14 1b96e: b6 01 movw r22, r12 1b970: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 1b974: 88 23 and r24, r24 1b976: 19 f0 breq .+6 ; 0x1b97e 1b978: c1 2c mov r12, r1 1b97a: d1 2c mov r13, r1 1b97c: 76 01 movw r14, r12 return (a_ * (1.f - f)) + (b * f); 1b97e: 23 e3 ldi r18, 0x33 ; 51 1b980: 33 e3 ldi r19, 0x33 ; 51 1b982: 43 e7 ldi r20, 0x73 ; 115 1b984: 5f e3 ldi r21, 0x3F ; 63 1b986: c7 01 movw r24, r14 1b988: b6 01 movw r22, r12 1b98a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b98e: 6b 01 movw r12, r22 1b990: 7c 01 movw r14, r24 1b992: 2d ec ldi r18, 0xCD ; 205 1b994: 3c ec ldi r19, 0xCC ; 204 1b996: 4c e4 ldi r20, 0x4C ; 76 1b998: 5d e3 ldi r21, 0x3D ; 61 1b99a: c3 01 movw r24, r6 1b99c: b2 01 movw r22, r4 1b99e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1b9a2: 9b 01 movw r18, r22 1b9a4: ac 01 movw r20, r24 1b9a6: c7 01 movw r24, r14 1b9a8: b6 01 movw r22, r12 1b9aa: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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; 1b9ae: 80 92 b4 12 sts 0x12B4, r8 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 1b9b2: 90 92 b5 12 sts 0x12B5, r9 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 1b9b6: a0 92 b6 12 sts 0x12B6, r10 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 1b9ba: b0 92 b7 12 sts 0x12B7, r11 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> dT_err_prev = dT_err_f; 1b9be: 60 93 b0 12 sts 0x12B0, r22 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 1b9c2: 70 93 b1 12 sts 0x12B1, r23 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 1b9c6: 80 93 b2 12 sts 0x12B2, r24 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 1b9ca: 90 93 b3 12 sts 0x12B3, r25 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> // check and trigger errors flag_bits.error = (fabsf(dT_err_f) > err_s); 1b9ce: 6b 01 movw r12, r22 1b9d0: 7c 01 movw r14, r24 1b9d2: e8 94 clt 1b9d4: f7 f8 bld r15, 7 1b9d6: 21 e0 ldi r18, 0x01 ; 1 1b9d8: 29 83 std Y+1, r18 ; 0x01 1b9da: 20 91 23 13 lds r18, 0x1323 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 1b9de: 30 91 24 13 lds r19, 0x1324 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 1b9e2: 40 91 25 13 lds r20, 0x1325 ; 0x801325 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 1b9e6: 50 91 26 13 lds r21, 0x1326 ; 0x801326 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> 1b9ea: c7 01 movw r24, r14 1b9ec: b6 01 movw r22, r12 1b9ee: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1b9f2: 18 16 cp r1, r24 1b9f4: 0c f0 brlt .+2 ; 0x1b9f8 1b9f6: 19 82 std Y+1, r1 ; 0x01 1b9f8: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 1b9fc: 39 81 ldd r19, Y+1 ; 0x01 1b9fe: 30 fb bst r19, 0 1ba00: 81 f9 bld r24, 1 1ba02: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> flag_bits.warning = (fabsf(dT_err_f) > warn_s); 1ba06: 41 e0 ldi r20, 0x01 ; 1 1ba08: 49 83 std Y+1, r20 ; 0x01 1ba0a: 20 91 1f 13 lds r18, 0x131F ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 1ba0e: 30 91 20 13 lds r19, 0x1320 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 1ba12: 40 91 21 13 lds r20, 0x1321 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 1ba16: 50 91 22 13 lds r21, 0x1322 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> 1ba1a: c7 01 movw r24, r14 1ba1c: b6 01 movw r22, r12 1ba1e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1ba22: 18 16 cp r1, r24 1ba24: 0c f0 brlt .+2 ; 0x1ba28 1ba26: 19 82 std Y+1, r1 ; 0x01 1ba28: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 1ba2c: 59 81 ldd r21, Y+1 ; 0x01 1ba2e: 50 fb bst r21, 0 1ba30: 82 f9 bld r24, 2 1ba32: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> } 1ba36: 27 96 adiw r28, 0x07 ; 7 1ba38: 0f b6 in r0, 0x3f ; 63 1ba3a: f8 94 cli 1ba3c: de bf out 0x3e, r29 ; 62 1ba3e: 0f be out 0x3f, r0 ; 63 1ba40: cd bf out 0x3d, r28 ; 61 1ba42: df 91 pop r29 1ba44: cf 91 pop r28 1ba46: 1f 91 pop r17 1ba48: 0f 91 pop r16 1ba4a: ff 90 pop r15 1ba4c: ef 90 pop r14 1ba4e: df 90 pop r13 1ba50: cf 90 pop r12 1ba52: bf 90 pop r11 1ba54: af 90 pop r10 1ba56: 9f 90 pop r9 1ba58: 8f 90 pop r8 1ba5a: 7f 90 pop r7 1ba5c: 6f 90 pop r6 1ba5e: 5f 90 pop r5 1ba60: 4f 90 pop r4 1ba62: 3f 90 pop r3 1ba64: 2f 90 pop r2 1ba66: 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); 1ba68: 1e 82 std Y+6, r1 ; 0x06 1ba6a: 0c cf rjmp .-488 ; 0x1b884 0001ba6c : float d = GOLDEN_RATIO * (bounds[1] - bounds[0]); points[0] = bounds[0] + d; points[1] = bounds[1] - d; } static float estimate(uint16_t samples, 1ba6c: 2f 92 push r2 1ba6e: 3f 92 push r3 1ba70: 4f 92 push r4 1ba72: 5f 92 push r5 1ba74: 6f 92 push r6 1ba76: 7f 92 push r7 1ba78: 8f 92 push r8 1ba7a: 9f 92 push r9 1ba7c: af 92 push r10 1ba7e: bf 92 push r11 1ba80: cf 92 push r12 1ba82: df 92 push r13 1ba84: ef 92 push r14 1ba86: ff 92 push r15 1ba88: 0f 93 push r16 1ba8a: 1f 93 push r17 1ba8c: cf 93 push r28 1ba8e: df 93 push r29 1ba90: cd b7 in r28, 0x3d ; 61 1ba92: de b7 in r29, 0x3e ; 62 1ba94: a4 97 sbiw r28, 0x24 ; 36 1ba96: 0f b6 in r0, 0x3f ; 63 1ba98: f8 94 cli 1ba9a: de bf out 0x3e, r29 ; 62 1ba9c: 0f be out 0x3f, r0 ; 63 1ba9e: cd bf out 0x3d, r28 ; 61 1baa0: 9b 8f std Y+27, r25 ; 0x1b 1baa2: 8a 8f std Y+26, r24 ; 0x1a 1baa4: 7a 8b std Y+18, r23 ; 0x12 1baa6: 69 8b std Y+17, r22 ; 0x11 1baa8: 2b 8b std Y+19, r18 ; 0x13 1baaa: 3c 8b std Y+20, r19 ; 0x14 1baac: 4d 8b std Y+21, r20 ; 0x15 1baae: 5e 8b std Y+22, r21 ; 0x16 1bab0: 0c 8f std Y+28, r16 ; 0x1c 1bab2: cd 8e std Y+29, r12 ; 0x1d 1bab4: de 8e std Y+30, r13 ; 0x1e 1bab6: ef 8e std Y+31, r14 ; 0x1f 1bab8: 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; 1baba: 20 91 20 05 lds r18, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> 1babe: 29 8f std Y+25, r18 ; 0x19 thermal_model_reset_enabled(false); 1bac0: 80 e0 ldi r24, 0x00 ; 0 1bac2: 0f 94 a3 48 call 0x29146 ; 0x29146 float orig = *var; 1bac6: a9 89 ldd r26, Y+17 ; 0x11 1bac8: ba 89 ldd r27, Y+18 ; 0x12 1baca: 8d 91 ld r24, X+ 1bacc: 9d 91 ld r25, X+ 1bace: 0d 90 ld r0, X+ 1bad0: bc 91 ld r27, X 1bad2: a0 2d mov r26, r0 1bad4: 89 a3 std Y+33, r24 ; 0x21 1bad6: 9a a3 std Y+34, r25 ; 0x22 1bad8: ab a3 std Y+35, r26 ; 0x23 1bada: bc a3 std Y+36, r27 ; 0x24 float e = NAN; float points[2]; float bounds[2] = {min, max}; 1badc: 80 e0 ldi r24, 0x00 ; 0 1bade: 90 e0 ldi r25, 0x00 ; 0 1bae0: a0 ea ldi r26, 0xA0 ; 160 1bae2: b0 e4 ldi r27, 0x40 ; 64 1bae4: 89 83 std Y+1, r24 ; 0x01 1bae6: 9a 83 std Y+2, r25 ; 0x02 1bae8: ab 83 std Y+3, r26 ; 0x03 1baea: bc 83 std Y+4, r27 ; 0x04 1baec: 8b 89 ldd r24, Y+19 ; 0x13 1baee: 9c 89 ldd r25, Y+20 ; 0x14 1baf0: ad 89 ldd r26, Y+21 ; 0x15 1baf2: be 89 ldd r27, Y+22 ; 0x16 1baf4: 8d 83 std Y+5, r24 ; 0x05 1baf6: 9e 83 std Y+6, r25 ; 0x06 1baf8: af 83 std Y+7, r26 ; 0x07 1bafa: 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]); 1bafc: 20 e0 ldi r18, 0x00 ; 0 1bafe: 30 e0 ldi r19, 0x00 ; 0 1bb00: 40 ea ldi r20, 0xA0 ; 160 1bb02: 50 e4 ldi r21, 0x40 ; 64 1bb04: bc 01 movw r22, r24 1bb06: cd 01 movw r24, r26 1bb08: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1bb0c: 2a e7 ldi r18, 0x7A ; 122 1bb0e: 37 e3 ldi r19, 0x37 ; 55 1bb10: 4e e1 ldi r20, 0x1E ; 30 1bb12: 5f e3 ldi r21, 0x3F ; 63 1bb14: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1bb18: 6b 01 movw r12, r22 1bb1a: 7c 01 movw r14, r24 points[0] = bounds[0] + d; 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: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1bb28: 69 87 std Y+9, r22 ; 0x09 1bb2a: 7a 87 std Y+10, r23 ; 0x0a 1bb2c: 8b 87 std Y+11, r24 ; 0x0b 1bb2e: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1bb30: a7 01 movw r20, r14 1bb32: 96 01 movw r18, r12 1bb34: 6b 89 ldd r22, Y+19 ; 0x13 1bb36: 7c 89 ldd r23, Y+20 ; 0x14 1bb38: 8d 89 ldd r24, Y+21 ; 0x15 1bb3a: 9e 89 ldd r25, Y+22 ; 0x16 1bb3c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1bb40: 6d 87 std Y+13, r22 ; 0x0d 1bb42: 7e 87 std Y+14, r23 ; 0x0e 1bb44: 8f 87 std Y+15, r24 ; 0x0f 1bb46: 98 8b std Y+16, r25 ; 0x10 1bb48: 31 2c mov r3, r1 1bb4a: 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); 1bb4c: 29 85 ldd r18, Y+9 ; 0x09 1bb4e: 3a 85 ldd r19, Y+10 ; 0x0a 1bb50: 4b 85 ldd r20, Y+11 ; 0x0b 1bb52: 5c 85 ldd r21, Y+12 ; 0x0c 1bb54: cd 8c ldd r12, Y+29 ; 0x1d 1bb56: de 8c ldd r13, Y+30 ; 0x1e 1bb58: ef 8c ldd r14, Y+31 ; 0x1f 1bb5a: f8 a0 ldd r15, Y+32 ; 0x20 1bb5c: 0c 8d ldd r16, Y+28 ; 0x1c 1bb5e: 69 89 ldd r22, Y+17 ; 0x11 1bb60: 7a 89 ldd r23, Y+18 ; 0x12 1bb62: 8a 8d ldd r24, Y+26 ; 0x1a 1bb64: 9b 8d ldd r25, Y+27 ; 0x1b 1bb66: 0f 94 ec 42 call 0x285d8 ; 0x285d8 1bb6a: 4b 01 movw r8, r22 1bb6c: 5c 01 movw r10, r24 float c2 = cost_fn(samples, var, points[1], fan_pwm, ambient); 1bb6e: 2d 85 ldd r18, Y+13 ; 0x0d 1bb70: 3e 85 ldd r19, Y+14 ; 0x0e 1bb72: 4f 85 ldd r20, Y+15 ; 0x0f 1bb74: 58 89 ldd r21, Y+16 ; 0x10 1bb76: cd 8c ldd r12, Y+29 ; 0x1d 1bb78: de 8c ldd r13, Y+30 ; 0x1e 1bb7a: ef 8c ldd r14, Y+31 ; 0x1f 1bb7c: f8 a0 ldd r15, Y+32 ; 0x20 1bb7e: 0c 8d ldd r16, Y+28 ; 0x1c 1bb80: 69 89 ldd r22, Y+17 ; 0x11 1bb82: 7a 89 ldd r23, Y+18 ; 0x12 1bb84: 8a 8d ldd r24, Y+26 ; 0x1a 1bb86: 9b 8d ldd r25, Y+27 ; 0x1b 1bb88: 0f 94 ec 42 call 0x285d8 ; 0x285d8 1bb8c: 9b 01 movw r18, r22 1bb8e: ac 01 movw r20, r24 bool dir = (c2 < c1); 1bb90: 11 e0 ldi r17, 0x01 ; 1 1bb92: c5 01 movw r24, r10 1bb94: b4 01 movw r22, r8 1bb96: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1bb9a: 18 16 cp r1, r24 1bb9c: 0c f0 brlt .+2 ; 0x1bba0 1bb9e: 10 e0 ldi r17, 0x00 ; 0 bounds[dir] = points[!dir]; 1bba0: 01 e0 ldi r16, 0x01 ; 1 1bba2: 01 27 eor r16, r17 1bba4: 80 2f mov r24, r16 1bba6: 90 e0 ldi r25, 0x00 ; 0 1bba8: e1 2f mov r30, r17 1bbaa: f0 e0 ldi r31, 0x00 ; 0 1bbac: ee 0f add r30, r30 1bbae: ff 1f adc r31, r31 1bbb0: ee 0f add r30, r30 1bbb2: ff 1f adc r31, r31 1bbb4: 41 e0 ldi r20, 0x01 ; 1 1bbb6: 50 e0 ldi r21, 0x00 ; 0 1bbb8: 4c 0f add r20, r28 1bbba: 5d 1f adc r21, r29 1bbbc: 4e 0f add r20, r30 1bbbe: 5f 1f adc r21, r31 1bbc0: 8c 01 movw r16, r24 1bbc2: 00 0f add r16, r16 1bbc4: 11 1f adc r17, r17 1bbc6: 00 0f add r16, r16 1bbc8: 11 1f adc r17, r17 1bbca: a1 e0 ldi r26, 0x01 ; 1 1bbcc: b0 e0 ldi r27, 0x00 ; 0 1bbce: ac 0f add r26, r28 1bbd0: bd 1f adc r27, r29 1bbd2: 0a 0f add r16, r26 1bbd4: 1b 1f adc r17, r27 1bbd6: f8 01 movw r30, r16 1bbd8: 38 96 adiw r30, 0x08 ; 8 1bbda: f8 8f std Y+24, r31 ; 0x18 1bbdc: ef 8b std Y+23, r30 ; 0x17 1bbde: f8 01 movw r30, r16 1bbe0: 80 85 ldd r24, Z+8 ; 0x08 1bbe2: 91 85 ldd r25, Z+9 ; 0x09 1bbe4: a2 85 ldd r26, Z+10 ; 0x0a 1bbe6: b3 85 ldd r27, Z+11 ; 0x0b 1bbe8: fa 01 movw r30, r20 1bbea: 80 83 st Z, r24 1bbec: 91 83 std Z+1, r25 ; 0x01 1bbee: a2 83 std Z+2, r26 ; 0x02 1bbf0: 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]); 1bbf2: 8d 80 ldd r8, Y+5 ; 0x05 1bbf4: 9e 80 ldd r9, Y+6 ; 0x06 1bbf6: af 80 ldd r10, Y+7 ; 0x07 1bbf8: b8 84 ldd r11, Y+8 ; 0x08 1bbfa: c9 80 ldd r12, Y+1 ; 0x01 1bbfc: da 80 ldd r13, Y+2 ; 0x02 1bbfe: eb 80 ldd r14, Y+3 ; 0x03 1bc00: fc 80 ldd r15, Y+4 ; 0x04 1bc02: a7 01 movw r20, r14 1bc04: 96 01 movw r18, r12 1bc06: c5 01 movw r24, r10 1bc08: b4 01 movw r22, r8 1bc0a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1bc0e: 2a e7 ldi r18, 0x7A ; 122 1bc10: 37 e3 ldi r19, 0x37 ; 55 1bc12: 4e e1 ldi r20, 0x1E ; 30 1bc14: 5f e3 ldi r21, 0x3F ; 63 1bc16: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1bc1a: 2b 01 movw r4, r22 1bc1c: 3c 01 movw r6, r24 points[0] = bounds[0] + d; 1bc1e: ac 01 movw r20, r24 1bc20: 9b 01 movw r18, r22 1bc22: c7 01 movw r24, r14 1bc24: b6 01 movw r22, r12 1bc26: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1bc2a: 69 87 std Y+9, r22 ; 0x09 1bc2c: 7a 87 std Y+10, r23 ; 0x0a 1bc2e: 8b 87 std Y+11, r24 ; 0x0b 1bc30: 9c 87 std Y+12, r25 ; 0x0c points[1] = bounds[1] - d; 1bc32: a3 01 movw r20, r6 1bc34: 92 01 movw r18, r4 1bc36: c5 01 movw r24, r10 1bc38: b4 01 movw r22, r8 1bc3a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1bc3e: 6d 87 std Y+13, r22 ; 0x0d 1bc40: 7e 87 std Y+14, r23 ; 0x0e 1bc42: 8f 87 std Y+15, r24 ; 0x0f 1bc44: 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]; 1bc46: d8 01 movw r26, r16 1bc48: 18 96 adiw r26, 0x08 ; 8 1bc4a: 4c 90 ld r4, X 1bc4c: ef 89 ldd r30, Y+23 ; 0x17 1bc4e: f8 8d ldd r31, Y+24 ; 0x18 1bc50: 51 80 ldd r5, Z+1 ; 0x01 1bc52: 62 80 ldd r6, Z+2 ; 0x02 1bc54: 73 80 ldd r7, Z+3 ; 0x03 e = (1-GOLDEN_RATIO) * fabsf((bounds[0]-bounds[1]) / x); 1bc56: a5 01 movw r20, r10 1bc58: 94 01 movw r18, r8 1bc5a: c7 01 movw r24, r14 1bc5c: b6 01 movw r22, r12 1bc5e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1bc62: 24 2d mov r18, r4 1bc64: 35 2d mov r19, r5 1bc66: 46 2d mov r20, r6 1bc68: 57 2d mov r21, r7 1bc6a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1bc6e: 9f 77 andi r25, 0x7F ; 127 1bc70: 2c e0 ldi r18, 0x0C ; 12 1bc72: 31 e9 ldi r19, 0x91 ; 145 1bc74: 43 ec ldi r20, 0xC3 ; 195 1bc76: 5e e3 ldi r21, 0x3E ; 62 1bc78: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1bc7c: 6b 01 movw r12, r22 1bc7e: 7c 01 movw r14, r24 1bc80: 5b 01 movw r10, r22 1bc82: 8c 01 movw r16, r24 printf_P(PSTR("TM iter:%u v:%.2f e:%.3f\n"), it, x, e); 1bc84: ff 92 push r15 1bc86: 8f 93 push r24 1bc88: df 92 push r13 1bc8a: 6f 93 push r22 1bc8c: 7f 92 push r7 1bc8e: 6f 92 push r6 1bc90: 5f 92 push r5 1bc92: 4f 92 push r4 1bc94: 3f 92 push r3 1bc96: 2f 92 push r2 1bc98: 2d e5 ldi r18, 0x5D ; 93 1bc9a: 30 e9 ldi r19, 0x90 ; 144 1bc9c: 3f 93 push r19 1bc9e: 2f 93 push r18 1bca0: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if(e < thr) { 1bca4: 0f b6 in r0, 0x3f ; 63 1bca6: f8 94 cli 1bca8: de bf out 0x3e, r29 ; 62 1bcaa: 0f be out 0x3f, r0 ; 63 1bcac: cd bf out 0x3d, r28 ; 61 1bcae: 2a e0 ldi r18, 0x0A ; 10 1bcb0: 37 ed ldi r19, 0xD7 ; 215 1bcb2: 43 e2 ldi r20, 0x23 ; 35 1bcb4: 5c e3 ldi r21, 0x3C ; 60 1bcb6: 6c 2d mov r22, r12 1bcb8: 7d 2d mov r23, r13 1bcba: 8e 2d mov r24, r14 1bcbc: 9f 2d mov r25, r15 1bcbe: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1bcc2: 87 ff sbrs r24, 7 1bcc4: 42 c0 rjmp .+132 ; 0x1bd4a if(x == min || x == max) { 1bcc6: 20 e0 ldi r18, 0x00 ; 0 1bcc8: 30 e0 ldi r19, 0x00 ; 0 1bcca: 40 ea ldi r20, 0xA0 ; 160 1bccc: 50 e4 ldi r21, 0x40 ; 64 1bcce: 64 2d mov r22, r4 1bcd0: 75 2d mov r23, r5 1bcd2: 86 2d mov r24, r6 1bcd4: 97 2d mov r25, r7 1bcd6: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1bcda: 88 23 and r24, r24 1bcdc: f1 f1 breq .+124 ; 0x1bd5a 1bcde: 24 2d mov r18, r4 1bce0: 35 2d mov r19, r5 1bce2: 46 2d mov r20, r6 1bce4: 57 2d mov r21, r7 1bce6: 6b 89 ldd r22, Y+19 ; 0x13 1bce8: 7c 89 ldd r23, Y+20 ; 0x14 1bcea: 8d 89 ldd r24, Y+21 ; 0x15 1bcec: 9e 89 ldd r25, Y+22 ; 0x16 1bcee: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1bcf2: 88 23 and r24, r24 1bcf4: 91 f1 breq .+100 ; 0x1bd5a // real value likely outside of the search boundaries break; } *var = x; 1bcf6: 84 2d mov r24, r4 1bcf8: 95 2d mov r25, r5 1bcfa: a6 2d mov r26, r6 1bcfc: b7 2d mov r27, r7 1bcfe: e9 89 ldd r30, Y+17 ; 0x11 1bd00: fa 89 ldd r31, Y+18 ; 0x12 1bd02: 80 83 st Z, r24 1bd04: 91 83 std Z+1, r25 ; 0x01 1bd06: a2 83 std Z+2, r26 ; 0x02 1bd08: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bd0a: 89 8d ldd r24, Y+25 ; 0x19 1bd0c: 0f 94 a3 48 call 0x29146 ; 0x29146 SERIAL_ECHOLNPGM("TM estimation did not converge"); *var = orig; thermal_model_reset_enabled(was_enabled); return NAN; } 1bd10: 6a 2d mov r22, r10 1bd12: 7b 2d mov r23, r11 1bd14: 80 2f mov r24, r16 1bd16: 91 2f mov r25, r17 1bd18: a4 96 adiw r28, 0x24 ; 36 1bd1a: 0f b6 in r0, 0x3f ; 63 1bd1c: f8 94 cli 1bd1e: de bf out 0x3e, r29 ; 62 1bd20: 0f be out 0x3f, r0 ; 63 1bd22: cd bf out 0x3d, r28 ; 61 1bd24: df 91 pop r29 1bd26: cf 91 pop r28 1bd28: 1f 91 pop r17 1bd2a: 0f 91 pop r16 1bd2c: ff 90 pop r15 1bd2e: ef 90 pop r14 1bd30: df 90 pop r13 1bd32: cf 90 pop r12 1bd34: bf 90 pop r11 1bd36: af 90 pop r10 1bd38: 9f 90 pop r9 1bd3a: 8f 90 pop r8 1bd3c: 7f 90 pop r7 1bd3e: 6f 90 pop r6 1bd40: 5f 90 pop r5 1bd42: 4f 90 pop r4 1bd44: 3f 90 pop r3 1bd46: 2f 90 pop r2 1bd48: 08 95 ret 1bd4a: ff ef ldi r31, 0xFF ; 255 1bd4c: 2f 1a sub r2, r31 1bd4e: 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) { 1bd50: 2e e1 ldi r18, 0x1E ; 30 1bd52: 22 16 cp r2, r18 1bd54: 31 04 cpc r3, r1 1bd56: 09 f0 breq .+2 ; 0x1bd5a 1bd58: f9 ce rjmp .-526 ; 0x1bb4c thermal_model_reset_enabled(was_enabled); return e; } } SERIAL_ECHOLNPGM("TM estimation did not converge"); 1bd5a: 8e e3 ldi r24, 0x3E ; 62 1bd5c: 90 e9 ldi r25, 0x90 ; 144 1bd5e: 0e 94 06 7b call 0xf60c ; 0xf60c *var = orig; 1bd62: 89 a1 ldd r24, Y+33 ; 0x21 1bd64: 9a a1 ldd r25, Y+34 ; 0x22 1bd66: ab a1 ldd r26, Y+35 ; 0x23 1bd68: bc a1 ldd r27, Y+36 ; 0x24 1bd6a: e9 89 ldd r30, Y+17 ; 0x11 1bd6c: fa 89 ldd r31, Y+18 ; 0x12 1bd6e: 80 83 st Z, r24 1bd70: 91 83 std Z+1, r25 ; 0x01 1bd72: a2 83 std Z+2, r26 ; 0x02 1bd74: b3 83 std Z+3, r27 ; 0x03 thermal_model_reset_enabled(was_enabled); 1bd76: 89 8d ldd r24, Y+25 ; 0x19 1bd78: 0f 94 a3 48 call 0x29146 ; 0x29146 return NAN; 1bd7c: a1 2c mov r10, r1 1bd7e: b1 2c mov r11, r1 1bd80: 00 ec ldi r16, 0xC0 ; 192 1bd82: 1f e7 ldi r17, 0x7F ; 127 1bd84: c5 cf rjmp .-118 ; 0x1bd10 0001bd86 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1bd86: ef 92 push r14 1bd88: ff 92 push r15 1bd8a: 0f 93 push r16 1bd8c: 1f 93 push r17 1bd8e: cf 93 push r28 1bd90: df 93 push r29 1bd92: 00 d0 rcall .+0 ; 0x1bd94 1bd94: 1f 92 push r1 1bd96: 1f 92 push r1 1bd98: cd b7 in r28, 0x3d ; 61 1bd9a: de b7 in r29, 0x3e ; 62 1bd9c: 08 2f mov r16, r24 1bd9e: 16 2f mov r17, r22 1bda0: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1bda2: 0f 94 56 88 call 0x310ac ; 0x310ac 1bda6: 88 23 and r24, r24 1bda8: d9 f0 breq .+54 ; 0x1bde0 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) { 1bdaa: 0b 30 cpi r16, 0x0B ; 11 1bdac: 29 f1 breq .+74 ; 0x1bdf8 1bdae: 04 31 cpi r16, 0x14 ; 20 1bdb0: 31 f1 breq .+76 ; 0x1bdfe /// @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()) { 1bdb2: 87 e5 ldi r24, 0x57 ; 87 1bdb4: e8 2e mov r14, r24 1bdb6: e9 82 std Y+1, r14 ; 0x01 1bdb8: 0a 83 std Y+2, r16 ; 0x02 1bdba: 1b 83 std Y+3, r17 ; 0x03 1bdbc: fc 82 std Y+4, r15 ; 0x04 1bdbe: ce 01 movw r24, r28 1bdc0: 01 96 adiw r24, 0x01 ; 1 1bdc2: 0f 94 e8 c2 call 0x385d0 ; 0x385d0 1bdc6: 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)); 1bdc8: 47 e5 ldi r20, 0x57 ; 87 1bdca: 50 2f mov r21, r16 1bdcc: 61 2f mov r22, r17 1bdce: 7f 2d mov r23, r15 1bdd0: 0f 94 7e 98 call 0x330fc ; 0x330fc 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)); 1bdd4: 60 e0 ldi r22, 0x00 ; 0 1bdd6: 80 e0 ldi r24, 0x00 ; 0 1bdd8: 0f 94 a2 9f call 0x33f44 ; 0x33f44 1bddc: 88 23 and r24, r24 1bdde: 59 f3 breq .-42 ; 0x1bdb6 return true; } 1bde0: 0f 90 pop r0 1bde2: 0f 90 pop r0 1bde4: 0f 90 pop r0 1bde6: 0f 90 pop r0 1bde8: 0f 90 pop r0 1bdea: df 91 pop r29 1bdec: cf 91 pop r28 1bdee: 1f 91 pop r17 1bdf0: 0f 91 pop r16 1bdf2: ff 90 pop r15 1bdf4: ef 90 pop r14 1bdf6: 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); 1bdf8: 10 93 75 13 sts 0x1375, r17 ; 0x801375 1bdfc: da cf rjmp .-76 ; 0x1bdb2 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1bdfe: 10 93 76 13 sts 0x1376, r17 ; 0x801376 1be02: d7 cf rjmp .-82 ; 0x1bdb2 0001be04 : #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) 1be04: 82 30 cpi r24, 0x02 ; 2 1be06: 91 05 cpc r25, r1 1be08: 38 f0 brcs .+14 ; 0x1be18 // 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 1be0a: 88 0f add r24, r24 1be0c: 99 1f adc r25, r25 1be0e: 88 0f add r24, r24 1be10: 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, 1be12: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1be14: 01 97 sbiw r24, 0x01 ; 1 1be16: f1 f7 brne .-4 ; 0x1be14 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1be18: 08 95 ret 0001be1a : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1be1a: cf 93 push r28 1be1c: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1be1e: 28 2f mov r18, r24 1be20: 30 e0 ldi r19, 0x00 ; 0 1be22: f9 01 movw r30, r18 1be24: ef 59 subi r30, 0x9F ; 159 1be26: f1 47 sbci r31, 0x71 ; 113 1be28: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1be2a: f9 01 movw r30, r18 1be2c: e5 5f subi r30, 0xF5 ; 245 1be2e: f1 47 sbci r31, 0x71 ; 113 1be30: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1be32: f9 01 movw r30, r18 1be34: eb 54 subi r30, 0x4B ; 75 1be36: f2 47 sbci r31, 0x72 ; 114 1be38: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1be3a: cc 23 and r28, r28 1be3c: a1 f0 breq .+40 ; 0x1be66 // 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); 1be3e: 81 11 cpse r24, r1 1be40: 0e 94 84 cf call 0x19f08 ; 0x19f08 if (*portInputRegister(port) & bit) return HIGH; 1be44: ec 2f mov r30, r28 1be46: f0 e0 ldi r31, 0x00 ; 0 1be48: ee 0f add r30, r30 1be4a: ff 1f adc r31, r31 1be4c: e5 56 subi r30, 0x65 ; 101 1be4e: f2 47 sbci r31, 0x72 ; 114 1be50: a5 91 lpm r26, Z+ 1be52: b4 91 lpm r27, Z 1be54: ec 91 ld r30, X 1be56: ed 23 and r30, r29 1be58: 81 e0 ldi r24, 0x01 ; 1 1be5a: 90 e0 ldi r25, 0x00 ; 0 1be5c: 09 f4 brne .+2 ; 0x1be60 1be5e: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1be60: df 91 pop r29 1be62: cf 91 pop r28 1be64: 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; 1be66: 80 e0 ldi r24, 0x00 ; 0 1be68: 90 e0 ldi r25, 0x00 ; 0 1be6a: fa cf rjmp .-12 ; 0x1be60 0001be6c : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1be6c: 1f 93 push r17 1be6e: cf 93 push r28 1be70: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1be72: 28 2f mov r18, r24 1be74: 30 e0 ldi r19, 0x00 ; 0 1be76: f9 01 movw r30, r18 1be78: ef 59 subi r30, 0x9F ; 159 1be7a: f1 47 sbci r31, 0x71 ; 113 1be7c: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1be7e: f9 01 movw r30, r18 1be80: e5 5f subi r30, 0xF5 ; 245 1be82: f1 47 sbci r31, 0x71 ; 113 1be84: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1be86: f9 01 movw r30, r18 1be88: eb 54 subi r30, 0x4B ; 75 1be8a: f2 47 sbci r31, 0x72 ; 114 1be8c: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1be8e: cc 23 and r28, r28 1be90: a9 f0 breq .+42 ; 0x1bebc 1be92: 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); 1be94: 81 11 cpse r24, r1 1be96: 0e 94 84 cf call 0x19f08 ; 0x19f08 out = portOutputRegister(port); 1be9a: ec 2f mov r30, r28 1be9c: f0 e0 ldi r31, 0x00 ; 0 1be9e: ee 0f add r30, r30 1bea0: ff 1f adc r31, r31 1bea2: ef 57 subi r30, 0x7F ; 127 1bea4: f2 47 sbci r31, 0x72 ; 114 1bea6: a5 91 lpm r26, Z+ 1bea8: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1beaa: 8f b7 in r24, 0x3f ; 63 cli(); 1beac: f8 94 cli if (val == LOW) { *out &= ~bit; 1beae: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1beb0: 11 11 cpse r17, r1 1beb2: 08 c0 rjmp .+16 ; 0x1bec4 *out &= ~bit; 1beb4: d0 95 com r29 1beb6: de 23 and r29, r30 } else { *out |= bit; 1beb8: dc 93 st X, r29 } SREG = oldSREG; 1beba: 8f bf out 0x3f, r24 ; 63 } 1bebc: df 91 pop r29 1bebe: cf 91 pop r28 1bec0: 1f 91 pop r17 1bec2: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1bec4: de 2b or r29, r30 1bec6: f8 cf rjmp .-16 ; 0x1beb8 0001bec8 : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1bec8: cf 93 push r28 1beca: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1becc: 90 e0 ldi r25, 0x00 ; 0 1bece: fc 01 movw r30, r24 1bed0: e5 5f subi r30, 0xF5 ; 245 1bed2: f1 47 sbci r31, 0x71 ; 113 1bed4: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1bed6: 8b 54 subi r24, 0x4B ; 75 1bed8: 92 47 sbci r25, 0x72 ; 114 1beda: fc 01 movw r30, r24 1bedc: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1bede: 88 23 and r24, r24 1bee0: d1 f0 breq .+52 ; 0x1bf16 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1bee2: 90 e0 ldi r25, 0x00 ; 0 1bee4: 88 0f add r24, r24 1bee6: 99 1f adc r25, r25 1bee8: fc 01 movw r30, r24 1beea: e9 59 subi r30, 0x99 ; 153 1beec: f2 47 sbci r31, 0x72 ; 114 1beee: a5 91 lpm r26, Z+ 1bef0: b4 91 lpm r27, Z out = portOutputRegister(port); 1bef2: fc 01 movw r30, r24 1bef4: ef 57 subi r30, 0x7F ; 127 1bef6: f2 47 sbci r31, 0x72 ; 114 1bef8: c5 91 lpm r28, Z+ 1befa: d4 91 lpm r29, Z if (mode == INPUT) { 1befc: 61 11 cpse r22, r1 1befe: 0e c0 rjmp .+28 ; 0x1bf1c uint8_t oldSREG = SREG; 1bf00: 9f b7 in r25, 0x3f ; 63 cli(); 1bf02: f8 94 cli *reg &= ~bit; 1bf04: 8c 91 ld r24, X 1bf06: e2 2f mov r30, r18 1bf08: e0 95 com r30 1bf0a: 8e 23 and r24, r30 1bf0c: 8c 93 st X, r24 *out &= ~bit; 1bf0e: 28 81 ld r18, Y 1bf10: e2 23 and r30, r18 1bf12: e8 83 st Y, r30 SREG = oldSREG; 1bf14: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1bf16: df 91 pop r29 1bf18: cf 91 pop r28 1bf1a: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1bf1c: 8f b7 in r24, 0x3f ; 63 cli(); 1bf1e: f8 94 cli *reg |= bit; 1bf20: ec 91 ld r30, X 1bf22: e2 2b or r30, r18 1bf24: ec 93 st X, r30 SREG = oldSREG; 1bf26: 8f bf out 0x3f, r24 ; 63 1bf28: f6 cf rjmp .-20 ; 0x1bf16 0001bf2a : // 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) { 1bf2a: 1f 93 push r17 1bf2c: cf 93 push r28 1bf2e: df 93 push r29 1bf30: 18 2f mov r17, r24 1bf32: 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); 1bf34: 61 e0 ldi r22, 0x01 ; 1 1bf36: 0e 94 64 df call 0x1bec8 ; 0x1bec8 if (val == 0) 1bf3a: 20 97 sbiw r28, 0x00 ; 0 1bf3c: 39 f4 brne .+14 ; 0x1bf4c { digitalWrite(pin, LOW); 1bf3e: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1bf40: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1bf42: df 91 pop r29 1bf44: cf 91 pop r28 1bf46: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1bf48: 0c 94 36 df jmp 0x1be6c ; 0x1be6c pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1bf4c: cf 3f cpi r28, 0xFF ; 255 1bf4e: d1 05 cpc r29, r1 1bf50: 11 f4 brne .+4 ; 0x1bf56 { digitalWrite(pin, HIGH); 1bf52: 61 e0 ldi r22, 0x01 ; 1 1bf54: f5 cf rjmp .-22 ; 0x1bf40 } else { switch(digitalPinToTimer(pin)) 1bf56: e1 2f mov r30, r17 1bf58: f0 e0 ldi r31, 0x00 ; 0 1bf5a: ef 59 subi r30, 0x9F ; 159 1bf5c: f1 47 sbci r31, 0x71 ; 113 1bf5e: e4 91 lpm r30, Z 1bf60: e1 50 subi r30, 0x01 ; 1 1bf62: e2 31 cpi r30, 0x12 ; 18 1bf64: 08 f0 brcs .+2 ; 0x1bf68 1bf66: b3 c0 rjmp .+358 ; 0x1c0ce 1bf68: f0 e0 ldi r31, 0x00 ; 0 1bf6a: 88 27 eor r24, r24 1bf6c: e5 54 subi r30, 0x45 ; 69 1bf6e: f0 42 sbci r31, 0x20 ; 32 1bf70: 8f 4f sbci r24, 0xFF ; 255 1bf72: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 1bf76: cd df rcall .-102 ; 0x1bf12 1bf78: d5 df rcall .-86 ; 0x1bf24 1bf7a: da df rcall .-76 ; 0x1bf30 1bf7c: e4 df rcall .-56 ; 0x1bf46 1bf7e: ee df rcall .-36 ; 0x1bf5c 1bf80: 67 e0 ldi r22, 0x07 ; 7 1bf82: f8 df rcall .-16 ; 0x1bf74 1bf84: 00 e0 ldi r16, 0x00 ; 0 1bf86: 08 e0 ldi r16, 0x08 ; 8 1bf88: 12 e0 ldi r17, 0x02 ; 2 1bf8a: 1c e0 ldi r17, 0x0C ; 12 1bf8c: 26 e0 ldi r18, 0x06 ; 6 1bf8e: 35 e0 ldi r19, 0x05 ; 5 1bf90: 3f e0 ldi r19, 0x0F ; 15 1bf92: 67 e0 ldi r22, 0x07 ; 7 1bf94: 49 e0 ldi r20, 0x09 ; 9 1bf96: 53 e0 ldi r21, 0x03 ; 3 1bf98: 5d e0 ldi r21, 0x0D ; 13 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1bf9a: 84 b5 in r24, 0x24 ; 36 1bf9c: 80 68 ori r24, 0x80 ; 128 1bf9e: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1bfa0: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1bfa2: df 91 pop r29 1bfa4: cf 91 pop r28 1bfa6: 1f 91 pop r17 1bfa8: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1bfaa: 84 b5 in r24, 0x24 ; 36 1bfac: 80 62 ori r24, 0x20 ; 32 1bfae: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1bfb0: c8 bd out 0x28, r28 ; 40 1bfb2: f7 cf rjmp .-18 ; 0x1bfa2 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1bfb4: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfb8: 80 68 ori r24, 0x80 ; 128 1bfba: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1bfbe: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1bfc2: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1bfc6: ed cf rjmp .-38 ; 0x1bfa2 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1bfc8: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfcc: 80 62 ori r24, 0x20 ; 32 1bfce: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1bfd2: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1bfd6: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1bfda: e3 cf rjmp .-58 ; 0x1bfa2 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1bfdc: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1bfe0: 88 60 ori r24, 0x08 ; 8 1bfe2: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1bfe6: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1bfea: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1bfee: d9 cf rjmp .-78 ; 0x1bfa2 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1bff0: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1bff4: 80 68 ori r24, 0x80 ; 128 1bff6: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1bffa: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1bffe: d1 cf rjmp .-94 ; 0x1bfa2 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1c000: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1c004: 80 62 ori r24, 0x20 ; 32 1c006: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1c00a: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1c00e: c9 cf rjmp .-110 ; 0x1bfa2 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1c010: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c014: 80 68 ori r24, 0x80 ; 128 1c016: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1c01a: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1c01e: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1c022: bf cf rjmp .-130 ; 0x1bfa2 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1c024: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c028: 80 62 ori r24, 0x20 ; 32 1c02a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1c02e: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1c032: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1c036: b5 cf rjmp .-150 ; 0x1bfa2 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1c038: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1c03c: 88 60 ori r24, 0x08 ; 8 1c03e: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1c042: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1c046: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1c04a: ab cf rjmp .-170 ; 0x1bfa2 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1c04c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c050: 80 68 ori r24, 0x80 ; 128 1c052: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1c056: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c05a: 8f 7b andi r24, 0xBF ; 191 1c05c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1c060: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1c064: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1c068: 9c cf rjmp .-200 ; 0x1bfa2 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1c06a: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c06e: 80 62 ori r24, 0x20 ; 32 1c070: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1c074: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1c078: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1c07c: 92 cf rjmp .-220 ; 0x1bfa2 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1c07e: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1c082: 88 60 ori r24, 0x08 ; 8 1c084: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1c088: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1c08c: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1c090: 88 cf rjmp .-240 ; 0x1bfa2 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1c092: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c096: 80 68 ori r24, 0x80 ; 128 1c098: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1c09c: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1c0a0: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1c0a4: 7e cf rjmp .-260 ; 0x1bfa2 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1c0a6: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c0aa: 80 62 ori r24, 0x20 ; 32 1c0ac: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1c0b0: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1c0b4: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1c0b8: 74 cf rjmp .-280 ; 0x1bfa2 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1c0ba: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1c0be: 88 60 ori r24, 0x08 ; 8 1c0c0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1c0c4: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1c0c8: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1c0cc: 6a cf rjmp .-300 ; 0x1bfa2 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1c0ce: c0 38 cpi r28, 0x80 ; 128 1c0d0: d1 05 cpc r29, r1 1c0d2: 0c f0 brlt .+2 ; 0x1c0d6 1c0d4: 3e cf rjmp .-388 ; 0x1bf52 1c0d6: 33 cf rjmp .-410 ; 0x1bf3e 0001c0d8 : } } /// 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){ 1c0d8: 4f 92 push r4 1c0da: 5f 92 push r5 1c0dc: 6f 92 push r6 1c0de: 7f 92 push r7 1c0e0: 8f 92 push r8 1c0e2: 9f 92 push r9 1c0e4: af 92 push r10 1c0e6: bf 92 push r11 1c0e8: cf 92 push r12 1c0ea: df 92 push r13 1c0ec: ef 92 push r14 1c0ee: ff 92 push r15 1c0f0: 0f 93 push r16 1c0f2: 1f 93 push r17 1c0f4: cf 93 push r28 1c0f6: 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 1c0f8: 86 b9 out 0x06, r24 ; 6 1c0fa: fa 01 movw r30, r20 1c0fc: e0 80 ld r14, Z 1c0fe: 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){ 1c100: 16 16 cp r1, r22 1c102: 17 06 cpc r1, r23 1c104: b4 f4 brge .+44 ; 0x1c132 1c106: e2 16 cp r14, r18 1c108: f3 06 cpc r15, r19 1c10a: 99 f4 brne .+38 ; 0x1c132 delayMicroseconds(delay_us); 1c10c: c7 01 movw r24, r14 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1c10e: df 91 pop r29 1c110: cf 91 pop r28 1c112: 1f 91 pop r17 1c114: 0f 91 pop r16 1c116: ff 90 pop r15 1c118: ef 90 pop r14 1c11a: df 90 pop r13 1c11c: cf 90 pop r12 1c11e: bf 90 pop r11 1c120: af 90 pop r10 1c122: 9f 90 pop r9 1c124: 8f 90 pop r8 1c126: 7f 90 pop r7 1c128: 6f 90 pop r6 1c12a: 5f 90 pop r5 1c12c: 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); 1c12e: 0c 94 02 df jmp 0x1be04 ; 0x1be04 1c132: 89 01 movw r16, r18 1c134: 6a 01 movw r12, r20 1c136: eb 01 movw r28, r22 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1c138: b7 01 movw r22, r14 1c13a: 90 e0 ldi r25, 0x00 ; 0 1c13c: 80 e0 ldi r24, 0x00 ; 0 1c13e: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 1c142: 2d eb ldi r18, 0xBD ; 189 1c144: 37 e3 ldi r19, 0x37 ; 55 1c146: 46 e8 ldi r20, 0x86 ; 134 1c148: 55 e3 ldi r21, 0x35 ; 53 1c14a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1c14e: 4b 01 movw r8, r22 1c150: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1c152: be 01 movw r22, r28 1c154: 0d 2e mov r0, r29 1c156: 00 0c add r0, r0 1c158: 88 0b sbc r24, r24 1c15a: 99 0b sbc r25, r25 1c15c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1c160: a5 01 movw r20, r10 1c162: 94 01 movw r18, r8 1c164: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1c168: 2b 01 movw r4, r22 1c16a: 3c 01 movw r6, r24 1c16c: a5 01 movw r20, r10 1c16e: 94 01 movw r18, r8 1c170: 6a e0 ldi r22, 0x0A ; 10 1c172: 77 ed ldi r23, 0xD7 ; 215 1c174: 83 e2 ldi r24, 0x23 ; 35 1c176: 9c e3 ldi r25, 0x3C ; 60 1c178: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1c17c: 9b 01 movw r18, r22 1c17e: ac 01 movw r20, r24 1c180: c3 01 movw r24, r6 1c182: b2 01 movw r22, r4 1c184: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1c188: 4b 01 movw r8, r22 1c18a: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1c18c: 2a e0 ldi r18, 0x0A ; 10 1c18e: 37 ed ldi r19, 0xD7 ; 215 1c190: 43 e2 ldi r20, 0x23 ; 35 1c192: 5e e3 ldi r21, 0x3E ; 62 1c194: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1c198: 18 16 cp r1, r24 1c19a: dc f5 brge .+118 ; 0x1c212 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)); 1c19c: a5 01 movw r20, r10 1c19e: 94 01 movw r18, r8 1c1a0: 6a e0 ldi r22, 0x0A ; 10 1c1a2: 77 ed ldi r23, 0xD7 ; 215 1c1a4: 83 e2 ldi r24, 0x23 ; 35 1c1a6: 9c e3 ldi r25, 0x3C ; 60 1c1a8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1c1ac: 20 e0 ldi r18, 0x00 ; 0 1c1ae: 34 e2 ldi r19, 0x24 ; 36 1c1b0: 44 e7 ldi r20, 0x74 ; 116 1c1b2: 59 e4 ldi r21, 0x49 ; 73 1c1b4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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); 1c1b8: 20 e0 ldi r18, 0x00 ; 0 1c1ba: 30 e0 ldi r19, 0x00 ; 0 1c1bc: 40 e0 ldi r20, 0x00 ; 0 1c1be: 5f e3 ldi r21, 0x3F ; 63 1c1c0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1c1c4: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 1c1c8: 5b 01 movw r10, r22 1c1ca: 60 17 cp r22, r16 1c1cc: 71 07 cpc r23, r17 1c1ce: 08 f4 brcc .+2 ; 0x1c1d2 1c1d0: 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){ 1c1d2: ea 14 cp r14, r10 1c1d4: fb 04 cpc r15, r11 1c1d6: 31 f4 brne .+12 ; 0x1c1e4 1c1d8: 20 97 sbiw r28, 0x00 ; 0 1c1da: 21 f0 breq .+8 ; 0x1c1e4 if (acc > 0) 1c1dc: fc f0 brlt .+62 ; 0x1c21c t1--; 1c1de: f1 e0 ldi r31, 0x01 ; 1 1c1e0: af 1a sub r10, r31 1c1e2: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1c1e4: c5 01 movw r24, r10 1c1e6: 0e 94 02 df call 0x1be04 ; 0x1be04 delay_us = t1; 1c1ea: f6 01 movw r30, r12 1c1ec: b1 82 std Z+1, r11 ; 0x01 1c1ee: a0 82 st Z, r10 } 1c1f0: df 91 pop r29 1c1f2: cf 91 pop r28 1c1f4: 1f 91 pop r17 1c1f6: 0f 91 pop r16 1c1f8: ff 90 pop r15 1c1fa: ef 90 pop r14 1c1fc: df 90 pop r13 1c1fe: cf 90 pop r12 1c200: bf 90 pop r11 1c202: af 90 pop r10 1c204: 9f 90 pop r9 1c206: 8f 90 pop r8 1c208: 7f 90 pop r7 1c20a: 6f 90 pop r6 1c20c: 5f 90 pop r5 1c20e: 4f 90 pop r4 1c210: 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 1c212: 80 e1 ldi r24, 0x10 ; 16 1c214: a8 2e mov r10, r24 1c216: 87 e2 ldi r24, 0x27 ; 39 1c218: b8 2e mov r11, r24 1c21a: db cf rjmp .-74 ; 0x1c1d2 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1c21c: 8f ef ldi r24, 0xFF ; 255 1c21e: a8 1a sub r10, r24 1c220: b8 0a sbc r11, r24 1c222: e0 cf rjmp .-64 ; 0x1c1e4 0001c224 : /// 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){ 1c224: 2f 92 push r2 1c226: 3f 92 push r3 1c228: 4f 92 push r4 1c22a: 5f 92 push r5 1c22c: 6f 92 push r6 1c22e: 7f 92 push r7 1c230: 8f 92 push r8 1c232: 9f 92 push r9 1c234: af 92 push r10 1c236: bf 92 push r11 1c238: cf 92 push r12 1c23a: df 92 push r13 1c23c: ef 92 push r14 1c23e: ff 92 push r15 1c240: 0f 93 push r16 1c242: 1f 93 push r17 1c244: cf 93 push r28 1c246: df 93 push r29 1c248: 00 d0 rcall .+0 ; 0x1c24a 1c24a: cd b7 in r28, 0x3d ; 61 1c24c: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1c24e: f9 01 movw r30, r18 1c250: e0 80 ld r14, Z 1c252: f1 80 ldd r15, Z+1 ; 0x01 1c254: e1 14 cp r14, r1 1c256: f1 04 cpc r15, r1 1c258: 09 f4 brne .+2 ; 0x1c25c 1c25a: 6b c0 rjmp .+214 ; 0x1c332 1c25c: 16 16 cp r1, r22 1c25e: 17 06 cpc r1, r23 1c260: 0c f0 brlt .+2 ; 0x1c264 1c262: 67 c0 rjmp .+206 ; 0x1c332 1c264: 19 01 movw r2, r18 1c266: 5b 83 std Y+3, r21 ; 0x03 1c268: 4a 83 std Y+2, r20 ; 0x02 1c26a: 6b 01 movw r12, r22 1c26c: 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)); 1c26e: fa 01 movw r30, r20 1c270: 00 81 ld r16, Z 1c272: 11 81 ldd r17, Z+1 ; 0x01 1c274: b8 01 movw r22, r16 1c276: 90 e0 ldi r25, 0x00 ; 0 1c278: 80 e0 ldi r24, 0x00 ; 0 1c27a: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 1c27e: 4b 01 movw r8, r22 1c280: 5c 01 movw r10, r24 1c282: b6 01 movw r22, r12 1c284: 0d 2c mov r0, r13 1c286: 00 0c add r0, r0 1c288: 88 0b sbc r24, r24 1c28a: 99 0b sbc r25, r25 1c28c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1c290: 2b 01 movw r4, r22 1c292: 3c 01 movw r6, r24 1c294: a5 01 movw r20, r10 1c296: 94 01 movw r18, r8 1c298: c5 01 movw r24, r10 1c29a: b4 01 movw r22, r8 1c29c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1c2a0: 9b 01 movw r18, r22 1c2a2: ac 01 movw r20, r24 1c2a4: c3 01 movw r24, r6 1c2a6: b2 01 movw r22, r4 1c2a8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1c2ac: 9b 01 movw r18, r22 1c2ae: ac 01 movw r20, r24 1c2b0: 6a e0 ldi r22, 0x0A ; 10 1c2b2: 77 ed ldi r23, 0xD7 ; 215 1c2b4: 83 ea ldi r24, 0xA3 ; 163 1c2b6: 9b e3 ldi r25, 0x3B ; 59 1c2b8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__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); 1c2bc: 20 e0 ldi r18, 0x00 ; 0 1c2be: 30 e0 ldi r19, 0x00 ; 0 1c2c0: 40 e0 ldi r20, 0x00 ; 0 1c2c2: 5f e3 ldi r21, 0x3F ; 63 1c2c4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1c2c8: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__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){ 1c2cc: 6e 15 cp r22, r14 1c2ce: 7f 05 cpc r23, r15 1c2d0: 28 f5 brcc .+74 ; 0x1c31c 1c2d2: f9 81 ldd r31, Y+1 ; 0x01 1c2d4: f6 b9 out 0x06, r31 ; 6 /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); 1c2d6: ea 81 ldd r30, Y+2 ; 0x02 1c2d8: fb 81 ldd r31, Y+3 ; 0x03 1c2da: 80 81 ld r24, Z 1c2dc: 91 81 ldd r25, Z+1 ; 0x01 1c2de: 0e 94 02 df call 0x1be04 ; 0x1be04 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1c2e2: f1 01 movw r30, r2 1c2e4: 80 81 ld r24, Z 1c2e6: 91 81 ldd r25, Z+1 ; 0x01 1c2e8: 01 97 sbiw r24, 0x01 ; 1 1c2ea: 91 83 std Z+1, r25 ; 0x01 1c2ec: 80 83 st Z, r24 return true; 1c2ee: 81 e0 ldi r24, 0x01 ; 1 } 1c2f0: 0f 90 pop r0 1c2f2: 0f 90 pop r0 1c2f4: 0f 90 pop r0 1c2f6: df 91 pop r29 1c2f8: cf 91 pop r28 1c2fa: 1f 91 pop r17 1c2fc: 0f 91 pop r16 1c2fe: ff 90 pop r15 1c300: ef 90 pop r14 1c302: df 90 pop r13 1c304: cf 90 pop r12 1c306: bf 90 pop r11 1c308: af 90 pop r10 1c30a: 9f 90 pop r9 1c30c: 8f 90 pop r8 1c30e: 7f 90 pop r7 1c310: 6f 90 pop r6 1c312: 5f 90 pop r5 1c314: 4f 90 pop r4 1c316: 3f 90 pop r3 1c318: 2f 90 pop r2 1c31a: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1c31c: 66 27 eor r22, r22 1c31e: 77 27 eor r23, r23 1c320: 6c 19 sub r22, r12 1c322: 7d 09 sbc r23, r13 1c324: 98 01 movw r18, r16 1c326: 4a 81 ldd r20, Y+2 ; 0x02 1c328: 5b 81 ldd r21, Y+3 ; 0x03 1c32a: 89 81 ldd r24, Y+1 ; 0x01 1c32c: 0e 94 6c e0 call 0x1c0d8 ; 0x1c0d8 1c330: d8 cf rjmp .-80 ; 0x1c2e2 /// 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; 1c332: 80 e0 ldi r24, 0x00 ; 0 1c334: dd cf rjmp .-70 ; 0x1c2f0 0001c336 : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1c336: 0f 93 push r16 1c338: 1f 93 push r17 1c33a: cf 93 push r28 1c33c: df 93 push r29 1c33e: 18 2f mov r17, r24 1c340: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c342: d1 e0 ldi r29, 0x01 ; 1 1c344: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1c346: 81 2f mov r24, r17 1c348: 8d 23 and r24, r29 1c34a: 29 f0 breq .+10 ; 0x1c356 sm4_set_dir(i, dir & mask); 1c34c: 60 2f mov r22, r16 1c34e: 6d 23 and r22, r29 1c350: 8c 2f mov r24, r28 1c352: 0f 94 77 6b call 0x2d6ee ; 0x2d6ee } } } 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) { 1c356: cf 5f subi r28, 0xFF ; 255 1c358: dd 0f add r29, r29 1c35a: c3 30 cpi r28, 0x03 ; 3 1c35c: a1 f7 brne .-24 ; 0x1c346 if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1c35e: df 91 pop r29 1c360: cf 91 pop r28 1c362: 1f 91 pop r17 1c364: 0f 91 pop r16 1c366: 08 95 ret 0001c368 : //@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) { 1c368: 8f 92 push r8 1c36a: 9f 92 push r9 1c36c: af 92 push r10 1c36e: bf 92 push r11 1c370: cf 92 push r12 1c372: df 92 push r13 1c374: ef 92 push r14 1c376: ff 92 push r15 1c378: 30 e0 ldi r19, 0x00 ; 0 1c37a: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1c37c: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1c37e: 48 2f mov r20, r24 1c380: 49 23 and r20, r25 1c382: 19 f1 breq .+70 ; 0x1c3ca count_position[i] += dir & mask ? -1L : 1L; 1c384: a9 01 movw r20, r18 1c386: 44 0f add r20, r20 1c388: 55 1f adc r21, r21 1c38a: 44 0f add r20, r20 1c38c: 55 1f adc r21, r21 1c38e: fa 01 movw r30, r20 1c390: ec 59 subi r30, 0x9C ; 156 1c392: f8 4f sbci r31, 0xF8 ; 248 1c394: c0 80 ld r12, Z 1c396: d1 80 ldd r13, Z+1 ; 0x01 1c398: e2 80 ldd r14, Z+2 ; 0x02 1c39a: f3 80 ldd r15, Z+3 ; 0x03 1c39c: 76 2f mov r23, r22 1c39e: 79 23 and r23, r25 1c3a0: 81 2c mov r8, r1 1c3a2: 91 2c mov r9, r1 1c3a4: 54 01 movw r10, r8 1c3a6: 83 94 inc r8 1c3a8: 77 23 and r23, r23 1c3aa: 21 f0 breq .+8 ; 0x1c3b4 1c3ac: 88 24 eor r8, r8 1c3ae: 8a 94 dec r8 1c3b0: 98 2c mov r9, r8 1c3b2: 54 01 movw r10, r8 1c3b4: c8 0c add r12, r8 1c3b6: d9 1c adc r13, r9 1c3b8: ea 1c adc r14, r10 1c3ba: fb 1c adc r15, r11 1c3bc: 4c 59 subi r20, 0x9C ; 156 1c3be: 58 4f sbci r21, 0xF8 ; 248 1c3c0: fa 01 movw r30, r20 1c3c2: c0 82 st Z, r12 1c3c4: d1 82 std Z+1, r13 ; 0x01 1c3c6: e2 82 std Z+2, r14 ; 0x02 1c3c8: 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) { 1c3ca: 99 0f add r25, r25 1c3cc: 2f 5f subi r18, 0xFF ; 255 1c3ce: 3f 4f sbci r19, 0xFF ; 255 1c3d0: 23 30 cpi r18, 0x03 ; 3 1c3d2: 31 05 cpc r19, r1 1c3d4: a1 f6 brne .-88 ; 0x1c37e if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1c3d6: ff 90 pop r15 1c3d8: ef 90 pop r14 1c3da: df 90 pop r13 1c3dc: cf 90 pop r12 1c3de: bf 90 pop r11 1c3e0: af 90 pop r10 1c3e2: 9f 90 pop r9 1c3e4: 8f 90 pop r8 1c3e6: 08 95 ret 0001c3e8 : /// 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) { 1c3e8: 2f 92 push r2 1c3ea: 3f 92 push r3 1c3ec: 4f 92 push r4 1c3ee: 5f 92 push r5 1c3f0: 6f 92 push r6 1c3f2: 7f 92 push r7 1c3f4: 8f 92 push r8 1c3f6: 9f 92 push r9 1c3f8: af 92 push r10 1c3fa: bf 92 push r11 1c3fc: cf 92 push r12 1c3fe: df 92 push r13 1c400: ef 92 push r14 1c402: ff 92 push r15 1c404: 0f 93 push r16 1c406: 1f 93 push r17 1c408: cf 93 push r28 1c40a: df 93 push r29 1c40c: 00 d0 rcall .+0 ; 0x1c40e 1c40e: 00 d0 rcall .+0 ; 0x1c410 1c410: cd b7 in r28, 0x3d ; 61 1c412: 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]; 1c414: c0 90 64 07 lds r12, 0x0764 ; 0x800764 1c418: d0 90 65 07 lds r13, 0x0765 ; 0x800765 1c41c: e0 90 66 07 lds r14, 0x0766 ; 0x800766 1c420: f0 90 67 07 lds r15, 0x0767 ; 0x800767 1c424: 7c 01 movw r14, r24 1c426: ec 18 sub r14, r12 1c428: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1c42a: 80 91 68 07 lds r24, 0x0768 ; 0x800768 1c42e: 90 91 69 07 lds r25, 0x0769 ; 0x800769 1c432: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 1c436: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 1c43a: 68 1b sub r22, r24 1c43c: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1c43e: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 1c442: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 1c446: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 1c44a: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 1c44e: fa 01 movw r30, r20 1c450: e8 1b sub r30, r24 1c452: f9 0b sbc r31, r25 1c454: fa 83 std Y+2, r31 ; 0x02 1c456: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1c458: fb 01 movw r30, r22 1c45a: ff 0f add r31, r31 1c45c: ee 0b sbc r30, r30 1c45e: ff 0f add r31, r31 1c460: fe 2f mov r31, r30 1c462: ee 1f adc r30, r30 1c464: e2 70 andi r30, 0x02 ; 2 1c466: 89 81 ldd r24, Y+1 ; 0x01 1c468: 9a 81 ldd r25, Y+2 ; 0x02 1c46a: 88 e0 ldi r24, 0x08 ; 8 1c46c: 98 02 muls r25, r24 1c46e: 81 2d mov r24, r1 1c470: 99 0b sbc r25, r25 1c472: 11 24 eor r1, r1 1c474: 84 70 andi r24, 0x04 ; 4 1c476: e8 2b or r30, r24 1c478: 8f 2d mov r24, r15 1c47a: 88 1f adc r24, r24 1c47c: 88 27 eor r24, r24 1c47e: 88 1f adc r24, r24 1c480: e8 2b or r30, r24 1c482: e0 93 fb 03 sts 0x03FB, r30 ; 0x8003fb asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1c486: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1c48a: 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; 1c48c: 8a e0 ldi r24, 0x0A ; 10 1c48e: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 1; //set X direction bit 1c490: e0 fd sbrc r30, 0 1c492: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 2) portL |= 2; //set Y direction bit 1c494: e1 fd sbrc r30, 1 1c496: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 4) portL |= 4; //set Z direction bit 1c498: e2 fd sbrc r30, 2 1c49a: 94 60 ori r25, 0x04 ; 4 if (dir_bits & 8) portL |= 64; //set E direction bit 1c49c: 90 64 ori r25, 0x40 ; 64 #endif PORTL = portL; 1c49e: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1c4a2: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1c4a4: 8b ee ldi r24, 0xEB ; 235 1c4a6: 9f ec ldi r25, 0xCF ; 207 1c4a8: 01 11 cpse r16, r1 1c4aa: 02 c0 rjmp .+4 ; 0x1c4b0 1c4ac: 90 e0 ldi r25, 0x00 ; 0 1c4ae: 80 e0 ldi r24, 0x00 ; 0 1c4b0: 90 93 69 05 sts 0x0569, r25 ; 0x800569 1c4b4: 80 93 68 05 sts 0x0568, r24 ; 0x800568 xyzcal_sm4_delay = delay_us; 1c4b8: 30 93 fa 03 sts 0x03FA, r19 ; 0x8003fa 1c4bc: 20 93 f9 03 sts 0x03F9, r18 ; 0x8003f9 // uint32_t u = _micros(); bool ret = sm4_line_xyz_ui(abs(x), abs(y), abs(z)) ? true : false; 1c4c0: 29 81 ldd r18, Y+1 ; 0x01 1c4c2: 3a 81 ldd r19, Y+2 ; 0x02 1c4c4: 3e 83 std Y+6, r19 ; 0x06 1c4c6: 2d 83 std Y+5, r18 ; 0x05 1c4c8: 37 ff sbrs r19, 7 1c4ca: 05 c0 rjmp .+10 ; 0x1c4d6 1c4cc: 31 95 neg r19 1c4ce: 21 95 neg r18 1c4d0: 31 09 sbc r19, r1 1c4d2: 3e 83 std Y+6, r19 ; 0x06 1c4d4: 2d 83 std Y+5, r18 ; 0x05 1c4d6: 8b 01 movw r16, r22 1c4d8: 77 ff sbrs r23, 7 1c4da: 03 c0 rjmp .+6 ; 0x1c4e2 1c4dc: 11 95 neg r17 1c4de: 01 95 neg r16 1c4e0: 11 09 sbc r17, r1 1c4e2: f7 fe sbrs r15, 7 1c4e4: 03 c0 rjmp .+6 ; 0x1c4ec 1c4e6: f1 94 neg r15 1c4e8: e1 94 neg r14 1c4ea: 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); 1c4ec: 98 01 movw r18, r16 1c4ee: d8 01 movw r26, r16 1c4f0: 0f 94 a9 de call 0x3bd52 ; 0x3bd52 <__mulhisi3> 1c4f4: 4b 01 movw r8, r22 1c4f6: 5c 01 movw r10, r24 1c4f8: 2d 81 ldd r18, Y+5 ; 0x05 1c4fa: 3e 81 ldd r19, Y+6 ; 0x06 1c4fc: d9 01 movw r26, r18 1c4fe: 0f 94 a9 de call 0x3bd52 ; 0x3bd52 <__mulhisi3> 1c502: 86 0e add r8, r22 1c504: 97 1e adc r9, r23 1c506: a8 1e adc r10, r24 1c508: b9 1e adc r11, r25 1c50a: 97 01 movw r18, r14 1c50c: d7 01 movw r26, r14 1c50e: 0f 94 a9 de call 0x3bd52 ; 0x3bd52 <__mulhisi3> 1c512: 68 0d add r22, r8 1c514: 79 1d adc r23, r9 1c516: 8a 1d adc r24, r10 1c518: 9b 1d adc r25, r11 1c51a: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 1c51e: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 1c522: 20 e0 ldi r18, 0x00 ; 0 1c524: 30 e0 ldi r19, 0x00 ; 0 1c526: 40 e0 ldi r20, 0x00 ; 0 1c528: 5f e3 ldi r21, 0x3F ; 63 1c52a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1c52e: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 1c532: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1c534: 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; 1c536: 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; 1c538: 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; 1c53a: 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; 1c53c: 1c 82 std Y+4, r1 ; 0x04 1c53e: 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; 1c540: 31 2c mov r3, r1 1c542: 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; 1c544: 1a 82 std Y+2, r1 ; 0x02 1c546: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1c548: 61 14 cp r6, r1 1c54a: 71 04 cpc r7, r1 1c54c: 09 f4 brne .+2 ; 0x1c550 1c54e: 47 c0 rjmp .+142 ; 0x1c5de if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1c550: e0 91 68 05 lds r30, 0x0568 ; 0x800568 1c554: f0 91 69 05 lds r31, 0x0569 ; 0x800569 1c558: 30 97 sbiw r30, 0x00 ; 0 1c55a: e9 f5 brne .+122 ; 0x1c5d6 uint8_t sm = 0; //step mask 1c55c: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1c55e: ec 14 cp r14, r12 1c560: fd 04 cpc r15, r13 1c562: 40 f0 brcs .+16 ; 0x1c574 sm |= 1; cx += dd; 1c564: c4 0c add r12, r4 1c566: d5 1c adc r13, r5 x++; 1c568: 89 81 ldd r24, Y+1 ; 0x01 1c56a: 9a 81 ldd r25, Y+2 ; 0x02 1c56c: 01 96 adiw r24, 0x01 ; 1 1c56e: 9a 83 std Y+2, r25 ; 0x02 1c570: 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; 1c572: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1c574: 0a 15 cp r16, r10 1c576: 1b 05 cpc r17, r11 1c578: 30 f0 brcs .+12 ; 0x1c586 sm |= 2; 1c57a: 82 60 ori r24, 0x02 ; 2 cy += dd; 1c57c: a4 0c add r10, r4 1c57e: b5 1c adc r11, r5 y++; 1c580: 9f ef ldi r25, 0xFF ; 255 1c582: 29 1a sub r2, r25 1c584: 39 0a sbc r3, r25 } if (cz <= dz){ 1c586: ed 81 ldd r30, Y+5 ; 0x05 1c588: fe 81 ldd r31, Y+6 ; 0x06 1c58a: e8 15 cp r30, r8 1c58c: f9 05 cpc r31, r9 1c58e: 48 f0 brcs .+18 ; 0x1c5a2 sm |= 4; 1c590: 84 60 ori r24, 0x04 ; 4 cz += dd; 1c592: 84 0c add r8, r4 1c594: 95 1c adc r9, r5 z++; 1c596: 2b 81 ldd r18, Y+3 ; 0x03 1c598: 3c 81 ldd r19, Y+4 ; 0x04 1c59a: 2f 5f subi r18, 0xFF ; 255 1c59c: 3f 4f sbci r19, 0xFF ; 255 1c59e: 3c 83 std Y+4, r19 ; 0x04 1c5a0: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1c5a2: ce 18 sub r12, r14 1c5a4: df 08 sbc r13, r15 cy -= dy; 1c5a6: a0 1a sub r10, r16 1c5a8: b1 0a sbc r11, r17 cz -= dz; 1c5aa: ed 81 ldd r30, Y+5 ; 0x05 1c5ac: fe 81 ldd r31, Y+6 ; 0x06 1c5ae: 8e 1a sub r8, r30 1c5b0: 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 1c5b2: 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); 1c5b4: e0 91 64 05 lds r30, 0x0564 ; 0x800564 1c5b8: f0 91 65 05 lds r31, 0x0565 ; 0x800565 1c5bc: 30 97 sbiw r30, 0x00 ; 0 1c5be: d1 f1 breq .+116 ; 0x1c634 1c5c0: b2 01 movw r22, r4 1c5c2: c3 01 movw r24, r6 1c5c4: 19 95 eicall if (delay) delayMicroseconds(delay); 1c5c6: 00 97 sbiw r24, 0x00 ; 0 1c5c8: 11 f0 breq .+4 ; 0x1c5ce 1c5ca: 0e 94 02 df call 0x1be04 ; 0x1be04 nd--; 1c5ce: f1 e0 ldi r31, 0x01 ; 1 1c5d0: 6f 1a sub r6, r31 1c5d2: 71 08 sbc r7, r1 1c5d4: b9 cf rjmp .-142 ; 0x1c548 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; 1c5d6: 19 95 eicall 1c5d8: 88 23 and r24, r24 1c5da: 09 f4 brne .+2 ; 0x1c5de 1c5dc: bf cf rjmp .-130 ; 0x1c55c 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) 1c5de: e0 91 66 05 lds r30, 0x0566 ; 0x800566 1c5e2: f0 91 67 05 lds r31, 0x0567 ; 0x800567 1c5e6: 30 97 sbiw r30, 0x00 ; 0 1c5e8: 41 f0 breq .+16 ; 0x1c5fa (*sm4_update_pos_cb)(x, y, z, 0); 1c5ea: 30 e0 ldi r19, 0x00 ; 0 1c5ec: 20 e0 ldi r18, 0x00 ; 0 1c5ee: 4b 81 ldd r20, Y+3 ; 0x03 1c5f0: 5c 81 ldd r21, Y+4 ; 0x04 1c5f2: b1 01 movw r22, r2 1c5f4: 89 81 ldd r24, Y+1 ; 0x01 1c5f6: 9a 81 ldd r25, Y+2 ; 0x02 1c5f8: 19 95 eicall 1c5fa: 81 e0 ldi r24, 0x01 ; 1 1c5fc: 67 28 or r6, r7 1c5fe: 09 f4 brne .+2 ; 0x1c602 1c600: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1c602: 26 96 adiw r28, 0x06 ; 6 1c604: 0f b6 in r0, 0x3f ; 63 1c606: f8 94 cli 1c608: de bf out 0x3e, r29 ; 62 1c60a: 0f be out 0x3f, r0 ; 63 1c60c: cd bf out 0x3d, r28 ; 61 1c60e: df 91 pop r29 1c610: cf 91 pop r28 1c612: 1f 91 pop r17 1c614: 0f 91 pop r16 1c616: ff 90 pop r15 1c618: ef 90 pop r14 1c61a: df 90 pop r13 1c61c: cf 90 pop r12 1c61e: bf 90 pop r11 1c620: af 90 pop r10 1c622: 9f 90 pop r9 1c624: 8f 90 pop r8 1c626: 7f 90 pop r7 1c628: 6f 90 pop r6 1c62a: 5f 90 pop r5 1c62c: 4f 90 pop r4 1c62e: 3f 90 pop r3 1c630: 2f 90 pop r2 1c632: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1c634: 84 ef ldi r24, 0xF4 ; 244 1c636: 91 e0 ldi r25, 0x01 ; 1 1c638: c8 cf rjmp .-112 ; 0x1c5ca 0001c63a : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 1c63a: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 1c63c: 0d b4 in r0, 0x2d ; 45 1c63e: 07 fe sbrs r0, 7 1c640: fd cf rjmp .-6 ; 0x1c63c return SPDR; 1c642: 8e b5 in r24, 0x2e ; 46 } 1c644: 08 95 ret 0001c646 : _CS_HIGH(); } uint8_t xflash_rd_status_reg(void) { _CS_LOW(); 1c646: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_RD_STATUS_REG); // send command 0x90 1c648: 85 e0 ldi r24, 0x05 ; 5 1c64a: 0e 94 1d e3 call 0x1c63a ; 0x1c63a uint8_t val = _SPI_RX(); // receive value 1c64e: 8f ef ldi r24, 0xFF ; 255 1c650: 0e 94 1d e3 call 0x1c63a ; 0x1c63a _CS_HIGH(); 1c654: 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) ; 1c656: 80 fd sbrc r24, 0 1c658: f6 cf rjmp .-20 ; 0x1c646 } 1c65a: 08 95 ret 0001c65c : _CS_HIGH(); return val; } static void xflash_send_cmdaddr(uint8_t cmd, uint32_t addr) { 1c65c: 1f 93 push r17 1c65e: cf 93 push r28 1c660: df 93 push r29 1c662: ea 01 movw r28, r20 1c664: 16 2f mov r17, r22 _SPI_TX(cmd); // send command 0x03 1c666: 0e 94 1d e3 call 0x1c63a ; 0x1c63a _SPI_TX(((uint8_t*)&addr)[2]); // send addr bits 16..23 1c66a: 81 2f mov r24, r17 1c66c: 0e 94 1d e3 call 0x1c63a ; 0x1c63a _SPI_TX(((uint8_t*)&addr)[1]); // send addr bits 8..15 1c670: 8d 2f mov r24, r29 1c672: 0e 94 1d e3 call 0x1c63a ; 0x1c63a _SPI_TX(((uint8_t*)&addr)[0]); // send addr bits 0..7 1c676: 8c 2f mov r24, r28 } 1c678: df 91 pop r29 1c67a: cf 91 pop r28 1c67c: 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 1c67e: 0c 94 1d e3 jmp 0x1c63a ; 0x1c63a 0001c682 : _CS_HIGH(); } void xflash_erase(uint8_t cmd, uint32_t addr) { _CS_LOW(); 1c682: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(cmd, addr); 1c684: 0e 94 2e e3 call 0x1c65c ; 0x1c65c _CS_HIGH(); 1c688: 45 9a sbi 0x08, 5 ; 8 } 1c68a: 08 95 ret 0001c68c : *(data++) = _SPI_RX(); _CS_HIGH(); } void xflash_page_program(uint32_t addr, uint8_t* data, uint16_t cnt) { 1c68c: ef 92 push r14 1c68e: ff 92 push r15 1c690: 0f 93 push r16 1c692: 1f 93 push r17 1c694: cf 93 push r28 1c696: df 93 push r29 1c698: 7a 01 movw r14, r20 1c69a: 89 01 movw r16, r18 _CS_LOW(); 1c69c: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c69e: ab 01 movw r20, r22 1c6a0: bc 01 movw r22, r24 1c6a2: 82 e0 ldi r24, 0x02 ; 2 1c6a4: 0e 94 2e e3 call 0x1c65c ; 0x1c65c 1c6a8: e7 01 movw r28, r14 1c6aa: 0e 0d add r16, r14 1c6ac: 1f 1d adc r17, r15 while (cnt--) // send data 1c6ae: c0 17 cp r28, r16 1c6b0: d1 07 cpc r29, r17 1c6b2: 41 f4 brne .+16 ; 0x1c6c4 _SPI_TX(*(data++)); _CS_HIGH(); 1c6b4: 45 9a sbi 0x08, 5 ; 8 } 1c6b6: df 91 pop r29 1c6b8: cf 91 pop r28 1c6ba: 1f 91 pop r17 1c6bc: 0f 91 pop r16 1c6be: ff 90 pop r15 1c6c0: ef 90 pop r14 1c6c2: 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++)); 1c6c4: 89 91 ld r24, Y+ 1c6c6: 0e 94 1d e3 call 0x1c63a ; 0x1c63a 1c6ca: f1 cf rjmp .-30 ; 0x1c6ae 0001c6cc : _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) { 1c6cc: ef 92 push r14 1c6ce: ff 92 push r15 1c6d0: 0f 93 push r16 1c6d2: 1f 93 push r17 1c6d4: cf 93 push r28 1c6d6: df 93 push r29 1c6d8: 7a 01 movw r14, r20 1c6da: 89 01 movw r16, r18 _CS_LOW(); 1c6dc: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_RD_DATA, addr); 1c6de: ab 01 movw r20, r22 1c6e0: bc 01 movw r22, r24 1c6e2: 83 e0 ldi r24, 0x03 ; 3 1c6e4: 0e 94 2e e3 call 0x1c65c ; 0x1c65c 1c6e8: e7 01 movw r28, r14 1c6ea: 0e 0d add r16, r14 1c6ec: 1f 1d adc r17, r15 while (cnt--) // receive data 1c6ee: c0 17 cp r28, r16 1c6f0: d1 07 cpc r29, r17 1c6f2: 41 f4 brne .+16 ; 0x1c704 *(data++) = _SPI_RX(); _CS_HIGH(); 1c6f4: 45 9a sbi 0x08, 5 ; 8 } 1c6f6: df 91 pop r29 1c6f8: cf 91 pop r28 1c6fa: 1f 91 pop r17 1c6fc: 0f 91 pop r16 1c6fe: ff 90 pop r15 1c700: ef 90 pop r14 1c702: 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(); 1c704: 8f ef ldi r24, 0xFF ; 255 1c706: 0e 94 1d e3 call 0x1c63a ; 0x1c63a 1c70a: 89 93 st Y+, r24 1c70c: f0 cf rjmp .-32 ; 0x1c6ee 0001c70e : #include "asm.h" #include "xflash.h" #include "Marlin.h" // for softReset bool xfdump_check_state(dump_crash_reason* reason) { 1c70e: 0f 93 push r16 1c710: 1f 93 push r17 1c712: cf 93 push r28 1c714: df 93 push r29 1c716: 00 d0 rcall .+0 ; 0x1c718 1c718: 1f 92 push r1 1c71a: cd b7 in r28, 0x3d ; 61 1c71c: de b7 in r29, 0x3e ; 62 1c71e: 8c 01 movw r16, r24 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c720: 8c e5 ldi r24, 0x5C ; 92 1c722: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c724: 1d bc out 0x2d, r1 ; 45 uint32_t magic; XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), 1c726: 24 e0 ldi r18, 0x04 ; 4 1c728: 30 e0 ldi r19, 0x00 ; 0 1c72a: ae 01 movw r20, r28 1c72c: 4f 5f subi r20, 0xFF ; 255 1c72e: 5f 4f sbci r21, 0xFF ; 255 1c730: 60 e0 ldi r22, 0x00 ; 0 1c732: 70 ed ldi r23, 0xD0 ; 208 1c734: 83 e0 ldi r24, 0x03 ; 3 1c736: 90 e0 ldi r25, 0x00 ; 0 1c738: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) 1c73c: 89 81 ldd r24, Y+1 ; 0x01 1c73e: 9a 81 ldd r25, Y+2 ; 0x02 1c740: ab 81 ldd r26, Y+3 ; 0x03 1c742: bc 81 ldd r27, Y+4 ; 0x04 1c744: 87 34 cpi r24, 0x47 ; 71 1c746: 95 45 sbci r25, 0x55 ; 85 1c748: a2 45 sbci r26, 0x52 ; 82 1c74a: b5 45 sbci r27, 0x55 ; 85 1c74c: 71 f4 brne .+28 ; 0x1c76a return false; if (reason) 1c74e: 01 15 cp r16, r1 1c750: 11 05 cpc r17, r1 1c752: 49 f0 breq .+18 ; 0x1c766 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), 1c754: 21 e0 ldi r18, 0x01 ; 1 1c756: 30 e0 ldi r19, 0x00 ; 0 1c758: a8 01 movw r20, r16 1c75a: 65 e0 ldi r22, 0x05 ; 5 1c75c: 70 ed ldi r23, 0xD0 ; 208 1c75e: 83 e0 ldi r24, 0x03 ; 3 1c760: 90 e0 ldi r25, 0x00 ; 0 1c762: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc (uint8_t*)reason, sizeof(*reason)); } return true; 1c766: 81 e0 ldi r24, 0x01 ; 1 1c768: 01 c0 rjmp .+2 ; 0x1c76c XFLASH_SPI_ENTER(); xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.magic), (uint8_t*)&magic, sizeof(magic)); if (magic != DUMP_MAGIC) return false; 1c76a: 80 e0 ldi r24, 0x00 ; 0 { xflash_rd_data(DUMP_OFFSET + offsetof(dump_t, header.crash_reason), (uint8_t*)reason, sizeof(*reason)); } return true; } 1c76c: 0f 90 pop r0 1c76e: 0f 90 pop r0 1c770: 0f 90 pop r0 1c772: 0f 90 pop r0 1c774: df 91 pop r29 1c776: cf 91 pop r28 1c778: 1f 91 pop r17 1c77a: 0f 91 pop r16 1c77c: 08 95 ret 0001c77e : return 1; } void xflash_enable_wr(void) { _CS_LOW(); 1c77e: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_ENABLE_WR); // send command 0x06 1c780: 86 e0 ldi r24, 0x06 ; 6 1c782: 0e 94 1d e3 call 0x1c63a ; 0x1c63a _CS_HIGH(); 1c786: 45 9a sbi 0x08, 5 ; 8 } 1c788: 08 95 ret 0001c78a : } } static void __attribute__((noinline)) xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, uint16_t cnt) { 1c78a: 4f 92 push r4 1c78c: 5f 92 push r5 1c78e: 6f 92 push r6 1c790: 7f 92 push r7 1c792: 8f 92 push r8 1c794: 9f 92 push r9 1c796: af 92 push r10 1c798: bf 92 push r11 1c79a: ef 92 push r14 1c79c: ff 92 push r15 1c79e: 0f 93 push r16 1c7a0: 1f 93 push r17 1c7a2: cf 93 push r28 1c7a4: df 93 push r29 1c7a6: 7c 01 movw r14, r24 1c7a8: 4a 01 movw r8, r20 1c7aa: 5b 01 movw r10, r22 1c7ac: e9 01 movw r28, r18 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c7ae: 8c e5 ldi r24, 0x5C ; 92 1c7b0: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c7b2: 1d bc out 0x2d, r1 ; 45 } static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; 1c7b4: 41 2c mov r4, r1 1c7b6: 80 ed ldi r24, 0xD0 ; 208 1c7b8: 58 2e mov r5, r24 1c7ba: 83 e0 ldi r24, 0x03 ; 3 1c7bc: 68 2e mov r6, r24 1c7be: 71 2c mov r7, r1 addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) { xflash_enable_wr(); 1c7c0: 0e 94 bf e3 call 0x1c77e ; 0x1c77e _CS_HIGH(); } void xflash_sector_erase(uint32_t addr) { return xflash_erase(_CMD_SECTOR_ERASE, addr); 1c7c4: b3 01 movw r22, r6 1c7c6: a2 01 movw r20, r4 1c7c8: 80 e2 ldi r24, 0x20 ; 32 1c7ca: 0e 94 41 e3 call 0x1c682 ; 0x1c682 xflash_sector_erase(addr); xflash_wait_busy(); 1c7ce: 0e 94 23 e3 call 0x1c646 ; 0x1c646 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; addr += 4096) 1c7d2: 80 e1 ldi r24, 0x10 ; 16 1c7d4: 58 0e add r5, r24 1c7d6: 61 1c adc r6, r1 1c7d8: 71 1c adc r7, r1 static void xfdump_erase() { for(uint32_t addr = DUMP_OFFSET; addr < DUMP_OFFSET + DUMP_SIZE; 1c7da: 41 14 cp r4, r1 1c7dc: 51 04 cpc r5, r1 1c7de: e4 e0 ldi r30, 0x04 ; 4 1c7e0: 6e 06 cpc r6, r30 1c7e2: 71 04 cpc r7, r1 1c7e4: 69 f7 brne .-38 ; 0x1c7c0 // start by clearing all sectors (we need all of them in any case) xfdump_erase(); // sample SP/PC hdr.sp = SP; 1c7e6: 8d b7 in r24, 0x3d ; 61 1c7e8: 9e b7 in r25, 0x3e ; 62 1c7ea: f7 01 movw r30, r14 1c7ec: 93 87 std Z+11, r25 ; 0x0b 1c7ee: 82 87 std Z+10, r24 ; 0x0a "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 1c7f0: 00 d0 rcall .+0 ; 0x1c7f2 1c7f2: 8f 91 pop r24 1c7f4: 9f 91 pop r25 1c7f6: af 91 pop r26 hdr.pc = GETPC(); 1c7f8: b0 e0 ldi r27, 0x00 ; 0 1c7fa: 86 83 std Z+6, r24 ; 0x06 1c7fc: 97 83 std Z+7, r25 ; 0x07 1c7fe: a0 87 std Z+8, r26 ; 0x08 1c800: 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(); 1c802: 0e 94 bf e3 call 0x1c77e ; 0x1c77e xflash_page_program(DUMP_OFFSET, (uint8_t*)&hdr, sizeof(hdr)); 1c806: 2c e0 ldi r18, 0x0C ; 12 1c808: 30 e0 ldi r19, 0x00 ; 0 1c80a: a7 01 movw r20, r14 1c80c: 60 e0 ldi r22, 0x00 ; 0 1c80e: 70 ed ldi r23, 0xD0 ; 208 1c810: 83 e0 ldi r24, 0x03 ; 3 1c812: 90 e0 ldi r25, 0x00 ; 0 1c814: 0e 94 46 e3 call 0x1c68c ; 0x1c68c xflash_wait_busy(); 1c818: 0e 94 23 e3 call 0x1c646 ; 0x1c646 void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) { xflash_enable_wr(); 1c81c: 0e 94 bf e3 call 0x1c77e ; 0x1c77e _CS_LOW(); 1c820: 45 98 cbi 0x08, 5 ; 8 xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); 1c822: b5 01 movw r22, r10 1c824: a4 01 movw r20, r8 1c826: 82 e0 ldi r24, 0x02 ; 2 1c828: 0e 94 2e e3 call 0x1c65c ; 0x1c65c 1c82c: fe 01 movw r30, r28 while(1) { // send data _SPI_TX(*(data++)); 1c82e: 21 96 adiw r28, 0x01 ; 1 1c830: 80 81 ld r24, Z 1c832: 0e 94 1d e3 call 0x1c63a ; 0x1c63a if(!--cnt || !(++addr & 0xFF)) 1c836: 01 50 subi r16, 0x01 ; 1 1c838: 11 09 sbc r17, r1 1c83a: 41 f0 breq .+16 ; 0x1c84c 1c83c: ff ef ldi r31, 0xFF ; 255 1c83e: 8f 1a sub r8, r31 1c840: 9f 0a sbc r9, r31 1c842: af 0a sbc r10, r31 1c844: bf 0a sbc r11, r31 _CS_LOW(); xflash_send_cmdaddr(_CMD_PAGE_PROGRAM, addr); while(1) { // send data _SPI_TX(*(data++)); 1c846: fe 01 movw r30, r28 if(!--cnt || !(++addr & 0xFF)) 1c848: 81 10 cpse r8, r1 1c84a: f1 cf rjmp .-30 ; 0x1c82e { // on a page boundary or end of write _CS_HIGH(); 1c84c: 45 9a sbi 0x08, 5 ; 8 xflash_wait_busy(); 1c84e: 0e 94 23 e3 call 0x1c646 ; 0x1c646 _CS_HIGH(); } void xflash_multipage_program(uint32_t addr, uint8_t* data, uint16_t cnt) { while(cnt) 1c852: 01 15 cp r16, r1 1c854: 11 05 cpc r17, r1 1c856: 11 f7 brne .-60 ; 0x1c81c // write data static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient"); xflash_multipage_program(addr, buf, cnt); } 1c858: df 91 pop r29 1c85a: cf 91 pop r28 1c85c: 1f 91 pop r17 1c85e: 0f 91 pop r16 1c860: ff 90 pop r15 1c862: ef 90 pop r14 1c864: bf 90 pop r11 1c866: af 90 pop r10 1c868: 9f 90 pop r9 1c86a: 8f 90 pop r8 1c86c: 7f 90 pop r7 1c86e: 6f 90 pop r6 1c870: 5f 90 pop r5 1c872: 4f 90 pop r4 1c874: 08 95 ret 0001c876 : (uint8_t*)RAMSTART, RAMSIZE); } void xfdump_full_dump_and_reset(dump_crash_reason reason) { 1c876: cf 93 push r28 1c878: df 93 push r29 1c87a: cd b7 in r28, 0x3d ; 61 1c87c: de b7 in r29, 0x3e ; 62 1c87e: 2c 97 sbiw r28, 0x0c ; 12 1c880: 0f b6 in r0, 0x3f ; 63 1c882: f8 94 cli 1c884: de bf out 0x3e, r29 ; 62 1c886: 0f be out 0x3f, r0 ; 63 1c888: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c88a: 47 e4 ldi r20, 0x47 ; 71 1c88c: 55 e5 ldi r21, 0x55 ; 85 1c88e: 62 e5 ldi r22, 0x52 ; 82 1c890: 75 e5 ldi r23, 0x55 ; 85 1c892: 49 83 std Y+1, r20 ; 0x01 1c894: 5a 83 std Y+2, r21 ; 0x02 1c896: 6b 83 std Y+3, r22 ; 0x03 1c898: 7c 83 std Y+4, r23 ; 0x04 buf.regs_present = true; 1c89a: 91 e0 ldi r25, 0x01 ; 1 1c89c: 9d 83 std Y+5, r25 ; 0x05 buf.crash_reason = (uint8_t)reason; 1c89e: 8e 83 std Y+6, r24 ; 0x06 // disable interrupts for a cleaner register dump cli(); 1c8a0: f8 94 cli 1c8a2: 88 e1 ldi r24, 0x18 ; 24 1c8a4: 9d e0 ldi r25, 0x0D ; 13 1c8a6: 0f b6 in r0, 0x3f ; 63 1c8a8: f8 94 cli 1c8aa: a8 95 wdr 1c8ac: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1c8b0: 0f be out 0x3f, r0 ; 63 1c8b2: 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); 1c8b6: 00 e0 ldi r16, 0x00 ; 0 1c8b8: 12 e2 ldi r17, 0x22 ; 34 1c8ba: 30 e0 ldi r19, 0x00 ; 0 1c8bc: 20 e0 ldi r18, 0x00 ; 0 1c8be: 40 e0 ldi r20, 0x00 ; 0 1c8c0: 51 ed ldi r21, 0xD1 ; 209 1c8c2: 63 e0 ldi r22, 0x03 ; 3 1c8c4: 70 e0 ldi r23, 0x00 ; 0 1c8c6: ce 01 movw r24, r28 1c8c8: 01 96 adiw r24, 0x01 ; 1 1c8ca: 0e 94 c5 e3 call 0x1c78a ; 0x1c78a // force a reset even sooner softReset(); 1c8ce: 0e 94 01 68 call 0xd002 ; 0xd002 0001c8d2 : xflash_multipage_program(addr, buf, cnt); } void xfdump_dump() { 1c8d2: 0f 93 push r16 1c8d4: 1f 93 push r17 1c8d6: cf 93 push r28 1c8d8: df 93 push r29 1c8da: cd b7 in r28, 0x3d ; 61 1c8dc: de b7 in r29, 0x3e ; 62 1c8de: 2c 97 sbiw r28, 0x0c ; 12 1c8e0: 0f b6 in r0, 0x3f ; 63 1c8e2: f8 94 cli 1c8e4: de bf out 0x3e, r29 ; 62 1c8e6: 0f be out 0x3f, r0 ; 63 1c8e8: cd bf out 0x3d, r28 ; 61 dump_header_t buf; buf.magic = DUMP_MAGIC; 1c8ea: 87 e4 ldi r24, 0x47 ; 71 1c8ec: 95 e5 ldi r25, 0x55 ; 85 1c8ee: a2 e5 ldi r26, 0x52 ; 82 1c8f0: b5 e5 ldi r27, 0x55 ; 85 1c8f2: 89 83 std Y+1, r24 ; 0x01 1c8f4: 9a 83 std Y+2, r25 ; 0x02 1c8f6: ab 83 std Y+3, r26 ; 0x03 1c8f8: bc 83 std Y+4, r27 ; 0x04 buf.regs_present = false; 1c8fa: 1d 82 std Y+5, r1 ; 0x05 buf.crash_reason = (uint8_t)dump_crash_reason::manual; 1c8fc: 1e 82 std Y+6, r1 ; 0x06 // write sram only xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data.sram), 1c8fe: 00 e0 ldi r16, 0x00 ; 0 1c900: 10 e2 ldi r17, 0x20 ; 32 1c902: 20 e0 ldi r18, 0x00 ; 0 1c904: 32 e0 ldi r19, 0x02 ; 2 1c906: 40 e0 ldi r20, 0x00 ; 0 1c908: 53 ed ldi r21, 0xD3 ; 211 1c90a: 63 e0 ldi r22, 0x03 ; 3 1c90c: 70 e0 ldi r23, 0x00 ; 0 1c90e: ce 01 movw r24, r28 1c910: 01 96 adiw r24, 0x01 ; 1 1c912: 0e 94 c5 e3 call 0x1c78a ; 0x1c78a (uint8_t*)RAMSTART, RAMSIZE); } 1c916: 2c 96 adiw r28, 0x0c ; 12 1c918: 0f b6 in r0, 0x3f ; 63 1c91a: f8 94 cli 1c91c: de bf out 0x3e, r29 ; 62 1c91e: 0f be out 0x3f, r0 ; 63 1c920: cd bf out 0x3d, r28 ; 61 1c922: df 91 pop r29 1c924: cf 91 pop r28 1c926: 1f 91 pop r17 1c928: 0f 91 pop r16 1c92a: 08 95 ret 0001c92c : int xflash_mfrid_devid(void); int8_t xflash_init(void) { 1c92c: cf 93 push r28 _CS_HIGH(); 1c92e: 45 9a sbi 0x08, 5 ; 8 SET_OUTPUT(XFLASH_PIN_CS); 1c930: 3d 9a sbi 0x07, 5 ; 7 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1c932: 8c e5 ldi r24, 0x5C ; 92 1c934: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1c936: 1d bc out 0x2d, r1 ; 45 _CS_HIGH(); } int xflash_mfrid_devid(void) { _CS_LOW(); 1c938: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_MFRID_DEVID); // send command 0x90 1c93a: 80 e9 ldi r24, 0x90 ; 144 1c93c: 0e 94 1d e3 call 0x1c63a ; 0x1c63a uint8_t cnt = 3; // 3 address bytes while (cnt--) // send address bytes _SPI_TX(0x00); 1c940: 80 e0 ldi r24, 0x00 ; 0 1c942: 0e 94 1d e3 call 0x1c63a ; 0x1c63a 1c946: 80 e0 ldi r24, 0x00 ; 0 1c948: 0e 94 1d e3 call 0x1c63a ; 0x1c63a 1c94c: 80 e0 ldi r24, 0x00 ; 0 1c94e: 0e 94 1d e3 call 0x1c63a ; 0x1c63a uint8_t xflash_mfrid = _SPI_RX(); // receive mfrid 1c952: 8f ef ldi r24, 0xFF ; 255 1c954: 0e 94 1d e3 call 0x1c63a ; 0x1c63a 1c958: c8 2f mov r28, r24 uint8_t xflash_devid = _SPI_RX(); // receive devid 1c95a: 8f ef ldi r24, 0xFF ; 255 1c95c: 0e 94 1d e3 call 0x1c63a ; 0x1c63a 1c960: 98 2f mov r25, r24 _CS_HIGH(); 1c962: 45 9a sbi 0x08, 5 ; 8 return ((xflash_mfrid == _MFRID_W25X20CL) && (xflash_devid == _DEVID_W25X20CL)) || 1c964: cf 3e cpi r28, 0xEF ; 239 1c966: 11 f0 breq .+4 ; 0x1c96c 1c968: c8 3c cpi r28, 0xC8 ; 200 1c96a: 19 f4 brne .+6 ; 0x1c972 1c96c: 81 e0 ldi r24, 0x01 ; 1 1c96e: 91 31 cpi r25, 0x11 ; 17 1c970: 09 f0 breq .+2 ; 0x1c974 int8_t xflash_init(void) { _CS_HIGH(); SET_OUTPUT(XFLASH_PIN_CS); XFLASH_SPI_ENTER(); if (!xflash_mfrid_devid()) return 0; 1c972: 80 e0 ldi r24, 0x00 ; 0 return 1; } 1c974: cf 91 pop r28 1c976: 08 95 ret 0001c978 : class IR_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return !READ(IR_SENSOR_PIN); } 1c978: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 1c97c: 80 95 com r24 1c97e: 81 70 andi r24, 0x01 ; 1 1c980: 08 95 ret 0001c982 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 1c982: 1f 93 push r17 1c984: cf 93 push r28 1c986: df 93 push r29 MENU_BEGIN(); 1c988: 0f 94 10 cf call 0x39e20 ; 0x39e20 1c98c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 #endif //SDSUPPORT if(!farm_mode) { const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1c990: 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 1c992: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1c994: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1c998: 84 30 cpi r24, 0x04 ; 4 1c99a: 08 f0 brcs .+2 ; 0x1c99e 1c99c: 3e c2 rjmp .+1148 ; 0x1ce1a 1c99e: 10 92 18 05 sts 0x0518, r1 ; 0x800518 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 1c9a2: 85 e8 ldi r24, 0x85 ; 133 1c9a4: 9c e3 ldi r25, 0x3C ; 60 1c9a6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1c9aa: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 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)) { 1c9ae: 0e 94 96 68 call 0xd12c ; 0xd12c 1c9b2: 81 11 cpse r24, r1 1c9b4: 19 c0 rjmp .+50 ; 0x1c9e8 1c9b6: 0e 94 30 68 call 0xd060 ; 0xd060 1c9ba: 81 11 cpse r24, r1 1c9bc: 15 c0 rjmp .+42 ; 0x1c9e8 1c9be: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 1c9c2: 81 11 cpse r24, r1 1c9c4: 11 c0 rjmp .+34 ; 0x1c9e8 #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 1c9c6: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.397> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 1c9ca: 83 30 cpi r24, 0x03 ; 3 1c9cc: 09 f0 breq .+2 ; 0x1c9d0 1c9ce: 51 c0 rjmp .+162 ; 0x1ca72 1c9d0: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 1c9d4: 88 23 and r24, r24 1c9d6: 41 f0 breq .+16 ; 0x1c9e8 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 1c9d8: 8b e7 ldi r24, 0x7B ; 123 1c9da: 9c e3 ldi r25, 0x3C ; 60 1c9dc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1c9e0: 64 ef ldi r22, 0xF4 ; 244 1c9e2: 72 ed ldi r23, 0xD2 ; 210 } else if ((GetPrinterState() == PrinterState::HostPrintingFinished) && M79_timer_get_status()) { MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1c9e4: 0f 94 8d ce call 0x39d1a ; 0x39d1a } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 1c9e8: 0e 94 80 68 call 0xd100 ; 0xd100 1c9ec: 88 23 and r24, r24 1c9ee: 81 f0 breq .+32 ; 0x1ca10 1c9f0: 0e 94 45 68 call 0xd08a ; 0xd08a 1c9f4: 81 11 cpse r24, r1 1c9f6: 04 c0 rjmp .+8 ; 0x1ca00 1c9f8: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1c9fc: 84 30 cpi r24, 0x04 ; 4 1c9fe: 41 f4 brne .+16 ; 0x1ca10 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 1ca00: 8b e6 ldi r24, 0x6B ; 107 1ca02: 9c e3 ldi r25, 0x3C ; 60 1ca04: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ca08: 64 ee ldi r22, 0xE4 ; 228 1ca0a: 79 e3 ldi r23, 0x39 ; 57 1ca0c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { 1ca10: 0e 94 30 68 call 0xd060 ; 0xd060 1ca14: 81 11 cpse r24, r1 1ca16: 61 c0 rjmp .+194 ; 0x1cada } //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); 1ca18: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 1ca1c: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 1ca20: 89 1b sub r24, r25 1ca22: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ca24: a9 f5 brne .+106 ; 0x1ca90 if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 1ca26: 0e 94 96 68 call 0xd12c ; 0xd12c 1ca2a: 81 11 cpse r24, r1 1ca2c: 31 c0 rjmp .+98 ; 0x1ca90 #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 1ca2e: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ca32: 82 30 cpi r24, 0x02 ; 2 1ca34: 69 f1 breq .+90 ; 0x1ca90 #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 1ca36: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1ca3a: 81 11 cpse r24, r1 1ca3c: 31 c0 rjmp .+98 ; 0x1caa0 MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 1ca3e: 8a e5 ldi r24, 0x5A ; 90 1ca40: 9c e3 ldi r25, 0x3C ; 60 1ca42: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ca46: 6c e0 ldi r22, 0x0C ; 12 1ca48: 7a e3 ldi r23, 0x3A ; 58 1ca4a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c if (M79_timer_get_status()) { 1ca4e: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.466> 1ca52: 88 23 and r24, r24 1ca54: 29 f1 breq .+74 ; 0x1caa0 #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 1ca56: 80 91 67 0e lds r24, 0x0E67 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 1ca5a: 81 30 cpi r24, 0x01 ; 1 1ca5c: 09 f0 breq .+2 ; 0x1ca60 1ca5e: 7e c0 rjmp .+252 ; 0x1cb5c MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 1ca60: 8a e4 ldi r24, 0x4A ; 74 1ca62: 9c e3 ldi r25, 0x3C ; 60 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 1ca64: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ca68: 6b e8 ldi r22, 0x8B ; 139 1ca6a: 70 ed ldi r23, 0xD0 ; 208 1ca6c: 0f 94 8d ce call 0x39d1a ; 0x39d1a 1ca70: 17 c0 rjmp .+46 ; 0x1caa0 // 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()) { 1ca72: 84 30 cpi r24, 0x04 ; 4 1ca74: 09 f0 breq .+2 ; 0x1ca78 1ca76: b8 cf rjmp .-144 ; 0x1c9e8 1ca78: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.466> 1ca7c: 88 23 and r24, r24 1ca7e: 09 f4 brne .+2 ; 0x1ca82 1ca80: b3 cf rjmp .-154 ; 0x1c9e8 MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 1ca82: 8b e7 ldi r24, 0x7B ; 123 1ca84: 9c e3 ldi r25, 0x3C ; 60 1ca86: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ca8a: 65 e8 ldi r22, 0x85 ; 133 1ca8c: 70 ed ldi r23, 0xD0 ; 208 1ca8e: aa cf rjmp .-172 ; 0x1c9e4 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); 1ca90: 84 e6 ldi r24, 0x64 ; 100 1ca92: 9c e3 ldi r25, 0x3C ; 60 1ca94: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ca98: 6b ee ldi r22, 0xEB ; 235 1ca9a: 74 ed ldi r23, 0xD4 ; 212 1ca9c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #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) { 1caa0: c0 91 59 0e lds r28, 0x0E59 ; 0x800e59 1caa4: 0e 94 3a 68 call 0xd074 ; 0xd074 1caa8: c1 11 cpse r28, r1 1caaa: 17 c0 rjmp .+46 ; 0x1cada 1caac: 90 91 58 0e lds r25, 0x0E58 ; 0x800e58 1cab0: 91 11 cpse r25, r1 1cab2: 13 c0 rjmp .+38 ; 0x1cada 1cab4: 81 11 cpse r24, r1 1cab6: 15 c0 rjmp .+42 ; 0x1cae2 1cab8: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1cabc: 81 11 cpse r24, r1 1cabe: 0d c0 rjmp .+26 ; 0x1cada if (usb_timer.running()) { 1cac0: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1cac4: 88 23 and r24, r24 1cac6: 09 f4 brne .+2 ; 0x1caca 1cac8: 4c c0 rjmp .+152 ; 0x1cb62 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 1caca: 80 e3 ldi r24, 0x30 ; 48 1cacc: 9c e3 ldi r25, 0x3C ; 60 1cace: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cad2: 66 e0 ldi r22, 0x06 ; 6 1cad4: 7b e3 ldi r23, 0x3B ; 59 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1cad6: 0f 94 8d ce call 0x39d1a ; 0x39d1a } } } if (printingIsPaused() 1cada: 0e 94 3a 68 call 0xd074 ; 0xd074 && !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) { 1cade: 88 23 and r24, r24 1cae0: f1 f0 breq .+60 ; 0x1cb1e temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1cae2: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 1cae6: 81 11 cpse r24, r1 1cae8: 1a c0 rjmp .+52 ; 0x1cb1e #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1caea: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1caee: 82 30 cpi r24, 0x02 ; 2 1caf0: b1 f0 breq .+44 ; 0x1cb1e #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 1caf2: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 1caf6: 82 30 cpi r24, 0x02 ; 2 1caf8: 21 f4 brne .+8 ; 0x1cb02 1cafa: 90 91 5a 0e lds r25, 0x0E5A ; 0x800e5a 1cafe: 99 23 and r25, r25 1cb00: 71 f0 breq .+28 ; 0x1cb1e && custom_message_type != CustomMsg::Resuming) { 1cb02: 90 91 75 07 lds r25, 0x0775 ; 0x800775 1cb06: 98 30 cpi r25, 0x08 ; 8 1cb08: 51 f0 breq .+20 ; 0x1cb1e if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 1cb0a: 81 11 cpse r24, r1 1cb0c: 36 c0 rjmp .+108 ; 0x1cb7a MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 1cb0e: 81 e2 ldi r24, 0x21 ; 33 1cb10: 9c e3 ldi r25, 0x3C ; 60 1cb12: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cb16: 62 e7 ldi r22, 0x72 ; 114 1cb18: 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); 1cb1a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 1cb1e: 0e 94 45 68 call 0xd08a ; 0xd08a && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1cb22: 81 11 cpse r24, r1 1cb24: 08 c0 rjmp .+16 ; 0x1cb36 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())) 1cb26: 0e 94 3a 68 call 0xd074 ; 0xd074 1cb2a: 81 11 cpse r24, r1 1cb2c: 04 c0 rjmp .+8 ; 0x1cb36 1cb2e: 0e 94 30 68 call 0xd060 ; 0xd060 1cb32: 88 23 and r24, r24 1cb34: 41 f0 breq .+16 ; 0x1cb46 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 1cb36: 80 91 75 07 lds r24, 0x0775 ; 0x800775 1cb3a: 81 30 cpi r24, 0x01 ; 1 1cb3c: 21 f0 breq .+8 ; 0x1cb46 1cb3e: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 1cb42: 88 23 and r24, r24 1cb44: 39 f1 breq .+78 ; 0x1cb94 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); } #ifdef THERMAL_MODEL else if(Stopped) { 1cb46: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1cb4a: 88 23 and r24, r24 1cb4c: 59 f1 breq .+86 ; 0x1cba4 MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1cb4e: 80 e1 ldi r24, 0x10 ; 16 1cb50: 9c e3 ldi r25, 0x3C ; 60 1cb52: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cb56: 68 ea ldi r22, 0xA8 ; 168 1cb58: 7a e3 ldi r23, 0x3A ; 58 1cb5a: 22 c0 rjmp .+68 ; 0x1cba0 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); 1cb5c: 8e e3 ldi r24, 0x3E ; 62 1cb5e: 9c e3 ldi r25, 0x3C ; 60 1cb60: 81 cf rjmp .-254 ; 0x1ca64 } } 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) { 1cb62: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 1cb66: 88 23 and r24, r24 1cb68: 09 f4 brne .+2 ; 0x1cb6c 1cb6a: b7 cf rjmp .-146 ; 0x1cada MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 1cb6c: 80 e3 ldi r24, 0x30 ; 48 1cb6e: 9c e3 ldi r25, 0x3C ; 60 1cb70: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cb74: 68 e7 ldi r22, 0x78 ; 120 1cb76: 79 e3 ldi r23, 0x39 ; 57 1cb78: ae cf rjmp .-164 ; 0x1cad6 #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())) { 1cb7a: 81 30 cpi r24, 0x01 ; 1 1cb7c: 81 f6 brne .-96 ; 0x1cb1e 1cb7e: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.466> 1cb82: 88 23 and r24, r24 1cb84: 61 f2 breq .-104 ; 0x1cb1e MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 1cb86: 81 e2 ldi r24, 0x21 ; 33 1cb88: 9c e3 ldi r25, 0x3C ; 60 1cb8a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cb8e: 66 e3 ldi r22, 0x36 ; 54 1cb90: 7a e3 ldi r23, 0x3A ; 58 1cb92: c3 cf rjmp .-122 ; 0x1cb1a } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 1cb94: 8d e7 ldi r24, 0x7D ; 125 1cb96: 9d e3 ldi r25, 0x3D ; 61 1cb98: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cb9c: 6d ef ldi r22, 0xFD ; 253 1cb9e: 72 ed ldi r23, 0xD2 ; 210 } #ifdef THERMAL_MODEL else if(Stopped) { MENU_ITEM_SUBMENU_P(_T(MSG_TM_ACK_ERROR), lcd_print_stop); 1cba0: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } #endif // only allow starting SD print if hardware errors (temperature or fan) are cleared if (!printer_recovering() && !printer_active() && !get_temp_error() 1cba4: 0e 94 30 68 call 0xd060 ; 0xd060 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cba8: 81 11 cpse r24, r1 1cbaa: 9e c0 rjmp .+316 ; 0x1cce8 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() 1cbac: 0e 94 96 68 call 0xd12c ; 0xd12c 1cbb0: 81 11 cpse r24, r1 1cbb2: 9a c0 rjmp .+308 ; 0x1cce8 1cbb4: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 1cbb8: 81 11 cpse r24, r1 1cbba: 96 c0 rjmp .+300 ; 0x1cce8 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1cbbc: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1cbc0: 82 30 cpi r24, 0x02 ; 2 1cbc2: 09 f4 brne .+2 ; 0x1cbc6 1cbc4: 91 c0 rjmp .+290 ; 0x1cce8 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 1cbc6: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 1cbca: 81 11 cpse r24, r1 1cbcc: 05 c0 rjmp .+10 ; 0x1cbd8 || lcd_commands_type != LcdCommands::Idle) { 1cbce: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1cbd2: 88 23 and r24, r24 1cbd4: 09 f4 brne .+2 ; 0x1cbd8 1cbd6: b9 c0 rjmp .+370 ; 0x1cd4a if (!card.isFileOpen()) { 1cbd8: 80 91 01 17 lds r24, 0x1701 ; 0x801701 1cbdc: 81 11 cpse r24, r1 1cbde: 12 c0 rjmp .+36 ; 0x1cc04 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 1cbe0: 80 91 11 05 lds r24, 0x0511 ; 0x800511 1cbe4: 81 11 cpse r24, r1 1cbe6: 0e c0 rjmp .+28 ; 0x1cc04 1cbe8: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 1cbec: 81 11 cpse r24, r1 1cbee: 0a c0 rjmp .+20 ; 0x1cc04 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 1cbf0: d0 93 dd 03 sts 0x03DD, r29 ; 0x8003dd MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 1cbf4: 80 e0 ldi r24, 0x00 ; 0 1cbf6: 9c e3 ldi r25, 0x3C ; 60 1cbf8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cbfc: 6c e6 ldi r22, 0x6C ; 108 1cbfe: 79 e3 ldi r23, 0x39 ; 57 1cc00: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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)); 1cc04: 81 ea ldi r24, 0xA1 ; 161 1cc06: 9d e0 ldi r25, 0x0D ; 13 1cc08: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1cc0c: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 1cc0e: 0e 94 da 77 call 0xefb4 ; 0xefb4 if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 1cc12: 87 fd sbrc r24, 7 1cc14: 09 c0 rjmp .+18 ; 0x1cc28 1cc16: c8 17 cp r28, r24 1cc18: 39 f0 breq .+14 ; 0x1cc28 MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 1cc1a: c1 02 muls r28, r17 1cc1c: c0 01 movw r24, r0 1cc1e: 11 24 eor r1, r1 1cc20: 87 5b subi r24, 0xB7 ; 183 1cc22: 92 4f sbci r25, 0xF2 ; 242 1cc24: 0e 94 a9 d1 call 0x1a352 ; 0x1a352 } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1cc28: 80 91 ee 04 lds r24, 0x04EE ; 0x8004ee 1cc2c: 8c 33 cpi r24, 0x3C ; 60 1cc2e: 09 f4 brne .+2 ; 0x1cc32 1cc30: b0 c0 rjmp .+352 ; 0x1cd92 1cc32: 08 f0 brcs .+2 ; 0x1cc36 1cc34: 93 c0 rjmp .+294 ; 0x1cd5c 1cc36: 89 31 cpi r24, 0x19 ; 25 1cc38: 09 f4 brne .+2 ; 0x1cc3c 1cc3a: 9f c0 rjmp .+318 ; 0x1cd7a 1cc3c: 88 32 cpi r24, 0x28 ; 40 1cc3e: 09 f4 brne .+2 ; 0x1cc42 1cc40: 92 c0 rjmp .+292 ; 0x1cd66 #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1cc42: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 1cc46: 81 11 cpse r24, r1 1cc48: 4f c0 rjmp .+158 ; 0x1cce8 1cc4a: 80 91 14 05 lds r24, 0x0514 ; 0x800514 1cc4e: 81 11 cpse r24, r1 1cc50: 4b c0 rjmp .+150 ; 0x1cce8 if (MMU2::mmu2.Enabled()) { 1cc52: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1cc56: 81 30 cpi r24, 0x01 ; 1 1cc58: 09 f0 breq .+2 ; 0x1cc5c 1cc5a: af c0 rjmp .+350 ; 0x1cdba if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 1cc5c: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 1cc60: 81 11 cpse r24, r1 1cc62: 0c c0 rjmp .+24 ; 0x1cc7c 1cc64: 0e 94 bc e4 call 0x1c978 ; 0x1c978 1cc68: 81 11 cpse r24, r1 1cc6a: 08 c0 rjmp .+16 ; 0x1cc7c // 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); 1cc6c: 86 ed ldi r24, 0xD6 ; 214 1cc6e: 9b e3 ldi r25, 0x3B ; 59 1cc70: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cc74: 65 eb ldi r22, 0xB5 ; 181 1cc76: 78 ed ldi r23, 0xD8 ; 216 1cc78: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 1cc7c: 85 ec ldi r24, 0xC5 ; 197 1cc7e: 9b e3 ldi r25, 0x3B ; 59 1cc80: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cc84: 6c ee ldi r22, 0xEC ; 236 1cc86: 78 ed ldi r23, 0xD8 ; 216 1cc88: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 1cc8c: 83 eb ldi r24, 0xB3 ; 179 1cc8e: 9b e3 ldi r25, 0x3B ; 59 1cc90: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cc94: 6f ee ldi r22, 0xEF ; 239 1cc96: 78 ed ldi r23, 0xD8 ; 216 1cc98: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 1cc9c: 85 e6 ldi r24, 0x65 ; 101 1cc9e: 9c e5 ldi r25, 0x5C ; 92 1cca0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cca4: 62 ef ldi r22, 0xF2 ; 242 1cca6: 78 ed ldi r23, 0xD8 ; 216 1cca8: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 1ccac: 8e ec ldi r24, 0xCE ; 206 1ccae: 9e e0 ldi r25, 0x0E ; 14 1ccb0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1ccb4: 88 23 and r24, r24 1ccb6: 41 f0 breq .+16 ; 0x1ccc8 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 1ccb8: 86 e5 ldi r24, 0x56 ; 86 1ccba: 9c e5 ldi r25, 0x5C ; 92 1ccbc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ccc0: 65 ef ldi r22, 0xF5 ; 245 1ccc2: 78 ed ldi r23, 0xD8 ; 216 } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 1ccc4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 1ccc8: 87 e6 ldi r24, 0x67 ; 103 1ccca: 9d e3 ldi r25, 0x3D ; 61 1cccc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ccd0: 66 ea ldi r22, 0xA6 ; 166 1ccd2: 79 e3 ldi r23, 0x39 ; 57 1ccd4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 1ccd8: 81 e8 ldi r24, 0x81 ; 129 1ccda: 9b e3 ldi r25, 0x3B ; 59 1ccdc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cce0: 62 e3 ldi r22, 0x32 ; 50 1cce2: 74 ed ldi r23, 0xD4 ; 212 1cce4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 1cce8: 84 e7 ldi r24, 0x74 ; 116 1ccea: 9b e3 ldi r25, 0x3B ; 59 1ccec: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ccf0: 68 ee ldi r22, 0xE8 ; 232 1ccf2: 7a e3 ldi r23, 0x3A ; 58 1ccf4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 1ccf8: 87 e6 ldi r24, 0x67 ; 103 1ccfa: 9b e3 ldi r25, 0x3B ; 59 1ccfc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cd00: 60 ea ldi r22, 0xA0 ; 160 1cd02: 79 e3 ldi r23, 0x39 ; 57 1cd04: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #endif if (MMU2::mmu2.Enabled()) { 1cd08: 80 91 98 13 lds r24, 0x1398 ; 0x801398 1cd0c: 81 30 cpi r24, 0x01 ; 1 1cd0e: 41 f4 brne .+16 ; 0x1cd20 MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1cd10: 86 e5 ldi r24, 0x56 ; 86 1cd12: 9b e3 ldi r25, 0x3B ; 59 1cd14: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cd18: 68 e5 ldi r22, 0x58 ; 88 1cd1a: 7a e3 ldi r23, 0x3A ; 58 1cd1c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 1cd20: 8c e4 ldi r24, 0x4C ; 76 1cd22: 9b e3 ldi r25, 0x3B ; 59 1cd24: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cd28: 6e e8 ldi r22, 0x8E ; 142 1cd2a: 79 e3 ldi r23, 0x39 ; 57 1cd2c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_END(); 1cd30: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 1cd34: 80 91 15 05 lds r24, 0x0515 ; 0x800515 1cd38: 8f 5f subi r24, 0xFF ; 255 1cd3a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 1cd3e: 80 91 17 05 lds r24, 0x0517 ; 0x800517 1cd42: 8f 5f subi r24, 0xFF ; 255 1cd44: 80 93 17 05 sts 0x0517, r24 ; 0x800517 1cd48: 25 ce rjmp .-950 ; 0x1c994 #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 1cd4a: d0 93 dd 03 sts 0x03DD, r29 ; 0x8003dd MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 1cd4e: 83 ef ldi r24, 0xF3 ; 243 1cd50: 9b e3 ldi r25, 0x3B ; 59 1cd52: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cd56: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 1cd5a: 54 cf rjmp .-344 ; 0x1cc04 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); } #ifdef QUICK_NOZZLE_CHANGE SETTINGS_NOZZLE; 1cd5c: 80 35 cpi r24, 0x50 ; 80 1cd5e: 19 f1 breq .+70 ; 0x1cda6 1cd60: 8f 3f cpi r24, 0xFF ; 255 1cd62: 09 f0 breq .+2 ; 0x1cd66 1cd64: 6e cf rjmp .-292 ; 0x1cc42 1cd66: 87 ee ldi r24, 0xE7 ; 231 1cd68: 9b e3 ldi r25, 0x3B ; 59 1cd6a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cd6e: 22 e0 ldi r18, 0x02 ; 2 1cd70: 42 e6 ldi r20, 0x62 ; 98 1cd72: 5b e3 ldi r21, 0x3B ; 59 1cd74: 6d e2 ldi r22, 0x2D ; 45 1cd76: 7b e8 ldi r23, 0x8B ; 139 1cd78: 09 c0 rjmp .+18 ; 0x1cd8c 1cd7a: 87 ee ldi r24, 0xE7 ; 231 1cd7c: 9b e3 ldi r25, 0x3B ; 59 1cd7e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cd82: 22 e0 ldi r18, 0x02 ; 2 1cd84: 42 e6 ldi r20, 0x62 ; 98 1cd86: 5b e3 ldi r21, 0x3B ; 59 1cd88: 62 e3 ldi r22, 0x32 ; 50 1cd8a: 7b e8 ldi r23, 0x8B ; 139 1cd8c: 0f 94 9f d0 call 0x3a13e ; 0x3a13e 1cd90: 58 cf rjmp .-336 ; 0x1cc42 1cd92: 87 ee ldi r24, 0xE7 ; 231 1cd94: 9b e3 ldi r25, 0x3B ; 59 1cd96: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cd9a: 22 e0 ldi r18, 0x02 ; 2 1cd9c: 42 e6 ldi r20, 0x62 ; 98 1cd9e: 5b e3 ldi r21, 0x3B ; 59 1cda0: 68 e2 ldi r22, 0x28 ; 40 1cda2: 7b e8 ldi r23, 0x8B ; 139 1cda4: f3 cf rjmp .-26 ; 0x1cd8c 1cda6: 87 ee ldi r24, 0xE7 ; 231 1cda8: 9b e3 ldi r25, 0x3B ; 59 1cdaa: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cdae: 22 e0 ldi r18, 0x02 ; 2 1cdb0: 42 e6 ldi r20, 0x62 ; 98 1cdb2: 5b e3 ldi r21, 0x3B ; 59 1cdb4: 63 e2 ldi r22, 0x23 ; 35 1cdb6: 7b e8 ldi r23, 0x8B ; 139 1cdb8: e9 cf rjmp .-46 ; 0x1cd8c MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 1cdba: 80 91 88 17 lds r24, 0x1788 ; 0x801788 1cdbe: 88 23 and r24, r24 1cdc0: 19 f1 breq .+70 ; 0x1ce08 if (!fsensor.getAutoLoadEnabled()) { 1cdc2: 80 91 89 17 lds r24, 0x1789 ; 0x801789 1cdc6: 81 11 cpse r24, r1 1cdc8: 08 c0 rjmp .+16 ; 0x1cdda MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1cdca: 83 ea ldi r24, 0xA3 ; 163 1cdcc: 9b e3 ldi r25, 0x3B ; 59 1cdce: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cdd2: 6a e6 ldi r22, 0x6A ; 106 1cdd4: 7b e3 ldi r23, 0x3B ; 59 1cdd6: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } if (fsensor.getFilamentPresent()) { 1cdda: 0e 94 bc e4 call 0x1c978 ; 0x1c978 1cdde: 88 23 and r24, r24 1cde0: 39 f0 breq .+14 ; 0x1cdf0 } #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); 1cde2: 83 eb ldi r24, 0xB3 ; 179 1cde4: 9b e3 ldi r25, 0x3B ; 59 1cde6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cdea: 66 eb ldi r22, 0xB6 ; 182 1cdec: 79 e3 ldi r23, 0x39 ; 57 1cdee: 6a cf rjmp .-300 ; 0x1ccc4 if (fsensor.getFilamentPresent()) { MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); } #ifndef REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY else { if (fsensor.getAutoLoadEnabled()) { 1cdf0: 80 91 89 17 lds r24, 0x1789 ; 0x801789 1cdf4: 88 23 and r24, r24 1cdf6: 09 f4 brne .+2 ; 0x1cdfa 1cdf8: 67 cf rjmp .-306 ; 0x1ccc8 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 1cdfa: 8f e8 ldi r24, 0x8F ; 143 1cdfc: 9b e3 ldi r25, 0x3B ; 59 1cdfe: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ce02: 68 e3 ldi r22, 0x38 ; 56 1ce04: 7b e3 ldi r23, 0x3B ; 59 1ce06: 5e cf rjmp .-324 ; 0x1ccc4 } } #endif //REMOVE_AUTOLOAD_FILAMENT_MENU_ENTRY } else { #endif //FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 1ce08: 83 ea ldi r24, 0xA3 ; 163 1ce0a: 9b e3 ldi r25, 0x3B ; 59 1ce0c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1ce10: 6a e6 ldi r22, 0x6A ; 106 1ce12: 7b e3 ldi r23, 0x3B ; 59 1ce14: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 1ce18: e4 cf rjmp .-56 ; 0x1cde2 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 1ce1a: df 91 pop r29 1ce1c: cf 91 pop r28 1ce1e: 1f 91 pop r17 1ce20: 08 95 ret 0001ce22 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1ce22: cf 93 push r28 1ce24: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1ce26: 86 ea ldi r24, 0xA6 ; 166 1ce28: 9c e0 ldi r25, 0x0C ; 12 1ce2a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 status &= ~components; 1ce2e: c0 95 com r28 1ce30: 6c 2f mov r22, r28 1ce32: 68 23 and r22, r24 1ce34: 86 ea ldi r24, 0xA6 ; 166 1ce36: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1ce38: cf 91 pop r28 1ce3a: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0001ce3e : } } } static void lcd_reset_sheet() { 1ce3e: 1f 93 push r17 1ce40: cf 93 push r28 1ce42: df 93 push r29 1ce44: 00 d0 rcall .+0 ; 0x1ce46 1ce46: 00 d0 rcall .+0 ; 0x1ce48 1ce48: 1f 92 push r1 1ce4a: 1f 92 push r1 1ce4c: cd b7 in r28, 0x3d ; 61 1ce4e: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1ce50: be 01 movw r22, r28 1ce52: 6f 5f subi r22, 0xFF ; 255 1ce54: 7f 4f sbci r23, 0xFF ; 255 1ce56: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1ce5a: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1ce5e: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 1ce62: 1b e0 ldi r17, 0x0B ; 11 1ce64: 81 9f mul r24, r17 1ce66: c0 01 movw r24, r0 1ce68: 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); 1ce6a: 6f ef ldi r22, 0xFF ; 255 1ce6c: 7f ef ldi r23, 0xFF ; 255 1ce6e: 80 5b subi r24, 0xB0 ; 176 1ce70: 92 4f sbci r25, 0xF2 ; 242 1ce72: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1ce76: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 1ce7a: 61 9f mul r22, r17 1ce7c: b0 01 movw r22, r0 1ce7e: 11 24 eor r1, r1 1ce80: 67 5b subi r22, 0xB7 ; 183 1ce82: 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); 1ce84: 47 e0 ldi r20, 0x07 ; 7 1ce86: 50 e0 ldi r21, 0x00 ; 0 1ce88: ce 01 movw r24, r28 1ce8a: 01 96 adiw r24, 0x01 ; 1 1ce8c: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1ce90: 81 ea ldi r24, 0xA1 ; 161 1ce92: 9d e0 ldi r25, 0x0D ; 13 1ce94: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1ce98: 90 91 de 03 lds r25, 0x03DE ; 0x8003de 1ce9c: 89 13 cpse r24, r25 1ce9e: 0a c0 rjmp .+20 ; 0x1ceb4 { eeprom_switch_to_next_sheet(); 1cea0: 0e 94 ee 77 call 0xefdc ; 0xefdc if (-1 == eeprom_next_initialized_sheet(0)) 1cea4: 80 e0 ldi r24, 0x00 ; 0 1cea6: 0e 94 da 77 call 0xefb4 ; 0xefb4 1ceaa: 8f 3f cpi r24, 0xFF ; 255 1ceac: 19 f4 brne .+6 ; 0x1ceb4 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1ceae: 80 e1 ldi r24, 0x10 ; 16 1ceb0: 0e 94 11 e7 call 0x1ce22 ; 0x1ce22 } menu_back(); 1ceb4: 0f 94 d8 d1 call 0x3a3b0 ; 0x3a3b0 } 1ceb8: 28 96 adiw r28, 0x08 ; 8 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: df 91 pop r29 1cec6: cf 91 pop r28 1cec8: 1f 91 pop r17 1ceca: 08 95 ret 0001cecc : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1cecc: cf 93 push r28 1cece: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1ced0: 86 ea ldi r24, 0xA6 ; 166 1ced2: 9c e0 ldi r25, 0x0C ; 12 1ced4: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 status |= components; 1ced8: 68 2f mov r22, r24 1ceda: 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); 1cedc: 86 ea ldi r24, 0xA6 ; 166 1cede: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1cee0: cf 91 pop r28 1cee2: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0001cee6 : //! @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) 1cee6: 2f 92 push r2 1cee8: 3f 92 push r3 1ceea: 4f 92 push r4 1ceec: 5f 92 push r5 1ceee: 6f 92 push r6 1cef0: 7f 92 push r7 1cef2: 8f 92 push r8 1cef4: 9f 92 push r9 1cef6: af 92 push r10 1cef8: bf 92 push r11 1cefa: cf 92 push r12 1cefc: df 92 push r13 1cefe: ef 92 push r14 1cf00: ff 92 push r15 1cf02: 0f 93 push r16 1cf04: 1f 93 push r17 1cf06: cf 93 push r28 1cf08: df 93 push r29 1cf0a: cd b7 in r28, 0x3d ; 61 1cf0c: de b7 in r29, 0x3e ; 62 1cf0e: ce 5c subi r28, 0xCE ; 206 1cf10: d1 09 sbc r29, r1 1cf12: 0f b6 in r0, 0x3f ; 63 1cf14: f8 94 cli 1cf16: de bf out 0x3e, r29 ; 62 1cf18: 0f be out 0x3f, r0 ; 63 1cf1a: cd bf out 0x3d, r28 ; 61 1cf1c: 18 2f mov r17, r24 { bool final_result = false; #ifdef TMC2130 FORCE_HIGH_POWER_START; 1cf1e: 81 e0 ldi r24, 0x01 ; 1 1cf20: 0e 94 65 67 call 0xceca ; 0xceca #endif // TMC2130 FORCE_BL_ON_START; 1cf24: 81 e0 ldi r24, 0x01 ; 1 1cf26: 0e 94 7c 8b call 0x116f8 ; 0x116f8 // Only Z calibration? if (!onlyZ) 1cf2a: 11 11 cpse r17, r1 1cf2c: 04 c0 rjmp .+8 ; 0x1cf36 { disable_heater(); 1cf2e: 0f 94 57 45 call 0x28aae ; 0x28aae eeprom_adjust_bed_reset(); //reset bed level correction 1cf32: 0e 94 23 78 call 0xf046 ; 0xf046 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 1cf36: 80 e0 ldi r24, 0x00 ; 0 1cf38: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 // Let the planner use the uncorrected coordinates. mbl.reset(); 1cf3c: 0f 94 1f 8c call 0x3183e ; 0x3183e // 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(); 1cf40: 0f 94 b0 cb call 0x39760 ; 0x39760 babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 1cf44: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.516+0x1> 1cf48: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.516> // Reset the baby step value applied without moving the axes. babystep_reset(); // Mark all axes as in a need for homing. memset(axis_known_position, 0, sizeof(axis_known_position)); 1cf4c: e0 e4 ldi r30, 0x40 ; 64 1cf4e: f7 e0 ldi r31, 0x07 ; 7 1cf50: 83 e0 ldi r24, 0x03 ; 3 1cf52: df 01 movw r26, r30 1cf54: 1d 92 st X+, r1 1cf56: 8a 95 dec r24 1cf58: e9 f7 brne .-6 ; 0x1cf54 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 1cf5a: 81 e0 ldi r24, 0x01 ; 1 1cf5c: 0e 94 9d 67 call 0xcf3a ; 0xcf3a 1cf60: c7 55 subi r28, 0x57 ; 87 1cf62: df 4f sbci r29, 0xFF ; 255 1cf64: 99 83 std Y+1, r25 ; 0x01 1cf66: 88 83 st Y, r24 1cf68: c9 5a subi r28, 0xA9 ; 169 1cf6a: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 1cf6c: 83 e5 ldi r24, 0x53 ; 83 1cf6e: 99 e4 ldi r25, 0x49 ; 73 1cf70: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1cf74: 0f 94 85 35 call 0x26b0a ; 0x26b0a raise_z_above(MESH_HOME_Z_SEARCH); 1cf78: 60 e0 ldi r22, 0x00 ; 0 1cf7a: 70 e0 ldi r23, 0x00 ; 0 1cf7c: 80 ea ldi r24, 0xA0 ; 160 1cf7e: 90 e4 ldi r25, 0x40 ; 64 1cf80: 0e 94 15 6f call 0xde2a ; 0xde2a } /**/ void home_xy() { set_destination_to_current(); 1cf84: 0e 94 ef 68 call 0xd1de ; 0xd1de homeaxis(X_AXIS); 1cf88: 50 e0 ldi r21, 0x00 ; 0 1cf8a: 40 e0 ldi r20, 0x00 ; 0 1cf8c: 61 e0 ldi r22, 0x01 ; 1 1cf8e: 80 e0 ldi r24, 0x00 ; 0 1cf90: 0e 94 f6 7b call 0xf7ec ; 0xf7ec homeaxis(Y_AXIS); 1cf94: 50 e0 ldi r21, 0x00 ; 0 1cf96: 40 e0 ldi r20, 0x00 ; 0 1cf98: 61 e0 ldi r22, 0x01 ; 1 1cf9a: 81 e0 ldi r24, 0x01 ; 1 1cf9c: 0e 94 f6 7b call 0xf7ec ; 0xf7ec plan_set_position_curposXYZE(); 1cfa0: 0f 94 53 b9 call 0x372a6 ; 0x372a6 endstops_hit_on_purpose(); 1cfa4: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec 1cfa8: 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; 1cfac: 20 e0 ldi r18, 0x00 ; 0 1cfae: 30 e0 ldi r19, 0x00 ; 0 1cfb0: 40 ea ldi r20, 0xA0 ; 160 1cfb2: 50 e4 ldi r21, 0x40 ; 64 1cfb4: 60 91 43 07 lds r22, 0x0743 ; 0x800743 1cfb8: 70 91 44 07 lds r23, 0x0744 ; 0x800744 1cfbc: 80 91 45 07 lds r24, 0x0745 ; 0x800745 1cfc0: 90 91 46 07 lds r25, 0x0746 ; 0x800746 1cfc4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1cfc8: 60 93 43 07 sts 0x0743, r22 ; 0x800743 1cfcc: 70 93 44 07 sts 0x0744, r23 ; 0x800744 1cfd0: 80 93 45 07 sts 0x0745, r24 ; 0x800745 1cfd4: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] += 5; 1cfd8: 20 e0 ldi r18, 0x00 ; 0 1cfda: 30 e0 ldi r19, 0x00 ; 0 1cfdc: 40 ea ldi r20, 0xA0 ; 160 1cfde: 50 e4 ldi r21, 0x40 ; 64 1cfe0: 60 91 47 07 lds r22, 0x0747 ; 0x800747 1cfe4: 70 91 48 07 lds r23, 0x0748 ; 0x800748 1cfe8: 80 91 49 07 lds r24, 0x0749 ; 0x800749 1cfec: 90 91 4a 07 lds r25, 0x074A ; 0x80074a 1cff0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1cff4: 60 93 47 07 sts 0x0747, r22 ; 0x800747 1cff8: 70 93 48 07 sts 0x0748, r23 ; 0x800748 1cffc: 80 93 49 07 sts 0x0749, r24 ; 0x800749 1d000: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1d004: 60 e0 ldi r22, 0x00 ; 0 1d006: 70 e0 ldi r23, 0x00 ; 0 1d008: 80 ea ldi r24, 0xA0 ; 160 1d00a: 91 e4 ldi r25, 0x41 ; 65 1d00c: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1d010: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Let the user move the Z axes up to the end stoppers. #ifdef TMC2130 if (calibrate_z_auto()) 1d014: 0e 94 f3 73 call 0xe7e6 ; 0xe7e6 1d018: e5 96 adiw r28, 0x35 ; 53 1d01a: 8f af std Y+63, r24 ; 0x3f 1d01c: e5 97 sbiw r28, 0x35 ; 53 1d01e: 81 11 cpse r24, r1 1d020: 04 c0 rjmp .+8 ; 0x1d02a //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 1d022: e5 96 adiw r28, 0x35 ; 53 1d024: 1f ae std Y+63, r1 ; 0x3f 1d026: e5 97 sbiw r28, 0x35 ; 53 1d028: 0d c3 rjmp .+1562 ; 0x1d644 { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 1d02a: 87 e1 ldi r24, 0x17 ; 23 1d02c: 99 e4 ldi r25, 0x49 ; 73 1d02e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1d032: 0f 94 0c 36 call 0x26c18 ; 0x26c18 if(onlyZ){ 1d036: 11 23 and r17, r17 1d038: 09 f4 brne .+2 ; 0x1d03c 1d03a: df c2 rjmp .+1470 ; 0x1d5fa prompt_steel_sheet_on_bed(true); 1d03c: 81 e0 ldi r24, 0x01 ; 1 1d03e: 0f 94 bc 67 call 0x2cf78 ; 0x2cf78 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 1d042: 85 ee ldi r24, 0xE5 ; 229 1d044: 98 e4 ldi r25, 0x48 ; 72 1d046: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1d04a: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_puts_at_P(0,3,_n("1/9")); 1d04e: 43 e9 ldi r20, 0x93 ; 147 1d050: 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")); 1d052: 63 e0 ldi r22, 0x03 ; 3 1d054: 80 e0 ldi r24, 0x00 ; 0 1d056: 0e 94 a9 6f call 0xdf52 ; 0xdf52 } refresh_cmd_timeout(); 1d05a: 0e 94 78 67 call 0xcef0 ; 0xcef0 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 1d05e: 11 11 cpse r17, r1 1d060: 1b c0 rjmp .+54 ; 0x1d098 { KEEPALIVE_STATE(PAUSED_FOR_USER); 1d062: 84 e0 ldi r24, 0x04 ; 4 1d064: 80 93 96 02 sts 0x0296, r24 ; 0x800296 prompt_steel_sheet_on_bed(false); 1d068: 80 e0 ldi r24, 0x00 ; 0 1d06a: 0f 94 bc 67 call 0x2cf78 ; 0x2cf78 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 1d06e: 8b e2 ldi r24, 0x2B ; 43 1d070: 98 e4 ldi r25, 0x48 ; 72 1d072: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1d076: 0f 94 0c 36 call 0x26c18 ; 0x26c18 KEEPALIVE_STATE(IN_HANDLER); 1d07a: 82 e0 ldi r24, 0x02 ; 2 1d07c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 1d080: 83 ec ldi r24, 0xC3 ; 195 1d082: 98 e4 ldi r25, 0x48 ; 72 1d084: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1d088: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_puts_at_P(0,3,_n("1/4")); 1d08c: 4b e8 ldi r20, 0x8B ; 139 1d08e: 5e e6 ldi r21, 0x6E ; 110 1d090: 63 e0 ldi r22, 0x03 ; 3 1d092: 80 e0 ldi r24, 0x00 ; 0 1d094: 0e 94 a9 6f call 0xdf52 ; 0xdf52 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 1d098: 00 91 8f 02 lds r16, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 1d09c: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 1d0a0: 60 e0 ldi r22, 0x00 ; 0 1d0a2: 70 e0 ldi r23, 0x00 ; 0 1d0a4: 80 e8 ldi r24, 0x80 ; 128 1d0a6: 9f eb ldi r25, 0xBF ; 191 1d0a8: 0e 94 96 6e call 0xdd2c ; 0xdd2c // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1d0ac: c1 2c mov r12, r1 1d0ae: d1 2c mov r13, r1 1d0b0: b0 ea ldi r27, 0xA0 ; 160 1d0b2: eb 2e mov r14, r27 1d0b4: b0 e4 ldi r27, 0x40 ; 64 1d0b6: fb 2e mov r15, r27 1d0b8: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 1d0bc: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 1d0c0: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 1d0c4: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e 1d0c8: 81 e0 ldi r24, 0x01 ; 1 1d0ca: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 1d0ce: 84 e0 ldi r24, 0x04 ; 4 1d0d0: 0f 94 93 3b call 0x27726 ; 0x27726 #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1d0d4: 60 e0 ldi r22, 0x00 ; 0 1d0d6: 70 e0 ldi r23, 0x00 ; 0 1d0d8: 80 ea ldi r24, 0xA0 ; 160 1d0da: 91 e4 ldi r25, 0x41 ; 65 1d0dc: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1d0e0: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #ifdef TMC2130 tmc2130_home_exit(); 1d0e4: 0f 94 64 3b call 0x276c8 ; 0x276c8 1d0e8: 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)) && 1d0ec: 82 e0 ldi r24, 0x02 ; 2 1d0ee: 0f 94 18 59 call 0x2b230 ; 0x2b230 1d0f2: 2d ec ldi r18, 0xCD ; 205 1d0f4: 3c ec ldi r19, 0xCC ; 204 1d0f6: 44 ea ldi r20, 0xA4 ; 164 1d0f8: 50 e4 ldi r21, 0x40 ; 64 1d0fa: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1d0fe: 18 16 cp r1, r24 1d100: 0c f4 brge .+2 ; 0x1d104 1d102: 84 c2 rjmp .+1288 ; 0x1d60c (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 1d104: 82 e0 ldi r24, 0x02 ; 2 1d106: 0f 94 18 59 call 0x2b230 ; 0x2b230 #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)) && 1d10a: 23 e3 ldi r18, 0x33 ; 51 1d10c: 33 e3 ldi r19, 0x33 ; 51 1d10e: 4b e9 ldi r20, 0x9B ; 155 1d110: 50 e4 ldi r21, 0x40 ; 64 1d112: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1d116: 87 fd sbrc r24, 7 1d118: 79 c2 rjmp .+1266 ; 0x1d60c (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 1d11a: 11 11 cpse r17, r1 1d11c: 7c c2 rjmp .+1272 ; 0x1d616 } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1d11e: 80 e1 ldi r24, 0x10 ; 16 1d120: 0e 94 11 e7 call 0x1ce22 ; 0x1ce22 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1d124: 81 ea ldi r24, 0xA1 ; 161 1d126: 9d e0 ldi r25, 0x0D ; 13 1d128: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1d12c: bb e0 ldi r27, 0x0B ; 11 1d12e: 8b 9f mul r24, r27 1d130: c0 01 movw r24, r0 1d132: 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); 1d134: 70 e0 ldi r23, 0x00 ; 0 1d136: 60 e0 ldi r22, 0x00 ; 0 1d138: 80 5b subi r24, 0xB0 ; 176 1d13a: 92 4f sbci r25, 0xF2 ; 242 1d13c: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 } 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(); 1d140: 0e 94 78 67 call 0xcef0 ; 0xcef0 // 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); 1d144: e1 ea ldi r30, 0xA1 ; 161 1d146: f3 e1 ldi r31, 0x13 ; 19 1d148: 84 ec ldi r24, 0xC4 ; 196 1d14a: df 01 movw r26, r30 1d14c: 1d 92 st X+, r1 1d14e: 8a 95 dec r24 1d150: e9 f7 brne .-6 ; 0x1d14c { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 1d152: 84 e4 ldi r24, 0x44 ; 68 1d154: 92 e9 ldi r25, 0x92 ; 146 1d156: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 MYSERIAL.println(int(iteration + 1)); 1d15a: 81 e0 ldi r24, 0x01 ; 1 1d15c: 90 e0 ldi r25, 0x00 ; 0 1d15e: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 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)); 1d162: 83 ec ldi r24, 0xC3 ; 195 1d164: 98 e4 ldi r25, 0x48 ; 72 1d166: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1d16a: 0f 94 85 35 call 0x26b0a ; 0x26b0a #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; 1d16e: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 1d172: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 1d176: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 1d17a: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e 1d17e: b2 e0 ldi r27, 0x02 ; 2 1d180: e1 96 adiw r28, 0x31 ; 49 1d182: bf af std Y+63, r27 ; 0x3f 1d184: e1 97 sbiw r28, 0x31 ; 49 1d186: 2f e1 ldi r18, 0x1F ; 31 1d188: 32 e9 ldi r19, 0x92 ; 146 1d18a: cd 56 subi r28, 0x6D ; 109 1d18c: df 4f sbci r29, 0xFF ; 255 1d18e: 39 83 std Y+1, r19 ; 0x01 1d190: 28 83 st Y, r18 1d192: c3 59 subi r28, 0x93 ; 147 1d194: d0 40 sbci r29, 0x00 ; 0 1d196: 40 ea ldi r20, 0xA0 ; 160 1d198: 53 e1 ldi r21, 0x13 ; 19 1d19a: cf 56 subi r28, 0x6F ; 111 1d19c: df 4f sbci r29, 0xFF ; 255 1d19e: 59 83 std Y+1, r21 ; 0x01 1d1a0: 48 83 st Y, r20 1d1a2: c1 59 subi r28, 0x91 ; 145 1d1a4: d0 40 sbci r29, 0x00 ; 0 1d1a6: a0 96 adiw r28, 0x20 ; 32 1d1a8: 5f af std Y+63, r21 ; 0x3f 1d1aa: 4e af std Y+62, r20 ; 0x3e 1d1ac: a0 97 sbiw r28, 0x20 ; 32 1d1ae: e0 96 adiw r28, 0x30 ; 48 1d1b0: 3f af std Y+63, r19 ; 0x3f 1d1b2: 2e af std Y+62, r18 ; 0x3e 1d1b4: 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; 1d1b6: a7 96 adiw r28, 0x27 ; 39 1d1b8: 1f ae std Y+63, r1 ; 0x3f 1d1ba: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 1d1bc: 31 2c mov r3, r1 1d1be: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 1d1c0: 0e 94 78 67 call 0xcef0 ; 0xcef0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 1d1c4: 63 e0 ldi r22, 0x03 ; 3 1d1c6: 80 e0 ldi r24, 0x00 ; 0 1d1c8: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%d/4"),(k+1)); 1d1cc: bf ef ldi r27, 0xFF ; 255 1d1ce: 2b 1a sub r2, r27 1d1d0: 3b 0a sbc r3, r27 1d1d2: 3f 92 push r3 1d1d4: 2f 92 push r2 1d1d6: ef e3 ldi r30, 0x3F ; 63 1d1d8: f2 e9 ldi r31, 0x92 ; 146 1d1da: ff 93 push r31 1d1dc: ef 93 push r30 1d1de: 0e 94 6e 6f call 0xdedc ; 0xdedc } #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); 1d1e2: 65 e5 ldi r22, 0x55 ; 85 1d1e4: 75 e5 ldi r23, 0x55 ; 85 1d1e6: 85 e5 ldi r24, 0x55 ; 85 1d1e8: 91 e4 ldi r25, 0x41 ; 65 1d1ea: 0f 94 50 c3 call 0x386a0 ; 0x386a0 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); 1d1ee: e0 96 adiw r28, 0x30 ; 48 1d1f0: ee ad ldd r30, Y+62 ; 0x3e 1d1f2: ff ad ldd r31, Y+63 ; 0x3f 1d1f4: e0 97 sbiw r28, 0x30 ; 48 1d1f6: 85 91 lpm r24, Z+ 1d1f8: 95 91 lpm r25, Z+ 1d1fa: a5 91 lpm r26, Z+ 1d1fc: b4 91 lpm r27, Z 1d1fe: 80 93 43 07 sts 0x0743, r24 ; 0x800743 1d202: 90 93 44 07 sts 0x0744, r25 ; 0x800744 1d206: a0 93 45 07 sts 0x0745, r26 ; 0x800745 1d20a: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 1d20e: e0 96 adiw r28, 0x30 ; 48 1d210: ee ad ldd r30, Y+62 ; 0x3e 1d212: ff ad ldd r31, Y+63 ; 0x3f 1d214: e0 97 sbiw r28, 0x30 ; 48 1d216: 34 96 adiw r30, 0x04 ; 4 1d218: 85 91 lpm r24, Z+ 1d21a: 95 91 lpm r25, Z+ 1d21c: a5 91 lpm r26, Z+ 1d21e: b4 91 lpm r27, Z 1d220: 80 93 47 07 sts 0x0747, r24 ; 0x800747 1d224: 90 93 48 07 sts 0x0748, r25 ; 0x800748 1d228: a0 93 49 07 sts 0x0749, r26 ; 0x800749 1d22c: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a MYSERIAL.print(current_position[Z_AXIS], 5); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY go_to_current(homing_feedrate[X_AXIS] / 60.f); 1d230: 60 e0 ldi r22, 0x00 ; 0 1d232: 70 e0 ldi r23, 0x00 ; 0 1d234: 88 e4 ldi r24, 0x48 ; 72 1d236: 92 e4 ldi r25, 0x42 ; 66 1d238: 0f 94 50 c3 call 0x386a0 ; 0x386a0 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 1d23c: 44 ea ldi r20, 0xA4 ; 164 1d23e: 50 e9 ldi r21, 0x90 ; 144 1d240: 5f 93 push r21 1d242: 4f 93 push r20 1d244: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 1d248: 43 e9 ldi r20, 0x93 ; 147 1d24a: 50 e9 ldi r21, 0x90 ; 144 1d24c: 63 e0 ldi r22, 0x03 ; 3 1d24e: 84 e0 ldi r24, 0x04 ; 4 1d250: 0e 94 a9 6f call 0xdf52 ; 0xdf52 // disable heaters and stop motion before we initialize sm4 disable_heater(); 1d254: 0f 94 57 45 call 0x28aae ; 0x28aae st_synchronize(); 1d258: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 1d25c: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d260: 8d 7f andi r24, 0xFD ; 253 1d262: 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" ); 1d266: 0f b6 in r0, 0x3f ; 63 1d268: f8 94 cli 1d26a: a8 95 wdr 1d26c: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d270: 88 61 ori r24, 0x18 ; 24 1d272: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d276: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d27a: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 1d27c: 10 92 69 05 sts 0x0569, r1 ; 0x800569 1d280: 10 92 68 05 sts 0x0568, r1 ; 0x800568 sm4_update_pos_cb = xyzcal_update_pos; 1d284: 8f ee ldi r24, 0xEF ; 239 1d286: 9f ec ldi r25, 0xCF ; 207 1d288: 90 93 67 05 sts 0x0567, r25 ; 0x800567 1d28c: 80 93 66 05 sts 0x0566, r24 ; 0x800566 sm4_calc_delay_cb = xyzcal_calc_delay; 1d290: af e7 ldi r26, 0x7F ; 127 1d292: bf ec ldi r27, 0xCF ; 207 1d294: b0 93 65 05 sts 0x0565, r27 ; 0x800565 1d298: a0 93 64 05 sts 0x0564, r26 ; 0x800564 const uint16_t xyzcal_point_pattern_10[12] PROGMEM = {0x000, 0x0f0, 0x1f8, 0x3fc, 0x7fe, 0x7fe, 0x7fe, 0x7fe, 0x3fc, 0x1f8, 0x0f0, 0x000}; const uint16_t xyzcal_point_pattern_08[12] PROGMEM = {0x000, 0x000, 0x0f0, 0x1f8, 0x3fc, 0x3fc, 0x3fc, 0x3fc, 0x1f8, 0x0f0, 0x000, 0x000}; bool xyzcal_searchZ(void) { //@size=118 DBG(_n("xyzcal_searchZ x=%ld y=%ld z=%ld\n"), count_position[X_AXIS], count_position[Y_AXIS], count_position[Z_AXIS]); 1d29c: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 1d2a0: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 1d2a4: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 1d2a8: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 1d2ac: 40 91 68 07 lds r20, 0x0768 ; 0x800768 1d2b0: 50 91 69 07 lds r21, 0x0769 ; 0x800769 1d2b4: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 1d2b8: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 1d2bc: 80 91 64 07 lds r24, 0x0764 ; 0x800764 1d2c0: 90 91 65 07 lds r25, 0x0765 ; 0x800765 1d2c4: a0 91 66 07 lds r26, 0x0766 ; 0x800766 1d2c8: b0 91 67 07 lds r27, 0x0767 ; 0x800767 1d2cc: 3f 93 push r19 1d2ce: 2f 93 push r18 1d2d0: 1f 93 push r17 1d2d2: 0f 93 push r16 1d2d4: 7f 93 push r23 1d2d6: 6f 93 push r22 1d2d8: 5f 93 push r21 1d2da: 4f 93 push r20 1d2dc: bf 93 push r27 1d2de: af 93 push r26 1d2e0: 9f 93 push r25 1d2e2: 8f 93 push r24 1d2e4: e3 e4 ldi r30, 0x43 ; 67 1d2e6: f1 e9 ldi r31, 0x91 ; 145 1d2e8: ff 93 push r31 1d2ea: ef 93 push r30 1d2ec: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 int16_t x0 = _X; 1d2f0: 40 90 64 07 lds r4, 0x0764 ; 0x800764 1d2f4: 50 90 65 07 lds r5, 0x0765 ; 0x800765 1d2f8: 60 90 66 07 lds r6, 0x0766 ; 0x800766 1d2fc: 70 90 67 07 lds r7, 0x0767 ; 0x800767 1d300: b4 2c mov r11, r4 1d302: a5 2c mov r10, r5 int16_t y0 = _Y; 1d304: 80 91 68 07 lds r24, 0x0768 ; 0x800768 1d308: 90 91 69 07 lds r25, 0x0769 ; 0x800769 1d30c: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 1d310: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 1d314: a6 96 adiw r28, 0x26 ; 38 1d316: 8c af std Y+60, r24 ; 0x3c 1d318: 9d af std Y+61, r25 ; 0x3d 1d31a: ae af std Y+62, r26 ; 0x3e 1d31c: bf af std Y+63, r27 ; 0x3f 1d31e: a6 97 sbiw r28, 0x26 ; 38 1d320: a3 96 adiw r28, 0x23 ; 35 1d322: 9f ac ldd r9, Y+63 ; 0x3f 1d324: a3 97 sbiw r28, 0x23 ; 35 1d326: a4 96 adiw r28, 0x24 ; 36 1d328: 8f ac ldd r8, Y+63 ; 0x3f 1d32a: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 1d32c: c0 90 6c 07 lds r12, 0x076C ; 0x80076c 1d330: d0 90 6d 07 lds r13, 0x076D ; 0x80076d 1d334: e0 90 6e 07 lds r14, 0x076E ; 0x80076e 1d338: f0 90 6f 07 lds r15, 0x076F ; 0x80076f 1d33c: 0f b6 in r0, 0x3f ; 63 1d33e: f8 94 cli 1d340: de bf out 0x3e, r29 ; 62 1d342: 0f be out 0x3f, r0 ; 63 1d344: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 1d346: b5 e0 ldi r27, 0x05 ; 5 1d348: cb 16 cp r12, r27 1d34a: b7 ef ldi r27, 0xF7 ; 247 1d34c: db 06 cpc r13, r27 1d34e: 0c f4 brge .+2 ; 0x1d352 1d350: d9 c1 rjmp .+946 ; 0x1d704 } 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; 1d352: 1a 82 std Y+2, r1 ; 0x02 1d354: 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); 1d356: 1f 92 push r1 1d358: 1f 92 push r1 1d35a: e3 e0 ldi r30, 0x03 ; 3 1d35c: ef 93 push r30 1d35e: f4 e8 ldi r31, 0x84 ; 132 1d360: ff 93 push r31 1d362: 1f 92 push r1 1d364: 24 e6 ldi r18, 0x64 ; 100 1d366: 2f 93 push r18 1d368: df 92 push r13 1d36a: cf 92 push r12 1d36c: 8f 92 push r8 1d36e: 9f 92 push r9 1d370: af 92 push r10 1d372: bf 92 push r11 1d374: 4a eb ldi r20, 0xBA ; 186 1d376: 50 e9 ldi r21, 0x90 ; 144 1d378: 5f 93 push r21 1d37a: 4f 93 push r20 1d37c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if (!ret && (ad < 720)) 1d380: 0f b6 in r0, 0x3f ; 63 1d382: f8 94 cli 1d384: de bf out 0x3e, r29 ; 62 1d386: 0f be out 0x3f, r0 ; 63 1d388: cd bf out 0x3d, r28 ; 61 1d38a: 89 81 ldd r24, Y+1 ; 0x01 1d38c: 9a 81 ldd r25, Y+2 ; 0x02 1d38e: 80 3d cpi r24, 0xD0 ; 208 1d390: 92 40 sbci r25, 0x02 ; 2 1d392: 08 f4 brcc .+2 ; 0x1d396 1d394: 82 c1 rjmp .+772 ; 0x1d69a if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 1d396: 89 81 ldd r24, Y+1 ; 0x01 1d398: 9a 81 ldd r25, Y+2 ; 0x02 1d39a: 80 3a cpi r24, 0xA0 ; 160 1d39c: 95 40 sbci r25, 0x05 ; 5 1d39e: 10 f0 brcs .+4 ; 0x1d3a4 1d3a0: 0c 94 cd f8 jmp 0x1f19a ; 0x1f19a if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 1d3a4: 9e 01 movw r18, r28 1d3a6: 2f 5f subi r18, 0xFF ; 255 1d3a8: 3f 4f sbci r19, 0xFF ; 255 1d3aa: 79 01 movw r14, r18 1d3ac: 10 e0 ldi r17, 0x00 ; 0 1d3ae: 00 e0 ldi r16, 0x00 ; 0 1d3b0: 2c e7 ldi r18, 0x7C ; 124 1d3b2: 3c ef ldi r19, 0xFC ; 252 1d3b4: a6 01 movw r20, r12 1d3b6: 44 56 subi r20, 0x64 ; 100 1d3b8: 51 09 sbc r21, r1 1d3ba: 69 2d mov r22, r9 1d3bc: 78 2d mov r23, r8 1d3be: 8b 2d mov r24, r11 1d3c0: 9a 2d mov r25, r10 1d3c2: 0f 94 17 95 call 0x32a2e ; 0x32a2e 1d3c6: 88 23 and r24, r24 1d3c8: 11 f4 brne .+4 ; 0x1d3ce 1d3ca: 0c 94 cd f8 jmp 0x1f19a ; 0x1f19a ad += 720; 1d3ce: 89 81 ldd r24, Y+1 ; 0x01 1d3d0: 9a 81 ldd r25, Y+2 ; 0x02 1d3d2: 80 53 subi r24, 0x30 ; 48 1d3d4: 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); 1d3d6: c0 90 6c 07 lds r12, 0x076C ; 0x80076c 1d3da: d0 90 6d 07 lds r13, 0x076D ; 0x80076d 1d3de: e0 90 6e 07 lds r14, 0x076E ; 0x80076e 1d3e2: f0 90 6f 07 lds r15, 0x076F ; 0x80076f 1d3e6: 00 91 68 07 lds r16, 0x0768 ; 0x800768 1d3ea: 10 91 69 07 lds r17, 0x0769 ; 0x800769 1d3ee: 20 91 6a 07 lds r18, 0x076A ; 0x80076a 1d3f2: 30 91 6b 07 lds r19, 0x076B ; 0x80076b 1d3f6: 40 91 64 07 lds r20, 0x0764 ; 0x800764 1d3fa: 50 91 65 07 lds r21, 0x0765 ; 0x800765 1d3fe: 60 91 66 07 lds r22, 0x0766 ; 0x800766 1d402: 70 91 67 07 lds r23, 0x0767 ; 0x800767 1d406: 9f 93 push r25 1d408: 8f 93 push r24 1d40a: df 92 push r13 1d40c: cf 92 push r12 1d40e: 1f 93 push r17 1d410: 0f 93 push r16 1d412: 5f 93 push r21 1d414: 4f 93 push r20 1d416: 8f e1 ldi r24, 0x1F ; 31 1d418: 91 e9 ldi r25, 0x91 ; 145 1d41a: 9f 93 push r25 1d41c: 8f 93 push r24 1d41e: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 /// 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); 1d422: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 1d426: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 1d42a: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 1d42e: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 1d432: 48 54 subi r20, 0x48 ; 72 1d434: 51 09 sbc r21, r1 1d436: 00 e0 ldi r16, 0x00 ; 0 1d438: 28 ec ldi r18, 0xC8 ; 200 1d43a: 30 e0 ldi r19, 0x00 ; 0 1d43c: a3 96 adiw r28, 0x23 ; 35 1d43e: 6f ad ldd r22, Y+63 ; 0x3f 1d440: a3 97 sbiw r28, 0x23 ; 35 1d442: a4 96 adiw r28, 0x24 ; 36 1d444: 7f ad ldd r23, Y+63 ; 0x3f 1d446: a4 97 sbiw r28, 0x24 ; 36 1d448: c2 01 movw r24, r4 1d44a: 0e 94 f4 e1 call 0x1c3e8 ; 0x1c3e8 /// 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; 1d44e: 20 91 64 07 lds r18, 0x0764 ; 0x800764 1d452: 30 91 65 07 lds r19, 0x0765 ; 0x800765 1d456: 40 91 66 07 lds r20, 0x0766 ; 0x800766 1d45a: 50 91 67 07 lds r21, 0x0767 ; 0x800767 1d45e: 6e 96 adiw r28, 0x1e ; 30 1d460: 2c af std Y+60, r18 ; 0x3c 1d462: 3d af std Y+61, r19 ; 0x3d 1d464: 4e af std Y+62, r20 ; 0x3e 1d466: 5f af std Y+63, r21 ; 0x3f 1d468: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 1d46a: 80 91 68 07 lds r24, 0x0768 ; 0x800768 1d46e: 90 91 69 07 lds r25, 0x0769 ; 0x800769 1d472: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 1d476: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 1d47a: ae 96 adiw r28, 0x2e ; 46 1d47c: 8c af std Y+60, r24 ; 0x3c 1d47e: 9d af std Y+61, r25 ; 0x3d 1d480: ae af std Y+62, r26 ; 0x3e 1d482: bf af std Y+63, r27 ; 0x3f 1d484: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 1d486: 20 91 6c 07 lds r18, 0x076C ; 0x80076c 1d48a: 30 91 6d 07 lds r19, 0x076D ; 0x80076d 1d48e: 40 91 6e 07 lds r20, 0x076E ; 0x80076e 1d492: 50 91 6f 07 lds r21, 0x076F ; 0x80076f 1d496: e9 96 adiw r28, 0x39 ; 57 1d498: 2c af std Y+60, r18 ; 0x3c 1d49a: 3d af std Y+61, r19 ; 0x3d 1d49c: 4e af std Y+62, r20 ; 0x3e 1d49e: 5f af std Y+63, r21 ; 0x3f 1d4a0: e9 97 sbiw r28, 0x39 ; 57 1d4a2: a6 e7 ldi r26, 0x76 ; 118 1d4a4: bb e0 ldi r27, 0x0B ; 11 1d4a6: 0f b6 in r0, 0x3f ; 63 1d4a8: f8 94 cli 1d4aa: de bf out 0x3e, r29 ; 62 1d4ac: 0f be out 0x3f, r0 ; 63 1d4ae: cd bf out 0x3d, r28 ; 61 1d4b0: 90 e0 ldi r25, 0x00 ; 0 1d4b2: 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)); 1d4b4: fc 01 movw r30, r24 1d4b6: e6 54 subi r30, 0x46 ; 70 1d4b8: fe 46 sbci r31, 0x6E ; 110 1d4ba: 25 91 lpm r18, Z+ 1d4bc: 34 91 lpm r19, Z 1d4be: 2d 93 st X+, r18 1d4c0: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 1d4c2: fc 01 movw r30, r24 1d4c4: ee 55 subi r30, 0x5E ; 94 1d4c6: fe 46 sbci r31, 0x6E ; 110 1d4c8: 25 91 lpm r18, Z+ 1d4ca: 34 91 lpm r19, Z 1d4cc: 57 96 adiw r26, 0x17 ; 23 1d4ce: 3c 93 st X, r19 1d4d0: 2e 93 st -X, r18 1d4d2: 56 97 sbiw r26, 0x16 ; 22 1d4d4: 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++){ 1d4d6: 88 31 cpi r24, 0x18 ; 24 1d4d8: 91 05 cpc r25, r1 1d4da: 61 f7 brne .-40 ; 0x1d4b4 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); 1d4dc: e7 96 adiw r28, 0x37 ; 55 1d4de: 4e ad ldd r20, Y+62 ; 0x3e 1d4e0: 5f ad ldd r21, Y+63 ; 0x3f 1d4e2: e7 97 sbiw r28, 0x37 ; 55 1d4e4: ac 96 adiw r28, 0x2c ; 44 1d4e6: 6e ad ldd r22, Y+62 ; 0x3e 1d4e8: 7f ad ldd r23, Y+63 ; 0x3f 1d4ea: ac 97 sbiw r28, 0x2c ; 44 1d4ec: 6c 96 adiw r28, 0x1c ; 28 1d4ee: 8e ad ldd r24, Y+62 ; 0x3e 1d4f0: 9f ad ldd r25, Y+63 ; 0x3f 1d4f2: 6c 97 sbiw r28, 0x1c ; 28 1d4f4: 0f 94 9f 91 call 0x3233e ; 0x3233e 1d4f8: 26 e7 ldi r18, 0x76 ; 118 1d4fa: 37 e0 ldi r19, 0x07 ; 7 1d4fc: a4 96 adiw r28, 0x24 ; 36 1d4fe: 3f af std Y+63, r19 ; 0x3f 1d500: 2e af std Y+62, r18 ; 0x3e 1d502: a4 97 sbiw r28, 0x24 ; 36 1d504: 79 01 movw r14, r18 1d506: f0 e2 ldi r31, 0x20 ; 32 1d508: 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]); 1d50a: a5 e6 ldi r26, 0x65 ; 101 1d50c: ca 2e mov r12, r26 1d50e: a1 e9 ldi r26, 0x91 ; 145 1d510: da 2e mov r13, r26 } DBG(endl); 1d512: 0e ef ldi r16, 0xFE ; 254 1d514: 14 ea ldi r17, 0xA4 ; 164 for (uint8_t i = 0; i < 12; i++){ pattern08[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_08 + i)); pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); } xyzcal_scan_pixels_32x32_Zhop(x, y, z, 2400, 200, matrix32); 1d516: 57 01 movw r10, r14 1d518: e0 e2 ldi r30, 0x20 ; 32 1d51a: 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]); 1d51c: d5 01 movw r26, r10 1d51e: 8d 91 ld r24, X+ 1d520: 5d 01 movw r10, r26 1d522: 1f 92 push r1 1d524: 8f 93 push r24 1d526: df 92 push r13 1d528: cf 92 push r12 1d52a: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1d52e: 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){ 1d530: 0f 90 pop r0 1d532: 0f 90 pop r0 1d534: 0f 90 pop r0 1d536: 0f 90 pop r0 1d538: 81 10 cpse r8, r1 1d53a: f0 cf rjmp .-32 ; 0x1d51c DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 1d53c: 1f 93 push r17 1d53e: 0f 93 push r16 1d540: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1d544: 9a 94 dec r9 1d546: b0 e2 ldi r27, 0x20 ; 32 1d548: eb 0e add r14, r27 1d54a: 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){ 1d54c: 0f 90 pop r0 1d54e: 0f 90 pop r0 1d550: 91 10 cpse r9, r1 1d552: e1 cf rjmp .-62 ; 0x1d516 for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 1d554: 1f 93 push r17 1d556: 0f 93 push r16 1d558: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1d55c: 66 e7 ldi r22, 0x76 ; 118 1d55e: 7b e0 ldi r23, 0x0B ; 11 1d560: 0f 90 pop r0 1d562: 0f 90 pop r0 1d564: e6 e7 ldi r30, 0x76 ; 118 1d566: 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; 1d568: 90 e0 ldi r25, 0x00 ; 0 1d56a: 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; 1d56c: 50 e0 ldi r21, 0x00 ; 0 1d56e: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 1d570: 21 91 ld r18, Z+ 1d572: 21 11 cpse r18, r1 1d574: 07 c3 rjmp .+1550 ; 0x1db84 ++mins; 1d576: 4f 5f subi r20, 0xFF ; 255 1d578: 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){ 1d57a: 6e 17 cp r22, r30 1d57c: 7f 07 cpc r23, r31 1d57e: c1 f7 brne .-16 ; 0x1d570 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 1d580: 9a 01 movw r18, r20 1d582: 28 0f add r18, r24 1d584: 39 1f adc r19, r25 1d586: 25 38 cpi r18, 0x85 ; 133 1d588: 33 40 sbci r19, 0x03 ; 3 1d58a: a4 f0 brlt .+40 ; 0x1d5b4 && mins > threshold_extreme 1d58c: 43 33 cpi r20, 0x33 ; 51 1d58e: 51 05 cpc r21, r1 1d590: 8c f0 brlt .+34 ; 0x1d5b4 && maxs > threshold_extreme 1d592: 83 33 cpi r24, 0x33 ; 51 1d594: 91 05 cpc r25, r1 1d596: 74 f0 brlt .+28 ; 0x1d5b4 ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 1d598: 20 e0 ldi r18, 0x00 ; 0 1d59a: 34 e0 ldi r19, 0x04 ; 4 1d59c: 24 1b sub r18, r20 1d59e: 35 0b sbc r19, r21 1d5a0: 28 1b sub r18, r24 1d5a2: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 1d5a4: 24 17 cp r18, r20 1d5a6: 35 07 cpc r19, r21 1d5a8: 2c f4 brge .+10 ; 0x1d5b4 } 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; 1d5aa: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 1d5ac: 28 17 cp r18, r24 1d5ae: 39 07 cpc r19, r25 1d5b0: 0c f4 brge .+2 ; 0x1d5b4 1d5b2: d8 c0 rjmp .+432 ; 0x1d764 } /// 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; 1d5b4: 66 96 adiw r28, 0x16 ; 22 1d5b6: 1f ae std Y+63, r1 ; 0x3f 1d5b8: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 1d5ba: 62 96 adiw r28, 0x12 ; 18 1d5bc: 1f ae std Y+63, r1 ; 0x3f 1d5be: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 1d5c0: 22 96 adiw r28, 0x02 ; 2 1d5c2: 1f ae std Y+63, r1 ; 0x3f 1d5c4: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 1d5c6: 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) 1d5c8: 86 e7 ldi r24, 0x76 ; 118 1d5ca: 97 e0 ldi r25, 0x07 ; 7 1d5cc: 89 2b or r24, r25 1d5ce: 99 f0 breq .+38 ; 0x1d5f6 1d5d0: 86 e7 ldi r24, 0x76 ; 118 1d5d2: 9b e0 ldi r25, 0x0B ; 11 return -1; 1d5d4: 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) 1d5d6: 00 97 sbiw r24, 0x00 ; 0 1d5d8: 49 f0 breq .+18 ; 0x1d5ec 1d5da: ae 01 movw r20, r28 1d5dc: 4f 5a subi r20, 0xAF ; 175 1d5de: 5f 4f sbci r21, 0xFF ; 255 1d5e0: be 01 movw r22, r28 1d5e2: 6b 5a subi r22, 0xAB ; 171 1d5e4: 7f 4f sbci r23, 0xFF ; 255 1d5e6: 0f 94 c2 90 call 0x32184 ; 0x32184 1d5ea: 08 2f mov r16, r24 1d5ec: 8e e8 ldi r24, 0x8E ; 142 1d5ee: 9b e0 ldi r25, 0x0B ; 11 1d5f0: 89 2b or r24, r25 1d5f2: 09 f0 breq .+2 ; 0x1d5f6 1d5f4: cc c2 rjmp .+1432 ; 0x1db8e 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; 1d5f6: 8f ef ldi r24, 0xFF ; 255 1d5f8: dc c2 rjmp .+1464 ; 0x1dbb2 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)); 1d5fa: 83 ec ldi r24, 0xC3 ; 195 1d5fc: 98 e4 ldi r25, 0x48 ; 72 1d5fe: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1d602: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_puts_at_P(0,3,_n("1/4")); 1d606: 4f e8 ldi r20, 0x8F ; 143 1d608: 5e e6 ldi r21, 0x6E ; 110 1d60a: 23 cd rjmp .-1466 ; 0x1d052 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 1d60c: 80 e5 ldi r24, 0x50 ; 80 1d60e: 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); 1d610: 0f 94 0c 36 call 0x26c18 ; 0x26c18 1d614: 06 cd rjmp .-1524 ; 0x1d022 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); 1d616: c7 55 subi r28, 0x57 ; 87 1d618: df 4f sbci r29, 0xFF ; 255 1d61a: 88 81 ld r24, Y 1d61c: 99 81 ldd r25, Y+1 ; 0x01 1d61e: c9 5a subi r28, 0xA9 ; 169 1d620: d0 40 sbci r29, 0x00 ; 0 1d622: 0e 94 83 67 call 0xcf06 ; 0xcf06 // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 1d626: 0f 94 15 cc call 0x3982a ; 0x3982a // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 1d62a: 0f 94 b3 c9 call 0x39366 ; 0x39366 //FIXME bool result = sample_mesh_and_store_reference(); 1d62e: 0f 94 c2 c7 call 0x38f84 ; 0x38f84 1d632: e5 96 adiw r28, 0x35 ; 53 1d634: 8f af std Y+63, r24 ; 0x3f 1d636: e5 97 sbiw r28, 0x35 ; 53 if (result) 1d638: 88 23 and r24, r24 1d63a: 09 f4 brne .+2 ; 0x1d63e 1d63c: f2 cc rjmp .-1564 ; 0x1d022 { calibration_status_set(CALIBRATION_STATUS_Z); 1d63e: 84 e0 ldi r24, 0x04 ; 4 1d640: 0e 94 66 e7 call 0x1cecc ; 0x1cecc } else { // Timeouted. } lcd_update_enable(true); 1d644: 81 e0 ldi r24, 0x01 ; 1 1d646: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 #ifdef TMC2130 FORCE_HIGH_POWER_END; 1d64a: 80 e0 ldi r24, 0x00 ; 0 1d64c: 0e 94 65 67 call 0xceca ; 0xceca #endif // TMC2130 FORCE_BL_ON_END; 1d650: 80 e0 ldi r24, 0x00 ; 0 1d652: 0e 94 7c 8b call 0x116f8 ; 0x116f8 return final_result; } 1d656: e5 96 adiw r28, 0x35 ; 53 1d658: 8f ad ldd r24, Y+63 ; 0x3f 1d65a: e5 97 sbiw r28, 0x35 ; 53 1d65c: c2 53 subi r28, 0x32 ; 50 1d65e: df 4f sbci r29, 0xFF ; 255 1d660: 0f b6 in r0, 0x3f ; 63 1d662: f8 94 cli 1d664: de bf out 0x3e, r29 ; 62 1d666: 0f be out 0x3f, r0 ; 63 1d668: cd bf out 0x3d, r28 ; 61 1d66a: df 91 pop r29 1d66c: cf 91 pop r28 1d66e: 1f 91 pop r17 1d670: 0f 91 pop r16 1d672: ff 90 pop r15 1d674: ef 90 pop r14 1d676: df 90 pop r13 1d678: cf 90 pop r12 1d67a: bf 90 pop r11 1d67c: af 90 pop r10 1d67e: 9f 90 pop r9 1d680: 8f 90 pop r8 1d682: 7f 90 pop r7 1d684: 6f 90 pop r6 1d686: 5f 90 pop r5 1d688: 4f 90 pop r4 1d68a: 3f 90 pop r3 1d68c: 2f 90 pop r2 1d68e: 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) { 1d690: e1 e0 ldi r30, 0x01 ; 1 1d692: e1 96 adiw r28, 0x31 ; 49 1d694: ef af std Y+63, r30 ; 0x3f 1d696: e1 97 sbiw r28, 0x31 ; 49 1d698: 76 cd rjmp .-1300 ; 0x1d186 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) 1d69a: fe 01 movw r30, r28 1d69c: 31 96 adiw r30, 0x01 ; 1 1d69e: 7f 01 movw r14, r30 1d6a0: 10 e0 ldi r17, 0x00 ; 0 1d6a2: 00 e0 ldi r16, 0x00 ; 0 1d6a4: 24 e8 ldi r18, 0x84 ; 132 1d6a6: 33 e0 ldi r19, 0x03 ; 3 1d6a8: a6 01 movw r20, r12 1d6aa: 69 2d mov r22, r9 1d6ac: 78 2d mov r23, r8 1d6ae: 8b 2d mov r24, r11 1d6b0: 9a 2d mov r25, r10 1d6b2: 0f 94 17 95 call 0x32a2e ; 0x32a2e ad += 0; if (!ret && (ad < 1440)) 1d6b6: 88 23 and r24, r24 1d6b8: 09 f4 brne .+2 ; 0x1d6bc 1d6ba: 6d ce rjmp .-806 ; 0x1d396 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; 1d6bc: 89 81 ldd r24, Y+1 ; 0x01 1d6be: 9a 81 ldd r25, Y+2 ; 0x02 1d6c0: 8a ce rjmp .-748 ; 0x1d3d6 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)) 1d6c2: 89 81 ldd r24, Y+1 ; 0x01 1d6c4: 9a 81 ldd r25, Y+2 ; 0x02 1d6c6: 80 34 cpi r24, 0x40 ; 64 1d6c8: 9b 40 sbci r25, 0x0B ; 11 1d6ca: b8 f4 brcc .+46 ; 0x1d6fa if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 1d6cc: ce 01 movw r24, r28 1d6ce: 01 96 adiw r24, 0x01 ; 1 1d6d0: 7c 01 movw r14, r24 1d6d2: 04 eb ldi r16, 0xB4 ; 180 1d6d4: 10 e0 ldi r17, 0x00 ; 0 1d6d6: 2c e7 ldi r18, 0x7C ; 124 1d6d8: 3c ef ldi r19, 0xFC ; 252 1d6da: a6 01 movw r20, r12 1d6dc: 4c 52 subi r20, 0x2C ; 44 1d6de: 51 40 sbci r21, 0x01 ; 1 1d6e0: 69 2d mov r22, r9 1d6e2: 78 2d mov r23, r8 1d6e4: 8b 2d mov r24, r11 1d6e6: 9a 2d mov r25, r10 1d6e8: 0f 94 17 95 call 0x32a2e ; 0x32a2e 1d6ec: 88 23 and r24, r24 1d6ee: 29 f0 breq .+10 ; 0x1d6fa ad += 2160; 1d6f0: 89 81 ldd r24, Y+1 ; 0x01 1d6f2: 9a 81 ldd r25, Y+2 ; 0x02 1d6f4: 80 59 subi r24, 0x90 ; 144 1d6f6: 97 4f sbci r25, 0xF7 ; 247 1d6f8: 6e ce rjmp .-804 ; 0x1d3d6 /// 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; 1d6fa: 90 e9 ldi r25, 0x90 ; 144 1d6fc: c9 1a sub r12, r25 1d6fe: 91 e0 ldi r25, 0x01 ; 1 1d700: d9 0a sbc r13, r25 1d702: 21 ce rjmp .-958 ; 0x1d346 } //@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]); 1d704: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 1d708: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 1d70c: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 1d710: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 1d714: 40 91 68 07 lds r20, 0x0768 ; 0x800768 1d718: 50 91 69 07 lds r21, 0x0769 ; 0x800769 1d71c: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 1d720: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 1d724: 80 91 64 07 lds r24, 0x0764 ; 0x800764 1d728: 90 91 65 07 lds r25, 0x0765 ; 0x800765 1d72c: a0 91 66 07 lds r26, 0x0766 ; 0x800766 1d730: b0 91 67 07 lds r27, 0x0767 ; 0x800767 1d734: 3f 93 push r19 1d736: 2f 93 push r18 1d738: 1f 93 push r17 1d73a: 0f 93 push r16 1d73c: 7f 93 push r23 1d73e: 6f 93 push r22 1d740: 5f 93 push r21 1d742: 4f 93 push r20 1d744: bf 93 push r27 1d746: af 93 push r26 1d748: 9f 93 push r25 1d74a: 8f 93 push r24 1d74c: 82 ef ldi r24, 0xF2 ; 242 1d74e: 90 e9 ldi r25, 0x90 ; 144 1d750: 9f 93 push r25 1d752: 8f 93 push r24 1d754: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1d758: 0f b6 in r0, 0x3f ; 63 1d75a: f8 94 cli 1d75c: de bf out 0x3e, r29 ; 62 1d75e: 0f be out 0x3f, r0 ; 63 1d760: 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; 1d762: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 1d764: 82 ed ldi r24, 0xD2 ; 210 1d766: 91 e9 ldi r25, 0x91 ; 145 1d768: 9f 93 push r25 1d76a: 8f 93 push r24 1d76c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 lcd_set_cursor(4,3); 1d770: 63 e0 ldi r22, 0x03 ; 3 1d772: 84 e0 ldi r24, 0x04 ; 4 1d774: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_space(16); 1d778: 80 e1 ldi r24, 0x10 ; 16 1d77a: 0e 94 8b 6f call 0xdf16 ; 0xdf16 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 1d77e: 0f 94 c6 ba call 0x3758c ; 0x3758c : "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" ); 1d782: 88 e1 ldi r24, 0x18 ; 24 1d784: 98 e2 ldi r25, 0x28 ; 40 1d786: 0f b6 in r0, 0x3f ; 63 1d788: f8 94 cli 1d78a: a8 95 wdr 1d78c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d790: 0f be out 0x3f, r0 ; 63 1d792: 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); 1d796: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d79a: 80 64 ori r24, 0x40 ; 64 1d79c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 1d7a0: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1d7a4: 82 60 ori r24, 0x02 ; 2 1d7a6: 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){ 1d7aa: 0f 90 pop r0 1d7ac: 0f 90 pop r0 1d7ae: 1d 3f cpi r17, 0xFD ; 253 1d7b0: 09 f4 brne .+2 ; 0x1d7b4 1d7b2: 64 c3 rjmp .+1736 ; 0x1de7c 1d7b4: 1f 3f cpi r17, 0xFF ; 255 1d7b6: 11 f4 brne .+4 ; 0x1d7bc 1d7b8: 0c 94 89 f8 jmp 0x1f112 ; 0x1f112 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); 1d7bc: 20 e0 ldi r18, 0x00 ; 0 1d7be: 30 e0 ldi r19, 0x00 ; 0 1d7c0: a9 01 movw r20, r18 1d7c2: a0 96 adiw r28, 0x20 ; 32 1d7c4: ee ad ldd r30, Y+62 ; 0x3e 1d7c6: ff ad ldd r31, Y+63 ; 0x3f 1d7c8: a0 97 sbiw r28, 0x20 ; 32 1d7ca: 61 81 ldd r22, Z+1 ; 0x01 1d7cc: 72 81 ldd r23, Z+2 ; 0x02 1d7ce: 83 81 ldd r24, Z+3 ; 0x03 1d7d0: 94 81 ldd r25, Z+4 ; 0x04 1d7d2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 1d7d6: 20 91 43 07 lds r18, 0x0743 ; 0x800743 1d7da: 30 91 44 07 lds r19, 0x0744 ; 0x800744 1d7de: 40 91 45 07 lds r20, 0x0745 ; 0x800745 1d7e2: 50 91 46 07 lds r21, 0x0746 ; 0x800746 1d7e6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1d7ea: a0 96 adiw r28, 0x20 ; 32 1d7ec: ae ad ldd r26, Y+62 ; 0x3e 1d7ee: bf ad ldd r27, Y+63 ; 0x3f 1d7f0: a0 97 sbiw r28, 0x20 ; 32 1d7f2: 11 96 adiw r26, 0x01 ; 1 1d7f4: 6d 93 st X+, r22 1d7f6: 7d 93 st X+, r23 1d7f8: 8d 93 st X+, r24 1d7fa: 9c 93 st X, r25 1d7fc: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d7fe: c0 90 47 07 lds r12, 0x0747 ; 0x800747 1d802: d0 90 48 07 lds r13, 0x0748 ; 0x800748 1d806: e0 90 49 07 lds r14, 0x0749 ; 0x800749 1d80a: f0 90 4a 07 lds r15, 0x074A ; 0x80074a MYSERIAL.println(current_position[Y_AXIS]); } #endif // SUPPORT_VERBOSITY pt[0] = (pt[0] * iteration) / (iteration + 1); pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average pt[1] = (pt[1] * iteration) / (iteration + 1); 1d80e: 20 e0 ldi r18, 0x00 ; 0 1d810: 30 e0 ldi r19, 0x00 ; 0 1d812: a9 01 movw r20, r18 1d814: 15 96 adiw r26, 0x05 ; 5 1d816: 6d 91 ld r22, X+ 1d818: 7d 91 ld r23, X+ 1d81a: 8d 91 ld r24, X+ 1d81c: 9c 91 ld r25, X 1d81e: 18 97 sbiw r26, 0x08 ; 8 1d820: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 1d824: a7 01 movw r20, r14 1d826: 96 01 movw r18, r12 1d828: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1d82c: a0 96 adiw r28, 0x20 ; 32 1d82e: ee ad ldd r30, Y+62 ; 0x3e 1d830: ff ad ldd r31, Y+63 ; 0x3f 1d832: a0 97 sbiw r28, 0x20 ; 32 1d834: 65 83 std Z+5, r22 ; 0x05 1d836: 76 83 std Z+6, r23 ; 0x06 1d838: 87 83 std Z+7, r24 ; 0x07 1d83a: 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) 1d83c: 20 e0 ldi r18, 0x00 ; 0 1d83e: 30 e0 ldi r19, 0x00 ; 0 1d840: 40 e8 ldi r20, 0x80 ; 128 1d842: 50 ec ldi r21, 0xC0 ; 192 1d844: c7 01 movw r24, r14 1d846: b6 01 movw r22, r12 1d848: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1d84c: 87 ff sbrs r24, 7 1d84e: 0c c0 rjmp .+24 ; 0x1d868 current_position[Y_AXIS] = Y_MIN_POS; 1d850: 80 e0 ldi r24, 0x00 ; 0 1d852: 90 e0 ldi r25, 0x00 ; 0 1d854: a0 e8 ldi r26, 0x80 ; 128 1d856: b0 ec ldi r27, 0xC0 ; 192 1d858: 80 93 47 07 sts 0x0747, r24 ; 0x800747 1d85c: 90 93 48 07 sts 0x0748, r25 ; 0x800748 1d860: a0 93 49 07 sts 0x0749, r26 ; 0x800749 1d864: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a // Start searching for the other points at 3mm above the last point. current_position[Z_AXIS] += 3.f + FIND_BED_INDUCTION_SENSOR_POINT_Z_STEP * iteration * 0.3; 1d868: 20 e0 ldi r18, 0x00 ; 0 1d86a: 30 e0 ldi r19, 0x00 ; 0 1d86c: 40 e4 ldi r20, 0x40 ; 64 1d86e: 50 e4 ldi r21, 0x40 ; 64 1d870: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 1d874: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 1d878: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 1d87c: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 1d880: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1d884: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 1d888: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 1d88c: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 1d890: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e 1d894: e0 96 adiw r28, 0x30 ; 48 1d896: 2e ad ldd r18, Y+62 ; 0x3e 1d898: 3f ad ldd r19, Y+63 ; 0x3f 1d89a: e0 97 sbiw r28, 0x30 ; 48 1d89c: 28 5f subi r18, 0xF8 ; 248 1d89e: 3f 4f sbci r19, 0xFF ; 255 1d8a0: e0 96 adiw r28, 0x30 ; 48 1d8a2: 3f af std Y+63, r19 ; 0x3f 1d8a4: 2e af std Y+62, r18 ; 0x3e 1d8a6: e0 97 sbiw r28, 0x30 ; 48 1d8a8: a0 96 adiw r28, 0x20 ; 32 1d8aa: 4e ad ldd r20, Y+62 ; 0x3e 1d8ac: 5f ad ldd r21, Y+63 ; 0x3f 1d8ae: a0 97 sbiw r28, 0x20 ; 32 1d8b0: 48 5f subi r20, 0xF8 ; 248 1d8b2: 5f 4f sbci r21, 0xFF ; 255 1d8b4: a0 96 adiw r28, 0x20 ; 32 1d8b6: 5f af std Y+63, r21 ; 0x3f 1d8b8: 4e af std Y+62, r20 ; 0x3e 1d8ba: 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) { 1d8bc: 54 e0 ldi r21, 0x04 ; 4 1d8be: 25 16 cp r2, r21 1d8c0: 31 04 cpc r3, r1 1d8c2: 09 f0 breq .+2 ; 0x1d8c6 1d8c4: 7d cc rjmp .-1798 ; 0x1d1c0 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 1d8c6: a7 96 adiw r28, 0x27 ; 39 1d8c8: 6f ad ldd r22, Y+63 ; 0x3f 1d8ca: a7 97 sbiw r28, 0x27 ; 39 1d8cc: 66 23 and r22, r22 1d8ce: 31 f0 breq .+12 ; 0x1d8dc 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) { 1d8d0: e1 96 adiw r28, 0x31 ; 49 1d8d2: 8f ad ldd r24, Y+63 ; 0x3f 1d8d4: e1 97 sbiw r28, 0x31 ; 49 1d8d6: 81 30 cpi r24, 0x01 ; 1 1d8d8: 09 f0 breq .+2 ; 0x1d8dc 1d8da: da ce rjmp .-588 ; 0x1d690 #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 1d8dc: 8a e6 ldi r24, 0x6A ; 106 1d8de: 9e e6 ldi r25, 0x6E ; 110 1d8e0: 9f 93 push r25 1d8e2: 8f 93 push r24 1d8e4: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1d8e8: 90 e0 ldi r25, 0x00 ; 0 1d8ea: 80 e0 ldi r24, 0x00 ; 0 1d8ec: 0e 94 87 8e call 0x11d0e ; 0x11d0e 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) { 1d8f0: 0f 90 pop r0 1d8f2: 0f 90 pop r0 1d8f4: 20 e0 ldi r18, 0x00 ; 0 1d8f6: 30 e0 ldi r19, 0x00 ; 0 1d8f8: 40 e9 ldi r20, 0x90 ; 144 1d8fa: 50 ec ldi r21, 0xC0 ; 192 1d8fc: 60 91 a5 13 lds r22, 0x13A5 ; 0x8013a5 1d900: 70 91 a6 13 lds r23, 0x13A6 ; 0x8013a6 1d904: 80 91 a7 13 lds r24, 0x13A7 ; 0x8013a7 1d908: 90 91 a8 13 lds r25, 0x13A8 ; 0x8013a8 1d90c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1d910: 87 ff sbrs r24, 7 1d912: bb c2 rjmp .+1398 ; 0x1de8a too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 1d914: 8e e1 ldi r24, 0x1E ; 30 1d916: 92 e9 ldi r25, 0x92 ; 146 1d918: 0e 94 06 7b call 0xf60c ; 0xf60c SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 1d91c: 8c ee ldi r24, 0xEC ; 236 1d91e: 91 e9 ldi r25, 0x91 ; 145 1d920: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1d924: 60 91 a5 13 lds r22, 0x13A5 ; 0x8013a5 1d928: 70 91 a6 13 lds r23, 0x13A6 ; 0x8013a6 1d92c: 80 91 a7 13 lds r24, 0x13A7 ; 0x8013a7 1d930: 90 91 a8 13 lds r25, 0x13A8 ; 0x8013a8 1d934: 42 e0 ldi r20, 0x02 ; 2 1d936: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 1d93a: 88 ee ldi r24, 0xE8 ; 232 1d93c: 91 e9 ldi r25, 0x91 ; 145 1d93e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 1d942: 60 e0 ldi r22, 0x00 ; 0 1d944: 70 e0 ldi r23, 0x00 ; 0 1d946: 80 e9 ldi r24, 0x90 ; 144 1d948: 90 ec ldi r25, 0xC0 ; 192 1d94a: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 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 1d94e: 92 e0 ldi r25, 0x02 ; 2 1d950: af 96 adiw r28, 0x2f ; 47 1d952: 9f af std Y+63, r25 ; 0x3f 1d954: 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; 1d956: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 1d95a: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1d95e: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1d962: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 cntr[1] = 0.f; 1d966: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1d96a: 10 92 d6 13 sts 0x13D6, r1 ; 0x8013d6 1d96e: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 1d972: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 1d976: a4 e6 ldi r26, 0x64 ; 100 1d978: e6 96 adiw r28, 0x36 ; 54 1d97a: af af std Y+63, r26 ; 0x3f 1d97c: 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; 1d97e: a2 96 adiw r28, 0x22 ; 34 1d980: 1c ae std Y+60, r1 ; 0x3c 1d982: 1d ae std Y+61, r1 ; 0x3d 1d984: 1e ae std Y+62, r1 ; 0x3e 1d986: 1f ae std Y+63, r1 ; 0x3f 1d988: 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; 1d98a: a6 96 adiw r28, 0x26 ; 38 1d98c: 1c ae std Y+60, r1 ; 0x3c 1d98e: 1d ae std Y+61, r1 ; 0x3d 1d990: 1e ae std Y+62, r1 ; 0x3e 1d992: 1f ae std Y+63, r1 ; 0x3f 1d994: 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 }; 1d996: fe 01 movw r30, r28 1d998: 31 96 adiw r30, 0x01 ; 1 1d99a: 68 96 adiw r28, 0x18 ; 24 1d99c: ff af std Y+63, r31 ; 0x3f 1d99e: ee af std Y+62, r30 ; 0x3e 1d9a0: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 1d9a2: 9e 01 movw r18, r28 1d9a4: 2f 5b subi r18, 0xBF ; 191 1d9a6: 3f 4f sbci r19, 0xFF ; 255 1d9a8: 6a 96 adiw r28, 0x1a ; 26 1d9aa: 3f af std Y+63, r19 ; 0x3f 1d9ac: 2e af std Y+62, r18 ; 0x3e 1d9ae: 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; 1d9b0: a6 96 adiw r28, 0x26 ; 38 1d9b2: 6c ad ldd r22, Y+60 ; 0x3c 1d9b4: 7d ad ldd r23, Y+61 ; 0x3d 1d9b6: 8e ad ldd r24, Y+62 ; 0x3e 1d9b8: 9f ad ldd r25, Y+63 ; 0x3f 1d9ba: a6 97 sbiw r28, 0x26 ; 38 1d9bc: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 1d9c0: 6e 96 adiw r28, 0x1e ; 30 1d9c2: 6c af std Y+60, r22 ; 0x3c 1d9c4: 7d af std Y+61, r23 ; 0x3d 1d9c6: 8e af std Y+62, r24 ; 0x3e 1d9c8: 9f af std Y+63, r25 ; 0x3f 1d9ca: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 1d9cc: a6 96 adiw r28, 0x26 ; 38 1d9ce: 6c ad ldd r22, Y+60 ; 0x3c 1d9d0: 7d ad ldd r23, Y+61 ; 0x3d 1d9d2: 8e ad ldd r24, Y+62 ; 0x3e 1d9d4: 9f ad ldd r25, Y+63 ; 0x3f 1d9d6: a6 97 sbiw r28, 0x26 ; 38 1d9d8: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 1d9dc: cb 57 subi r28, 0x7B ; 123 1d9de: df 4f sbci r29, 0xFF ; 255 1d9e0: 68 83 st Y, r22 1d9e2: 79 83 std Y+1, r23 ; 0x01 1d9e4: 8a 83 std Y+2, r24 ; 0x02 1d9e6: 9b 83 std Y+3, r25 ; 0x03 1d9e8: c5 58 subi r28, 0x85 ; 133 1d9ea: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 1d9ec: a2 96 adiw r28, 0x22 ; 34 1d9ee: 6c ad ldd r22, Y+60 ; 0x3c 1d9f0: 7d ad ldd r23, Y+61 ; 0x3d 1d9f2: 8e ad ldd r24, Y+62 ; 0x3e 1d9f4: 9f ad ldd r25, Y+63 ; 0x3f 1d9f6: a2 97 sbiw r28, 0x22 ; 34 1d9f8: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 1d9fc: c7 57 subi r28, 0x77 ; 119 1d9fe: df 4f sbci r29, 0xFF ; 255 1da00: 68 83 st Y, r22 1da02: 79 83 std Y+1, r23 ; 0x01 1da04: 8a 83 std Y+2, r24 ; 0x02 1da06: 9b 83 std Y+3, r25 ; 0x03 1da08: c9 58 subi r28, 0x89 ; 137 1da0a: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 1da0c: a2 96 adiw r28, 0x22 ; 34 1da0e: 6c ad ldd r22, Y+60 ; 0x3c 1da10: 7d ad ldd r23, Y+61 ; 0x3d 1da12: 8e ad ldd r24, Y+62 ; 0x3e 1da14: 9f ad ldd r25, Y+63 ; 0x3f 1da16: a2 97 sbiw r28, 0x22 ; 34 1da18: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 1da1c: cb 56 subi r28, 0x6B ; 107 1da1e: df 4f sbci r29, 0xFF ; 255 1da20: 68 83 st Y, r22 1da22: 79 83 std Y+1, r23 ; 0x01 1da24: 8a 83 std Y+2, r24 ; 0x02 1da26: 9b 83 std Y+3, r25 ; 0x03 1da28: c5 59 subi r28, 0x95 ; 149 1da2a: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 1da2c: 68 96 adiw r28, 0x18 ; 24 1da2e: ae ad ldd r26, Y+62 ; 0x3e 1da30: bf ad ldd r27, Y+63 ; 0x3f 1da32: 68 97 sbiw r28, 0x18 ; 24 1da34: e0 e4 ldi r30, 0x40 ; 64 1da36: 1d 92 st X+, r1 1da38: ea 95 dec r30 1da3a: e9 f7 brne .-6 ; 0x1da36 float b[4] = { 0.f }; 1da3c: 80 e1 ldi r24, 0x10 ; 16 1da3e: 6a 96 adiw r28, 0x1a ; 26 1da40: ae ad ldd r26, Y+62 ; 0x3e 1da42: bf ad ldd r27, Y+63 ; 0x3f 1da44: 6a 97 sbiw r28, 0x1a ; 26 1da46: 1d 92 st X+, r1 1da48: 8a 95 dec r24 1da4a: e9 f7 brne .-6 ; 0x1da46 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 1da4c: 90 e0 ldi r25, 0x00 ; 0 1da4e: 80 e0 ldi r24, 0x00 ; 0 1da50: 0e 94 87 8e call 0x11d0e ; 0x11d0e 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); 1da54: 20 91 d1 13 lds r18, 0x13D1 ; 0x8013d1 1da58: 30 91 d2 13 lds r19, 0x13D2 ; 0x8013d2 1da5c: 40 91 d3 13 lds r20, 0x13D3 ; 0x8013d3 1da60: 50 91 d4 13 lds r21, 0x13D4 ; 0x8013d4 1da64: c5 55 subi r28, 0x55 ; 85 1da66: df 4f sbci r29, 0xFF ; 255 1da68: 28 83 st Y, r18 1da6a: 39 83 std Y+1, r19 ; 0x01 1da6c: 4a 83 std Y+2, r20 ; 0x02 1da6e: 5b 83 std Y+3, r21 ; 0x03 1da70: cb 5a subi r28, 0xAB ; 171 1da72: 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); 1da74: 80 91 d5 13 lds r24, 0x13D5 ; 0x8013d5 1da78: 90 91 d6 13 lds r25, 0x13D6 ; 0x8013d6 1da7c: a0 91 d7 13 lds r26, 0x13D7 ; 0x8013d7 1da80: b0 91 d8 13 lds r27, 0x13D8 ; 0x8013d8 1da84: c1 55 subi r28, 0x51 ; 81 1da86: df 4f sbci r29, 0xFF ; 255 1da88: 88 83 st Y, r24 1da8a: 99 83 std Y+1, r25 ; 0x01 1da8c: aa 83 std Y+2, r26 ; 0x02 1da8e: bb 83 std Y+3, r27 ; 0x03 1da90: cf 5a subi r28, 0xAF ; 175 1da92: d0 40 sbci r29, 0x00 ; 0 1da94: de 01 movw r26, r28 1da96: af 5b subi r26, 0xBF ; 191 1da98: bf 4f sbci r27, 0xFF ; 255 1da9a: c7 56 subi r28, 0x67 ; 103 1da9c: df 4f sbci r29, 0xFF ; 255 1da9e: b9 83 std Y+1, r27 ; 0x01 1daa0: a8 83 st Y, r26 1daa2: c9 59 subi r28, 0x99 ; 153 1daa4: d0 40 sbci r29, 0x00 ; 0 1daa6: fe 01 movw r30, r28 1daa8: 31 96 adiw r30, 0x01 ; 1 1daaa: ac 96 adiw r28, 0x2c ; 44 1daac: ff af std Y+63, r31 ; 0x3f 1daae: ee af std Y+62, r30 ; 0x3e 1dab0: 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) { 1dab2: 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])); 1dab4: cb 56 subi r28, 0x6B ; 107 1dab6: df 4f sbci r29, 0xFF ; 255 1dab8: 28 81 ld r18, Y 1daba: 39 81 ldd r19, Y+1 ; 0x01 1dabc: 4a 81 ldd r20, Y+2 ; 0x02 1dabe: 5b 81 ldd r21, Y+3 ; 0x03 1dac0: c5 59 subi r28, 0x95 ; 149 1dac2: d0 40 sbci r29, 0x00 ; 0 1dac4: 50 58 subi r21, 0x80 ; 128 1dac6: ed 96 adiw r28, 0x3d ; 61 1dac8: 2c af std Y+60, r18 ; 0x3c 1daca: 3d af std Y+61, r19 ; 0x3d 1dacc: 4e af std Y+62, r20 ; 0x3e 1dace: 5f af std Y+63, r21 ; 0x3f 1dad0: 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])); 1dad2: c7 57 subi r28, 0x77 ; 119 1dad4: df 4f sbci r29, 0xFF ; 255 1dad6: 88 81 ld r24, Y 1dad8: 99 81 ldd r25, Y+1 ; 0x01 1dada: aa 81 ldd r26, Y+2 ; 0x02 1dadc: bb 81 ldd r27, Y+3 ; 0x03 1dade: c9 58 subi r28, 0x89 ; 137 1dae0: d0 40 sbci r29, 0x00 ; 0 1dae2: b0 58 subi r27, 0x80 ; 128 1dae4: c3 58 subi r28, 0x83 ; 131 1dae6: df 4f sbci r29, 0xFF ; 255 1dae8: 88 83 st Y, r24 1daea: 99 83 std Y+1, r25 ; 0x01 1daec: aa 83 std Y+2, r26 ; 0x02 1daee: bb 83 std Y+3, r27 ; 0x03 1daf0: cd 57 subi r28, 0x7D ; 125 1daf2: 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]) : 1daf4: cb 57 subi r28, 0x7B ; 123 1daf6: df 4f sbci r29, 0xFF ; 255 1daf8: 28 81 ld r18, Y 1dafa: 39 81 ldd r19, Y+1 ; 0x01 1dafc: 4a 81 ldd r20, Y+2 ; 0x02 1dafe: 5b 81 ldd r21, Y+3 ; 0x03 1db00: c5 58 subi r28, 0x85 ; 133 1db02: d0 40 sbci r29, 0x00 ; 0 1db04: 50 58 subi r21, 0x80 ; 128 1db06: cf 57 subi r28, 0x7F ; 127 1db08: df 4f sbci r29, 0xFF ; 255 1db0a: 28 83 st Y, r18 1db0c: 39 83 std Y+1, r19 ; 0x01 1db0e: 4a 83 std Y+2, r20 ; 0x02 1db10: 5b 83 std Y+3, r21 ; 0x03 1db12: c1 58 subi r28, 0x81 ; 129 1db14: 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) { 1db16: ac 96 adiw r28, 0x2c ; 44 1db18: 2e ac ldd r2, Y+62 ; 0x3e 1db1a: 3f ac ldd r3, Y+63 ; 0x3f 1db1c: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 1db1e: 10 e0 ldi r17, 0x00 ; 0 1db20: 60 ea ldi r22, 0xA0 ; 160 1db22: 46 2e mov r4, r22 1db24: 63 e1 ldi r22, 0x13 ; 19 1db26: 56 2e mov r5, r22 1db28: 74 e0 ldi r23, 0x04 ; 4 1db2a: 77 2e mov r7, r23 acc = 0; 1db2c: c1 2c mov r12, r1 1db2e: d1 2c mov r13, r1 1db30: 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) { 1db32: 01 30 cpi r16, 0x01 ; 1 1db34: 11 f4 brne .+4 ; 0x1db3a 1db36: 0c 94 41 f9 jmp 0x1f282 ; 0x1f282 1db3a: 11 30 cpi r17, 0x01 ; 1 1db3c: 11 f4 brne .+4 ; 0x1db42 1db3e: 0c 94 ef f8 jmp 0x1f1de ; 0x1f1de float a = (r == 0) ? 1.f : 1db42: 00 23 and r16, r16 1db44: 11 f4 brne .+4 ; 0x1db4a 1db46: 0c 94 2f f9 jmp 0x1f25e ; 0x1f25e ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1db4a: 02 30 cpi r16, 0x02 ; 2 1db4c: 09 f0 breq .+2 ; 0x1db50 1db4e: a1 c1 rjmp .+834 ; 0x1de92 1db50: d2 01 movw r26, r4 1db52: 11 96 adiw r26, 0x01 ; 1 1db54: 2d 91 ld r18, X+ 1db56: 3d 91 ld r19, X+ 1db58: 4d 91 ld r20, X+ 1db5a: 5c 91 ld r21, X 1db5c: 14 97 sbiw r26, 0x04 ; 4 1db5e: cf 57 subi r28, 0x7F ; 127 1db60: df 4f sbci r29, 0xFF ; 255 1db62: 68 81 ld r22, Y 1db64: 79 81 ldd r23, Y+1 ; 0x01 1db66: 8a 81 ldd r24, Y+2 ; 0x02 1db68: 9b 81 ldd r25, Y+3 ; 0x03 1db6a: c1 58 subi r28, 0x81 ; 129 1db6c: d0 40 sbci r29, 0x00 ; 0 1db6e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1db72: 4b 01 movw r8, r22 1db74: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1db76: 11 11 cpse r17, r1 1db78: 9a c1 rjmp .+820 ; 0x1deae 1db7a: 60 e0 ldi r22, 0x00 ; 0 1db7c: 70 e0 ldi r23, 0x00 ; 0 1db7e: 80 e8 ldi r24, 0x80 ; 128 1db80: 9f e3 ldi r25, 0x3F ; 63 1db82: aa c1 rjmp .+852 ; 0x1ded8 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 1db84: 2f 3f cpi r18, 0xFF ; 255 1db86: 09 f0 breq .+2 ; 0x1db8a 1db88: f8 cc rjmp .-1552 ; 0x1d57a ++maxs; 1db8a: 01 96 adiw r24, 0x01 ; 1 1db8c: f6 cc rjmp .-1556 ; 0x1d57a 1db8e: ae 01 movw r20, r28 1db90: 4f 5f subi r20, 0xFF ; 255 1db92: 5f 4f sbci r21, 0xFF ; 255 1db94: be 01 movw r22, r28 1db96: 6f 5b subi r22, 0xBF ; 191 1db98: 7f 4f sbci r23, 0xFF ; 255 1db9a: 8e e8 ldi r24, 0x8E ; 142 1db9c: 9b e0 ldi r25, 0x0B ; 11 1db9e: 0f 94 c2 90 call 0x32184 ; 0x32184 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; 1dba2: 66 96 adiw r28, 0x16 ; 22 1dba4: 6f ad ldd r22, Y+63 ; 0x3f 1dba6: 66 97 sbiw r28, 0x16 ; 22 row = r08; 1dba8: 62 96 adiw r28, 0x12 ; 18 1dbaa: 1f ad ldd r17, Y+63 ; 0x3f 1dbac: 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){ 1dbae: 80 17 cp r24, r16 1dbb0: 28 f0 brcs .+10 ; 0x1dbbc col = c08; row = r08; return match08; } col = c10; 1dbb2: 22 96 adiw r28, 0x02 ; 2 1dbb4: 6f ad ldd r22, Y+63 ; 0x3f 1dbb6: 22 97 sbiw r28, 0x02 ; 2 row = r10; 1dbb8: 19 81 ldd r17, Y+1 ; 0x01 1dbba: 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){ 1dbbc: 08 35 cpi r16, 0x58 ; 88 1dbbe: 08 f4 brcc .+2 ; 0x1dbc2 1dbc0: 5b c1 rjmp .+694 ; 0x1de78 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 1dbc2: 70 e0 ldi r23, 0x00 ; 0 1dbc4: 90 e0 ldi r25, 0x00 ; 0 1dbc6: 80 e0 ldi r24, 0x00 ; 0 1dbc8: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1dbcc: 20 e0 ldi r18, 0x00 ; 0 1dbce: 30 e0 ldi r19, 0x00 ; 0 1dbd0: 40 eb ldi r20, 0xB0 ; 176 1dbd2: 50 e4 ldi r21, 0x40 ; 64 1dbd4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1dbd8: 2b 01 movw r4, r22 1dbda: 3c 01 movw r6, r24 1dbdc: 65 96 adiw r28, 0x15 ; 21 1dbde: 4c ae std Y+60, r4 ; 0x3c 1dbe0: 5d ae std Y+61, r5 ; 0x3d 1dbe2: 6e ae std Y+62, r6 ; 0x3e 1dbe4: 7f ae std Y+63, r7 ; 0x3f 1dbe6: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 1dbe8: 61 2f mov r22, r17 1dbea: 70 e0 ldi r23, 0x00 ; 0 1dbec: 90 e0 ldi r25, 0x00 ; 0 1dbee: 80 e0 ldi r24, 0x00 ; 0 1dbf0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1dbf4: 20 e0 ldi r18, 0x00 ; 0 1dbf6: 30 e0 ldi r19, 0x00 ; 0 1dbf8: 40 eb ldi r20, 0xB0 ; 176 1dbfa: 50 e4 ldi r21, 0x40 ; 64 1dbfc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1dc00: 4b 01 movw r8, r22 1dc02: 5c 01 movw r10, r24 1dc04: 25 96 adiw r28, 0x05 ; 5 1dc06: 8c ae std Y+60, r8 ; 0x3c 1dc08: 9d ae std Y+61, r9 ; 0x3d 1dc0a: ae ae std Y+62, r10 ; 0x3e 1dc0c: bf ae std Y+63, r11 ; 0x3f 1dc0e: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 1dc10: 20 e0 ldi r18, 0x00 ; 0 1dc12: 30 e0 ldi r19, 0x00 ; 0 1dc14: 40 e9 ldi r20, 0x90 ; 144 1dc16: 50 e4 ldi r21, 0x40 ; 64 1dc18: 29 83 std Y+1, r18 ; 0x01 1dc1a: 3a 83 std Y+2, r19 ; 0x02 1dc1c: 4b 83 std Y+3, r20 ; 0x03 1dc1e: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 1dc20: ae 01 movw r20, r28 1dc22: 4f 5f subi r20, 0xFF ; 255 1dc24: 5f 4f sbci r21, 0xFF ; 255 1dc26: be 01 movw r22, r28 1dc28: 6f 5b subi r22, 0xBF ; 191 1dc2a: 7f 4f sbci r23, 0xFF ; 255 1dc2c: ce 01 movw r24, r28 1dc2e: 8f 5a subi r24, 0xAF ; 175 1dc30: 9f 4f sbci r25, 0xFF ; 255 1dc32: 0f 94 77 8d call 0x31aee ; 0x31aee if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 1dc36: a3 01 movw r20, r6 1dc38: 92 01 movw r18, r4 1dc3a: 65 96 adiw r28, 0x15 ; 21 1dc3c: 6c ad ldd r22, Y+60 ; 0x3c 1dc3e: 7d ad ldd r23, Y+61 ; 0x3d 1dc40: 8e ad ldd r24, Y+62 ; 0x3e 1dc42: 9f ad ldd r25, Y+63 ; 0x3f 1dc44: 65 97 sbiw r28, 0x15 ; 21 1dc46: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1dc4a: 6b 01 movw r12, r22 1dc4c: 7c 01 movw r14, r24 1dc4e: 9f 77 andi r25, 0x7F ; 127 1dc50: 20 e0 ldi r18, 0x00 ; 0 1dc52: 30 e0 ldi r19, 0x00 ; 0 1dc54: 40 e4 ldi r20, 0x40 ; 64 1dc56: 50 e4 ldi r21, 0x40 ; 64 1dc58: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1dc5c: 18 16 cp r1, r24 1dc5e: 34 f1 brlt .+76 ; 0x1dcac 1dc60: a5 01 movw r20, r10 1dc62: 94 01 movw r18, r8 1dc64: 25 96 adiw r28, 0x05 ; 5 1dc66: 6c ad ldd r22, Y+60 ; 0x3c 1dc68: 7d ad ldd r23, Y+61 ; 0x3d 1dc6a: 8e ad ldd r24, Y+62 ; 0x3e 1dc6c: 9f ad ldd r25, Y+63 ; 0x3f 1dc6e: 25 97 sbiw r28, 0x05 ; 5 1dc70: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1dc74: 9f 77 andi r25, 0x7F ; 127 1dc76: 20 e0 ldi r18, 0x00 ; 0 1dc78: 30 e0 ldi r19, 0x00 ; 0 1dc7a: 40 e4 ldi r20, 0x40 ; 64 1dc7c: 50 e4 ldi r21, 0x40 ; 64 1dc7e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1dc82: 18 16 cp r1, r24 1dc84: 9c f0 brlt .+38 ; 0x1dcac 1dc86: 20 e0 ldi r18, 0x00 ; 0 1dc88: 30 e0 ldi r19, 0x00 ; 0 1dc8a: 40 ea ldi r20, 0xA0 ; 160 1dc8c: 50 e4 ldi r21, 0x40 ; 64 1dc8e: 69 81 ldd r22, Y+1 ; 0x01 1dc90: 7a 81 ldd r23, Y+2 ; 0x02 1dc92: 8b 81 ldd r24, Y+3 ; 0x03 1dc94: 9c 81 ldd r25, Y+4 ; 0x04 1dc96: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1dc9a: 9f 77 andi r25, 0x7F ; 127 1dc9c: 20 e0 ldi r18, 0x00 ; 0 1dc9e: 30 e0 ldi r19, 0x00 ; 0 1dca0: 40 e4 ldi r20, 0x40 ; 64 1dca2: 50 e4 ldi r21, 0x40 ; 64 1dca4: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1dca8: 18 16 cp r1, r24 1dcaa: bc f5 brge .+110 ; 0x1dd1a //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 1dcac: 20 e0 ldi r18, 0x00 ; 0 1dcae: 30 e0 ldi r19, 0x00 ; 0 1dcb0: 40 ea ldi r20, 0xA0 ; 160 1dcb2: 50 e4 ldi r21, 0x40 ; 64 1dcb4: 69 81 ldd r22, Y+1 ; 0x01 1dcb6: 7a 81 ldd r23, Y+2 ; 0x02 1dcb8: 8b 81 ldd r24, Y+3 ; 0x03 1dcba: 9c 81 ldd r25, Y+4 ; 0x04 1dcbc: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1dcc0: 9f 93 push r25 1dcc2: 8f 93 push r24 1dcc4: 7f 93 push r23 1dcc6: 6f 93 push r22 1dcc8: a5 01 movw r20, r10 1dcca: 94 01 movw r18, r8 1dccc: 25 96 adiw r28, 0x05 ; 5 1dcce: 6c ad ldd r22, Y+60 ; 0x3c 1dcd0: 7d ad ldd r23, Y+61 ; 0x3d 1dcd2: 8e ad ldd r24, Y+62 ; 0x3e 1dcd4: 9f ad ldd r25, Y+63 ; 0x3f 1dcd6: 25 97 sbiw r28, 0x05 ; 5 1dcd8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1dcdc: 9f 93 push r25 1dcde: 8f 93 push r24 1dce0: 7f 93 push r23 1dce2: 6f 93 push r22 1dce4: ff 92 push r15 1dce6: ef 92 push r14 1dce8: df 92 push r13 1dcea: cf 92 push r12 1dcec: 86 e8 ldi r24, 0x86 ; 134 1dcee: 91 e9 ldi r25, 0x91 ; 145 1dcf0: 9f 93 push r25 1dcf2: 8f 93 push r24 1dcf4: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 1dcf8: 65 96 adiw r28, 0x15 ; 21 1dcfa: 4c ae std Y+60, r4 ; 0x3c 1dcfc: 5d ae std Y+61, r5 ; 0x3d 1dcfe: 6e ae std Y+62, r6 ; 0x3e 1dd00: 7f ae std Y+63, r7 ; 0x3f 1dd02: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 1dd04: 25 96 adiw r28, 0x05 ; 5 1dd06: 8c ae std Y+60, r8 ; 0x3c 1dd08: 9d ae std Y+61, r9 ; 0x3d 1dd0a: ae ae std Y+62, r10 ; 0x3e 1dd0c: bf ae std Y+63, r11 ; 0x3f 1dd0e: 25 97 sbiw r28, 0x05 ; 5 1dd10: 0f b6 in r0, 0x3f ; 63 1dd12: f8 94 cli 1dd14: de bf out 0x3e, r29 ; 62 1dd16: 0f be out 0x3f, r0 ; 63 1dd18: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 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: 65 96 adiw r28, 0x15 ; 21 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: 65 97 sbiw r28, 0x15 ; 21 1dd2e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__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 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1dd3e: 6b 01 movw r12, r22 1dd40: 7c 01 movw r14, r24 1dd42: 6c 96 adiw r28, 0x1c ; 28 1dd44: ae ad ldd r26, Y+62 ; 0x3e 1dd46: bf ad ldd r27, Y+63 ; 0x3f 1dd48: 6c 97 sbiw r28, 0x1c ; 28 1dd4a: bd 01 movw r22, r26 1dd4c: bb 0f add r27, r27 1dd4e: 88 0b sbc r24, r24 1dd50: 99 0b sbc r25, r25 1dd52: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1dd56: 9b 01 movw r18, r22 1dd58: ac 01 movw r20, r24 1dd5a: c7 01 movw r24, r14 1dd5c: b6 01 movw r22, r12 1dd5e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1dd62: 6b 01 movw r12, r22 1dd64: 7c 01 movw r14, r24 1dd66: 65 96 adiw r28, 0x15 ; 21 1dd68: cc ae std Y+60, r12 ; 0x3c 1dd6a: dd ae std Y+61, r13 ; 0x3d 1dd6c: ee ae std Y+62, r14 ; 0x3e 1dd6e: ff ae std Y+63, r15 ; 0x3f 1dd70: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 1dd72: 20 e0 ldi r18, 0x00 ; 0 1dd74: 30 e0 ldi r19, 0x00 ; 0 1dd76: 48 e7 ldi r20, 0x78 ; 120 1dd78: 51 e4 ldi r21, 0x41 ; 65 1dd7a: 25 96 adiw r28, 0x05 ; 5 1dd7c: 6c ad ldd r22, Y+60 ; 0x3c 1dd7e: 7d ad ldd r23, Y+61 ; 0x3d 1dd80: 8e ad ldd r24, Y+62 ; 0x3e 1dd82: 9f ad ldd r25, Y+63 ; 0x3f 1dd84: 25 97 sbiw r28, 0x05 ; 5 1dd86: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1dd8a: 20 e0 ldi r18, 0x00 ; 0 1dd8c: 30 e0 ldi r19, 0x00 ; 0 1dd8e: 40 e8 ldi r20, 0x80 ; 128 1dd90: 52 e4 ldi r21, 0x42 ; 66 1dd92: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1dd96: 4b 01 movw r8, r22 1dd98: 5c 01 movw r10, r24 1dd9a: ac 96 adiw r28, 0x2c ; 44 1dd9c: ee ad ldd r30, Y+62 ; 0x3e 1dd9e: ff ad ldd r31, Y+63 ; 0x3f 1dda0: ac 97 sbiw r28, 0x2c ; 44 1dda2: bf 01 movw r22, r30 1dda4: ff 0f add r31, r31 1dda6: 88 0b sbc r24, r24 1dda8: 99 0b sbc r25, r25 1ddaa: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 1ddae: 9b 01 movw r18, r22 1ddb0: ac 01 movw r20, r24 1ddb2: c5 01 movw r24, r10 1ddb4: b4 01 movw r22, r8 1ddb6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1ddba: 25 96 adiw r28, 0x05 ; 5 1ddbc: 6c af std Y+60, r22 ; 0x3c 1ddbe: 7d af std Y+61, r23 ; 0x3d 1ddc0: 8e af std Y+62, r24 ; 0x3e 1ddc2: 9f af std Y+63, r25 ; 0x3f 1ddc4: 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; 1ddc6: 2a e0 ldi r18, 0x0A ; 10 1ddc8: 37 ed ldi r19, 0xD7 ; 215 1ddca: 43 e2 ldi r20, 0x23 ; 35 1ddcc: 5c e3 ldi r21, 0x3C ; 60 1ddce: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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)); 1ddd2: 9f 93 push r25 1ddd4: 8f 93 push r24 1ddd6: 7f 93 push r23 1ddd8: 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; 1ddda: 2a e0 ldi r18, 0x0A ; 10 1dddc: 37 ed ldi r19, 0xD7 ; 215 1ddde: 43 e2 ldi r20, 0x23 ; 35 1dde0: 5c e3 ldi r21, 0x3C ; 60 1dde2: c7 01 movw r24, r14 1dde4: b6 01 movw r22, r12 1dde6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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)); 1ddea: 9f 93 push r25 1ddec: 8f 93 push r24 1ddee: 7f 93 push r23 1ddf0: 6f 93 push r22 1ddf2: 8a e6 ldi r24, 0x6A ; 106 1ddf4: 91 e9 ldi r25, 0x91 ; 145 1ddf6: 9f 93 push r25 1ddf8: 8f 93 push r24 1ddfa: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 1ddfe: 20 e0 ldi r18, 0x00 ; 0 1de00: 30 e0 ldi r19, 0x00 ; 0 1de02: 40 e0 ldi r20, 0x00 ; 0 1de04: 5f e3 ldi r21, 0x3F ; 63 1de06: 25 96 adiw r28, 0x05 ; 5 1de08: 6c ad ldd r22, Y+60 ; 0x3c 1de0a: 7d ad ldd r23, Y+61 ; 0x3d 1de0c: 8e ad ldd r24, Y+62 ; 0x3e 1de0e: 9f ad ldd r25, Y+63 ; 0x3f 1de10: 25 97 sbiw r28, 0x05 ; 5 1de12: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1de16: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 1de1a: 6b 01 movw r12, r22 1de1c: 20 e0 ldi r18, 0x00 ; 0 1de1e: 30 e0 ldi r19, 0x00 ; 0 1de20: 40 e0 ldi r20, 0x00 ; 0 1de22: 5f e3 ldi r21, 0x3F ; 63 1de24: 65 96 adiw r28, 0x15 ; 21 1de26: 6c ad ldd r22, Y+60 ; 0x3c 1de28: 7d ad ldd r23, Y+61 ; 0x3d 1de2a: 8e ad ldd r24, Y+62 ; 0x3e 1de2c: 9f ad ldd r25, Y+63 ; 0x3f 1de2e: 65 97 sbiw r28, 0x15 ; 21 1de30: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1de34: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 1de38: 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); 1de3a: 00 e0 ldi r16, 0x00 ; 0 1de3c: 28 ec ldi r18, 0xC8 ; 200 1de3e: 30 e0 ldi r19, 0x00 ; 0 1de40: e7 96 adiw r28, 0x37 ; 55 1de42: 4e ad ldd r20, Y+62 ; 0x3e 1de44: 5f ad ldd r21, Y+63 ; 0x3f 1de46: e7 97 sbiw r28, 0x37 ; 55 1de48: b6 01 movw r22, r12 1de4a: 0e 94 f4 e1 call 0x1c3e8 ; 0x1c3e8 1de4e: 0f b6 in r0, 0x3f ; 63 1de50: f8 94 cli 1de52: de bf out 0x3e, r29 ; 62 1de54: 0f be out 0x3f, r0 ; 63 1de56: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 1de58: 10 e0 ldi r17, 0x00 ; 0 1de5a: 86 e5 ldi r24, 0x56 ; 86 1de5c: 9e e0 ldi r25, 0x0E ; 14 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 1de5e: a4 96 adiw r28, 0x24 ; 36 1de60: ae ad ldd r26, Y+62 ; 0x3e 1de62: bf ad ldd r27, Y+63 ; 0x3f 1de64: a4 97 sbiw r28, 0x24 ; 36 1de66: 1d 92 st X+, r1 1de68: a4 96 adiw r28, 0x24 ; 36 1de6a: bf af std Y+63, r27 ; 0x3f 1de6c: ae af std Y+62, r26 ; 0x3e 1de6e: 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++) 1de70: 8a 17 cp r24, r26 1de72: 9b 07 cpc r25, r27 1de74: a1 f7 brne .-24 ; 0x1de5e 1de76: 76 cc rjmp .-1812 ; 0x1d764 /// 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; 1de78: 1f ef ldi r17, 0xFF ; 255 1de7a: ef cf rjmp .-34 ; 0x1de5a 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; 1de7c: e5 96 adiw r28, 0x35 ; 53 1de7e: bf ad ldd r27, Y+63 ; 0x3f 1de80: e5 97 sbiw r28, 0x35 ; 53 1de82: a7 96 adiw r28, 0x27 ; 39 1de84: bf af std Y+63, r27 ; 0x3f 1de86: a7 97 sbiw r28, 0x27 ; 39 1de88: 99 cc rjmp .-1742 ; 0x1d7bc // 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; 1de8a: af 96 adiw r28, 0x2f ; 47 1de8c: 1f ae std Y+63, r1 ; 0x3f 1de8e: af 97 sbiw r28, 0x2f ; 47 1de90: 62 cd rjmp .-1340 ; 0x1d956 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]) : 1de92: f2 01 movw r30, r4 1de94: 25 81 ldd r18, Z+5 ; 0x05 1de96: 36 81 ldd r19, Z+6 ; 0x06 1de98: 47 81 ldd r20, Z+7 ; 0x07 1de9a: 50 85 ldd r21, Z+8 ; 0x08 1de9c: c3 58 subi r28, 0x83 ; 131 1de9e: df 4f sbci r29, 0xFF ; 255 1dea0: 68 81 ld r22, Y 1dea2: 79 81 ldd r23, Y+1 ; 0x01 1dea4: 8a 81 ldd r24, Y+2 ; 0x02 1dea6: 9b 81 ldd r25, Y+3 ; 0x03 1dea8: cd 57 subi r28, 0x7D ; 125 1deaa: d0 40 sbci r29, 0x00 ; 0 1deac: 60 ce rjmp .-832 ; 0x1db6e (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 1deae: 12 30 cpi r17, 0x02 ; 2 1deb0: 11 f0 breq .+4 ; 0x1deb6 1deb2: 0c 94 30 f8 jmp 0x1f060 ; 0x1f060 1deb6: d2 01 movw r26, r4 1deb8: 11 96 adiw r26, 0x01 ; 1 1deba: 2d 91 ld r18, X+ 1debc: 3d 91 ld r19, X+ 1debe: 4d 91 ld r20, X+ 1dec0: 5c 91 ld r21, X 1dec2: 14 97 sbiw r26, 0x04 ; 4 1dec4: cf 57 subi r28, 0x7F ; 127 1dec6: df 4f sbci r29, 0xFF ; 255 1dec8: 68 81 ld r22, Y 1deca: 79 81 ldd r23, Y+1 ; 0x01 1decc: 8a 81 ldd r24, Y+2 ; 0x02 1dece: 9b 81 ldd r25, Y+3 ; 0x03 1ded0: c1 58 subi r28, 0x81 ; 129 1ded2: d0 40 sbci r29, 0x00 ; 0 1ded4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 1ded8: 9b 01 movw r18, r22 1deda: ac 01 movw r20, r24 1dedc: c5 01 movw r24, r10 1dede: b4 01 movw r22, r8 1dee0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1dee4: 9b 01 movw r18, r22 1dee6: ac 01 movw r20, r24 1dee8: c7 01 movw r24, r14 1deea: b6 01 movw r22, r12 1deec: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1def0: 6b 01 movw r12, r22 1def2: 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) { 1def4: 01 11 cpse r16, r1 1def6: 0c 94 3d f9 jmp 0x1f27a ; 0x1f27a 1defa: 7a 94 dec r7 1defc: f8 e0 ldi r31, 0x08 ; 8 1defe: 4f 0e add r4, r31 1df00: 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) { 1df02: 71 10 cpse r7, r1 1df04: 16 ce rjmp .-980 ; 0x1db32 (-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; 1df06: d1 01 movw r26, r2 1df08: cd 92 st X+, r12 1df0a: dd 92 st X+, r13 1df0c: ed 92 st X+, r14 1df0e: fd 92 st X+, r15 1df10: 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) { 1df12: 1f 5f subi r17, 0xFF ; 255 1df14: 14 30 cpi r17, 0x04 ; 4 1df16: 09 f0 breq .+2 ; 0x1df1a 1df18: 03 ce rjmp .-1018 ; 0x1db20 1df1a: 3f e1 ldi r19, 0x1F ; 31 1df1c: 23 2e mov r2, r19 1df1e: 32 e9 ldi r19, 0x92 ; 146 1df20: 33 2e mov r3, r19 1df22: e0 ea ldi r30, 0xA0 ; 160 1df24: f3 e1 ldi r31, 0x13 ; 19 1df26: a8 96 adiw r28, 0x28 ; 40 1df28: ff af std Y+63, r31 ; 0x3f 1df2a: ee af std Y+62, r30 ; 0x3e 1df2c: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 1df2e: c3 57 subi r28, 0x73 ; 115 1df30: df 4f sbci r29, 0xFF ; 255 1df32: 18 82 st Y, r1 1df34: cd 58 subi r28, 0x8D ; 141 1df36: d0 40 sbci r29, 0x00 ; 0 1df38: c3 56 subi r28, 0x63 ; 99 1df3a: df 4f sbci r29, 0xFF ; 255 1df3c: 18 82 st Y, r1 1df3e: cd 59 subi r28, 0x9D ; 157 1df40: d0 40 sbci r29, 0x00 ; 0 1df42: cf 55 subi r28, 0x5F ; 95 1df44: df 4f sbci r29, 0xFF ; 255 1df46: 18 82 st Y, r1 1df48: c1 5a subi r28, 0xA1 ; 161 1df4a: d0 40 sbci r29, 0x00 ; 0 1df4c: 10 e0 ldi r17, 0x00 ; 0 1df4e: a8 96 adiw r28, 0x28 ; 40 1df50: ae ad ldd r26, Y+62 ; 0x3e 1df52: bf ad ldd r27, Y+63 ; 0x3f 1df54: a8 97 sbiw r28, 0x28 ; 40 1df56: 11 96 adiw r26, 0x01 ; 1 1df58: 2d 91 ld r18, X+ 1df5a: 3d 91 ld r19, X+ 1df5c: 4d 91 ld r20, X+ 1df5e: 5c 91 ld r21, X 1df60: 14 97 sbiw r26, 0x04 ; 4 1df62: e4 96 adiw r28, 0x34 ; 52 1df64: 2c af std Y+60, r18 ; 0x3c 1df66: 3d af std Y+61, r19 ; 0x3d 1df68: 4e af std Y+62, r20 ; 0x3e 1df6a: 5f af std Y+63, r21 ; 0x3f 1df6c: e4 97 sbiw r28, 0x34 ; 52 1df6e: 15 96 adiw r26, 0x05 ; 5 1df70: 4d 90 ld r4, X+ 1df72: 5d 90 ld r5, X+ 1df74: 6d 90 ld r6, X+ 1df76: 7c 90 ld r7, X 1df78: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1df7a: 00 23 and r16, r16 1df7c: 11 f4 brne .+4 ; 0x1df82 1df7e: 0c 94 63 f8 jmp 0x1f0c6 ; 0x1f0c6 ((r == 1) ? 0.f : 1df82: 81 2c mov r8, r1 1df84: 91 2c mov r9, r1 1df86: 54 01 movw r10, r8 1df88: 01 30 cpi r16, 0x01 ; 1 1df8a: 81 f0 breq .+32 ; 0x1dfac ((r == 2) ? (-s1 * measured_pts[2 * i]) : 1df8c: 02 30 cpi r16, 0x02 ; 2 1df8e: 11 f0 breq .+4 ; 0x1df94 1df90: 0c 94 57 f8 jmp 0x1f0ae ; 0x1f0ae 1df94: cf 57 subi r28, 0x7F ; 127 1df96: df 4f sbci r29, 0xFF ; 255 1df98: 68 81 ld r22, Y 1df9a: 79 81 ldd r23, Y+1 ; 0x01 1df9c: 8a 81 ldd r24, Y+2 ; 0x02 1df9e: 9b 81 ldd r25, Y+3 ; 0x03 1dfa0: c1 58 subi r28, 0x81 ; 129 1dfa2: d0 40 sbci r29, 0x00 ; 0 1dfa4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1dfa8: 4b 01 movw r8, r22 1dfaa: 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); 1dfac: e4 96 adiw r28, 0x34 ; 52 1dfae: 2c ad ldd r18, Y+60 ; 0x3c 1dfb0: 3d ad ldd r19, Y+61 ; 0x3d 1dfb2: 4e ad ldd r20, Y+62 ; 0x3e 1dfb4: 5f ad ldd r21, Y+63 ; 0x3f 1dfb6: e4 97 sbiw r28, 0x34 ; 52 1dfb8: 6e 96 adiw r28, 0x1e ; 30 1dfba: 6c ad ldd r22, Y+60 ; 0x3c 1dfbc: 7d ad ldd r23, Y+61 ; 0x3d 1dfbe: 8e ad ldd r24, Y+62 ; 0x3e 1dfc0: 9f ad ldd r25, Y+63 ; 0x3f 1dfc2: 6e 97 sbiw r28, 0x1e ; 30 1dfc4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1dfc8: 6b 01 movw r12, r22 1dfca: 7c 01 movw r14, r24 1dfcc: f1 01 movw r30, r2 1dfce: 25 91 lpm r18, Z+ 1dfd0: 35 91 lpm r19, Z+ 1dfd2: 45 91 lpm r20, Z+ 1dfd4: 54 91 lpm r21, Z 1dfd6: cb 55 subi r28, 0x5B ; 91 1dfd8: df 4f sbci r29, 0xFF ; 255 1dfda: 28 83 st Y, r18 1dfdc: 39 83 std Y+1, r19 ; 0x01 1dfde: 4a 83 std Y+2, r20 ; 0x02 1dfe0: 5b 83 std Y+3, r21 ; 0x03 1dfe2: c5 5a subi r28, 0xA5 ; 165 1dfe4: d0 40 sbci r29, 0x00 ; 0 1dfe6: a3 01 movw r20, r6 1dfe8: 92 01 movw r18, r4 1dfea: cb 56 subi r28, 0x6B ; 107 1dfec: df 4f sbci r29, 0xFF ; 255 1dfee: 68 81 ld r22, Y 1dff0: 79 81 ldd r23, Y+1 ; 0x01 1dff2: 8a 81 ldd r24, Y+2 ; 0x02 1dff4: 9b 81 ldd r25, Y+3 ; 0x03 1dff6: c5 59 subi r28, 0x95 ; 149 1dff8: d0 40 sbci r29, 0x00 ; 0 1dffa: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1dffe: 9b 01 movw r18, r22 1e000: ac 01 movw r20, r24 1e002: c7 01 movw r24, r14 1e004: b6 01 movw r22, r12 1e006: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e00a: c5 55 subi r28, 0x55 ; 85 1e00c: df 4f sbci r29, 0xFF ; 255 1e00e: 28 81 ld r18, Y 1e010: 39 81 ldd r19, Y+1 ; 0x01 1e012: 4a 81 ldd r20, Y+2 ; 0x02 1e014: 5b 81 ldd r21, Y+3 ; 0x03 1e016: cb 5a subi r28, 0xAB ; 171 1e018: d0 40 sbci r29, 0x00 ; 0 1e01a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e01e: cb 55 subi r28, 0x5B ; 91 1e020: df 4f sbci r29, 0xFF ; 255 1e022: 28 81 ld r18, Y 1e024: 39 81 ldd r19, Y+1 ; 0x01 1e026: 4a 81 ldd r20, Y+2 ; 0x02 1e028: 5b 81 ldd r21, Y+3 ; 0x03 1e02a: c5 5a subi r28, 0xA5 ; 165 1e02c: d0 40 sbci r29, 0x00 ; 0 1e02e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 1e032: a5 01 movw r20, r10 1e034: 94 01 movw r18, r8 1e036: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e03a: c3 57 subi r28, 0x73 ; 115 1e03c: df 4f sbci r29, 0xFF ; 255 1e03e: 28 81 ld r18, Y 1e040: cd 58 subi r28, 0x8D ; 141 1e042: d0 40 sbci r29, 0x00 ; 0 1e044: c3 56 subi r28, 0x63 ; 99 1e046: df 4f sbci r29, 0xFF ; 255 1e048: 38 81 ld r19, Y 1e04a: cd 59 subi r28, 0x9D ; 157 1e04c: d0 40 sbci r29, 0x00 ; 0 1e04e: cf 55 subi r28, 0x5F ; 95 1e050: df 4f sbci r29, 0xFF ; 255 1e052: 48 81 ld r20, Y 1e054: c1 5a subi r28, 0xA1 ; 161 1e056: d0 40 sbci r29, 0x00 ; 0 1e058: 51 2f mov r21, r17 1e05a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e05e: c3 57 subi r28, 0x73 ; 115 1e060: df 4f sbci r29, 0xFF ; 255 1e062: 68 83 st Y, r22 1e064: 79 83 std Y+1, r23 ; 0x01 1e066: 8a 83 std Y+2, r24 ; 0x02 1e068: 9b 83 std Y+3, r25 ; 0x03 1e06a: cd 58 subi r28, 0x8D ; 141 1e06c: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 1e06e: 00 23 and r16, r16 1e070: 11 f4 brne .+4 ; 0x1e076 1e072: 0c 94 6b f8 jmp 0x1f0d6 ; 0x1f0d6 ((r == 1) ? 1.f : 1e076: 01 30 cpi r16, 0x01 ; 1 1e078: 11 f4 brne .+4 ; 0x1e07e 1e07a: 0c 94 70 f8 jmp 0x1f0e0 ; 0x1f0e0 ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1e07e: 02 30 cpi r16, 0x02 ; 2 1e080: 61 f0 breq .+24 ; 0x1e09a 1e082: a3 01 movw r20, r6 1e084: 92 01 movw r18, r4 1e086: ed 96 adiw r28, 0x3d ; 61 1e088: 6c ad ldd r22, Y+60 ; 0x3c 1e08a: 7d ad ldd r23, Y+61 ; 0x3d 1e08c: 8e ad ldd r24, Y+62 ; 0x3e 1e08e: 9f ad ldd r25, Y+63 ; 0x3f 1e090: ed 97 sbiw r28, 0x3d ; 61 1e092: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e096: 6b 01 movw r12, r22 1e098: 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); 1e09a: f1 01 movw r30, r2 1e09c: 34 96 adiw r30, 0x04 ; 4 1e09e: 85 90 lpm r8, Z+ 1e0a0: 95 90 lpm r9, Z+ 1e0a2: a5 90 lpm r10, Z+ 1e0a4: b4 90 lpm r11, Z 1e0a6: e4 96 adiw r28, 0x34 ; 52 1e0a8: 2c ad ldd r18, Y+60 ; 0x3c 1e0aa: 3d ad ldd r19, Y+61 ; 0x3d 1e0ac: 4e ad ldd r20, Y+62 ; 0x3e 1e0ae: 5f ad ldd r21, Y+63 ; 0x3f 1e0b0: e4 97 sbiw r28, 0x34 ; 52 1e0b2: cb 57 subi r28, 0x7B ; 123 1e0b4: df 4f sbci r29, 0xFF ; 255 1e0b6: 68 81 ld r22, Y 1e0b8: 79 81 ldd r23, Y+1 ; 0x01 1e0ba: 8a 81 ldd r24, Y+2 ; 0x02 1e0bc: 9b 81 ldd r25, Y+3 ; 0x03 1e0be: c5 58 subi r28, 0x85 ; 133 1e0c0: d0 40 sbci r29, 0x00 ; 0 1e0c2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e0c6: e4 96 adiw r28, 0x34 ; 52 1e0c8: 6c af std Y+60, r22 ; 0x3c 1e0ca: 7d af std Y+61, r23 ; 0x3d 1e0cc: 8e af std Y+62, r24 ; 0x3e 1e0ce: 9f af std Y+63, r25 ; 0x3f 1e0d0: e4 97 sbiw r28, 0x34 ; 52 1e0d2: a3 01 movw r20, r6 1e0d4: 92 01 movw r18, r4 1e0d6: c7 57 subi r28, 0x77 ; 119 1e0d8: df 4f sbci r29, 0xFF ; 255 1e0da: 68 81 ld r22, Y 1e0dc: 79 81 ldd r23, Y+1 ; 0x01 1e0de: 8a 81 ldd r24, Y+2 ; 0x02 1e0e0: 9b 81 ldd r25, Y+3 ; 0x03 1e0e2: c9 58 subi r28, 0x89 ; 137 1e0e4: d0 40 sbci r29, 0x00 ; 0 1e0e6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e0ea: 9b 01 movw r18, r22 1e0ec: ac 01 movw r20, r24 1e0ee: e4 96 adiw r28, 0x34 ; 52 1e0f0: 6c ad ldd r22, Y+60 ; 0x3c 1e0f2: 7d ad ldd r23, Y+61 ; 0x3d 1e0f4: 8e ad ldd r24, Y+62 ; 0x3e 1e0f6: 9f ad ldd r25, Y+63 ; 0x3f 1e0f8: e4 97 sbiw r28, 0x34 ; 52 1e0fa: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e0fe: c1 55 subi r28, 0x51 ; 81 1e100: df 4f sbci r29, 0xFF ; 255 1e102: 28 81 ld r18, Y 1e104: 39 81 ldd r19, Y+1 ; 0x01 1e106: 4a 81 ldd r20, Y+2 ; 0x02 1e108: 5b 81 ldd r21, Y+3 ; 0x03 1e10a: cf 5a subi r28, 0xAF ; 175 1e10c: d0 40 sbci r29, 0x00 ; 0 1e10e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e112: a5 01 movw r20, r10 1e114: 94 01 movw r18, r8 1e116: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 1e11a: a7 01 movw r20, r14 1e11c: 96 01 movw r18, r12 1e11e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e122: c3 57 subi r28, 0x73 ; 115 1e124: df 4f sbci r29, 0xFF ; 255 1e126: 28 81 ld r18, Y 1e128: 39 81 ldd r19, Y+1 ; 0x01 1e12a: 4a 81 ldd r20, Y+2 ; 0x02 1e12c: 5b 81 ldd r21, Y+3 ; 0x03 1e12e: cd 58 subi r28, 0x8D ; 141 1e130: d0 40 sbci r29, 0x00 ; 0 1e132: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e136: c3 57 subi r28, 0x73 ; 115 1e138: df 4f sbci r29, 0xFF ; 255 1e13a: 68 83 st Y, r22 1e13c: cd 58 subi r28, 0x8D ; 141 1e13e: d0 40 sbci r29, 0x00 ; 0 1e140: c3 56 subi r28, 0x63 ; 99 1e142: df 4f sbci r29, 0xFF ; 255 1e144: 78 83 st Y, r23 1e146: cd 59 subi r28, 0x9D ; 157 1e148: d0 40 sbci r29, 0x00 ; 0 1e14a: cf 55 subi r28, 0x5F ; 95 1e14c: df 4f sbci r29, 0xFF ; 255 1e14e: 88 83 st Y, r24 1e150: c1 5a subi r28, 0xA1 ; 161 1e152: d0 40 sbci r29, 0x00 ; 0 1e154: 19 2f mov r17, r25 1e156: a8 96 adiw r28, 0x28 ; 40 1e158: 4e ad ldd r20, Y+62 ; 0x3e 1e15a: 5f ad ldd r21, Y+63 ; 0x3f 1e15c: a8 97 sbiw r28, 0x28 ; 40 1e15e: 48 5f subi r20, 0xF8 ; 248 1e160: 5f 4f sbci r21, 0xFF ; 255 1e162: a8 96 adiw r28, 0x28 ; 40 1e164: 5f af std Y+63, r21 ; 0x3f 1e166: 4e af std Y+62, r20 ; 0x3e 1e168: a8 97 sbiw r28, 0x28 ; 40 1e16a: 58 e0 ldi r21, 0x08 ; 8 1e16c: 25 0e add r2, r21 1e16e: 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) { 1e170: a0 ec ldi r26, 0xC0 ; 192 1e172: b3 e1 ldi r27, 0x13 ; 19 1e174: a8 96 adiw r28, 0x28 ; 40 1e176: ee ad ldd r30, Y+62 ; 0x3e 1e178: ff ad ldd r31, Y+63 ; 0x3f 1e17a: a8 97 sbiw r28, 0x28 ; 40 1e17c: ae 17 cp r26, r30 1e17e: bf 07 cpc r27, r31 1e180: 09 f0 breq .+2 ; 0x1e184 1e182: e5 ce rjmp .-566 ; 0x1df4e 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; 1e184: 90 58 subi r25, 0x80 ; 128 1e186: c7 56 subi r28, 0x67 ; 103 1e188: df 4f sbci r29, 0xFF ; 255 1e18a: a8 81 ld r26, Y 1e18c: b9 81 ldd r27, Y+1 ; 0x01 1e18e: c9 59 subi r28, 0x99 ; 153 1e190: d0 40 sbci r29, 0x00 ; 0 1e192: 6d 93 st X+, r22 1e194: 7d 93 st X+, r23 1e196: 8d 93 st X+, r24 1e198: 9d 93 st X+, r25 1e19a: c7 56 subi r28, 0x67 ; 103 1e19c: df 4f sbci r29, 0xFF ; 255 1e19e: b9 83 std Y+1, r27 ; 0x01 1e1a0: a8 83 st Y, r26 1e1a2: c9 59 subi r28, 0x99 ; 153 1e1a4: 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) { 1e1a6: 0f 5f subi r16, 0xFF ; 255 1e1a8: ac 96 adiw r28, 0x2c ; 44 1e1aa: ee ad ldd r30, Y+62 ; 0x3e 1e1ac: ff ad ldd r31, Y+63 ; 0x3f 1e1ae: ac 97 sbiw r28, 0x2c ; 44 1e1b0: 70 96 adiw r30, 0x10 ; 16 1e1b2: ac 96 adiw r28, 0x2c ; 44 1e1b4: ff af std Y+63, r31 ; 0x3f 1e1b6: ee af std Y+62, r30 ; 0x3e 1e1b8: ac 97 sbiw r28, 0x2c ; 44 1e1ba: 04 30 cpi r16, 0x04 ; 4 1e1bc: 09 f0 breq .+2 ; 0x1e1c0 1e1be: ab cc rjmp .-1706 ; 0x1db16 } // 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]; 1e1c0: 25 96 adiw r28, 0x05 ; 5 1e1c2: 2c ad ldd r18, Y+60 ; 0x3c 1e1c4: 3d ad ldd r19, Y+61 ; 0x3d 1e1c6: 4e ad ldd r20, Y+62 ; 0x3e 1e1c8: 5f ad ldd r21, Y+63 ; 0x3f 1e1ca: 25 97 sbiw r28, 0x05 ; 5 1e1cc: ae 96 adiw r28, 0x2e ; 46 1e1ce: 2c af std Y+60, r18 ; 0x3c 1e1d0: 3d af std Y+61, r19 ; 0x3d 1e1d2: 4e af std Y+62, r20 ; 0x3e 1e1d4: 5f af std Y+63, r21 ; 0x3f 1e1d6: ae 97 sbiw r28, 0x2e ; 46 1e1d8: 8d 81 ldd r24, Y+5 ; 0x05 1e1da: 9e 81 ldd r25, Y+6 ; 0x06 1e1dc: af 81 ldd r26, Y+7 ; 0x07 1e1de: b8 85 ldd r27, Y+8 ; 0x08 1e1e0: e4 96 adiw r28, 0x34 ; 52 1e1e2: 8c af std Y+60, r24 ; 0x3c 1e1e4: 9d af std Y+61, r25 ; 0x3d 1e1e6: ae af std Y+62, r26 ; 0x3e 1e1e8: bf af std Y+63, r27 ; 0x3f 1e1ea: e4 97 sbiw r28, 0x34 ; 52 1e1ec: 29 85 ldd r18, Y+9 ; 0x09 1e1ee: 3a 85 ldd r19, Y+10 ; 0x0a 1e1f0: 4b 85 ldd r20, Y+11 ; 0x0b 1e1f2: 5c 85 ldd r21, Y+12 ; 0x0c 1e1f4: ed 96 adiw r28, 0x3d ; 61 1e1f6: 2c af std Y+60, r18 ; 0x3c 1e1f8: 3d af std Y+61, r19 ; 0x3d 1e1fa: 4e af std Y+62, r20 ; 0x3e 1e1fc: 5f af std Y+63, r21 ; 0x3f 1e1fe: ed 97 sbiw r28, 0x3d ; 61 1e200: 8d 85 ldd r24, Y+13 ; 0x0d 1e202: 9e 85 ldd r25, Y+14 ; 0x0e 1e204: af 85 ldd r26, Y+15 ; 0x0f 1e206: b8 89 ldd r27, Y+16 ; 0x10 1e208: c3 58 subi r28, 0x83 ; 131 1e20a: df 4f sbci r29, 0xFF ; 255 1e20c: 88 83 st Y, r24 1e20e: 99 83 std Y+1, r25 ; 0x01 1e210: aa 83 std Y+2, r26 ; 0x02 1e212: bb 83 std Y+3, r27 ; 0x03 1e214: cd 57 subi r28, 0x7D ; 125 1e216: d0 40 sbci r29, 0x00 ; 0 1e218: 29 81 ldd r18, Y+1 ; 0x01 1e21a: 3a 81 ldd r19, Y+2 ; 0x02 1e21c: 4b 81 ldd r20, Y+3 ; 0x03 1e21e: 5c 81 ldd r21, Y+4 ; 0x04 1e220: cf 57 subi r28, 0x7F ; 127 1e222: df 4f sbci r29, 0xFF ; 255 1e224: 28 83 st Y, r18 1e226: 39 83 std Y+1, r19 ; 0x01 1e228: 4a 83 std Y+2, r20 ; 0x02 1e22a: 5b 83 std Y+3, r21 ; 0x03 1e22c: c1 58 subi r28, 0x81 ; 129 1e22e: 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]; 1e230: 29 96 adiw r28, 0x09 ; 9 1e232: 8c ad ldd r24, Y+60 ; 0x3c 1e234: 9d ad ldd r25, Y+61 ; 0x3d 1e236: ae ad ldd r26, Y+62 ; 0x3e 1e238: bf ad ldd r27, Y+63 ; 0x3f 1e23a: 29 97 sbiw r28, 0x09 ; 9 1e23c: cb 57 subi r28, 0x7B ; 123 1e23e: df 4f sbci r29, 0xFF ; 255 1e240: 88 83 st Y, r24 1e242: 99 83 std Y+1, r25 ; 0x01 1e244: aa 83 std Y+2, r26 ; 0x02 1e246: bb 83 std Y+3, r27 ; 0x03 1e248: c5 58 subi r28, 0x85 ; 133 1e24a: d0 40 sbci r29, 0x00 ; 0 1e24c: 29 89 ldd r18, Y+17 ; 0x11 1e24e: 3a 89 ldd r19, Y+18 ; 0x12 1e250: 4b 89 ldd r20, Y+19 ; 0x13 1e252: 5c 89 ldd r21, Y+20 ; 0x14 1e254: c7 57 subi r28, 0x77 ; 119 1e256: df 4f sbci r29, 0xFF ; 255 1e258: 28 83 st Y, r18 1e25a: 39 83 std Y+1, r19 ; 0x01 1e25c: 4a 83 std Y+2, r20 ; 0x02 1e25e: 5b 83 std Y+3, r21 ; 0x03 1e260: c9 58 subi r28, 0x89 ; 137 1e262: d0 40 sbci r29, 0x00 ; 0 1e264: 89 8d ldd r24, Y+25 ; 0x19 1e266: 9a 8d ldd r25, Y+26 ; 0x1a 1e268: ab 8d ldd r26, Y+27 ; 0x1b 1e26a: bc 8d ldd r27, Y+28 ; 0x1c 1e26c: cb 56 subi r28, 0x6B ; 107 1e26e: df 4f sbci r29, 0xFF ; 255 1e270: 88 83 st Y, r24 1e272: 99 83 std Y+1, r25 ; 0x01 1e274: aa 83 std Y+2, r26 ; 0x02 1e276: bb 83 std Y+3, r27 ; 0x03 1e278: c5 59 subi r28, 0x95 ; 149 1e27a: d0 40 sbci r29, 0x00 ; 0 1e27c: 2d 8d ldd r18, Y+29 ; 0x1d 1e27e: 3e 8d ldd r19, Y+30 ; 0x1e 1e280: 4f 8d ldd r20, Y+31 ; 0x1f 1e282: 58 a1 ldd r21, Y+32 ; 0x20 1e284: c7 56 subi r28, 0x67 ; 103 1e286: df 4f sbci r29, 0xFF ; 255 1e288: 28 83 st Y, r18 1e28a: 39 83 std Y+1, r19 ; 0x01 1e28c: 4a 83 std Y+2, r20 ; 0x02 1e28e: 5b 83 std Y+3, r21 ; 0x03 1e290: c9 59 subi r28, 0x99 ; 153 1e292: d0 40 sbci r29, 0x00 ; 0 1e294: 8d 89 ldd r24, Y+21 ; 0x15 1e296: 9e 89 ldd r25, Y+22 ; 0x16 1e298: af 89 ldd r26, Y+23 ; 0x17 1e29a: b8 8d ldd r27, Y+24 ; 0x18 1e29c: c3 57 subi r28, 0x73 ; 115 1e29e: df 4f sbci r29, 0xFF ; 255 1e2a0: 88 83 st Y, r24 1e2a2: 99 83 std Y+1, r25 ; 0x01 1e2a4: aa 83 std Y+2, r26 ; 0x02 1e2a6: bb 83 std Y+3, r27 ; 0x03 1e2a8: cd 58 subi r28, 0x8D ; 141 1e2aa: 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]; 1e2ac: 2d 96 adiw r28, 0x0d ; 13 1e2ae: 2c ad ldd r18, Y+60 ; 0x3c 1e2b0: 3d ad ldd r19, Y+61 ; 0x3d 1e2b2: 4e ad ldd r20, Y+62 ; 0x3e 1e2b4: 5f ad ldd r21, Y+63 ; 0x3f 1e2b6: 2d 97 sbiw r28, 0x0d ; 13 1e2b8: c3 56 subi r28, 0x63 ; 99 1e2ba: df 4f sbci r29, 0xFF ; 255 1e2bc: 28 83 st Y, r18 1e2be: 39 83 std Y+1, r19 ; 0x01 1e2c0: 4a 83 std Y+2, r20 ; 0x02 1e2c2: 5b 83 std Y+3, r21 ; 0x03 1e2c4: cd 59 subi r28, 0x9D ; 157 1e2c6: d0 40 sbci r29, 0x00 ; 0 1e2c8: 89 a1 ldd r24, Y+33 ; 0x21 1e2ca: 9a a1 ldd r25, Y+34 ; 0x22 1e2cc: ab a1 ldd r26, Y+35 ; 0x23 1e2ce: bc a1 ldd r27, Y+36 ; 0x24 1e2d0: cf 55 subi r28, 0x5F ; 95 1e2d2: df 4f sbci r29, 0xFF ; 255 1e2d4: 88 83 st Y, r24 1e2d6: 99 83 std Y+1, r25 ; 0x01 1e2d8: aa 83 std Y+2, r26 ; 0x02 1e2da: bb 83 std Y+3, r27 ; 0x03 1e2dc: c1 5a subi r28, 0xA1 ; 161 1e2de: d0 40 sbci r29, 0x00 ; 0 1e2e0: 2d a1 ldd r18, Y+37 ; 0x25 1e2e2: 3e a1 ldd r19, Y+38 ; 0x26 1e2e4: 4f a1 ldd r20, Y+39 ; 0x27 1e2e6: 58 a5 ldd r21, Y+40 ; 0x28 1e2e8: cb 55 subi r28, 0x5B ; 91 1e2ea: df 4f sbci r29, 0xFF ; 255 1e2ec: 28 83 st Y, r18 1e2ee: 39 83 std Y+1, r19 ; 0x01 1e2f0: 4a 83 std Y+2, r20 ; 0x02 1e2f2: 5b 83 std Y+3, r21 ; 0x03 1e2f4: c5 5a subi r28, 0xA5 ; 165 1e2f6: d0 40 sbci r29, 0x00 ; 0 1e2f8: 8d a5 ldd r24, Y+45 ; 0x2d 1e2fa: 9e a5 ldd r25, Y+46 ; 0x2e 1e2fc: af a5 ldd r26, Y+47 ; 0x2f 1e2fe: b8 a9 ldd r27, Y+48 ; 0x30 1e300: cd 54 subi r28, 0x4D ; 77 1e302: df 4f sbci r29, 0xFF ; 255 1e304: 88 83 st Y, r24 1e306: 99 83 std Y+1, r25 ; 0x01 1e308: aa 83 std Y+2, r26 ; 0x02 1e30a: bb 83 std Y+3, r27 ; 0x03 1e30c: c3 5b subi r28, 0xB3 ; 179 1e30e: d0 40 sbci r29, 0x00 ; 0 1e310: 29 a5 ldd r18, Y+41 ; 0x29 1e312: 3a a5 ldd r19, Y+42 ; 0x2a 1e314: 4b a5 ldd r20, Y+43 ; 0x2b 1e316: 5c a5 ldd r21, Y+44 ; 0x2c 1e318: c9 54 subi r28, 0x49 ; 73 1e31a: df 4f sbci r29, 0xFF ; 255 1e31c: 28 83 st Y, r18 1e31e: 39 83 std Y+1, r19 ; 0x01 1e320: 4a 83 std Y+2, r20 ; 0x02 1e322: 5b 83 std Y+3, r21 ; 0x03 1e324: c7 5b subi r28, 0xB7 ; 183 1e326: 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]; 1e328: 61 96 adiw r28, 0x11 ; 17 1e32a: 8c ad ldd r24, Y+60 ; 0x3c 1e32c: 9d ad ldd r25, Y+61 ; 0x3d 1e32e: ae ad ldd r26, Y+62 ; 0x3e 1e330: bf ad ldd r27, Y+63 ; 0x3f 1e332: 61 97 sbiw r28, 0x11 ; 17 1e334: c5 54 subi r28, 0x45 ; 69 1e336: df 4f sbci r29, 0xFF ; 255 1e338: 88 83 st Y, r24 1e33a: 99 83 std Y+1, r25 ; 0x01 1e33c: aa 83 std Y+2, r26 ; 0x02 1e33e: bb 83 std Y+3, r27 ; 0x03 1e340: cb 5b subi r28, 0xBB ; 187 1e342: d0 40 sbci r29, 0x00 ; 0 1e344: 29 a9 ldd r18, Y+49 ; 0x31 1e346: 3a a9 ldd r19, Y+50 ; 0x32 1e348: 4b a9 ldd r20, Y+51 ; 0x33 1e34a: 5c a9 ldd r21, Y+52 ; 0x34 1e34c: c1 54 subi r28, 0x41 ; 65 1e34e: df 4f sbci r29, 0xFF ; 255 1e350: 28 83 st Y, r18 1e352: 39 83 std Y+1, r19 ; 0x01 1e354: 4a 83 std Y+2, r20 ; 0x02 1e356: 5b 83 std Y+3, r21 ; 0x03 1e358: cf 5b subi r28, 0xBF ; 191 1e35a: d0 40 sbci r29, 0x00 ; 0 1e35c: 8d a9 ldd r24, Y+53 ; 0x35 1e35e: 9e a9 ldd r25, Y+54 ; 0x36 1e360: af a9 ldd r26, Y+55 ; 0x37 1e362: b8 ad ldd r27, Y+56 ; 0x38 1e364: cd 53 subi r28, 0x3D ; 61 1e366: df 4f sbci r29, 0xFF ; 255 1e368: 88 83 st Y, r24 1e36a: 99 83 std Y+1, r25 ; 0x01 1e36c: aa 83 std Y+2, r26 ; 0x02 1e36e: bb 83 std Y+3, r27 ; 0x03 1e370: c3 5c subi r28, 0xC3 ; 195 1e372: d0 40 sbci r29, 0x00 ; 0 1e374: 29 ad ldd r18, Y+57 ; 0x39 1e376: 3a ad ldd r19, Y+58 ; 0x3a 1e378: 4b ad ldd r20, Y+59 ; 0x3b 1e37a: 5c ad ldd r21, Y+60 ; 0x3c 1e37c: c9 53 subi r28, 0x39 ; 57 1e37e: df 4f sbci r29, 0xFF ; 255 1e380: 28 83 st Y, r18 1e382: 39 83 std Y+1, r19 ; 0x01 1e384: 4a 83 std Y+2, r20 ; 0x02 1e386: 5b 83 std Y+3, r21 ; 0x03 1e388: c7 5c subi r28, 0xC7 ; 199 1e38a: d0 40 sbci r29, 0x00 ; 0 1e38c: 21 96 adiw r28, 0x01 ; 1 1e38e: 8c ad ldd r24, Y+60 ; 0x3c 1e390: 9d ad ldd r25, Y+61 ; 0x3d 1e392: ae ad ldd r26, Y+62 ; 0x3e 1e394: bf ad ldd r27, Y+63 ; 0x3f 1e396: 21 97 sbiw r28, 0x01 ; 1 1e398: c5 53 subi r28, 0x35 ; 53 1e39a: df 4f sbci r29, 0xFF ; 255 1e39c: 88 83 st Y, r24 1e39e: 99 83 std Y+1, r25 ; 0x01 1e3a0: aa 83 std Y+2, r26 ; 0x02 1e3a2: bb 83 std Y+3, r27 ; 0x03 1e3a4: cb 5c subi r28, 0xCB ; 203 1e3a6: d0 40 sbci r29, 0x00 ; 0 1e3a8: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 1e3aa: c1 2c mov r12, r1 1e3ac: d1 2c mov r13, r1 1e3ae: 76 01 movw r14, r12 1e3b0: 46 01 movw r8, r12 1e3b2: 57 01 movw r10, r14 1e3b4: 26 01 movw r4, r12 1e3b6: 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]; 1e3b8: a3 01 movw r20, r6 1e3ba: 92 01 movw r18, r4 1e3bc: e4 96 adiw r28, 0x34 ; 52 1e3be: 6c ad ldd r22, Y+60 ; 0x3c 1e3c0: 7d ad ldd r23, Y+61 ; 0x3d 1e3c2: 8e ad ldd r24, Y+62 ; 0x3e 1e3c4: 9f ad ldd r25, Y+63 ; 0x3f 1e3c6: e4 97 sbiw r28, 0x34 ; 52 1e3c8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e3cc: 9b 01 movw r18, r22 1e3ce: ac 01 movw r20, r24 1e3d0: ae 96 adiw r28, 0x2e ; 46 1e3d2: 6c ad ldd r22, Y+60 ; 0x3c 1e3d4: 7d ad ldd r23, Y+61 ; 0x3d 1e3d6: 8e ad ldd r24, Y+62 ; 0x3e 1e3d8: 9f ad ldd r25, Y+63 ; 0x3f 1e3da: ae 97 sbiw r28, 0x2e ; 46 1e3dc: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e3e0: 2b 01 movw r4, r22 1e3e2: 3c 01 movw r6, r24 1e3e4: a5 01 movw r20, r10 1e3e6: 94 01 movw r18, r8 1e3e8: ed 96 adiw r28, 0x3d ; 61 1e3ea: 6c ad ldd r22, Y+60 ; 0x3c 1e3ec: 7d ad ldd r23, Y+61 ; 0x3d 1e3ee: 8e ad ldd r24, Y+62 ; 0x3e 1e3f0: 9f ad ldd r25, Y+63 ; 0x3f 1e3f2: ed 97 sbiw r28, 0x3d ; 61 1e3f4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e3f8: 9b 01 movw r18, r22 1e3fa: ac 01 movw r20, r24 1e3fc: c3 01 movw r24, r6 1e3fe: b2 01 movw r22, r4 1e400: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e404: 2b 01 movw r4, r22 1e406: 3c 01 movw r6, r24 1e408: a7 01 movw r20, r14 1e40a: 96 01 movw r18, r12 1e40c: c3 58 subi r28, 0x83 ; 131 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: cd 57 subi r28, 0x7D ; 125 1e41a: d0 40 sbci r29, 0x00 ; 0 1e41c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e420: 9b 01 movw r18, r22 1e422: ac 01 movw r20, r24 1e424: c3 01 movw r24, r6 1e426: b2 01 movw r22, r4 1e428: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e42c: cf 57 subi r28, 0x7F ; 127 1e42e: df 4f sbci r29, 0xFF ; 255 1e430: 28 81 ld r18, Y 1e432: 39 81 ldd r19, Y+1 ; 0x01 1e434: 4a 81 ldd r20, Y+2 ; 0x02 1e436: 5b 81 ldd r21, Y+3 ; 0x03 1e438: c1 58 subi r28, 0x81 ; 129 1e43a: d0 40 sbci r29, 0x00 ; 0 1e43c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1e440: 6e 96 adiw r28, 0x1e ; 30 1e442: 6c af std Y+60, r22 ; 0x3c 1e444: 7d af std Y+61, r23 ; 0x3d 1e446: 8e af std Y+62, r24 ; 0x3e 1e448: 9f af std Y+63, r25 ; 0x3f 1e44a: 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]; 1e44c: c7 57 subi r28, 0x77 ; 119 1e44e: df 4f sbci r29, 0xFF ; 255 1e450: 28 81 ld r18, Y 1e452: 39 81 ldd r19, Y+1 ; 0x01 1e454: 4a 81 ldd r20, Y+2 ; 0x02 1e456: 5b 81 ldd r21, Y+3 ; 0x03 1e458: c9 58 subi r28, 0x89 ; 137 1e45a: d0 40 sbci r29, 0x00 ; 0 1e45c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e460: 9b 01 movw r18, r22 1e462: ac 01 movw r20, r24 1e464: cb 57 subi r28, 0x7B ; 123 1e466: df 4f sbci r29, 0xFF ; 255 1e468: 68 81 ld r22, Y 1e46a: 79 81 ldd r23, Y+1 ; 0x01 1e46c: 8a 81 ldd r24, Y+2 ; 0x02 1e46e: 9b 81 ldd r25, Y+3 ; 0x03 1e470: c5 58 subi r28, 0x85 ; 133 1e472: d0 40 sbci r29, 0x00 ; 0 1e474: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e478: 2b 01 movw r4, r22 1e47a: 3c 01 movw r6, r24 1e47c: a5 01 movw r20, r10 1e47e: 94 01 movw r18, r8 1e480: cb 56 subi r28, 0x6B ; 107 1e482: df 4f sbci r29, 0xFF ; 255 1e484: 68 81 ld r22, Y 1e486: 79 81 ldd r23, Y+1 ; 0x01 1e488: 8a 81 ldd r24, Y+2 ; 0x02 1e48a: 9b 81 ldd r25, Y+3 ; 0x03 1e48c: c5 59 subi r28, 0x95 ; 149 1e48e: d0 40 sbci r29, 0x00 ; 0 1e490: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e494: 9b 01 movw r18, r22 1e496: ac 01 movw r20, r24 1e498: c3 01 movw r24, r6 1e49a: b2 01 movw r22, r4 1e49c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e4a0: 4b 01 movw r8, r22 1e4a2: 5c 01 movw r10, r24 1e4a4: a7 01 movw r20, r14 1e4a6: 96 01 movw r18, r12 1e4a8: c7 56 subi r28, 0x67 ; 103 1e4aa: df 4f sbci r29, 0xFF ; 255 1e4ac: 68 81 ld r22, Y 1e4ae: 79 81 ldd r23, Y+1 ; 0x01 1e4b0: 8a 81 ldd r24, Y+2 ; 0x02 1e4b2: 9b 81 ldd r25, Y+3 ; 0x03 1e4b4: c9 59 subi r28, 0x99 ; 153 1e4b6: d0 40 sbci r29, 0x00 ; 0 1e4b8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e4bc: 9b 01 movw r18, r22 1e4be: ac 01 movw r20, r24 1e4c0: c5 01 movw r24, r10 1e4c2: b4 01 movw r22, r8 1e4c4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e4c8: c3 57 subi r28, 0x73 ; 115 1e4ca: df 4f sbci r29, 0xFF ; 255 1e4cc: 28 81 ld r18, Y 1e4ce: 39 81 ldd r19, Y+1 ; 0x01 1e4d0: 4a 81 ldd r20, Y+2 ; 0x02 1e4d2: 5b 81 ldd r21, Y+3 ; 0x03 1e4d4: cd 58 subi r28, 0x8D ; 141 1e4d6: d0 40 sbci r29, 0x00 ; 0 1e4d8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1e4dc: 2b 01 movw r4, r22 1e4de: 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]; 1e4e0: cf 55 subi r28, 0x5F ; 95 1e4e2: df 4f sbci r29, 0xFF ; 255 1e4e4: 28 81 ld r18, Y 1e4e6: 39 81 ldd r19, Y+1 ; 0x01 1e4e8: 4a 81 ldd r20, Y+2 ; 0x02 1e4ea: 5b 81 ldd r21, Y+3 ; 0x03 1e4ec: c1 5a subi r28, 0xA1 ; 161 1e4ee: d0 40 sbci r29, 0x00 ; 0 1e4f0: 6e 96 adiw r28, 0x1e ; 30 1e4f2: 6c ad ldd r22, Y+60 ; 0x3c 1e4f4: 7d ad ldd r23, Y+61 ; 0x3d 1e4f6: 8e ad ldd r24, Y+62 ; 0x3e 1e4f8: 9f ad ldd r25, Y+63 ; 0x3f 1e4fa: 6e 97 sbiw r28, 0x1e ; 30 1e4fc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e500: 9b 01 movw r18, r22 1e502: ac 01 movw r20, r24 1e504: c3 56 subi r28, 0x63 ; 99 1e506: df 4f sbci r29, 0xFF ; 255 1e508: 68 81 ld r22, Y 1e50a: 79 81 ldd r23, Y+1 ; 0x01 1e50c: 8a 81 ldd r24, Y+2 ; 0x02 1e50e: 9b 81 ldd r25, Y+3 ; 0x03 1e510: cd 59 subi r28, 0x9D ; 157 1e512: d0 40 sbci r29, 0x00 ; 0 1e514: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e518: 4b 01 movw r8, r22 1e51a: 5c 01 movw r10, r24 1e51c: cb 55 subi r28, 0x5B ; 91 1e51e: df 4f sbci r29, 0xFF ; 255 1e520: 28 81 ld r18, Y 1e522: 39 81 ldd r19, Y+1 ; 0x01 1e524: 4a 81 ldd r20, Y+2 ; 0x02 1e526: 5b 81 ldd r21, Y+3 ; 0x03 1e528: c5 5a subi r28, 0xA5 ; 165 1e52a: d0 40 sbci r29, 0x00 ; 0 1e52c: c3 01 movw r24, r6 1e52e: b2 01 movw r22, r4 1e530: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e534: 9b 01 movw r18, r22 1e536: ac 01 movw r20, r24 1e538: c5 01 movw r24, r10 1e53a: b4 01 movw r22, r8 1e53c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e540: 4b 01 movw r8, r22 1e542: 5c 01 movw r10, r24 1e544: a7 01 movw r20, r14 1e546: 96 01 movw r18, r12 1e548: cd 54 subi r28, 0x4D ; 77 1e54a: df 4f sbci r29, 0xFF ; 255 1e54c: 68 81 ld r22, Y 1e54e: 79 81 ldd r23, Y+1 ; 0x01 1e550: 8a 81 ldd r24, Y+2 ; 0x02 1e552: 9b 81 ldd r25, Y+3 ; 0x03 1e554: c3 5b subi r28, 0xB3 ; 179 1e556: d0 40 sbci r29, 0x00 ; 0 1e558: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e55c: 9b 01 movw r18, r22 1e55e: ac 01 movw r20, r24 1e560: c5 01 movw r24, r10 1e562: b4 01 movw r22, r8 1e564: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e568: c9 54 subi r28, 0x49 ; 73 1e56a: df 4f sbci r29, 0xFF ; 255 1e56c: 28 81 ld r18, Y 1e56e: 39 81 ldd r19, Y+1 ; 0x01 1e570: 4a 81 ldd r20, Y+2 ; 0x02 1e572: 5b 81 ldd r21, Y+3 ; 0x03 1e574: c7 5b subi r28, 0xB7 ; 183 1e576: d0 40 sbci r29, 0x00 ; 0 1e578: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1e57c: 4b 01 movw r8, r22 1e57e: 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]; 1e580: c1 54 subi r28, 0x41 ; 65 1e582: df 4f sbci r29, 0xFF ; 255 1e584: 28 81 ld r18, Y 1e586: 39 81 ldd r19, Y+1 ; 0x01 1e588: 4a 81 ldd r20, Y+2 ; 0x02 1e58a: 5b 81 ldd r21, Y+3 ; 0x03 1e58c: cf 5b subi r28, 0xBF ; 191 1e58e: d0 40 sbci r29, 0x00 ; 0 1e590: 6e 96 adiw r28, 0x1e ; 30 1e592: 6c ad ldd r22, Y+60 ; 0x3c 1e594: 7d ad ldd r23, Y+61 ; 0x3d 1e596: 8e ad ldd r24, Y+62 ; 0x3e 1e598: 9f ad ldd r25, Y+63 ; 0x3f 1e59a: 6e 97 sbiw r28, 0x1e ; 30 1e59c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e5a0: 9b 01 movw r18, r22 1e5a2: ac 01 movw r20, r24 1e5a4: c5 54 subi r28, 0x45 ; 69 1e5a6: df 4f sbci r29, 0xFF ; 255 1e5a8: 68 81 ld r22, Y 1e5aa: 79 81 ldd r23, Y+1 ; 0x01 1e5ac: 8a 81 ldd r24, Y+2 ; 0x02 1e5ae: 9b 81 ldd r25, Y+3 ; 0x03 1e5b0: cb 5b subi r28, 0xBB ; 187 1e5b2: d0 40 sbci r29, 0x00 ; 0 1e5b4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e5b8: 6b 01 movw r12, r22 1e5ba: 7c 01 movw r14, r24 1e5bc: cd 53 subi r28, 0x3D ; 61 1e5be: df 4f sbci r29, 0xFF ; 255 1e5c0: 28 81 ld r18, Y 1e5c2: 39 81 ldd r19, Y+1 ; 0x01 1e5c4: 4a 81 ldd r20, Y+2 ; 0x02 1e5c6: 5b 81 ldd r21, Y+3 ; 0x03 1e5c8: c3 5c subi r28, 0xC3 ; 195 1e5ca: d0 40 sbci r29, 0x00 ; 0 1e5cc: c3 01 movw r24, r6 1e5ce: b2 01 movw r22, r4 1e5d0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e5d4: 9b 01 movw r18, r22 1e5d6: ac 01 movw r20, r24 1e5d8: c7 01 movw r24, r14 1e5da: b6 01 movw r22, r12 1e5dc: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e5e0: 6b 01 movw r12, r22 1e5e2: 7c 01 movw r14, r24 1e5e4: c9 53 subi r28, 0x39 ; 57 1e5e6: df 4f sbci r29, 0xFF ; 255 1e5e8: 28 81 ld r18, Y 1e5ea: 39 81 ldd r19, Y+1 ; 0x01 1e5ec: 4a 81 ldd r20, Y+2 ; 0x02 1e5ee: 5b 81 ldd r21, Y+3 ; 0x03 1e5f0: c7 5c subi r28, 0xC7 ; 199 1e5f2: d0 40 sbci r29, 0x00 ; 0 1e5f4: c5 01 movw r24, r10 1e5f6: b4 01 movw r22, r8 1e5f8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e5fc: 9b 01 movw r18, r22 1e5fe: ac 01 movw r20, r24 1e600: c7 01 movw r24, r14 1e602: b6 01 movw r22, r12 1e604: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e608: c5 53 subi r28, 0x35 ; 53 1e60a: df 4f sbci r29, 0xFF ; 255 1e60c: 28 81 ld r18, Y 1e60e: 39 81 ldd r19, Y+1 ; 0x01 1e610: 4a 81 ldd r20, Y+2 ; 0x02 1e612: 5b 81 ldd r21, Y+3 ; 0x03 1e614: cb 5c subi r28, 0xCB ; 203 1e616: d0 40 sbci r29, 0x00 ; 0 1e618: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1e61c: 6b 01 movw r12, r22 1e61e: 7c 01 movw r14, r24 1e620: 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) { 1e622: 09 f0 breq .+2 ; 0x1e626 1e624: c9 ce rjmp .-622 ; 0x1e3b8 // 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]; 1e626: 6e 96 adiw r28, 0x1e ; 30 1e628: 2c ad ldd r18, Y+60 ; 0x3c 1e62a: 3d ad ldd r19, Y+61 ; 0x3d 1e62c: 4e ad ldd r20, Y+62 ; 0x3e 1e62e: 5f ad ldd r21, Y+63 ; 0x3f 1e630: 6e 97 sbiw r28, 0x1e ; 30 1e632: c5 55 subi r28, 0x55 ; 85 1e634: df 4f sbci r29, 0xFF ; 255 1e636: 68 81 ld r22, Y 1e638: 79 81 ldd r23, Y+1 ; 0x01 1e63a: 8a 81 ldd r24, Y+2 ; 0x02 1e63c: 9b 81 ldd r25, Y+3 ; 0x03 1e63e: cb 5a subi r28, 0xAB ; 171 1e640: d0 40 sbci r29, 0x00 ; 0 1e642: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e646: 60 93 d1 13 sts 0x13D1, r22 ; 0x8013d1 1e64a: 70 93 d2 13 sts 0x13D2, r23 ; 0x8013d2 1e64e: 80 93 d3 13 sts 0x13D3, r24 ; 0x8013d3 1e652: 90 93 d4 13 sts 0x13D4, r25 ; 0x8013d4 cntr[1] += h[1]; 1e656: a3 01 movw r20, r6 1e658: 92 01 movw r18, r4 1e65a: c1 55 subi r28, 0x51 ; 81 1e65c: df 4f sbci r29, 0xFF ; 255 1e65e: 68 81 ld r22, Y 1e660: 79 81 ldd r23, Y+1 ; 0x01 1e662: 8a 81 ldd r24, Y+2 ; 0x02 1e664: 9b 81 ldd r25, Y+3 ; 0x03 1e666: cf 5a subi r28, 0xAF ; 175 1e668: d0 40 sbci r29, 0x00 ; 0 1e66a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e66e: 60 93 d5 13 sts 0x13D5, r22 ; 0x8013d5 1e672: 70 93 d6 13 sts 0x13D6, r23 ; 0x8013d6 1e676: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1e67a: 90 93 d8 13 sts 0x13D8, r25 ; 0x8013d8 a1 += h[2]; 1e67e: a5 01 movw r20, r10 1e680: 94 01 movw r18, r8 1e682: a6 96 adiw r28, 0x26 ; 38 1e684: 6c ad ldd r22, Y+60 ; 0x3c 1e686: 7d ad ldd r23, Y+61 ; 0x3d 1e688: 8e ad ldd r24, Y+62 ; 0x3e 1e68a: 9f ad ldd r25, Y+63 ; 0x3f 1e68c: a6 97 sbiw r28, 0x26 ; 38 1e68e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e692: a6 96 adiw r28, 0x26 ; 38 1e694: 6c af std Y+60, r22 ; 0x3c 1e696: 7d af std Y+61, r23 ; 0x3d 1e698: 8e af std Y+62, r24 ; 0x3e 1e69a: 9f af std Y+63, r25 ; 0x3f 1e69c: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 1e69e: a7 01 movw r20, r14 1e6a0: 96 01 movw r18, r12 1e6a2: a2 96 adiw r28, 0x22 ; 34 1e6a4: 6c ad ldd r22, Y+60 ; 0x3c 1e6a6: 7d ad ldd r23, Y+61 ; 0x3d 1e6a8: 8e ad ldd r24, Y+62 ; 0x3e 1e6aa: 9f ad ldd r25, Y+63 ; 0x3f 1e6ac: a2 97 sbiw r28, 0x22 ; 34 1e6ae: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e6b2: a2 96 adiw r28, 0x22 ; 34 1e6b4: 6c af std Y+60, r22 ; 0x3c 1e6b6: 7d af std Y+61, r23 ; 0x3d 1e6b8: 8e af std Y+62, r24 ; 0x3e 1e6ba: 9f af std Y+63, r25 ; 0x3f 1e6bc: a2 97 sbiw r28, 0x22 ; 34 1e6be: e6 96 adiw r28, 0x36 ; 54 1e6c0: 9f ad ldd r25, Y+63 ; 0x3f 1e6c2: e6 97 sbiw r28, 0x36 ; 54 1e6c4: 91 50 subi r25, 0x01 ; 1 1e6c6: e6 96 adiw r28, 0x36 ; 54 1e6c8: 9f af std Y+63, r25 ; 0x3f 1e6ca: 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) { 1e6cc: 91 11 cpse r25, r1 1e6ce: 70 c9 rjmp .-3360 ; 0x1d9b0 SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1e6d0: a6 96 adiw r28, 0x26 ; 38 1e6d2: 6c ad ldd r22, Y+60 ; 0x3c 1e6d4: 7d ad ldd r23, Y+61 ; 0x3d 1e6d6: 8e ad ldd r24, Y+62 ; 0x3e 1e6d8: 9f ad ldd r25, Y+63 ; 0x3f 1e6da: a6 97 sbiw r28, 0x26 ; 38 1e6dc: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 1e6e0: 60 93 c1 13 sts 0x13C1, r22 ; 0x8013c1 1e6e4: 70 93 c2 13 sts 0x13C2, r23 ; 0x8013c2 1e6e8: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 1e6ec: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1e6f0: a6 96 adiw r28, 0x26 ; 38 1e6f2: 6c ad ldd r22, Y+60 ; 0x3c 1e6f4: 7d ad ldd r23, Y+61 ; 0x3d 1e6f6: 8e ad ldd r24, Y+62 ; 0x3e 1e6f8: 9f ad ldd r25, Y+63 ; 0x3f 1e6fa: a6 97 sbiw r28, 0x26 ; 38 1e6fc: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 1e700: 60 93 c5 13 sts 0x13C5, r22 ; 0x8013c5 1e704: 70 93 c6 13 sts 0x13C6, r23 ; 0x8013c6 1e708: 80 93 c7 13 sts 0x13C7, r24 ; 0x8013c7 1e70c: 90 93 c8 13 sts 0x13C8, r25 ; 0x8013c8 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 1e710: a2 96 adiw r28, 0x22 ; 34 1e712: 6c ad ldd r22, Y+60 ; 0x3c 1e714: 7d ad ldd r23, Y+61 ; 0x3d 1e716: 8e ad ldd r24, Y+62 ; 0x3e 1e718: 9f ad ldd r25, Y+63 ; 0x3f 1e71a: a2 97 sbiw r28, 0x22 ; 34 1e71c: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 1e720: 90 58 subi r25, 0x80 ; 128 1e722: 60 93 c9 13 sts 0x13C9, r22 ; 0x8013c9 1e726: 70 93 ca 13 sts 0x13CA, r23 ; 0x8013ca 1e72a: 80 93 cb 13 sts 0x13CB, r24 ; 0x8013cb 1e72e: 90 93 cc 13 sts 0x13CC, r25 ; 0x8013cc vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 1e732: a2 96 adiw r28, 0x22 ; 34 1e734: 6c ad ldd r22, Y+60 ; 0x3c 1e736: 7d ad ldd r23, Y+61 ; 0x3d 1e738: 8e ad ldd r24, Y+62 ; 0x3e 1e73a: 9f ad ldd r25, Y+63 ; 0x3f 1e73c: a2 97 sbiw r28, 0x22 ; 34 1e73e: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 1e742: 60 93 cd 13 sts 0x13CD, r22 ; 0x8013cd 1e746: 70 93 ce 13 sts 0x13CE, r23 ; 0x8013ce 1e74a: 80 93 cf 13 sts 0x13CF, r24 ; 0x8013cf 1e74e: 90 93 d0 13 sts 0x13D0, r25 ; 0x8013d0 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 1e752: a6 96 adiw r28, 0x26 ; 38 1e754: 2c ad ldd r18, Y+60 ; 0x3c 1e756: 3d ad ldd r19, Y+61 ; 0x3d 1e758: 4e ad ldd r20, Y+62 ; 0x3e 1e75a: 5f ad ldd r21, Y+63 ; 0x3f 1e75c: a6 97 sbiw r28, 0x26 ; 38 1e75e: a2 96 adiw r28, 0x22 ; 34 1e760: 6c ad ldd r22, Y+60 ; 0x3c 1e762: 7d ad ldd r23, Y+61 ; 0x3d 1e764: 8e ad ldd r24, Y+62 ; 0x3e 1e766: 9f ad ldd r25, Y+63 ; 0x3f 1e768: a2 97 sbiw r28, 0x22 ; 34 1e76a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e76e: 4b 01 movw r8, r22 1e770: 5c 01 movw r10, r24 1e772: 7c 01 movw r14, r24 1e774: 6b 01 movw r12, r22 1e776: e8 94 clt 1e778: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 1e77a: 21 ee ldi r18, 0xE1 ; 225 1e77c: 3e e2 ldi r19, 0x2E ; 46 1e77e: 45 e6 ldi r20, 0x65 ; 101 1e780: 52 e4 ldi r21, 0x42 ; 66 1e782: a2 96 adiw r28, 0x22 ; 34 1e784: 6c ad ldd r22, Y+60 ; 0x3c 1e786: 7d ad ldd r23, Y+61 ; 0x3d 1e788: 8e ad ldd r24, Y+62 ; 0x3e 1e78a: 9f ad ldd r25, Y+63 ; 0x3f 1e78c: a2 97 sbiw r28, 0x22 ; 34 1e78e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e792: 9f 93 push r25 1e794: 8f 93 push r24 1e796: 7f 93 push r23 1e798: 6f 93 push r22 1e79a: 21 ee ldi r18, 0xE1 ; 225 1e79c: 3e e2 ldi r19, 0x2E ; 46 1e79e: 45 e6 ldi r20, 0x65 ; 101 1e7a0: 52 e4 ldi r21, 0x42 ; 66 1e7a2: c5 01 movw r24, r10 1e7a4: b4 01 movw r22, r8 1e7a6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e7aa: 9f 93 push r25 1e7ac: 8f 93 push r24 1e7ae: 7f 93 push r23 1e7b0: 6f 93 push r22 1e7b2: 86 e1 ldi r24, 0x16 ; 22 1e7b4: 9e e6 ldi r25, 0x6E ; 110 1e7b6: 9f 93 push r25 1e7b8: 8f 93 push r24 1e7ba: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 1e7be: b7 01 movw r22, r14 1e7c0: a6 01 movw r20, r12 1e7c2: 80 e6 ldi r24, 0x60 ; 96 1e7c4: 9f e0 ldi r25, 0x0F ; 15 1e7c6: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 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) 1e7ca: 0f b6 in r0, 0x3f ; 63 1e7cc: f8 94 cli 1e7ce: de bf out 0x3e, r29 ; 62 1e7d0: 0f be out 0x3f, r0 ; 63 1e7d2: cd bf out 0x3d, r28 ; 61 1e7d4: 2f e1 ldi r18, 0x1F ; 31 1e7d6: 32 e4 ldi r19, 0x42 ; 66 1e7d8: 49 e0 ldi r20, 0x09 ; 9 1e7da: 5b e3 ldi r21, 0x3B ; 59 1e7dc: c7 01 movw r24, r14 1e7de: b6 01 movw r22, r12 1e7e0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__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; 1e7e4: 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) 1e7e6: 18 16 cp r1, r24 1e7e8: 64 f4 brge .+24 ; 0x1e802 result = (angleDiff > bed_skew_angle_extreme) ? 1e7ea: 25 e3 ldi r18, 0x35 ; 53 1e7ec: 3a ef ldi r19, 0xFA ; 250 1e7ee: 4e e8 ldi r20, 0x8E ; 142 1e7f0: 5b e3 ldi r21, 0x3B ; 59 1e7f2: c7 01 movw r24, r14 1e7f4: b6 01 movw r22, r12 1e7f6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1e7fa: 12 e0 ldi r17, 0x02 ; 2 1e7fc: 18 16 cp r1, r24 1e7fe: 0c f0 brlt .+2 ; 0x1e802 1e800: 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 || 1e802: 25 e3 ldi r18, 0x35 ; 53 1e804: 3a ef ldi r19, 0xFA ; 250 1e806: 4e e8 ldi r20, 0x8E ; 142 1e808: 5b e3 ldi r21, 0x3B ; 59 1e80a: a6 96 adiw r28, 0x26 ; 38 1e80c: 6c ad ldd r22, Y+60 ; 0x3c 1e80e: 7d ad ldd r23, Y+61 ; 0x3d 1e810: 8e ad ldd r24, Y+62 ; 0x3e 1e812: 9f ad ldd r25, Y+63 ; 0x3f 1e814: a6 97 sbiw r28, 0x26 ; 38 1e816: 9f 77 andi r25, 0x7F ; 127 1e818: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1e81c: 18 16 cp r1, r24 1e81e: 0c f4 brge .+2 ; 0x1e822 1e820: 67 c4 rjmp .+2254 ; 0x1f0f0 1e822: 25 e3 ldi r18, 0x35 ; 53 1e824: 3a ef ldi r19, 0xFA ; 250 1e826: 4e e8 ldi r20, 0x8E ; 142 1e828: 5b e3 ldi r21, 0x3B ; 59 1e82a: a2 96 adiw r28, 0x22 ; 34 1e82c: 6c ad ldd r22, Y+60 ; 0x3c 1e82e: 7d ad ldd r23, Y+61 ; 0x3d 1e830: 8e ad ldd r24, Y+62 ; 0x3e 1e832: 9f ad ldd r25, Y+63 ; 0x3f 1e834: a2 97 sbiw r28, 0x22 ; 34 1e836: 9f 77 andi r25, 0x7F ; 127 1e838: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1e83c: 18 16 cp r1, r24 1e83e: 0c f4 brge .+2 ; 0x1e842 1e840: 57 c4 rjmp .+2222 ; 0x1f0f0 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]; 1e842: 20 91 c1 13 lds r18, 0x13C1 ; 0x8013c1 1e846: 30 91 c2 13 lds r19, 0x13C2 ; 0x8013c2 1e84a: 40 91 c3 13 lds r20, 0x13C3 ; 0x8013c3 1e84e: 50 91 c4 13 lds r21, 0x13C4 ; 0x8013c4 1e852: ae 96 adiw r28, 0x2e ; 46 1e854: 2c af std Y+60, r18 ; 0x3c 1e856: 3d af std Y+61, r19 ; 0x3d 1e858: 4e af std Y+62, r20 ; 0x3e 1e85a: 5f af std Y+63, r21 ; 0x3f 1e85c: ae 97 sbiw r28, 0x2e ; 46 1e85e: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 1e862: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 1e866: a0 91 cb 13 lds r26, 0x13CB ; 0x8013cb 1e86a: b0 91 cc 13 lds r27, 0x13CC ; 0x8013cc 1e86e: e9 96 adiw r28, 0x39 ; 57 1e870: 8c af std Y+60, r24 ; 0x3c 1e872: 9d af std Y+61, r25 ; 0x3d 1e874: ae af std Y+62, r26 ; 0x3e 1e876: bf af std Y+63, r27 ; 0x3f 1e878: e9 97 sbiw r28, 0x39 ; 57 1e87a: 20 91 d1 13 lds r18, 0x13D1 ; 0x8013d1 1e87e: 30 91 d2 13 lds r19, 0x13D2 ; 0x8013d2 1e882: 40 91 d3 13 lds r20, 0x13D3 ; 0x8013d3 1e886: 50 91 d4 13 lds r21, 0x13D4 ; 0x8013d4 1e88a: e4 96 adiw r28, 0x34 ; 52 1e88c: 2c af std Y+60, r18 ; 0x3c 1e88e: 3d af std Y+61, r19 ; 0x3d 1e890: 4e af std Y+62, r20 ; 0x3e 1e892: 5f af std Y+63, r21 ; 0x3f 1e894: 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]; 1e896: 80 91 c5 13 lds r24, 0x13C5 ; 0x8013c5 1e89a: 90 91 c6 13 lds r25, 0x13C6 ; 0x8013c6 1e89e: a0 91 c7 13 lds r26, 0x13C7 ; 0x8013c7 1e8a2: b0 91 c8 13 lds r27, 0x13C8 ; 0x8013c8 1e8a6: ed 96 adiw r28, 0x3d ; 61 1e8a8: 8c af std Y+60, r24 ; 0x3c 1e8aa: 9d af std Y+61, r25 ; 0x3d 1e8ac: ae af std Y+62, r26 ; 0x3e 1e8ae: bf af std Y+63, r27 ; 0x3f 1e8b0: ed 97 sbiw r28, 0x3d ; 61 1e8b2: 20 91 cd 13 lds r18, 0x13CD ; 0x8013cd 1e8b6: 30 91 ce 13 lds r19, 0x13CE ; 0x8013ce 1e8ba: 40 91 cf 13 lds r20, 0x13CF ; 0x8013cf 1e8be: 50 91 d0 13 lds r21, 0x13D0 ; 0x8013d0 1e8c2: c3 58 subi r28, 0x83 ; 131 1e8c4: df 4f sbci r29, 0xFF ; 255 1e8c6: 28 83 st Y, r18 1e8c8: 39 83 std Y+1, r19 ; 0x01 1e8ca: 4a 83 std Y+2, r20 ; 0x02 1e8cc: 5b 83 std Y+3, r21 ; 0x03 1e8ce: cd 57 subi r28, 0x7D ; 125 1e8d0: d0 40 sbci r29, 0x00 ; 0 1e8d2: 80 91 d5 13 lds r24, 0x13D5 ; 0x8013d5 1e8d6: 90 91 d6 13 lds r25, 0x13D6 ; 0x8013d6 1e8da: a0 91 d7 13 lds r26, 0x13D7 ; 0x8013d7 1e8de: b0 91 d8 13 lds r27, 0x13D8 ; 0x8013d8 1e8e2: cf 57 subi r28, 0x7F ; 127 1e8e4: df 4f sbci r29, 0xFF ; 255 1e8e6: 88 83 st Y, r24 1e8e8: 99 83 std Y+1, r25 ; 0x01 1e8ea: aa 83 std Y+2, r26 ; 0x02 1e8ec: bb 83 std Y+3, r27 ; 0x03 1e8ee: c1 58 subi r28, 0x81 ; 129 1e8f0: d0 40 sbci r29, 0x00 ; 0 1e8f2: af e1 ldi r26, 0x1F ; 31 1e8f4: b2 e9 ldi r27, 0x92 ; 146 1e8f6: 6c 96 adiw r28, 0x1c ; 28 1e8f8: bf af std Y+63, r27 ; 0x3f 1e8fa: ae af std Y+62, r26 ; 0x3e 1e8fc: 6c 97 sbiw r28, 0x1c ; 28 1e8fe: 80 ea ldi r24, 0xA0 ; 160 1e900: 28 2e mov r2, r24 1e902: 83 e1 ldi r24, 0x13 ; 19 1e904: 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]; 1e906: f1 01 movw r30, r2 1e908: c1 80 ldd r12, Z+1 ; 0x01 1e90a: d2 80 ldd r13, Z+2 ; 0x02 1e90c: e3 80 ldd r14, Z+3 ; 0x03 1e90e: f4 80 ldd r15, Z+4 ; 0x04 1e910: 45 80 ldd r4, Z+5 ; 0x05 1e912: 56 80 ldd r5, Z+6 ; 0x06 1e914: 67 80 ldd r6, Z+7 ; 0x07 1e916: 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; 1e918: 6c 96 adiw r28, 0x1c ; 28 1e91a: ee ad ldd r30, Y+62 ; 0x3e 1e91c: ff ad ldd r31, Y+63 ; 0x3f 1e91e: 6c 97 sbiw r28, 0x1c ; 28 1e920: 25 91 lpm r18, Z+ 1e922: 35 91 lpm r19, Z+ 1e924: 45 91 lpm r20, Z+ 1e926: 54 91 lpm r21, Z 1e928: cb 57 subi r28, 0x7B ; 123 1e92a: df 4f sbci r29, 0xFF ; 255 1e92c: 28 83 st Y, r18 1e92e: 39 83 std Y+1, r19 ; 0x01 1e930: 4a 83 std Y+2, r20 ; 0x02 1e932: 5b 83 std Y+3, r21 ; 0x03 1e934: c5 58 subi r28, 0x85 ; 133 1e936: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 1e938: 6c 96 adiw r28, 0x1c ; 28 1e93a: ee ad ldd r30, Y+62 ; 0x3e 1e93c: ff ad ldd r31, Y+63 ; 0x3f 1e93e: 6c 97 sbiw r28, 0x1c ; 28 1e940: 34 96 adiw r30, 0x04 ; 4 1e942: 85 90 lpm r8, Z+ 1e944: 95 90 lpm r9, Z+ 1e946: a5 90 lpm r10, Z+ 1e948: 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]; 1e94a: ed 96 adiw r28, 0x3d ; 61 1e94c: 2c ad ldd r18, Y+60 ; 0x3c 1e94e: 3d ad ldd r19, Y+61 ; 0x3d 1e950: 4e ad ldd r20, Y+62 ; 0x3e 1e952: 5f ad ldd r21, Y+63 ; 0x3f 1e954: ed 97 sbiw r28, 0x3d ; 61 1e956: c7 01 movw r24, r14 1e958: b6 01 movw r22, r12 1e95a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e95e: c7 57 subi r28, 0x77 ; 119 1e960: df 4f sbci r29, 0xFF ; 255 1e962: 68 83 st Y, r22 1e964: 79 83 std Y+1, r23 ; 0x01 1e966: 8a 83 std Y+2, r24 ; 0x02 1e968: 9b 83 std Y+3, r25 ; 0x03 1e96a: c9 58 subi r28, 0x89 ; 137 1e96c: d0 40 sbci r29, 0x00 ; 0 1e96e: c3 58 subi r28, 0x83 ; 131 1e970: df 4f sbci r29, 0xFF ; 255 1e972: 28 81 ld r18, Y 1e974: 39 81 ldd r19, Y+1 ; 0x01 1e976: 4a 81 ldd r20, Y+2 ; 0x02 1e978: 5b 81 ldd r21, Y+3 ; 0x03 1e97a: cd 57 subi r28, 0x7D ; 125 1e97c: d0 40 sbci r29, 0x00 ; 0 1e97e: c3 01 movw r24, r6 1e980: b2 01 movw r22, r4 1e982: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e986: 9b 01 movw r18, r22 1e988: ac 01 movw r20, r24 1e98a: c7 57 subi r28, 0x77 ; 119 1e98c: df 4f sbci r29, 0xFF ; 255 1e98e: 68 81 ld r22, Y 1e990: 79 81 ldd r23, Y+1 ; 0x01 1e992: 8a 81 ldd r24, Y+2 ; 0x02 1e994: 9b 81 ldd r25, Y+3 ; 0x03 1e996: c9 58 subi r28, 0x89 ; 137 1e998: d0 40 sbci r29, 0x00 ; 0 1e99a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e99e: cf 57 subi r28, 0x7F ; 127 1e9a0: df 4f sbci r29, 0xFF ; 255 1e9a2: 28 81 ld r18, Y 1e9a4: 39 81 ldd r19, Y+1 ; 0x01 1e9a6: 4a 81 ldd r20, Y+2 ; 0x02 1e9a8: 5b 81 ldd r21, Y+3 ; 0x03 1e9aa: c1 58 subi r28, 0x81 ; 129 1e9ac: d0 40 sbci r29, 0x00 ; 0 1e9ae: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e9b2: 9b 01 movw r18, r22 1e9b4: 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; 1e9b6: c5 01 movw r24, r10 1e9b8: b4 01 movw r22, r8 1e9ba: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1e9be: 4b 01 movw r8, r22 1e9c0: 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]; 1e9c2: a7 01 movw r20, r14 1e9c4: 96 01 movw r18, r12 1e9c6: ae 96 adiw r28, 0x2e ; 46 1e9c8: 6c ad ldd r22, Y+60 ; 0x3c 1e9ca: 7d ad ldd r23, Y+61 ; 0x3d 1e9cc: 8e ad ldd r24, Y+62 ; 0x3e 1e9ce: 9f ad ldd r25, Y+63 ; 0x3f 1e9d0: ae 97 sbiw r28, 0x2e ; 46 1e9d2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e9d6: 6b 01 movw r12, r22 1e9d8: 7c 01 movw r14, r24 1e9da: a3 01 movw r20, r6 1e9dc: 92 01 movw r18, r4 1e9de: e9 96 adiw r28, 0x39 ; 57 1e9e0: 6c ad ldd r22, Y+60 ; 0x3c 1e9e2: 7d ad ldd r23, Y+61 ; 0x3d 1e9e4: 8e ad ldd r24, Y+62 ; 0x3e 1e9e6: 9f ad ldd r25, Y+63 ; 0x3f 1e9e8: e9 97 sbiw r28, 0x39 ; 57 1e9ea: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1e9ee: 9b 01 movw r18, r22 1e9f0: ac 01 movw r20, r24 1e9f2: c7 01 movw r24, r14 1e9f4: b6 01 movw r22, r12 1e9f6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1e9fa: e4 96 adiw r28, 0x34 ; 52 1e9fc: 2c ad ldd r18, Y+60 ; 0x3c 1e9fe: 3d ad ldd r19, Y+61 ; 0x3d 1ea00: 4e ad ldd r20, Y+62 ; 0x3e 1ea02: 5f ad ldd r21, Y+63 ; 0x3f 1ea04: e4 97 sbiw r28, 0x34 ; 52 1ea06: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1ea0a: 9b 01 movw r18, r22 1ea0c: 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; 1ea0e: cb 57 subi r28, 0x7B ; 123 1ea10: df 4f sbci r29, 0xFF ; 255 1ea12: 68 81 ld r22, Y 1ea14: 79 81 ldd r23, Y+1 ; 0x01 1ea16: 8a 81 ldd r24, Y+2 ; 0x02 1ea18: 9b 81 ldd r25, Y+3 ; 0x03 1ea1a: c5 58 subi r28, 0x85 ; 133 1ea1c: d0 40 sbci r29, 0x00 ; 0 1ea1e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 1ea22: a5 01 movw r20, r10 1ea24: 94 01 movw r18, r8 1ea26: 0f 94 55 e1 call 0x3c2aa ; 0x3c2aa } 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) { 1ea2a: 2d ec ldi r18, 0xCD ; 205 1ea2c: 3c ec ldi r19, 0xCC ; 204 1ea2e: 4c e4 ldi r20, 0x4C ; 76 1ea30: 5f e3 ldi r21, 0x3F ; 63 1ea32: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1ea36: 18 16 cp r1, r24 1ea38: 0c f4 brge .+2 ; 0x1ea3c result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 1ea3a: 1e ef ldi r17, 0xFE ; 254 1ea3c: 38 e0 ldi r19, 0x08 ; 8 1ea3e: 23 0e add r2, r19 1ea40: 31 1c adc r3, r1 1ea42: 6c 96 adiw r28, 0x1c ; 28 1ea44: 4e ad ldd r20, Y+62 ; 0x3e 1ea46: 5f ad ldd r21, Y+63 ; 0x3f 1ea48: 6c 97 sbiw r28, 0x1c ; 28 1ea4a: 48 5f subi r20, 0xF8 ; 248 1ea4c: 5f 4f sbci r21, 0xFF ; 255 1ea4e: 6c 96 adiw r28, 0x1c ; 28 1ea50: 5f af std Y+63, r21 ; 0x3f 1ea52: 4e af std Y+62, r20 ; 0x3e 1ea54: 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) { 1ea56: a8 96 adiw r28, 0x28 ; 40 1ea58: 8e ad ldd r24, Y+62 ; 0x3e 1ea5a: 9f ad ldd r25, Y+63 ; 0x3f 1ea5c: a8 97 sbiw r28, 0x28 ; 40 1ea5e: 82 15 cp r24, r2 1ea60: 93 05 cpc r25, r3 1ea62: 09 f0 breq .+2 ; 0x1ea66 1ea64: 50 cf rjmp .-352 ; 0x1e906 MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 1ea66: 11 11 cpse r17, r1 1ea68: 62 c1 rjmp .+708 ; 0x1ed2e #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); 1ea6a: a2 96 adiw r28, 0x22 ; 34 1ea6c: 2c ad ldd r18, Y+60 ; 0x3c 1ea6e: 3d ad ldd r19, Y+61 ; 0x3d 1ea70: 4e ad ldd r20, Y+62 ; 0x3e 1ea72: 5f ad ldd r21, Y+63 ; 0x3f 1ea74: a2 97 sbiw r28, 0x22 ; 34 1ea76: a6 96 adiw r28, 0x26 ; 38 1ea78: 6c ad ldd r22, Y+60 ; 0x3c 1ea7a: 7d ad ldd r23, Y+61 ; 0x3d 1ea7c: 8e ad ldd r24, Y+62 ; 0x3e 1ea7e: 9f ad ldd r25, Y+63 ; 0x3f 1ea80: a6 97 sbiw r28, 0x26 ; 38 1ea82: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1ea86: 20 e0 ldi r18, 0x00 ; 0 1ea88: 30 e0 ldi r19, 0x00 ; 0 1ea8a: 40 e0 ldi r20, 0x00 ; 0 1ea8c: 5f e3 ldi r21, 0x3F ; 63 1ea8e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1ea92: 6b 01 movw r12, r22 1ea94: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 1ea96: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 1ea9a: a2 96 adiw r28, 0x22 ; 34 1ea9c: 6c af std Y+60, r22 ; 0x3c 1ea9e: 7d af std Y+61, r23 ; 0x3d 1eaa0: 8e af std Y+62, r24 ; 0x3e 1eaa2: 9f af std Y+63, r25 ; 0x3f 1eaa4: a2 97 sbiw r28, 0x22 ; 34 1eaa6: 60 93 c1 13 sts 0x13C1, r22 ; 0x8013c1 1eaaa: 70 93 c2 13 sts 0x13C2, r23 ; 0x8013c2 1eaae: 80 93 c3 13 sts 0x13C3, r24 ; 0x8013c3 1eab2: 90 93 c4 13 sts 0x13C4, r25 ; 0x8013c4 vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 1eab6: c7 01 movw r24, r14 1eab8: b6 01 movw r22, r12 1eaba: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 1eabe: a6 96 adiw r28, 0x26 ; 38 1eac0: 6c af std Y+60, r22 ; 0x3c 1eac2: 7d af std Y+61, r23 ; 0x3d 1eac4: 8e af std Y+62, r24 ; 0x3e 1eac6: 9f af std Y+63, r25 ; 0x3f 1eac8: a6 97 sbiw r28, 0x26 ; 38 1eaca: 60 93 c5 13 sts 0x13C5, r22 ; 0x8013c5 1eace: 70 93 c6 13 sts 0x13C6, r23 ; 0x8013c6 1ead2: 80 93 c7 13 sts 0x13C7, r24 ; 0x8013c7 1ead6: 90 93 c8 13 sts 0x13C8, r25 ; 0x8013c8 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 1eada: 9b 01 movw r18, r22 1eadc: ac 01 movw r20, r24 1eade: 50 58 subi r21, 0x80 ; 128 1eae0: aa 96 adiw r28, 0x2a ; 42 1eae2: 2c af std Y+60, r18 ; 0x3c 1eae4: 3d af std Y+61, r19 ; 0x3d 1eae6: 4e af std Y+62, r20 ; 0x3e 1eae8: 5f af std Y+63, r21 ; 0x3f 1eaea: aa 97 sbiw r28, 0x2a ; 42 1eaec: 20 93 c9 13 sts 0x13C9, r18 ; 0x8013c9 1eaf0: 30 93 ca 13 sts 0x13CA, r19 ; 0x8013ca 1eaf4: 40 93 cb 13 sts 0x13CB, r20 ; 0x8013cb 1eaf8: 50 93 cc 13 sts 0x13CC, r21 ; 0x8013cc vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 1eafc: a2 96 adiw r28, 0x22 ; 34 1eafe: 8c ad ldd r24, Y+60 ; 0x3c 1eb00: 9d ad ldd r25, Y+61 ; 0x3d 1eb02: ae ad ldd r26, Y+62 ; 0x3e 1eb04: bf ad ldd r27, Y+63 ; 0x3f 1eb06: a2 97 sbiw r28, 0x22 ; 34 1eb08: 80 93 cd 13 sts 0x13CD, r24 ; 0x8013cd 1eb0c: 90 93 ce 13 sts 0x13CE, r25 ; 0x8013ce 1eb10: a0 93 cf 13 sts 0x13CF, r26 ; 0x8013cf 1eb14: b0 93 d0 13 sts 0x13D0, r27 ; 0x8013d0 // Refresh the offset. cntr[0] = 0.f; 1eb18: 10 92 d1 13 sts 0x13D1, r1 ; 0x8013d1 1eb1c: 10 92 d2 13 sts 0x13D2, r1 ; 0x8013d2 1eb20: 10 92 d3 13 sts 0x13D3, r1 ; 0x8013d3 1eb24: 10 92 d4 13 sts 0x13D4, r1 ; 0x8013d4 cntr[1] = 0.f; 1eb28: 10 92 d5 13 sts 0x13D5, r1 ; 0x8013d5 1eb2c: 10 92 d6 13 sts 0x13D6, r1 ; 0x8013d6 1eb30: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 1eb34: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 float wx = 0.f; 1eb38: 41 2c mov r4, r1 1eb3a: 51 2c mov r5, r1 1eb3c: 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]; 1eb3e: cf 56 subi r28, 0x6F ; 111 1eb40: df 4f sbci r29, 0xFF ; 255 1eb42: a8 81 ld r26, Y 1eb44: b9 81 ldd r27, Y+1 ; 0x01 1eb46: c1 59 subi r28, 0x91 ; 145 1eb48: d0 40 sbci r29, 0x00 ; 0 1eb4a: 11 96 adiw r26, 0x01 ; 1 1eb4c: 8d 90 ld r8, X+ 1eb4e: 9d 90 ld r9, X+ 1eb50: ad 90 ld r10, X+ 1eb52: bc 90 ld r11, X 1eb54: 14 97 sbiw r26, 0x04 ; 4 1eb56: 15 96 adiw r26, 0x05 ; 5 1eb58: 2d 91 ld r18, X+ 1eb5a: 3d 91 ld r19, X+ 1eb5c: 4d 91 ld r20, X+ 1eb5e: 5c 91 ld r21, X 1eb60: 18 97 sbiw r26, 0x08 ; 8 1eb62: 6e 96 adiw r28, 0x1e ; 30 1eb64: 2c af std Y+60, r18 ; 0x3c 1eb66: 3d af std Y+61, r19 ; 0x3d 1eb68: 4e af std Y+62, r20 ; 0x3e 1eb6a: 5f af std Y+63, r21 ; 0x3f 1eb6c: 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); 1eb6e: cd 56 subi r28, 0x6D ; 109 1eb70: df 4f sbci r29, 0xFF ; 255 1eb72: e8 81 ld r30, Y 1eb74: f9 81 ldd r31, Y+1 ; 0x01 1eb76: c3 59 subi r28, 0x93 ; 147 1eb78: d0 40 sbci r29, 0x00 ; 0 1eb7a: c5 90 lpm r12, Z+ 1eb7c: d5 90 lpm r13, Z+ 1eb7e: e5 90 lpm r14, Z+ 1eb80: 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]; 1eb82: a5 01 movw r20, r10 1eb84: 94 01 movw r18, r8 1eb86: a2 96 adiw r28, 0x22 ; 34 1eb88: 6c ad ldd r22, Y+60 ; 0x3c 1eb8a: 7d ad ldd r23, Y+61 ; 0x3d 1eb8c: 8e ad ldd r24, Y+62 ; 0x3e 1eb8e: 9f ad ldd r25, Y+63 ; 0x3f 1eb90: a2 97 sbiw r28, 0x22 ; 34 1eb92: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1eb96: ae 96 adiw r28, 0x2e ; 46 1eb98: 6c af std Y+60, r22 ; 0x3c 1eb9a: 7d af std Y+61, r23 ; 0x3d 1eb9c: 8e af std Y+62, r24 ; 0x3e 1eb9e: 9f af std Y+63, r25 ; 0x3f 1eba0: ae 97 sbiw r28, 0x2e ; 46 1eba2: 6e 96 adiw r28, 0x1e ; 30 1eba4: 2c ad ldd r18, Y+60 ; 0x3c 1eba6: 3d ad ldd r19, Y+61 ; 0x3d 1eba8: 4e ad ldd r20, Y+62 ; 0x3e 1ebaa: 5f ad ldd r21, Y+63 ; 0x3f 1ebac: 6e 97 sbiw r28, 0x1e ; 30 1ebae: aa 96 adiw r28, 0x2a ; 42 1ebb0: 6c ad ldd r22, Y+60 ; 0x3c 1ebb2: 7d ad ldd r23, Y+61 ; 0x3d 1ebb4: 8e ad ldd r24, Y+62 ; 0x3e 1ebb6: 9f ad ldd r25, Y+63 ; 0x3f 1ebb8: aa 97 sbiw r28, 0x2a ; 42 1ebba: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1ebbe: 9b 01 movw r18, r22 1ebc0: ac 01 movw r20, r24 1ebc2: ae 96 adiw r28, 0x2e ; 46 1ebc4: 6c ad ldd r22, Y+60 ; 0x3c 1ebc6: 7d ad ldd r23, Y+61 ; 0x3d 1ebc8: 8e ad ldd r24, Y+62 ; 0x3e 1ebca: 9f ad ldd r25, Y+63 ; 0x3f 1ebcc: ae 97 sbiw r28, 0x2e ; 46 1ebce: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1ebd2: 9b 01 movw r18, r22 1ebd4: 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); 1ebd6: c7 01 movw r24, r14 1ebd8: b6 01 movw r22, r12 1ebda: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1ebde: 20 91 d1 13 lds r18, 0x13D1 ; 0x8013d1 1ebe2: 30 91 d2 13 lds r19, 0x13D2 ; 0x8013d2 1ebe6: 40 91 d3 13 lds r20, 0x13D3 ; 0x8013d3 1ebea: 50 91 d4 13 lds r21, 0x13D4 ; 0x8013d4 1ebee: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1ebf2: 6b 01 movw r12, r22 1ebf4: 7c 01 movw r14, r24 1ebf6: c0 92 d1 13 sts 0x13D1, r12 ; 0x8013d1 1ebfa: d0 92 d2 13 sts 0x13D2, r13 ; 0x8013d2 1ebfe: e0 92 d3 13 sts 0x13D3, r14 ; 0x8013d3 1ec02: f0 92 d4 13 sts 0x13D4, r15 ; 0x8013d4 wx += w; 1ec06: 20 e0 ldi r18, 0x00 ; 0 1ec08: 30 e0 ldi r19, 0x00 ; 0 1ec0a: 40 e8 ldi r20, 0x80 ; 128 1ec0c: 5f e3 ldi r21, 0x3F ; 63 1ec0e: c3 01 movw r24, r6 1ec10: b2 01 movw r22, r4 1ec12: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1ec16: 2b 01 movw r4, r22 1ec18: 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); 1ec1a: cd 56 subi r28, 0x6D ; 109 1ec1c: df 4f sbci r29, 0xFF ; 255 1ec1e: e8 81 ld r30, Y 1ec20: f9 81 ldd r31, Y+1 ; 0x01 1ec22: c3 59 subi r28, 0x93 ; 147 1ec24: d0 40 sbci r29, 0x00 ; 0 1ec26: 34 96 adiw r30, 0x04 ; 4 1ec28: 25 91 lpm r18, Z+ 1ec2a: 35 91 lpm r19, Z+ 1ec2c: 45 91 lpm r20, Z+ 1ec2e: 54 91 lpm r21, Z 1ec30: ae 96 adiw r28, 0x2e ; 46 1ec32: 2c af std Y+60, r18 ; 0x3c 1ec34: 3d af std Y+61, r19 ; 0x3d 1ec36: 4e af std Y+62, r20 ; 0x3e 1ec38: 5f af std Y+63, r21 ; 0x3f 1ec3a: 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]; 1ec3c: a5 01 movw r20, r10 1ec3e: 94 01 movw r18, r8 1ec40: a6 96 adiw r28, 0x26 ; 38 1ec42: 6c ad ldd r22, Y+60 ; 0x3c 1ec44: 7d ad ldd r23, Y+61 ; 0x3d 1ec46: 8e ad ldd r24, Y+62 ; 0x3e 1ec48: 9f ad ldd r25, Y+63 ; 0x3f 1ec4a: a6 97 sbiw r28, 0x26 ; 38 1ec4c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1ec50: 4b 01 movw r8, r22 1ec52: 5c 01 movw r10, r24 1ec54: 6e 96 adiw r28, 0x1e ; 30 1ec56: 2c ad ldd r18, Y+60 ; 0x3c 1ec58: 3d ad ldd r19, Y+61 ; 0x3d 1ec5a: 4e ad ldd r20, Y+62 ; 0x3e 1ec5c: 5f ad ldd r21, Y+63 ; 0x3f 1ec5e: 6e 97 sbiw r28, 0x1e ; 30 1ec60: a2 96 adiw r28, 0x22 ; 34 1ec62: 6c ad ldd r22, Y+60 ; 0x3c 1ec64: 7d ad ldd r23, Y+61 ; 0x3d 1ec66: 8e ad ldd r24, Y+62 ; 0x3e 1ec68: 9f ad ldd r25, Y+63 ; 0x3f 1ec6a: a2 97 sbiw r28, 0x22 ; 34 1ec6c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1ec70: 9b 01 movw r18, r22 1ec72: ac 01 movw r20, r24 1ec74: c5 01 movw r24, r10 1ec76: b4 01 movw r22, r8 1ec78: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1ec7c: 9b 01 movw r18, r22 1ec7e: 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); 1ec80: ae 96 adiw r28, 0x2e ; 46 1ec82: 6c ad ldd r22, Y+60 ; 0x3c 1ec84: 7d ad ldd r23, Y+61 ; 0x3d 1ec86: 8e ad ldd r24, Y+62 ; 0x3e 1ec88: 9f ad ldd r25, Y+63 ; 0x3f 1ec8a: ae 97 sbiw r28, 0x2e ; 46 1ec8c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1ec90: 20 91 d5 13 lds r18, 0x13D5 ; 0x8013d5 1ec94: 30 91 d6 13 lds r19, 0x13D6 ; 0x8013d6 1ec98: 40 91 d7 13 lds r20, 0x13D7 ; 0x8013d7 1ec9c: 50 91 d8 13 lds r21, 0x13D8 ; 0x8013d8 1eca0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1eca4: 4b 01 movw r8, r22 1eca6: 5c 01 movw r10, r24 1eca8: 80 92 d5 13 sts 0x13D5, r8 ; 0x8013d5 1ecac: 90 92 d6 13 sts 0x13D6, r9 ; 0x8013d6 1ecb0: a0 92 d7 13 sts 0x13D7, r10 ; 0x8013d7 1ecb4: b0 92 d8 13 sts 0x13D8, r11 ; 0x8013d8 1ecb8: cf 56 subi r28, 0x6F ; 111 1ecba: df 4f sbci r29, 0xFF ; 255 1ecbc: 48 81 ld r20, Y 1ecbe: 59 81 ldd r21, Y+1 ; 0x01 1ecc0: c1 59 subi r28, 0x91 ; 145 1ecc2: d0 40 sbci r29, 0x00 ; 0 1ecc4: 48 5f subi r20, 0xF8 ; 248 1ecc6: 5f 4f sbci r21, 0xFF ; 255 1ecc8: cf 56 subi r28, 0x6F ; 111 1ecca: df 4f sbci r29, 0xFF ; 255 1eccc: 59 83 std Y+1, r21 ; 0x01 1ecce: 48 83 st Y, r20 1ecd0: c1 59 subi r28, 0x91 ; 145 1ecd2: d0 40 sbci r29, 0x00 ; 0 1ecd4: cd 56 subi r28, 0x6D ; 109 1ecd6: df 4f sbci r29, 0xFF ; 255 1ecd8: 88 81 ld r24, Y 1ecda: 99 81 ldd r25, Y+1 ; 0x01 1ecdc: c3 59 subi r28, 0x93 ; 147 1ecde: d0 40 sbci r29, 0x00 ; 0 1ece0: 08 96 adiw r24, 0x08 ; 8 1ece2: cd 56 subi r28, 0x6D ; 109 1ece4: df 4f sbci r29, 0xFF ; 255 1ece6: 99 83 std Y+1, r25 ; 0x01 1ece8: 88 83 st Y, r24 1ecea: c3 59 subi r28, 0x93 ; 147 1ecec: 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) { 1ecee: 24 16 cp r2, r20 1ecf0: 35 06 cpc r3, r21 1ecf2: 09 f0 breq .+2 ; 0x1ecf6 1ecf4: 24 cf rjmp .-440 ; 0x1eb3e SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 1ecf6: a3 01 movw r20, r6 1ecf8: 92 01 movw r18, r4 1ecfa: c7 01 movw r24, r14 1ecfc: b6 01 movw r22, r12 1ecfe: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1ed02: 60 93 d1 13 sts 0x13D1, r22 ; 0x8013d1 1ed06: 70 93 d2 13 sts 0x13D2, r23 ; 0x8013d2 1ed0a: 80 93 d3 13 sts 0x13D3, r24 ; 0x8013d3 1ed0e: 90 93 d4 13 sts 0x13D4, r25 ; 0x8013d4 cntr[1] /= wy; 1ed12: a3 01 movw r20, r6 1ed14: 92 01 movw r18, r4 1ed16: c5 01 movw r24, r10 1ed18: b4 01 movw r22, r8 1ed1a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1ed1e: 60 93 d5 13 sts 0x13D5, r22 ; 0x8013d5 1ed22: 70 93 d6 13 sts 0x13D6, r23 ; 0x8013d6 1ed26: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1ed2a: 90 93 d8 13 sts 0x13D8, r25 ; 0x8013d8 #endif // SUPPORT_VERBOSITY } // Invert the transformation matrix made of vec_x, vec_y and cntr. { float d = vec_x[0] * vec_y[1] - vec_x[1] * vec_y[0]; 1ed2e: 40 90 c1 13 lds r4, 0x13C1 ; 0x8013c1 1ed32: 50 90 c2 13 lds r5, 0x13C2 ; 0x8013c2 1ed36: 60 90 c3 13 lds r6, 0x13C3 ; 0x8013c3 1ed3a: 70 90 c4 13 lds r7, 0x13C4 ; 0x8013c4 1ed3e: c0 90 cd 13 lds r12, 0x13CD ; 0x8013cd 1ed42: d0 90 ce 13 lds r13, 0x13CE ; 0x8013ce 1ed46: e0 90 cf 13 lds r14, 0x13CF ; 0x8013cf 1ed4a: f0 90 d0 13 lds r15, 0x13D0 ; 0x8013d0 1ed4e: 20 91 c5 13 lds r18, 0x13C5 ; 0x8013c5 1ed52: 30 91 c6 13 lds r19, 0x13C6 ; 0x8013c6 1ed56: 40 91 c7 13 lds r20, 0x13C7 ; 0x8013c7 1ed5a: 50 91 c8 13 lds r21, 0x13C8 ; 0x8013c8 1ed5e: a2 96 adiw r28, 0x22 ; 34 1ed60: 2c af std Y+60, r18 ; 0x3c 1ed62: 3d af std Y+61, r19 ; 0x3d 1ed64: 4e af std Y+62, r20 ; 0x3e 1ed66: 5f af std Y+63, r21 ; 0x3f 1ed68: a2 97 sbiw r28, 0x22 ; 34 1ed6a: 80 91 c9 13 lds r24, 0x13C9 ; 0x8013c9 1ed6e: 90 91 ca 13 lds r25, 0x13CA ; 0x8013ca 1ed72: a0 91 cb 13 lds r26, 0x13CB ; 0x8013cb 1ed76: b0 91 cc 13 lds r27, 0x13CC ; 0x8013cc 1ed7a: a6 96 adiw r28, 0x26 ; 38 1ed7c: 8c af std Y+60, r24 ; 0x3c 1ed7e: 9d af std Y+61, r25 ; 0x3d 1ed80: ae af std Y+62, r26 ; 0x3e 1ed82: bf af std Y+63, r27 ; 0x3f 1ed84: a6 97 sbiw r28, 0x26 ; 38 1ed86: a7 01 movw r20, r14 1ed88: 96 01 movw r18, r12 1ed8a: c3 01 movw r24, r6 1ed8c: b2 01 movw r22, r4 1ed8e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1ed92: 4b 01 movw r8, r22 1ed94: 5c 01 movw r10, r24 1ed96: a6 96 adiw r28, 0x26 ; 38 1ed98: 2c ad ldd r18, Y+60 ; 0x3c 1ed9a: 3d ad ldd r19, Y+61 ; 0x3d 1ed9c: 4e ad ldd r20, Y+62 ; 0x3e 1ed9e: 5f ad ldd r21, Y+63 ; 0x3f 1eda0: a6 97 sbiw r28, 0x26 ; 38 1eda2: a2 96 adiw r28, 0x22 ; 34 1eda4: 6c ad ldd r22, Y+60 ; 0x3c 1eda6: 7d ad ldd r23, Y+61 ; 0x3d 1eda8: 8e ad ldd r24, Y+62 ; 0x3e 1edaa: 9f ad ldd r25, Y+63 ; 0x3f 1edac: a2 97 sbiw r28, 0x22 ; 34 1edae: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1edb2: 9b 01 movw r18, r22 1edb4: ac 01 movw r20, r24 1edb6: c5 01 movw r24, r10 1edb8: b4 01 movw r22, r8 1edba: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 1edbe: 4b 01 movw r8, r22 1edc0: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 1edc2: ac 01 movw r20, r24 1edc4: 9b 01 movw r18, r22 1edc6: c7 01 movw r24, r14 1edc8: b6 01 movw r22, r12 1edca: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1edce: 6b 01 movw r12, r22 1edd0: 7c 01 movw r14, r24 1edd2: a6 96 adiw r28, 0x26 ; 38 1edd4: 6c ad ldd r22, Y+60 ; 0x3c 1edd6: 7d ad ldd r23, Y+61 ; 0x3d 1edd8: 8e ad ldd r24, Y+62 ; 0x3e 1edda: 9f ad ldd r25, Y+63 ; 0x3f 1eddc: a6 97 sbiw r28, 0x26 ; 38 1edde: 90 58 subi r25, 0x80 ; 128 1ede0: a5 01 movw r20, r10 1ede2: 94 01 movw r18, r8 1ede4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1ede8: a6 96 adiw r28, 0x26 ; 38 1edea: 6c af std Y+60, r22 ; 0x3c 1edec: 7d af std Y+61, r23 ; 0x3d 1edee: 8e af std Y+62, r24 ; 0x3e 1edf0: 9f af std Y+63, r25 ; 0x3f 1edf2: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 1edf4: a2 96 adiw r28, 0x22 ; 34 1edf6: 6c ad ldd r22, Y+60 ; 0x3c 1edf8: 7d ad ldd r23, Y+61 ; 0x3d 1edfa: 8e ad ldd r24, Y+62 ; 0x3e 1edfc: 9f ad ldd r25, Y+63 ; 0x3f 1edfe: a2 97 sbiw r28, 0x22 ; 34 1ee00: 90 58 subi r25, 0x80 ; 128 1ee02: a5 01 movw r20, r10 1ee04: 94 01 movw r18, r8 1ee06: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1ee0a: aa 96 adiw r28, 0x2a ; 42 1ee0c: 6c af std Y+60, r22 ; 0x3c 1ee0e: 7d af std Y+61, r23 ; 0x3d 1ee10: 8e af std Y+62, r24 ; 0x3e 1ee12: 9f af std Y+63, r25 ; 0x3f 1ee14: aa 97 sbiw r28, 0x2a ; 42 1ee16: a5 01 movw r20, r10 1ee18: 94 01 movw r18, r8 1ee1a: c3 01 movw r24, r6 1ee1c: b2 01 movw r22, r4 1ee1e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 1ee22: 4b 01 movw r8, r22 1ee24: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1ee26: 40 90 d1 13 lds r4, 0x13D1 ; 0x8013d1 1ee2a: 50 90 d2 13 lds r5, 0x13D2 ; 0x8013d2 1ee2e: 60 90 d3 13 lds r6, 0x13D3 ; 0x8013d3 1ee32: 70 90 d4 13 lds r7, 0x13D4 ; 0x8013d4 1ee36: 20 91 d5 13 lds r18, 0x13D5 ; 0x8013d5 1ee3a: 30 91 d6 13 lds r19, 0x13D6 ; 0x8013d6 1ee3e: 40 91 d7 13 lds r20, 0x13D7 ; 0x8013d7 1ee42: 50 91 d8 13 lds r21, 0x13D8 ; 0x8013d8 1ee46: a2 96 adiw r28, 0x22 ; 34 1ee48: 2c af std Y+60, r18 ; 0x3c 1ee4a: 3d af std Y+61, r19 ; 0x3d 1ee4c: 4e af std Y+62, r20 ; 0x3e 1ee4e: 5f af std Y+63, r21 ; 0x3f 1ee50: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 1ee52: c0 92 c1 13 sts 0x13C1, r12 ; 0x8013c1 1ee56: d0 92 c2 13 sts 0x13C2, r13 ; 0x8013c2 1ee5a: e0 92 c3 13 sts 0x13C3, r14 ; 0x8013c3 1ee5e: f0 92 c4 13 sts 0x13C4, r15 ; 0x8013c4 vec_x[1] = Ainv[1][0]; 1ee62: aa 96 adiw r28, 0x2a ; 42 1ee64: 8c ad ldd r24, Y+60 ; 0x3c 1ee66: 9d ad ldd r25, Y+61 ; 0x3d 1ee68: ae ad ldd r26, Y+62 ; 0x3e 1ee6a: bf ad ldd r27, Y+63 ; 0x3f 1ee6c: aa 97 sbiw r28, 0x2a ; 42 1ee6e: 80 93 c5 13 sts 0x13C5, r24 ; 0x8013c5 1ee72: 90 93 c6 13 sts 0x13C6, r25 ; 0x8013c6 1ee76: a0 93 c7 13 sts 0x13C7, r26 ; 0x8013c7 1ee7a: b0 93 c8 13 sts 0x13C8, r27 ; 0x8013c8 vec_y[0] = Ainv[0][1]; 1ee7e: a6 96 adiw r28, 0x26 ; 38 1ee80: 2c ad ldd r18, Y+60 ; 0x3c 1ee82: 3d ad ldd r19, Y+61 ; 0x3d 1ee84: 4e ad ldd r20, Y+62 ; 0x3e 1ee86: 5f ad ldd r21, Y+63 ; 0x3f 1ee88: a6 97 sbiw r28, 0x26 ; 38 1ee8a: 20 93 c9 13 sts 0x13C9, r18 ; 0x8013c9 1ee8e: 30 93 ca 13 sts 0x13CA, r19 ; 0x8013ca 1ee92: 40 93 cb 13 sts 0x13CB, r20 ; 0x8013cb 1ee96: 50 93 cc 13 sts 0x13CC, r21 ; 0x8013cc vec_y[1] = Ainv[1][1]; 1ee9a: 80 92 cd 13 sts 0x13CD, r8 ; 0x8013cd 1ee9e: 90 92 ce 13 sts 0x13CE, r9 ; 0x8013ce 1eea2: a0 92 cf 13 sts 0x13CF, r10 ; 0x8013cf 1eea6: b0 92 d0 13 sts 0x13D0, r11 ; 0x8013d0 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, { -vec_x[1] / d, vec_x[0] / d } }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 1eeaa: c7 01 movw r24, r14 1eeac: b6 01 movw r22, r12 1eeae: 90 58 subi r25, 0x80 ; 128 1eeb0: a3 01 movw r20, r6 1eeb2: 92 01 movw r18, r4 1eeb4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1eeb8: 6b 01 movw r12, r22 1eeba: 7c 01 movw r14, r24 1eebc: a2 96 adiw r28, 0x22 ; 34 1eebe: 2c ad ldd r18, Y+60 ; 0x3c 1eec0: 3d ad ldd r19, Y+61 ; 0x3d 1eec2: 4e ad ldd r20, Y+62 ; 0x3e 1eec4: 5f ad ldd r21, Y+63 ; 0x3f 1eec6: a2 97 sbiw r28, 0x22 ; 34 1eec8: a6 96 adiw r28, 0x26 ; 38 1eeca: 6c ad ldd r22, Y+60 ; 0x3c 1eecc: 7d ad ldd r23, Y+61 ; 0x3d 1eece: 8e ad ldd r24, Y+62 ; 0x3e 1eed0: 9f ad ldd r25, Y+63 ; 0x3f 1eed2: a6 97 sbiw r28, 0x26 ; 38 1eed4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1eed8: 9b 01 movw r18, r22 1eeda: ac 01 movw r20, r24 1eedc: c7 01 movw r24, r14 1eede: b6 01 movw r22, r12 1eee0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__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]; 1eee4: 60 93 d1 13 sts 0x13D1, r22 ; 0x8013d1 1eee8: 70 93 d2 13 sts 0x13D2, r23 ; 0x8013d2 1eeec: 80 93 d3 13 sts 0x13D3, r24 ; 0x8013d3 1eef0: 90 93 d4 13 sts 0x13D4, r25 ; 0x8013d4 { vec_y[1] / d, -vec_y[0] / d }, { -vec_x[1] / d, vec_x[0] / d } }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] 1eef4: aa 96 adiw r28, 0x2a ; 42 1eef6: 6c ad ldd r22, Y+60 ; 0x3c 1eef8: 7d ad ldd r23, Y+61 ; 0x3d 1eefa: 8e ad ldd r24, Y+62 ; 0x3e 1eefc: 9f ad ldd r25, Y+63 ; 0x3f 1eefe: aa 97 sbiw r28, 0x2a ; 42 1ef00: 90 58 subi r25, 0x80 ; 128 1ef02: a3 01 movw r20, r6 1ef04: 92 01 movw r18, r4 1ef06: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1ef0a: 6b 01 movw r12, r22 1ef0c: 7c 01 movw r14, r24 1ef0e: a2 96 adiw r28, 0x22 ; 34 1ef10: 2c ad ldd r18, Y+60 ; 0x3c 1ef12: 3d ad ldd r19, Y+61 ; 0x3d 1ef14: 4e ad ldd r20, Y+62 ; 0x3e 1ef16: 5f ad ldd r21, Y+63 ; 0x3f 1ef18: a2 97 sbiw r28, 0x22 ; 34 1ef1a: c5 01 movw r24, r10 1ef1c: b4 01 movw r22, r8 1ef1e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1ef22: 9b 01 movw r18, r22 1ef24: ac 01 movw r20, r24 1ef26: c7 01 movw r24, r14 1ef28: b6 01 movw r22, r12 1ef2a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__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]; 1ef2e: 60 93 d5 13 sts 0x13D5, r22 ; 0x8013d5 1ef32: 70 93 d6 13 sts 0x13D6, r23 ; 0x8013d6 1ef36: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 1ef3a: 90 93 d8 13 sts 0x13D8, r25 ; 0x8013d8 MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); } result = calculate_machine_skew_and_offset_LS(pts, 4, bed_ref_points_4, vec_x, vec_y, cntr, verbosity_level); delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 1ef3e: 90 e0 ldi r25, 0x00 ; 0 1ef40: 80 e0 ldi r24, 0x00 ; 0 1ef42: 0e 94 87 8e call 0x11d0e ; 0x11d0e if (result >= 0) { 1ef46: 17 fd sbrc r17, 7 1ef48: d5 c0 rjmp .+426 ; 0x1f0f4 DBG(_n("Calibration success.\n")); 1ef4a: 84 e5 ldi r24, 0x54 ; 84 1ef4c: 9e e6 ldi r25, 0x6E ; 110 1ef4e: 9f 93 push r25 1ef50: 8f 93 push r24 1ef52: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 world2machine_update(vec_x, vec_y, cntr); 1ef56: 41 ed ldi r20, 0xD1 ; 209 1ef58: 53 e1 ldi r21, 0x13 ; 19 1ef5a: 69 ec ldi r22, 0xC9 ; 201 1ef5c: 73 e1 ldi r23, 0x13 ; 19 1ef5e: 81 ec ldi r24, 0xC1 ; 193 1ef60: 93 e1 ldi r25, 0x13 ; 19 1ef62: 0f 94 2e ca call 0x3945c ; 0x3945c #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); 1ef66: 48 e0 ldi r20, 0x08 ; 8 1ef68: 50 e0 ldi r21, 0x00 ; 0 1ef6a: 65 ee ldi r22, 0xE5 ; 229 1ef6c: 7f e0 ldi r23, 0x0F ; 15 1ef6e: 81 ed ldi r24, 0xD1 ; 209 1ef70: 93 e1 ldi r25, 0x13 ; 19 1ef72: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 1ef76: 48 e0 ldi r20, 0x08 ; 8 1ef78: 50 e0 ldi r21, 0x00 ; 0 1ef7a: 6d ed ldi r22, 0xDD ; 221 1ef7c: 7f e0 ldi r23, 0x0F ; 15 1ef7e: 81 ec ldi r24, 0xC1 ; 193 1ef80: 93 e1 ldi r25, 0x13 ; 19 1ef82: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 1ef86: 48 e0 ldi r20, 0x08 ; 8 1ef88: 50 e0 ldi r21, 0x00 ; 0 1ef8a: 65 ed ldi r22, 0xD5 ; 213 1ef8c: 7f e0 ldi r23, 0x0F ; 15 1ef8e: 89 ec ldi r24, 0xC9 ; 201 1ef90: 93 e1 ldi r25, 0x13 ; 19 1ef92: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 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(); 1ef96: 0f 94 b3 c9 call 0x39366 ; 0x39366 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 1ef9a: 0f 90 pop r0 1ef9c: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 1ef9e: c7 55 subi r28, 0x57 ; 87 1efa0: df 4f sbci r29, 0xFF ; 255 1efa2: 88 81 ld r24, Y 1efa4: 99 81 ldd r25, Y+1 ; 0x01 1efa6: c9 5a subi r28, 0xA9 ; 169 1efa8: d0 40 sbci r29, 0x00 ; 0 1efaa: 0e 94 83 67 call 0xcf06 ; 0xcf06 // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1efae: 80 e0 ldi r24, 0x00 ; 0 1efb0: 90 e0 ldi r25, 0x00 ; 0 1efb2: a0 ea ldi r26, 0xA0 ; 160 1efb4: b0 e4 ldi r27, 0x40 ; 64 1efb6: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 1efba: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 1efbe: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 1efc2: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 1efc6: 60 e0 ldi r22, 0x00 ; 0 1efc8: 70 e0 ldi r23, 0x00 ; 0 1efca: 80 ea ldi r24, 0xA0 ; 160 1efcc: 91 e4 ldi r25, 0x41 ; 65 1efce: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 1efd2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 //#ifndef NEW_XYZCAL if (result >= 0) 1efd6: 17 fd sbrc r17, 7 1efd8: 22 c0 rjmp .+68 ; 0x1f01e 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; 1efda: 10 92 4b 07 sts 0x074B, r1 ; 0x80074b 1efde: 10 92 4c 07 sts 0x074C, r1 ; 0x80074c 1efe2: 10 92 4d 07 sts 0x074D, r1 ; 0x80074d 1efe6: 10 92 4e 07 sts 0x074E, r1 ; 0x80074e destination[Z_AXIS] = 150.F; 1efea: 80 e0 ldi r24, 0x00 ; 0 1efec: 90 e0 ldi r25, 0x00 ; 0 1efee: a6 e1 ldi r26, 0x16 ; 22 1eff0: b3 e4 ldi r27, 0x43 ; 67 1eff2: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 1eff6: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 1effa: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 1effe: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 1f002: 65 e5 ldi r22, 0x55 ; 85 1f004: 75 e5 ldi r23, 0x55 ; 85 1f006: 85 e5 ldi r24, 0x55 ; 85 1f008: 91 e4 ldi r25, 0x41 ; 65 1f00a: 0f 94 60 ba call 0x374c0 ; 0x374c0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 1f00e: 85 e6 ldi r24, 0x65 ; 101 1f010: 97 e4 ldi r25, 0x47 ; 71 1f012: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1f016: 0f 94 0c 36 call 0x26c18 ; 0x26c18 // 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()) 1f01a: 0f 94 c2 c7 call 0x38f84 ; 0x38f84 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 1f01e: 81 e0 ldi r24, 0x01 ; 1 1f020: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_update(2); 1f024: 82 e0 ldi r24, 0x02 ; 2 1f026: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 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)); 1f02a: 86 e2 ldi r24, 0x26 ; 38 1f02c: 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) { 1f02e: 1f 3f cpi r17, 0xFF ; 255 1f030: 99 f0 breq .+38 ; 0x1f058 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) { 1f032: 1e 3f cpi r17, 0xFE ; 254 1f034: 09 f0 breq .+2 ; 0x1f038 1f036: 73 c0 rjmp .+230 ; 0x1f11e if (point_too_far_mask == 0) 1f038: af 96 adiw r28, 0x2f ; 47 1f03a: 4f ad ldd r20, Y+63 ; 0x3f 1f03c: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1f03e: 81 ef ldi r24, 0xF1 ; 241 1f040: 96 e4 ldi r25, 0x46 ; 70 { const char *msg = NULL; if (result == BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND) { lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND)); } else if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED) { if (point_too_far_mask == 0) 1f042: 44 23 and r20, r20 1f044: 49 f0 breq .+18 ; 0x1f058 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 1f046: af 96 adiw r28, 0x2f ; 47 1f048: 5f ad ldd r21, Y+63 ; 0x3f 1f04a: 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); 1f04c: 8f ea ldi r24, 0xAF ; 175 1f04e: 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) 1f050: 52 30 cpi r21, 0x02 ; 2 1f052: 11 f0 breq .+4 ; 0x1f058 // 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); 1f054: 88 e6 ldi r24, 0x68 ; 104 1f056: 96 e4 ldi r25, 0x46 ; 70 1f058: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1f05c: 0c 94 08 eb jmp 0x1d610 ; 0x1d610 (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]) : 1f060: f2 01 movw r30, r4 1f062: 25 81 ldd r18, Z+5 ; 0x05 1f064: 36 81 ldd r19, Z+6 ; 0x06 1f066: 47 81 ldd r20, Z+7 ; 0x07 1f068: 50 85 ldd r21, Z+8 ; 0x08 1f06a: c3 58 subi r28, 0x83 ; 131 1f06c: df 4f sbci r29, 0xFF ; 255 1f06e: 68 81 ld r22, Y 1f070: 79 81 ldd r23, Y+1 ; 0x01 1f072: 8a 81 ldd r24, Y+2 ; 0x02 1f074: 9b 81 ldd r25, Y+3 ; 0x03 1f076: cd 57 subi r28, 0x7D ; 125 1f078: d0 40 sbci r29, 0x00 ; 0 1f07a: 0c 94 6a ef jmp 0x1ded4 ; 0x1ded4 // 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]) : 1f07e: f2 01 movw r30, r4 1f080: 25 81 ldd r18, Z+5 ; 0x05 1f082: 36 81 ldd r19, Z+6 ; 0x06 1f084: 47 81 ldd r20, Z+7 ; 0x07 1f086: 50 85 ldd r21, Z+8 ; 0x08 1f088: ed 96 adiw r28, 0x3d ; 61 1f08a: 6c ad ldd r22, Y+60 ; 0x3c 1f08c: 7d ad ldd r23, Y+61 ; 0x3d 1f08e: 8e ad ldd r24, Y+62 ; 0x3e 1f090: 9f ad ldd r25, Y+63 ; 0x3f 1f092: ed 97 sbiw r28, 0x3d ; 61 1f094: b8 c0 rjmp .+368 ; 0x1f206 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f096: f2 01 movw r30, r4 1f098: 25 81 ldd r18, Z+5 ; 0x05 1f09a: 36 81 ldd r19, Z+6 ; 0x06 1f09c: 47 81 ldd r20, Z+7 ; 0x07 1f09e: 50 85 ldd r21, Z+8 ; 0x08 1f0a0: ed 96 adiw r28, 0x3d ; 61 1f0a2: 6c ad ldd r22, Y+60 ; 0x3c 1f0a4: 7d ad ldd r23, Y+61 ; 0x3d 1f0a6: 8e ad ldd r24, Y+62 ; 0x3e 1f0a8: 9f ad ldd r25, Y+63 ; 0x3f 1f0aa: ed 97 sbiw r28, 0x3d ; 61 1f0ac: c6 c0 rjmp .+396 ; 0x1f23a 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]) : 1f0ae: a3 01 movw r20, r6 1f0b0: 92 01 movw r18, r4 1f0b2: c3 58 subi r28, 0x83 ; 131 1f0b4: df 4f sbci r29, 0xFF ; 255 1f0b6: 68 81 ld r22, Y 1f0b8: 79 81 ldd r23, Y+1 ; 0x01 1f0ba: 8a 81 ldd r24, Y+2 ; 0x02 1f0bc: 9b 81 ldd r25, Y+3 ; 0x03 1f0be: cd 57 subi r28, 0x7D ; 125 1f0c0: d0 40 sbci r29, 0x00 ; 0 1f0c2: 0c 94 d2 ef jmp 0x1dfa4 ; 0x1dfa4 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 1f0c6: 81 2c mov r8, r1 1f0c8: 91 2c mov r9, r1 1f0ca: 20 e8 ldi r18, 0x80 ; 128 1f0cc: a2 2e mov r10, r18 1f0ce: 2f e3 ldi r18, 0x3F ; 63 1f0d0: b2 2e mov r11, r18 1f0d2: 0c 94 d6 ef jmp 0x1dfac ; 0x1dfac float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 1f0d6: c1 2c mov r12, r1 1f0d8: d1 2c mov r13, r1 1f0da: 76 01 movw r14, r12 1f0dc: 0c 94 4d f0 jmp 0x1e09a ; 0x1e09a ((r == 1) ? 1.f : 1f0e0: c1 2c mov r12, r1 1f0e2: d1 2c mov r13, r1 1f0e4: 90 e8 ldi r25, 0x80 ; 128 1f0e6: e9 2e mov r14, r25 1f0e8: 9f e3 ldi r25, 0x3F ; 63 1f0ea: f9 2e mov r15, r25 1f0ec: 0c 94 4d f0 jmp 0x1e09a ; 0x1e09a 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; 1f0f0: 12 e0 ldi r17, 0x02 ; 2 1f0f2: a7 cb rjmp .-2226 ; 0x1e842 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1f0f4: 1e 3f cpi r17, 0xFE ; 254 1f0f6: 89 f4 brne .+34 ; 0x1f11a 1f0f8: af 96 adiw r28, 0x2f ; 47 1f0fa: 3f ad ldd r19, Y+63 ; 0x3f 1f0fc: af 97 sbiw r28, 0x2f ; 47 1f0fe: 32 30 cpi r19, 0x02 ; 2 1f100: 09 f0 breq .+2 ; 0x1f104 1f102: 4d cf rjmp .-358 ; 0x1ef9e DBG(_n("Fitting failed => calibration failed.\n")); 1f104: 8d e2 ldi r24, 0x2D ; 45 1f106: 9e e6 ldi r25, 0x6E ; 110 1f108: 9f 93 push r25 1f10a: 8f 93 push r24 1f10c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 1f110: 44 cf rjmp .-376 ; 0x1ef9a // 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; 1f112: af 96 adiw r28, 0x2f ; 47 1f114: 1f ae std Y+63, r1 ; 0x3f 1f116: af 97 sbiw r28, 0x2f ; 47 1f118: 42 cf rjmp .-380 ; 0x1ef9e } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 1f11a: 1f ef ldi r17, 0xFF ; 255 1f11c: 40 cf rjmp .-384 ; 0x1ef9e 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) { 1f11e: af 96 adiw r28, 0x2f ; 47 1f120: 6f ad ldd r22, Y+63 ; 0x3f 1f122: af 97 sbiw r28, 0x2f ; 47 1f124: 61 11 cpse r22, r1 1f126: 13 c0 rjmp .+38 ; 0x1f14e 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); 1f128: 8d e4 ldi r24, 0x4D ; 77 1f12a: 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) { 1f12c: 11 30 cpi r17, 0x01 ; 1 1f12e: 51 f0 breq .+20 ; 0x1f144 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); 1f130: 8a e0 ldi r24, 0x0A ; 10 1f132: 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) { 1f134: 12 30 cpi r17, 0x02 ; 2 1f136: 31 f0 breq .+12 ; 0x1f144 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 1f138: 81 ef ldi r24, 0xF1 ; 241 1f13a: 96 e4 ldi r25, 0x46 ; 70 // The left and maybe the center point out of reach. //@todo Why isn't it found in the firmware.map msg = _n("XYZ calibration compromised. Left front calibration point not reachable.");////MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR c=20 r=8 lcd_show_fullscreen_message_and_wait_P(msg); } if (point_too_far_mask == 0 || result > 0) { switch (result) { 1f13c: 11 11 cpse r17, r1 1f13e: 02 c0 rjmp .+4 ; 0x1f144 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); 1f140: 82 e9 ldi r24, 0x92 ; 146 1f142: 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); 1f144: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 break; } lcd_show_fullscreen_message_and_wait_P(msg); 1f148: 0f 94 0c 36 call 0x26c18 ; 0x26c18 1f14c: 0d c0 rjmp .+26 ; 0x1f168 // 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) 1f14e: af 96 adiw r28, 0x2f ; 47 1f150: 8f ad ldd r24, Y+63 ; 0x3f 1f152: af 97 sbiw r28, 0x2f ; 47 1f154: 82 30 cpi r24, 0x02 ; 2 1f156: f1 f4 brne .+60 ; 0x1f194 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 1f158: 81 e2 ldi r24, 0x21 ; 33 1f15a: 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); 1f15c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 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); 1f160: 0f 94 0c 36 call 0x26c18 ; 0x26c18 } if (point_too_far_mask == 0 || result > 0) { 1f164: 11 16 cp r1, r17 1f166: 04 f3 brlt .-64 ; 0x1f128 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 1f168: 1f 3f cpi r17, 0xFF ; 255 1f16a: 11 f4 brne .+4 ; 0x1f170 1f16c: 0c 94 11 e8 jmp 0x1d022 ; 0x1d022 { // 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); 1f170: 86 e0 ldi r24, 0x06 ; 6 1f172: 0e 94 66 e7 call 0x1cecc ; 0x1cecc if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1f176: 8f e5 ldi r24, 0x5F ; 95 1f178: 9f e0 ldi r25, 0x0F ; 15 1f17a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1f17e: 81 11 cpse r24, r1 1f180: 0c 94 22 eb jmp 0x1d644 ; 0x1d644 lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1f184: 8c e8 ldi r24, 0x8C ; 140 1f186: 97 e4 ldi r25, 0x47 ; 71 1f188: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1f18c: 0f 94 0c 36 call 0x26c18 ; 0x26c18 1f190: 0c 94 22 eb jmp 0x1d644 ; 0x1d644 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); 1f194: 85 ed ldi r24, 0xD5 ; 213 1f196: 95 e4 ldi r25, 0x45 ; 69 1f198: e1 cf rjmp .-62 ; 0x1f15c 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)) 1f19a: 89 81 ldd r24, Y+1 ; 0x01 1f19c: 9a 81 ldd r25, Y+2 ; 0x02 1f19e: 80 37 cpi r24, 0x70 ; 112 1f1a0: 98 40 sbci r25, 0x08 ; 8 1f1a2: 10 f0 brcs .+4 ; 0x1f1a8 1f1a4: 0c 94 61 eb jmp 0x1d6c2 ; 0x1d6c2 if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 1f1a8: ae 01 movw r20, r28 1f1aa: 4f 5f subi r20, 0xFF ; 255 1f1ac: 5f 4f sbci r21, 0xFF ; 255 1f1ae: 7a 01 movw r14, r20 1f1b0: 04 eb ldi r16, 0xB4 ; 180 1f1b2: 10 e0 ldi r17, 0x00 ; 0 1f1b4: 24 e8 ldi r18, 0x84 ; 132 1f1b6: 33 e0 ldi r19, 0x03 ; 3 1f1b8: a6 01 movw r20, r12 1f1ba: 48 5c subi r20, 0xC8 ; 200 1f1bc: 51 09 sbc r21, r1 1f1be: 69 2d mov r22, r9 1f1c0: 78 2d mov r23, r8 1f1c2: 8b 2d mov r24, r11 1f1c4: 9a 2d mov r25, r10 1f1c6: 0f 94 17 95 call 0x32a2e ; 0x32a2e 1f1ca: 88 23 and r24, r24 1f1cc: 11 f4 brne .+4 ; 0x1f1d2 1f1ce: 0c 94 61 eb jmp 0x1d6c2 ; 0x1d6c2 ad += 1440; 1f1d2: 89 81 ldd r24, Y+1 ; 0x01 1f1d4: 9a 81 ldd r25, Y+2 ; 0x02 1f1d6: 80 56 subi r24, 0x60 ; 96 1f1d8: 9a 4f sbci r25, 0xFA ; 250 1f1da: 0c 94 eb e9 jmp 0x1d3d6 ; 0x1d3d6 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) { 1f1de: 00 23 and r16, r16 1f1e0: 11 f4 brne .+4 ; 0x1f1e6 1f1e2: 0c 94 7d ef jmp 0x1defa ; 0x1defa float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 1f1e6: 02 30 cpi r16, 0x02 ; 2 1f1e8: 09 f0 breq .+2 ; 0x1f1ec 1f1ea: 49 cf rjmp .-366 ; 0x1f07e 1f1ec: d2 01 movw r26, r4 1f1ee: 11 96 adiw r26, 0x01 ; 1 1f1f0: 2d 91 ld r18, X+ 1f1f2: 3d 91 ld r19, X+ 1f1f4: 4d 91 ld r20, X+ 1f1f6: 5c 91 ld r21, X 1f1f8: 14 97 sbiw r26, 0x04 ; 4 1f1fa: 6e 96 adiw r28, 0x1e ; 30 1f1fc: 6c ad ldd r22, Y+60 ; 0x3c 1f1fe: 7d ad ldd r23, Y+61 ; 0x3d 1f200: 8e ad ldd r24, Y+62 ; 0x3e 1f202: 9f ad ldd r25, Y+63 ; 0x3f 1f204: 6e 97 sbiw r28, 0x1e ; 30 1f206: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1f20a: 4b 01 movw r8, r22 1f20c: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 1f20e: 60 e0 ldi r22, 0x00 ; 0 1f210: 70 e0 ldi r23, 0x00 ; 0 1f212: 80 e8 ldi r24, 0x80 ; 128 1f214: 9f e3 ldi r25, 0x3F ; 63 1f216: 11 30 cpi r17, 0x01 ; 1 1f218: 91 f0 breq .+36 ; 0x1f23e ((c == 2) ? ( c1 * measured_pts[2 * i]) : 1f21a: 12 30 cpi r17, 0x02 ; 2 1f21c: 09 f0 breq .+2 ; 0x1f220 1f21e: 3b cf rjmp .-394 ; 0x1f096 1f220: d2 01 movw r26, r4 1f222: 11 96 adiw r26, 0x01 ; 1 1f224: 2d 91 ld r18, X+ 1f226: 3d 91 ld r19, X+ 1f228: 4d 91 ld r20, X+ 1f22a: 5c 91 ld r21, X 1f22c: 14 97 sbiw r26, 0x04 ; 4 1f22e: 6e 96 adiw r28, 0x1e ; 30 1f230: 6c ad ldd r22, Y+60 ; 0x3c 1f232: 7d ad ldd r23, Y+61 ; 0x3d 1f234: 8e ad ldd r24, Y+62 ; 0x3e 1f236: 9f ad ldd r25, Y+63 ; 0x3f 1f238: 6e 97 sbiw r28, 0x1e ; 30 1f23a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 1f23e: 9b 01 movw r18, r22 1f240: ac 01 movw r20, r24 1f242: c5 01 movw r24, r10 1f244: b4 01 movw r22, r8 1f246: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 1f24a: 9b 01 movw r18, r22 1f24c: ac 01 movw r20, r24 1f24e: c7 01 movw r24, r14 1f250: b6 01 movw r22, r12 1f252: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 1f256: 6b 01 movw r12, r22 1f258: 7c 01 movw r14, r24 1f25a: 0c 94 7d ef jmp 0x1defa ; 0x1defa // 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 : 1f25e: 81 2c mov r8, r1 1f260: 91 2c mov r9, r1 1f262: 50 e8 ldi r21, 0x80 ; 128 1f264: a5 2e mov r10, r21 1f266: 5f e3 ldi r21, 0x3F ; 63 1f268: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 1f26a: 11 11 cpse r17, r1 1f26c: 0c 94 57 ef jmp 0x1deae ; 0x1deae ((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; 1f270: 20 e0 ldi r18, 0x00 ; 0 1f272: 30 e0 ldi r19, 0x00 ; 0 1f274: 40 e8 ldi r20, 0x80 ; 128 1f276: 5f e3 ldi r21, 0x3F ; 63 1f278: ea cf rjmp .-44 ; 0x1f24e } // 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) { 1f27a: 11 11 cpse r17, r1 1f27c: b4 cf rjmp .-152 ; 0x1f1e6 1f27e: 0c 94 7d ef jmp 0x1defa ; 0x1defa float a = (r == 1) ? 1.f : 1f282: 81 2c mov r8, r1 1f284: 91 2c mov r9, r1 1f286: 40 e8 ldi r20, 0x80 ; 128 1f288: a4 2e mov r10, r20 1f28a: 4f e3 ldi r20, 0x3F ; 63 1f28c: 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) { 1f28e: 11 11 cpse r17, r1 1f290: be cf rjmp .-132 ; 0x1f20e 1f292: 0c 94 7d ef jmp 0x1defa ; 0x1defa 0001f296 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1f296: cf 93 push r28 1f298: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1f29a: 86 ea ldi r24, 0xA6 ; 166 1f29c: 9c e0 ldi r25, 0x0C ; 12 1f29e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 return ((status & components) == components); 1f2a2: 98 2f mov r25, r24 1f2a4: 9c 23 and r25, r28 1f2a6: 81 e0 ldi r24, 0x01 ; 1 1f2a8: 9c 13 cpse r25, r28 1f2aa: 80 e0 ldi r24, 0x00 ; 0 } 1f2ac: cf 91 pop r28 1f2ae: 08 95 ret 0001f2b0 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1f2b0: 0f 93 push r16 1f2b2: 1f 93 push r17 1f2b4: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1f2b6: 0e 94 62 d0 call 0x1a0c4 ; 0x1a0c4 if (*str != '.') 1f2ba: fc 01 movw r30, r24 1f2bc: 20 81 ld r18, Z 1f2be: 2e 32 cpi r18, 0x2E ; 46 1f2c0: 11 f0 breq .+4 ; 0x1f2c6 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 1f2c2: 80 e0 ldi r24, 0x00 ; 0 1f2c4: 34 c0 rjmp .+104 ; 0x1f32e // 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); 1f2c6: b8 01 movw r22, r16 1f2c8: 6e 5f subi r22, 0xFE ; 254 1f2ca: 7f 4f sbci r23, 0xFF ; 255 1f2cc: 01 96 adiw r24, 0x01 ; 1 1f2ce: 0e 94 62 d0 call 0x1a0c4 ; 0x1a0c4 if (*str != '.') 1f2d2: fc 01 movw r30, r24 1f2d4: 20 81 ld r18, Z 1f2d6: 2e 32 cpi r18, 0x2E ; 46 1f2d8: a1 f7 brne .-24 ; 0x1f2c2 return false; ++str; } str = Number(str, version + 2); 1f2da: b8 01 movw r22, r16 1f2dc: 6c 5f subi r22, 0xFC ; 252 1f2de: 7f 4f sbci r23, 0xFF ; 255 1f2e0: 01 96 adiw r24, 0x01 ; 1 1f2e2: 0e 94 62 d0 call 0x1a0c4 ; 0x1a0c4 version[3] = FIRMWARE_REVISION_RELEASED; 1f2e6: 20 e4 ldi r18, 0x40 ; 64 1f2e8: 30 e0 ldi r19, 0x00 ; 0 1f2ea: f8 01 movw r30, r16 1f2ec: 37 83 std Z+7, r19 ; 0x07 1f2ee: 26 83 std Z+6, r18 ; 0x06 1f2f0: fc 01 movw r30, r24 1f2f2: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1f2f4: 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'; 1f2f6: 89 2f mov r24, r25 1f2f8: 8f 7d andi r24, 0xDF ; 223 1f2fa: c1 f1 breq .+112 ; 0x1f36c 1f2fc: 87 ef ldi r24, 0xF7 ; 247 1f2fe: 89 0f add r24, r25 1f300: 82 30 cpi r24, 0x02 ; 2 1f302: a0 f1 brcs .+104 ; 0x1f36c 1f304: 9d 30 cpi r25, 0x0D ; 13 1f306: 91 f1 breq .+100 ; 0x1f36c 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 == '-'){ 1f308: 9d 32 cpi r25, 0x2D ; 45 1f30a: 99 f7 brne .-26 ; 0x1f2f2 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f30c: 11 96 adiw r26, 0x01 ; 1 1f30e: 9c 91 ld r25, X 1f310: 92 34 cpi r25, 0x42 ; 66 1f312: e1 f0 breq .+56 ; 0x1f34c 1f314: 7c f4 brge .+30 ; 0x1f334 1f316: 91 34 cpi r25, 0x41 ; 65 1f318: a1 f6 brne .-88 ; 0x1f2c2 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); 1f31a: 0a 5f subi r16, 0xFA ; 250 1f31c: 1f 4f sbci r17, 0xFF ; 255 1f31e: 28 e0 ldi r18, 0x08 ; 8 1f320: 30 e0 ldi r19, 0x00 ; 0 1f322: 45 e0 ldi r20, 0x05 ; 5 1f324: 61 e6 ldi r22, 0x61 ; 97 1f326: 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); 1f328: cf 01 movw r24, r30 1f32a: 0e 94 37 d2 call 0x1a46e ; 0x1a46e // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1f32e: 1f 91 pop r17 1f330: 0f 91 pop r16 1f332: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1f334: 94 34 cpi r25, 0x44 ; 68 1f336: 91 f0 breq .+36 ; 0x1f35c 1f338: 92 35 cpi r25, 0x52 ; 82 1f33a: 19 f6 brne .-122 ; 0x1f2c2 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); 1f33c: 0a 5f subi r16, 0xFA ; 250 1f33e: 1f 4f sbci r17, 0xFF ; 255 1f340: 20 e2 ldi r18, 0x20 ; 32 1f342: 30 e0 ldi r19, 0x00 ; 0 1f344: 42 e0 ldi r20, 0x02 ; 2 1f346: 65 e5 ldi r22, 0x55 ; 85 1f348: 7d e8 ldi r23, 0x8D ; 141 1f34a: ee cf rjmp .-36 ; 0x1f328 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); 1f34c: 0a 5f subi r16, 0xFA ; 250 1f34e: 1f 4f sbci r17, 0xFF ; 255 1f350: 20 e1 ldi r18, 0x10 ; 16 1f352: 30 e0 ldi r19, 0x00 ; 0 1f354: 44 e0 ldi r20, 0x04 ; 4 1f356: 6c e5 ldi r22, 0x5C ; 92 1f358: 7d e8 ldi r23, 0x8D ; 141 1f35a: e6 cf rjmp .-52 ; 0x1f328 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); 1f35c: 0a 5f subi r16, 0xFA ; 250 1f35e: 1f 4f sbci r17, 0xFF ; 255 1f360: 30 e0 ldi r19, 0x00 ; 0 1f362: 20 e0 ldi r18, 0x00 ; 0 1f364: 43 e0 ldi r20, 0x03 ; 3 1f366: 68 e5 ldi r22, 0x58 ; 88 1f368: 7d e8 ldi r23, 0x8D ; 141 1f36a: de cf rjmp .-68 ; 0x1f328 // 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; 1f36c: 81 e0 ldi r24, 0x01 ; 1 1f36e: df cf rjmp .-66 ; 0x1f32e 0001f370 : 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)) { 1f370: 0f 93 push r16 1f372: 1f 93 push r17 1f374: cf 93 push r28 1f376: df 93 push r29 1f378: eb 01 movw r28, r22 1f37a: 8a 01 movw r16, r20 switch(*oCheckSetting) { 1f37c: 81 30 cpi r24, 0x01 ; 1 1f37e: 81 f0 breq .+32 ; 0x1f3a0 1f380: 82 30 cpi r24, 0x02 ; 2 1f382: 89 f0 breq .+34 ; 0x1f3a6 case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 1f384: 80 e3 ldi r24, 0x30 ; 48 1f386: 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); 1f388: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 1f38c: 22 e0 ldi r18, 0x02 ; 2 1f38e: a8 01 movw r20, r16 1f390: bc 01 movw r22, r24 1f392: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 1f394: df 91 pop r29 1f396: cf 91 pop r28 1f398: 1f 91 pop r17 1f39a: 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); 1f39c: 0d 94 9f d0 jmp 0x3a13e ; 0x3a13e 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); 1f3a0: 89 e2 ldi r24, 0x29 ; 41 1f3a2: 90 e4 ldi r25, 0x40 ; 64 1f3a4: f1 cf rjmp .-30 ; 0x1f388 break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 1f3a6: 80 e2 ldi r24, 0x20 ; 32 1f3a8: 90 e4 ldi r25, 0x40 ; 64 1f3aa: ee cf rjmp .-36 ; 0x1f388 0001f3ac : /// (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 ) 1f3ac: 84 e0 ldi r24, 0x04 ; 4 1f3ae: 9d e0 ldi r25, 0x0D ; 13 1f3b0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); 1f3b4: 8a 32 cpi r24, 0x2A ; 42 1f3b6: 39 f4 brne .+14 ; 0x1f3c6 1f3b8: 8a e2 ldi r24, 0x2A ; 42 1f3ba: 9d e0 ldi r25, 0x0D ; 13 1f3bc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1f3c0: 91 e0 ldi r25, 0x01 ; 1 1f3c2: 81 30 cpi r24, 0x01 ; 1 1f3c4: 09 f0 breq .+2 ; 0x1f3c8 1f3c6: 90 e0 ldi r25, 0x00 ; 0 } 1f3c8: 89 2f mov r24, r25 1f3ca: 08 95 ret 0001f3cc
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1f3cc: cf 93 push r28 1f3ce: df 93 push r29 1f3d0: cd b7 in r28, 0x3d ; 61 1f3d2: de b7 in r29, 0x3e ; 62 1f3d4: 67 97 sbiw r28, 0x17 ; 23 1f3d6: 0f b6 in r0, 0x3f ; 63 1f3d8: f8 94 cli 1f3da: de bf out 0x3e, r29 ; 62 1f3dc: 0f be out 0x3f, r0 ; 63 1f3de: cd bf out 0x3d, r28 ; 61 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1f3e0: 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); 1f3e2: 84 b5 in r24, 0x24 ; 36 1f3e4: 82 60 ori r24, 0x02 ; 2 1f3e6: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1f3e8: 84 b5 in r24, 0x24 ; 36 1f3ea: 81 60 ori r24, 0x01 ; 1 1f3ec: 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); 1f3ee: 85 b5 in r24, 0x25 ; 37 1f3f0: 82 60 ori r24, 0x02 ; 2 1f3f2: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1f3f4: 85 b5 in r24, 0x25 ; 37 1f3f6: 81 60 ori r24, 0x01 ; 1 1f3f8: 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); 1f3fa: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1f3fe: 81 60 ori r24, 0x01 ; 1 1f400: 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; 1f404: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1f408: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f40c: 82 60 ori r24, 0x02 ; 2 1f40e: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1f412: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1f416: 81 60 ori r24, 0x01 ; 1 1f418: 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); 1f41c: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1f420: 81 60 ori r24, 0x01 ; 1 1f422: 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); 1f426: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1f42a: 84 60 ori r24, 0x04 ; 4 1f42c: 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); 1f430: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1f434: 81 60 ori r24, 0x01 ; 1 1f436: 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 1f43a: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f43e: 82 60 ori r24, 0x02 ; 2 1f440: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1f444: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1f448: 81 60 ori r24, 0x01 ; 1 1f44a: 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 1f44e: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1f452: 81 60 ori r24, 0x01 ; 1 1f454: 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 1f458: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f45c: 82 60 ori r24, 0x02 ; 2 1f45e: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1f462: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1f466: 81 60 ori r24, 0x01 ; 1 1f468: 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 1f46c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1f470: 81 60 ori r24, 0x01 ; 1 1f472: 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 1f476: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f47a: 82 60 ori r24, 0x02 ; 2 1f47c: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1f480: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1f484: 81 60 ori r24, 0x01 ; 1 1f486: 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 1f48a: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1f48e: 81 60 ori r24, 0x01 ; 1 1f490: 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); 1f494: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f498: 84 60 ori r24, 0x04 ; 4 1f49a: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1f49e: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f4a2: 82 60 ori r24, 0x02 ; 2 1f4a4: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1f4a8: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f4ac: 81 60 ori r24, 0x01 ; 1 1f4ae: 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); 1f4b2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1f4b6: 80 68 ori r24, 0x80 ; 128 1f4b8: 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; 1f4bc: 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) { 1f4c0: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1f4c2: f8 94 cli wdt_reset(); 1f4c4: a8 95 wdr MCUSR &= ~_BV(WDRF); 1f4c6: 84 b7 in r24, 0x34 ; 52 1f4c8: 87 7f andi r24, 0xF7 ; 247 1f4ca: 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" ); 1f4cc: 0f b6 in r0, 0x3f ; 63 1f4ce: f8 94 cli 1f4d0: a8 95 wdr 1f4d2: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f4d6: 88 61 ori r24, 0x18 ; 24 1f4d8: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f4dc: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1f4e0: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1f4e2: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1f4e4: 9f b7 in r25, 0x3f ; 63 1f4e6: 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 1f4e8: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1f4ec: 84 e0 ldi r24, 0x04 ; 4 1f4ee: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1f4f6: 81 60 ori r24, 0x01 ; 1 1f4f8: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f500: 8d 7f andi r24, 0xFD ; 253 1f502: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1f50a: 8b 7f andi r24, 0xFB ; 251 1f50c: 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; 1f510: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1f514: 9f bf out 0x3f, r25 ; 63 } void backlight_init() { //check for backlight support on lcd SET_INPUT(LCD_BL_PIN); 1f516: 6b 98 cbi 0x0d, 3 ; 13 WRITE(LCD_BL_PIN,HIGH); 1f518: 73 9a sbi 0x0e, 3 ; 14 _delay(10); 1f51a: 6a e0 ldi r22, 0x0A ; 10 1f51c: 70 e0 ldi r23, 0x00 ; 0 1f51e: 80 e0 ldi r24, 0x00 ; 0 1f520: 90 e0 ldi r25, 0x00 ; 0 1f522: 0f 94 92 3d call 0x27b24 ; 0x27b24 backlightSupport = !READ(LCD_BL_PIN); 1f526: 9c b1 in r25, 0x0c ; 12 1f528: 81 e0 ldi r24, 0x01 ; 1 1f52a: 29 2f mov r18, r25 1f52c: 28 70 andi r18, 0x08 ; 8 1f52e: 93 fd sbrc r25, 3 1f530: 80 e0 ldi r24, 0x00 ; 0 1f532: 80 93 fe 03 sts 0x03FE, r24 ; 0x8003fe if (!backlightSupport) return; 1f536: 21 11 cpse r18, r1 1f538: 22 c0 rjmp .+68 ; 0x1f57e //initialize backlight backlightMode = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_MODE, BACKLIGHT_MODE_AUTO); 1f53a: 62 e0 ldi r22, 0x02 ; 2 1f53c: 82 e3 ldi r24, 0x32 ; 50 1f53e: 9d e0 ldi r25, 0x0D ; 13 1f540: 0e 94 94 77 call 0xef28 ; 0xef28 1f544: 80 93 4f 02 sts 0x024F, r24 ; 0x80024f backlightLevel_HIGH = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_HIGH, LCD_BACKLIGHT_LEVEL_HIGH); 1f548: 62 e8 ldi r22, 0x82 ; 130 1f54a: 84 e3 ldi r24, 0x34 ; 52 1f54c: 9d e0 ldi r25, 0x0D ; 13 1f54e: 0e 94 94 77 call 0xef28 ; 0xef28 1f552: 80 93 fd 03 sts 0x03FD, r24 ; 0x8003fd backlightLevel_LOW = eeprom_init_default_byte((uint8_t *)EEPROM_BACKLIGHT_LEVEL_LOW, LCD_BACKLIGHT_LEVEL_LOW); 1f556: 62 e3 ldi r22, 0x32 ; 50 1f558: 83 e3 ldi r24, 0x33 ; 51 1f55a: 9d e0 ldi r25, 0x0D ; 13 1f55c: 0e 94 94 77 call 0xef28 ; 0xef28 1f560: 80 93 fc 03 sts 0x03FC, r24 ; 0x8003fc backlightTimer_period = eeprom_init_default_word((uint16_t *)EEPROM_BACKLIGHT_TIMEOUT, LCD_BACKLIGHT_TIMEOUT); // in seconds 1f564: 6f e0 ldi r22, 0x0F ; 15 1f566: 70 e0 ldi r23, 0x00 ; 0 1f568: 80 e3 ldi r24, 0x30 ; 48 1f56a: 9d e0 ldi r25, 0x0D ; 13 1f56c: 0e 94 7c 77 call 0xeef8 ; 0xeef8 1f570: 90 93 4e 02 sts 0x024E, r25 ; 0x80024e 1f574: 80 93 4d 02 sts 0x024D, r24 ; 0x80024d SET_OUTPUT(LCD_BL_PIN); 1f578: 6b 9a sbi 0x0d, 3 ; 13 backlightTimer_reset(); 1f57a: 0e 94 95 8b call 0x1172a ; 0x1172a return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1f57e: 8f 98 cbi 0x11, 7 ; 17 SET_OUTPUT(LCD_PINS_RS); 1f580: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1f582: 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); 1f584: 85 9a sbi 0x10, 5 ; 16 SET_OUTPUT(LCD_PINS_D5); 1f586: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1f588: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f58c: 80 68 ori r24, 0x80 ; 128 1f58e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1f592: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1f594: 80 91 0d 04 lds r24, 0x040D ; 0x80040d <_ZL19lcd_displayfunction.lto_priv.570> 1f598: 88 60 ori r24, 0x08 ; 8 1f59a: 80 93 0d 04 sts 0x040D, r24 ; 0x80040d <_ZL19lcd_displayfunction.lto_priv.570> 1f59e: 2f ef ldi r18, 0xFF ; 255 1f5a0: 30 e7 ldi r19, 0x70 ; 112 1f5a2: 82 e0 ldi r24, 0x02 ; 2 1f5a4: 21 50 subi r18, 0x01 ; 1 1f5a6: 30 40 sbci r19, 0x00 ; 0 1f5a8: 80 40 sbci r24, 0x00 ; 0 1f5aa: e1 f7 brne .-8 ; 0x1f5a4 1f5ac: 00 c0 rjmp .+0 ; 0x1f5ae 1f5ae: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1f5b0: 81 e0 ldi r24, 0x01 ; 1 1f5b2: 0e 94 00 70 call 0xe000 ; 0xe000 fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1f5b6: 88 ea ldi r24, 0xA8 ; 168 1f5b8: 91 e7 ldi r25, 0x71 ; 113 1f5ba: 90 93 08 04 sts 0x0408, r25 ; 0x800408 <_lcdout+0x9> 1f5be: 80 93 07 04 sts 0x0407, r24 ; 0x800407 <_lcdout+0x8> 1f5c2: 10 92 0a 04 sts 0x040A, r1 ; 0x80040a <_lcdout+0xb> 1f5c6: 10 92 09 04 sts 0x0409, r1 ; 0x800409 <_lcdout+0xa> 1f5ca: 12 e0 ldi r17, 0x02 ; 2 1f5cc: 10 93 02 04 sts 0x0402, r17 ; 0x800402 <_lcdout+0x3> 1f5d0: 10 92 0c 04 sts 0x040C, r1 ; 0x80040c <_lcdout+0xd> 1f5d4: 10 92 0b 04 sts 0x040B, r1 ; 0x80040b <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1f5d8: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_longpress_func = menu_lcd_longpress_func; 1f5dc: 8a e3 ldi r24, 0x3A ; 58 1f5de: 93 ed ldi r25, 0xD3 ; 211 1f5e0: 90 93 12 04 sts 0x0412, r25 ; 0x800412 1f5e4: 80 93 11 04 sts 0x0411, r24 ; 0x800411 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1f5e8: 82 ec ldi r24, 0xC2 ; 194 1f5ea: 9a e3 ldi r25, 0x3A ; 58 1f5ec: 90 93 10 04 sts 0x0410, r25 ; 0x800410 1f5f0: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f menu_menu = lcd_status_screen; 1f5f4: 8c e3 ldi r24, 0x3C ; 60 1f5f6: 9a e3 ldi r25, 0x3A ; 58 1f5f8: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a 1f5fc: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 SET_INPUT(BTN_EN1); 1f600: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f604: 8b 7f andi r24, 0xFB ; 251 1f606: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1f60a: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f60e: 8d 7f andi r24, 0xFD ; 253 1f610: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1f614: 9f b7 in r25, 0x3f ; 63 1f616: f8 94 cli 1f618: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f61c: 84 60 ori r24, 0x04 ; 4 1f61e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f622: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1f624: 9f b7 in r25, 0x3f ; 63 1f626: f8 94 cli 1f628: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f62c: 82 60 ori r24, 0x02 ; 2 1f62e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f632: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1f634: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f638: 8f 7b andi r24, 0xBF ; 191 1f63a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1f63e: 9f b7 in r25, 0x3f ; 63 1f640: f8 94 cli 1f642: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f646: 80 64 ori r24, 0x40 ; 64 1f648: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1f64c: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1f64e: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1f652: 8e 7f andi r24, 0xFE ; 254 1f654: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1f658: 9f b7 in r25, 0x3f ; 63 1f65a: f8 94 cli 1f65c: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f660: 81 60 ori r24, 0x01 ; 1 1f662: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1f666: 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); 1f668: af e9 ldi r26, 0x9F ; 159 1f66a: bf e0 ldi r27, 0x0F ; 15 1f66c: 11 97 sbiw r26, 0x01 ; 1 1f66e: f1 f7 brne .-4 ; 0x1f66c 1f670: 00 c0 rjmp .+0 ; 0x1f672 1f672: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1f674: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f678: 80 95 com r24 1f67a: 81 70 andi r24, 0x01 ; 1 1f67c: 80 93 0e 04 sts 0x040E, r24 ; 0x80040e #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1f680: 44 e1 ldi r20, 0x14 ; 20 1f682: 50 e0 ldi r21, 0x00 ; 0 1f684: 6a e6 ldi r22, 0x6A ; 106 1f686: 70 e7 ldi r23, 0x70 ; 112 1f688: 8a e3 ldi r24, 0x3A ; 58 1f68a: 95 e0 ldi r25, 0x05 ; 5 1f68c: 0f 94 7e db call 0x3b6fc ; 0x3b6fc timer2_init(); // enables functional millis ultralcd_init(); spi_init(); 1f690: 0f 94 50 c0 call 0x380a0 ; 0x380a0 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1f694: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1f698: 87 eb ldi r24, 0xB7 ; 183 1f69a: 9e e8 ldi r25, 0x8E ; 142 1f69c: 9f 93 push r25 1f69e: 8f 93 push r24 1f6a0: 8e eb ldi r24, 0xBE ; 190 1f6a2: 9e e8 ldi r25, 0x8E ; 142 1f6a4: 9f 93 push r25 1f6a6: 8f 93 push r24 1f6a8: 0e 94 6e 6f call 0xdedc ; 0xdedc static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1f6ac: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1f6b0: 84 60 ori r24, 0x04 ; 4 1f6b2: 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)); 1f6b6: 60 e0 ldi r22, 0x00 ; 0 1f6b8: 87 ed ldi r24, 0xD7 ; 215 1f6ba: 9e e0 ldi r25, 0x0E ; 14 1f6bc: 0e 94 94 77 call 0xef28 ; 0xef28 1f6c0: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 spi_init(); lcd_splash(); Sound_Init(); // also guarantee "SET_OUTPUT(BEEPER)" selectedSerialPort = eeprom_init_default_byte((uint8_t *)EEPROM_SECOND_SERIAL_ACTIVE, 0); 1f6c4: 60 e0 ldi r22, 0x00 ; 0 1f6c6: 88 e0 ldi r24, 0x08 ; 8 1f6c8: 9f e0 ldi r25, 0x0F ; 15 1f6ca: 0e 94 94 77 call 0xef28 ; 0xef28 1f6ce: 80 93 21 05 sts 0x0521, r24 ; 0x800521 MYSERIAL.begin(BAUDRATE); 1f6d2: 0e 94 81 db call 0x1b702 ; 0x1b702 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1f6d6: 86 ed ldi r24, 0xD6 ; 214 1f6d8: 98 e7 ldi r25, 0x78 ; 120 1f6da: 90 93 09 05 sts 0x0509, r25 ; 0x800509 <_uartout+0x9> 1f6de: 80 93 08 05 sts 0x0508, r24 ; 0x800508 <_uartout+0x8> 1f6e2: 10 92 0b 05 sts 0x050B, r1 ; 0x80050b <_uartout+0xb> 1f6e6: 10 92 0a 05 sts 0x050A, r1 ; 0x80050a <_uartout+0xa> 1f6ea: 10 93 03 05 sts 0x0503, r17 ; 0x800503 <_uartout+0x3> 1f6ee: 10 92 0d 05 sts 0x050D, r1 ; 0x80050d <_uartout+0xd> 1f6f2: 10 92 0c 05 sts 0x050C, r1 ; 0x80050c <_uartout+0xc> stdout = uartout; 1f6f6: 80 e0 ldi r24, 0x00 ; 0 1f6f8: 95 e0 ldi r25, 0x05 ; 5 1f6fa: 90 93 16 18 sts 0x1816, r25 ; 0x801816 <__iob+0x3> 1f6fe: 80 93 15 18 sts 0x1815, r24 ; 0x801815 <__iob+0x2> #ifdef XFLASH bool xflash_success = xflash_init(); 1f702: 0e 94 96 e4 call 0x1c92c ; 0x1c92c 1f706: b8 2e mov r11, r24 uint8_t optiboot_status = 1; if (xflash_success) 1f708: 0f 90 pop r0 1f70a: 0f 90 pop r0 1f70c: 0f 90 pop r0 1f70e: 0f 90 pop r0 1f710: 8e 01 movw r16, r28 1f712: 0f 5f subi r16, 0xFF ; 255 1f714: 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; 1f716: aa 24 eor r10, r10 1f718: a3 94 inc r10 if (xflash_success) 1f71a: 88 23 and r24, r24 1f71c: 09 f4 brne .+2 ; 0x1f720 1f71e: d8 c0 rjmp .+432 ; 0x1f8d0 { optiboot_status = optiboot_xflash_enter(); 1f720: 0f 94 5e c0 call 0x380bc ; 0x380bc 1f724: 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)) 1f726: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e3> 1f72a: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e4> 1f72e: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e5> 1f732: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e6> 1f736: 8a 3a cpi r24, 0xAA ; 170 1f738: 95 45 sbci r25, 0x55 ; 85 1f73a: aa 4a sbci r26, 0xAA ; 170 1f73c: b5 45 sbci r27, 0x55 ; 85 1f73e: 09 f0 breq .+2 ; 0x1f742 1f740: bf c0 rjmp .+382 ; 0x1f8c0 1f742: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e2> 1f746: 87 ff sbrs r24, 7 1f748: bb c0 rjmp .+374 ; 0x1f8c0 { uint8_t lang = boot_reserved >> 3; 1f74a: 80 90 fa 1f lds r8, 0x1FFA ; 0x801ffa <__bss_end+0x7e1> 1f74e: 98 2c mov r9, r8 1f750: 96 94 lsr r9 1f752: 96 94 lsr r9 1f754: 96 94 lsr r9 uint8_t state = boot_reserved & 0x07; 1f756: f8 2d mov r31, r8 1f758: f7 70 andi r31, 0x07 ; 7 1f75a: 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 1f75c: 99 20 and r9, r9 1f75e: 09 f4 brne .+2 ; 0x1f762 1f760: af c0 rjmp .+350 ; 0x1f8c0 #ifdef XFLASH if (lang == LANG_ID_SEC) 1f762: 21 e0 ldi r18, 0x01 ; 1 1f764: 92 12 cpse r9, r18 1f766: 24 c0 rjmp .+72 ; 0x1f7b0 { 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 1f768: 40 e1 ldi r20, 0x10 ; 16 1f76a: 50 e0 ldi r21, 0x00 ; 0 1f76c: 60 e0 ldi r22, 0x00 ; 0 1f76e: 71 e0 ldi r23, 0x01 ; 1 1f770: c8 01 movw r24, r16 1f772: 0f 94 2b db call 0x3b656 ; 0x3b656 if (offset) *offset = ui; 1f776: 60 e0 ldi r22, 0x00 ; 0 1f778: 71 e0 ldi r23, 0x01 ; 1 1f77a: 6b 01 movw r12, r22 1f77c: f1 2c mov r15, r1 1f77e: e1 2c mov r14, r1 lang_table_header_t header; uint32_t src_addr; if (lang_get_header(lang, &header, &src_addr)) 1f780: 89 81 ldd r24, Y+1 ; 0x01 1f782: 9a 81 ldd r25, Y+2 ; 0x02 1f784: ab 81 ldd r26, Y+3 ; 0x03 1f786: bc 81 ldd r27, Y+4 ; 0x04 1f788: 85 3a cpi r24, 0xA5 ; 165 1f78a: 9a 45 sbci r25, 0x5A ; 90 1f78c: a4 4b sbci r26, 0xB4 ; 180 1f78e: bb 44 sbci r27, 0x4B ; 75 1f790: 09 f0 breq .+2 ; 0x1f794 1f792: 96 c0 rjmp .+300 ; 0x1f8c0 { lcd_puts_at_P(1,0,PSTR("Language update")); 1f794: 4c ee ldi r20, 0xEC ; 236 1f796: 5e e8 ldi r21, 0x8E ; 142 1f798: 60 e0 ldi r22, 0x00 ; 0 1f79a: 81 e0 ldi r24, 0x01 ; 1 1f79c: 0e 94 a9 6f call 0xdf52 ; 0xdf52 for (uint8_t i = 0; i < state; i++) 1f7a0: 91 2c mov r9, r1 1f7a2: 89 14 cp r8, r9 1f7a4: 39 f1 breq .+78 ; 0x1f7f4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1f7a6: 8e e2 ldi r24, 0x2E ; 46 1f7a8: 0e 94 44 70 call 0xe088 ; 0xe088 1f7ac: 93 94 inc r9 1f7ae: f9 cf rjmp .-14 ; 0x1f7a2 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 1f7b0: 8c e5 ldi r24, 0x5C ; 92 1f7b2: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 1f7b4: 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; 1f7b6: c1 2c mov r12, r1 1f7b8: d1 2c mov r13, r1 1f7ba: 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 1f7bc: 20 e1 ldi r18, 0x10 ; 16 1f7be: 30 e0 ldi r19, 0x00 ; 0 1f7c0: a8 01 movw r20, r16 1f7c2: c7 01 movw r24, r14 1f7c4: b6 01 movw r22, r12 1f7c6: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc if (header->magic != LANG_MAGIC) break; //break if not valid 1f7ca: 89 81 ldd r24, Y+1 ; 0x01 1f7cc: 9a 81 ldd r25, Y+2 ; 0x02 1f7ce: ab 81 ldd r26, Y+3 ; 0x03 1f7d0: bc 81 ldd r27, Y+4 ; 0x04 1f7d2: 85 3a cpi r24, 0xA5 ; 165 1f7d4: 9a 45 sbci r25, 0x5A ; 90 1f7d6: a4 4b sbci r26, 0xB4 ; 180 1f7d8: bb 44 sbci r27, 0x4B ; 75 1f7da: 09 f0 breq .+2 ; 0x1f7de 1f7dc: 71 c0 rjmp .+226 ; 0x1f8c0 if (offset) *offset = addr; if (--lang == 0) return 1; 1f7de: f2 e0 ldi r31, 0x02 ; 2 1f7e0: 9f 16 cp r9, r31 1f7e2: c1 f2 breq .-80 ; 0x1f794 addr += header->size; //calc address of next table 1f7e4: 8d 81 ldd r24, Y+5 ; 0x05 1f7e6: 9e 81 ldd r25, Y+6 ; 0x06 1f7e8: c8 0e add r12, r24 1f7ea: d9 1e adc r13, r25 1f7ec: e1 1c adc r14, r1 1f7ee: f1 1c adc r15, r1 1f7f0: 9a 94 dec r9 1f7f2: e4 cf rjmp .-56 ; 0x1f7bc lcd_print('.'); _delay(100); 1f7f4: 64 e6 ldi r22, 0x64 ; 100 1f7f6: 70 e0 ldi r23, 0x00 ; 0 1f7f8: 80 e0 ldi r24, 0x00 ; 0 1f7fa: 90 e0 ldi r25, 0x00 ; 0 1f7fc: 0f 94 92 3d call 0x27b24 ; 0x27b24 boot_reserved = (boot_reserved & 0xF8) | ((state + 1) & 0x07); 1f800: 80 91 fa 1f lds r24, 0x1FFA ; 0x801ffa <__bss_end+0x7e1> 1f804: 88 7f andi r24, 0xF8 ; 248 1f806: 91 e0 ldi r25, 0x01 ; 1 1f808: 98 0d add r25, r8 1f80a: 97 70 andi r25, 0x07 ; 7 1f80c: 89 2b or r24, r25 1f80e: 80 93 fa 1f sts 0x1FFA, r24 ; 0x801ffa <__bss_end+0x7e1> if ((state * LANGBOOT_BLOCKSIZE) < header.size) 1f812: 91 2c mov r9, r1 1f814: 98 2c mov r9, r8 1f816: 88 24 eor r8, r8 1f818: 92 94 swap r9 1f81a: 80 ef ldi r24, 0xF0 ; 240 1f81c: 98 22 and r9, r24 1f81e: 8d 81 ldd r24, Y+5 ; 0x05 1f820: 9e 81 ldd r25, Y+6 ; 0x06 1f822: 88 16 cp r8, r24 1f824: 99 06 cpc r9, r25 1f826: 08 f0 brcs .+2 ; 0x1f82a 1f828: 46 c0 rjmp .+140 ; 0x1f8b6 { cli(); 1f82a: f8 94 cli uint16_t size = header.size - state * LANGBOOT_BLOCKSIZE; 1f82c: 0d 81 ldd r16, Y+5 ; 0x05 1f82e: 1e 81 ldd r17, Y+6 ; 0x06 1f830: 08 19 sub r16, r8 1f832: 19 09 sbc r17, r9 if (size > LANGBOOT_BLOCKSIZE) size = LANGBOOT_BLOCKSIZE; 1f834: 01 30 cpi r16, 0x01 ; 1 1f836: 20 e1 ldi r18, 0x10 ; 16 1f838: 12 07 cpc r17, r18 1f83a: 10 f0 brcs .+4 ; 0x1f840 1f83c: 00 e0 ldi r16, 0x00 ; 0 1f83e: 10 e1 ldi r17, 0x10 ; 16 xflash_rd_data(src_addr + state * LANGBOOT_BLOCKSIZE, (uint8_t*)LANGBOOT_RAMBUFFER, size); 1f840: c7 01 movw r24, r14 1f842: b6 01 movw r22, r12 1f844: 68 0d add r22, r8 1f846: 79 1d adc r23, r9 1f848: 81 1d adc r24, r1 1f84a: 91 1d adc r25, r1 1f84c: 98 01 movw r18, r16 1f84e: 40 e0 ldi r20, 0x00 ; 0 1f850: 58 e0 ldi r21, 0x08 ; 8 1f852: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc } void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size) { cli(); 1f856: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1f858: 8a ea ldi r24, 0xAA ; 170 1f85a: 95 e5 ldi r25, 0x55 ; 85 1f85c: dc 01 movw r26, r24 1f85e: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e3> 1f862: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e4> 1f866: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e5> 1f86a: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e6> boot_app_flags |= BOOT_APP_FLG_COPY | BOOT_APP_FLG_ERASE; 1f86e: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e2> 1f872: 83 60 ori r24, 0x03 ; 3 1f874: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e2> boot_copy_size = (uint16_t)size; 1f878: 10 93 f9 1f sts 0x1FF9, r17 ; 0x801ff9 <__bss_end+0x7e0> 1f87c: 00 93 f8 1f sts 0x1FF8, r16 ; 0x801ff8 <__bss_end+0x7df> boot_src_addr = (uint32_t)rptr; 1f880: 80 e0 ldi r24, 0x00 ; 0 1f882: 98 e0 ldi r25, 0x08 ; 8 1f884: a0 e0 ldi r26, 0x00 ; 0 1f886: b0 e0 ldi r27, 0x00 ; 0 1f888: 80 93 f0 1f sts 0x1FF0, r24 ; 0x801ff0 <__bss_end+0x7d7> 1f88c: 90 93 f1 1f sts 0x1FF1, r25 ; 0x801ff1 <__bss_end+0x7d8> 1f890: a0 93 f2 1f sts 0x1FF2, r26 ; 0x801ff2 <__bss_end+0x7d9> 1f894: b0 93 f3 1f sts 0x1FF3, r27 ; 0x801ff3 <__bss_end+0x7da> if (state == 0) { //TODO - check header integrity } bootapp_ram2flash(LANGBOOT_RAMBUFFER, _SEC_LANG_TABLE + state * LANGBOOT_BLOCKSIZE, size); 1f898: c4 01 movw r24, r8 1f89a: 80 50 subi r24, 0x00 ; 0 1f89c: 9f 4f sbci r25, 0xFF ; 255 boot_dst_addr = (uint32_t)fptr; 1f89e: b0 e0 ldi r27, 0x00 ; 0 1f8a0: a0 e0 ldi r26, 0x00 ; 0 1f8a2: 80 93 f4 1f sts 0x1FF4, r24 ; 0x801ff4 <__bss_end+0x7db> 1f8a6: 90 93 f5 1f sts 0x1FF5, r25 ; 0x801ff5 <__bss_end+0x7dc> 1f8aa: a0 93 f6 1f sts 0x1FF6, r26 ; 0x801ff6 <__bss_end+0x7dd> 1f8ae: b0 93 f7 1f sts 0x1FF7, r27 ; 0x801ff7 <__bss_end+0x7de> for (uint16_t i = 0; i < EEPROM_TOP; i++) { eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); softReset(); 1f8b2: 0e 94 01 68 call 0xd002 ; 0xd002 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1f8b6: 61 e0 ldi r22, 0x01 ; 1 1f8b8: 8e ef ldi r24, 0xFE ; 254 1f8ba: 9f e0 ldi r25, 0x0F ; 15 1f8bc: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a //TODO - check sec lang data integrity eeprom_update_byte_notify((unsigned char *)EEPROM_LANG, LANG_ID_SEC); } } } boot_app_magic = 0; 1f8c0: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e3> 1f8c4: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e4> 1f8c8: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e5> 1f8cc: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e6> return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 1f8d0: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac setup_powerhold(); farm_mode_init(); #ifdef TMC2130 if(FarmOrUserECool()) { 1f8d4: 88 23 and r24, r24 1f8d6: 51 f0 breq .+20 ; 0x1f8ec //increased extruder current (PFW363) currents[E_AXIS].setiRun(TMC2130_CURRENTS_FARM); 1f8d8: 64 e2 ldi r22, 0x24 ; 36 1f8da: 86 e6 ldi r24, 0x66 ; 102 1f8dc: 92 e0 ldi r25, 0x02 ; 2 1f8de: 0e 94 bb 68 call 0xd176 ; 0xd176 currents[E_AXIS].setiHold(TMC2130_CURRENTS_FARM); 1f8e2: 64 e2 ldi r22, 0x24 ; 36 1f8e4: 86 e6 ldi r24, 0x66 ; 102 1f8e6: 92 e0 ldi r25, 0x02 ; 2 1f8e8: 0e 94 b3 68 call 0xd166 ; 0xd166 #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); 1f8ec: 44 e1 ldi r20, 0x14 ; 20 1f8ee: 50 e0 ldi r21, 0x00 ; 0 1f8f0: 65 e1 ldi r22, 0x15 ; 21 1f8f2: 7d e0 ldi r23, 0x0D ; 13 1f8f4: c8 01 movw r24, r16 1f8f6: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) 1f8fa: 8c 89 ldd r24, Y+20 ; 0x14 1f8fc: 81 11 cpse r24, r1 1f8fe: 0a c0 rjmp .+20 ; 0x1f914 1f900: 44 e0 ldi r20, 0x04 ; 4 1f902: 50 e0 ldi r21, 0x00 ; 0 1f904: 6c ef ldi r22, 0xFC ; 252 1f906: 7f e8 ldi r23, 0x8F ; 143 1f908: c8 01 movw r24, r16 1f90a: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 1f90e: 89 2b or r24, r25 1f910: 09 f4 brne .+2 ; 0x1f914 1f912: 51 c0 rjmp .+162 ; 0x1f9b6 * @return 1 on general failure */ #ifdef PRUSA_SN_SUPPORT static uint8_t get_PRUSA_SN(char* SN) { uint8_t selectedSerialPort_bak = selectedSerialPort; 1f914: e0 90 21 05 lds r14, 0x0521 ; 0x800521 uint8_t rxIndex; bool SN_valid = false; ShortTimer timeout; 1f918: 1d 8a std Y+21, r1 ; 0x15 1f91a: 1f 8a std Y+23, r1 ; 0x17 1f91c: 1e 8a std Y+22, r1 ; 0x16 selectedSerialPort = 0; 1f91e: 10 92 21 05 sts 0x0521, r1 ; 0x800521 timeout.start(); 1f922: ce 01 movw r24, r28 1f924: 45 96 adiw r24, 0x15 ; 21 1f926: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> while (!SN_valid) { rxIndex = 0; _delay(50); 1f92a: 62 e3 ldi r22, 0x32 ; 50 1f92c: 70 e0 ldi r23, 0x00 ; 0 1f92e: 80 e0 ldi r24, 0x00 ; 0 1f930: 90 e0 ldi r25, 0x00 ; 0 1f932: 0f 94 92 3d call 0x27b24 ; 0x27b24 // 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; 1f936: 80 91 95 04 lds r24, 0x0495 ; 0x800495 1f93a: 90 91 96 04 lds r25, 0x0496 ; 0x800496 1f93e: 90 93 94 04 sts 0x0494, r25 ; 0x800494 1f942: 80 93 93 04 sts 0x0493, r24 ; 0x800493 MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); 1f946: 81 e0 ldi r24, 0x01 ; 1 1f948: 9f e8 ldi r25, 0x8F ; 143 1f94a: 0e 94 06 7b call 0xf60c ; 0xf60c 1f94e: 68 01 movw r12, r16 selectedSerialPort = 0; timeout.start(); while (!SN_valid) { rxIndex = 0; 1f950: f1 2c mov r15, r1 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) 1f952: 33 e1 ldi r19, 0x13 ; 19 1f954: f3 16 cp r15, r19 1f956: a1 f0 breq .+40 ; 0x1f980 { if (timeout.expired(250u)) 1f958: 6a ef ldi r22, 0xFA ; 250 1f95a: 70 e0 ldi r23, 0x00 ; 0 1f95c: ce 01 movw r24, r28 1f95e: 45 96 adiw r24, 0x15 ; 21 1f960: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 1f964: 81 11 cpse r24, r1 1f966: c1 c0 rjmp .+386 ; 0x1faea goto exit; if (MYSERIAL.available() > 0) 1f968: 0e 94 94 78 call 0xf128 ; 0xf128 1f96c: 18 16 cp r1, r24 1f96e: 19 06 cpc r1, r25 1f970: 84 f7 brge .-32 ; 0x1f952 { SN[rxIndex] = MYSERIAL.read(); 1f972: 0f 94 9a d6 call 0x3ad34 ; 0x3ad34 1f976: d6 01 movw r26, r12 1f978: 8d 93 st X+, r24 1f97a: 6d 01 movw r12, r26 rxIndex++; 1f97c: f3 94 inc r15 1f97e: e9 cf rjmp .-46 ; 0x1f952 } } SN[rxIndex] = 0; 1f980: 1c 8a std Y+20, r1 ; 0x14 // printf_P(PSTR("SN:%s\n"), SN); SN_valid = (strncmp_P(SN, PSTR("CZPX"), 4) == 0); 1f982: 44 e0 ldi r20, 0x04 ; 4 1f984: 50 e0 ldi r21, 0x00 ; 0 1f986: 6c ef ldi r22, 0xFC ; 252 1f988: 7e e8 ldi r23, 0x8E ; 142 1f98a: c8 01 movw r24, r16 1f98c: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 ShortTimer timeout; selectedSerialPort = 0; timeout.start(); while (!SN_valid) 1f990: 89 2b or r24, r25 1f992: 59 f6 brne .-106 ; 0x1f92a 1f994: 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; 1f996: e0 92 21 05 sts 0x0521, r14 ; 0x800521 { char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); if (SN[19] || strncmp_P(SN, PSTR("CZPX"), 4)) { if (!get_PRUSA_SN(SN)) 1f99a: 88 23 and r24, r24 1f99c: 09 f4 brne .+2 ; 0x1f9a0 1f99e: a7 c0 rjmp .+334 ; 0x1faee #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); 1f9a0: 44 e1 ldi r20, 0x14 ; 20 1f9a2: 50 e0 ldi r21, 0x00 ; 0 1f9a4: 65 e1 ldi r22, 0x15 ; 21 1f9a6: 7d e0 ldi r23, 0x0D ; 13 1f9a8: c8 01 movw r24, r16 1f9aa: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); 1f9ae: 81 ef ldi r24, 0xF1 ; 241 1f9b0: 9f e8 ldi r25, 0x8F ; 143 } else puts_P(PSTR("SN update failed")); 1f9b2: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) 1f9b6: a1 10 cpse r10, r1 1f9b8: 04 c0 rjmp .+8 ; 0x1f9c2 1f9ba: 80 91 21 05 lds r24, 0x0521 ; 0x800521 1f9be: 88 23 and r24, r24 1f9c0: 21 f0 breq .+8 ; 0x1f9ca SERIAL_PROTOCOLLNPGM("start"); 1f9c2: 8a ed ldi r24, 0xDA ; 218 1f9c4: 9f e8 ldi r25, 0x8F ; 143 1f9c6: 0e 94 06 7b call 0xf60c ; 0xf60c #endif SERIAL_ECHO_START; 1f9ca: 82 ef ldi r24, 0xF2 ; 242 1f9cc: 99 ea ldi r25, 0xA9 ; 169 1f9ce: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1f9d2: 83 ec ldi r24, 0xC3 ; 195 1f9d4: 9f e8 ldi r25, 0x8F ; 143 1f9d6: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1f9da: 60 e0 ldi r22, 0x00 ; 0 1f9dc: 8c ea ldi r24, 0xAC ; 172 1f9de: 9c e0 ldi r25, 0x0C ; 12 1f9e0: 0e 94 94 77 call 0xef28 ; 0xef28 1f9e4: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1f9e6: 0e 94 23 db call 0x1b646 ; 0x1b646 } MMU2::mmu2.Status(); 1f9ea: 0f 94 07 77 call 0x2ee0e ; 0x2ee0e } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1f9ee: 84 e0 ldi r24, 0x04 ; 4 1f9f0: 9f e8 ldi r25, 0x8F ; 143 1f9f2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1f9f6: 62 e0 ldi r22, 0x02 ; 2 1f9f8: 86 ed ldi r24, 0xD6 ; 214 1f9fa: 9e e0 ldi r25, 0x0E ; 14 1f9fc: 0e 94 94 77 call 0xef28 ; 0xef28 if (status == (uint8_t)EEPROM::Enabled) 1fa00: 81 30 cpi r24, 0x01 ; 1 1fa02: 09 f0 breq .+2 ; 0x1fa06 1fa04: 77 c0 rjmp .+238 ; 0x1faf4 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1fa06: 8a e4 ldi r24, 0x4A ; 74 1fa08: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1fa0a: 0e 94 06 7b call 0xf60c ; 0xf60c #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1fa0e: 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); 1fa10: f0 fe sbrs r15, 0 1fa12: 04 c0 rjmp .+8 ; 0x1fa1c 1fa14: 8a ed ldi r24, 0xDA ; 218 1fa16: 9d e6 ldi r25, 0x6D ; 109 1fa18: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1fa1c: f1 fe sbrs r15, 1 1fa1e: 04 c0 rjmp .+8 ; 0x1fa28 1fa20: 8a ec ldi r24, 0xCA ; 202 1fa22: 9d e6 ldi r25, 0x6D ; 109 1fa24: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1fa28: f2 fe sbrs r15, 2 1fa2a: 04 c0 rjmp .+8 ; 0x1fa34 1fa2c: 89 eb ldi r24, 0xB9 ; 185 1fa2e: 9d e6 ldi r25, 0x6D ; 109 1fa30: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1fa34: f3 fe sbrs r15, 3 1fa36: 04 c0 rjmp .+8 ; 0x1fa40 1fa38: 89 ea ldi r24, 0xA9 ; 169 1fa3a: 9d e6 ldi r25, 0x6D ; 109 1fa3c: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1fa40: f5 fe sbrs r15, 5 1fa42: 04 c0 rjmp .+8 ; 0x1fa4c 1fa44: 89 e9 ldi r24, 0x99 ; 153 1fa46: 9d e6 ldi r25, 0x6D ; 109 1fa48: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 MCUSR = 0; 1fa4c: 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; 1fa4e: 82 ef ldi r24, 0xF2 ; 242 1fa50: 99 ea ldi r25, 0xA9 ; 169 1fa52: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1fa56: 89 e8 ldi r24, 0x89 ; 137 1fa58: 9d e6 ldi r25, 0x6D ; 109 1fa5a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1fa5e: 8f ea ldi r24, 0xAF ; 175 1fa60: 9f e8 ldi r25, 0x8F ; 143 1fa62: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1fa66: 8d e7 ldi r24, 0x7D ; 125 1fa68: 9d e6 ldi r25, 0x6D ; 109 1fa6a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1fa6e: 87 ea ldi r24, 0xA7 ; 167 1fa70: 9f e8 ldi r25, 0x8F ; 143 1fa72: 0e 94 06 7b call 0xf60c ; 0xf60c #endif #endif SERIAL_ECHO_START; 1fa76: 82 ef ldi r24, 0xF2 ; 242 1fa78: 99 ea ldi r25, 0xA9 ; 169 1fa7a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1fa7e: 8e e6 ldi r24, 0x6E ; 110 1fa80: 9d e6 ldi r25, 0x6D ; 109 1fa82: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1fa86: 80 91 0f 18 lds r24, 0x180F ; 0x80180f <__brkval> 1fa8a: 90 91 10 18 lds r25, 0x1810 ; 0x801810 <__brkval+0x1> 1fa8e: 00 97 sbiw r24, 0x00 ; 0 1fa90: a1 f1 breq .+104 ; 0x1fafa 1fa92: 08 1b sub r16, r24 1fa94: 19 0b sbc r17, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1fa96: b8 01 movw r22, r16 1fa98: 11 0f add r17, r17 1fa9a: 88 0b sbc r24, r24 1fa9c: 99 0b sbc r25, r25 1fa9e: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1faa2: 87 e5 ldi r24, 0x57 ; 87 1faa4: 9d e6 ldi r25, 0x6D ; 109 1faa6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1faaa: 80 ee ldi r24, 0xE0 ; 224 1faac: 96 e0 ldi r25, 0x06 ; 6 1faae: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 #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); 1fab2: 6e e2 ldi r22, 0x2E ; 46 1fab4: 71 e0 ldi r23, 0x01 ; 1 1fab6: 8e ee ldi r24, 0xEE ; 238 1fab8: 9e e0 ldi r25, 0x0E ; 14 1faba: 0e 94 7c 77 call 0xeef8 ; 0xeef8 1fabe: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1fac0: 66 e3 ldi r22, 0x36 ; 54 1fac2: 71 e0 ldi r23, 0x01 ; 1 1fac4: 8c ee ldi r24, 0xEC ; 236 1fac6: 9e e0 ldi r25, 0x0E ; 14 1fac8: 0e 94 7c 77 call 0xeef8 ; 0xeef8 if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1facc: 0e 32 cpi r16, 0x2E ; 46 1face: 11 40 sbci r17, 0x01 ; 1 1fad0: 11 f0 breq .+4 ; 0x1fad6 1fad2: 0d 94 b9 05 jmp 0x20b72 ; 0x20b72 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1fad6: 01 e0 ldi r16, 0x01 ; 1 1fad8: 86 33 cpi r24, 0x36 ; 54 1fada: 91 40 sbci r25, 0x01 ; 1 1fadc: 09 f4 brne .+2 ; 0x1fae0 1fade: 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(); 1fae0: 0e 94 59 95 call 0x12ab2 ; 0x12ab2 1fae4: f8 2e mov r15, r24 1fae6: 0d 94 c1 05 jmp 0x20b82 ; 0x20b82 _delay(50); MYSERIAL.flush(); //clear RX buffer SERIAL_ECHOLNRPGM(PSTR(";S")); while (rxIndex < 19) { if (timeout.expired(250u)) 1faea: 80 e0 ldi r24, 0x00 ; 0 1faec: 54 cf rjmp .-344 ; 0x1f996 { eeprom_update_block_notify(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); puts_P(PSTR("SN updated")); } else puts_P(PSTR("SN update failed")); 1faee: 80 ee ldi r24, 0xE0 ; 224 1faf0: 9f e8 ldi r25, 0x8F ; 143 1faf2: 5f cf rjmp .-322 ; 0x1f9b2 1faf4: 84 e4 ldi r24, 0x44 ; 68 1faf6: 9d e5 ldi r25, 0x5D ; 93 1faf8: 88 cf rjmp .-240 ; 0x1fa0a 1fafa: 09 51 subi r16, 0x19 ; 25 1fafc: 18 41 sbci r17, 0x18 ; 24 1fafe: cb cf rjmp .-106 ; 0x1fa96 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1fb00: 81 e3 ldi r24, 0x31 ; 49 1fb02: 91 e0 ldi r25, 0x01 ; 1 1fb04: 90 93 57 02 sts 0x0257, r25 ; 0x800257 <_ZL8maxttemp.lto_priv.485+0x1> 1fb08: 80 93 56 02 sts 0x0256, r24 ; 0x800256 <_ZL8maxttemp.lto_priv.485> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1fb0c: c0 90 9b 04 lds r12, 0x049B ; 0x80049b <_ZL12maxttemp_raw.lto_priv.478> 1fb10: d0 90 9c 04 lds r13, 0x049C ; 0x80049c <_ZL12maxttemp_raw.lto_priv.478+0x1> 1fb14: c6 01 movw r24, r12 1fb16: 0e 94 8e da call 0x1b51c ; 0x1b51c 1fb1a: 20 e0 ldi r18, 0x00 ; 0 1fb1c: 30 e8 ldi r19, 0x80 ; 128 1fb1e: 48 e9 ldi r20, 0x98 ; 152 1fb20: 53 e4 ldi r21, 0x43 ; 67 1fb22: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1fb26: 18 16 cp r1, r24 1fb28: 44 f4 brge .+16 ; 0x1fb3a #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1fb2a: f0 e1 ldi r31, 0x10 ; 16 1fb2c: cf 0e add r12, r31 1fb2e: d1 1c adc r13, r1 1fb30: d0 92 9c 04 sts 0x049C, r13 ; 0x80049c <_ZL12maxttemp_raw.lto_priv.478+0x1> 1fb34: c0 92 9b 04 sts 0x049B, r12 ; 0x80049b <_ZL12maxttemp_raw.lto_priv.478> 1fb38: e9 cf rjmp .-46 ; 0x1fb0c #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1fb3a: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 1fb3e: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 1fb42: 0f 94 fa 4a call 0x295f4 ; 0x295f4 1fb46: 20 e0 ldi r18, 0x00 ; 0 1fb48: 30 e0 ldi r19, 0x00 ; 0 1fb4a: 40 e2 ldi r20, 0x20 ; 32 1fb4c: 51 e4 ldi r21, 0x41 ; 65 1fb4e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1fb52: 87 ff sbrs r24, 7 1fb54: 0a c0 rjmp .+20 ; 0x1fb6a #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1fb56: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 1fb5a: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 1fb5e: 40 97 sbiw r24, 0x10 ; 16 1fb60: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 1fb64: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 1fb68: e8 cf rjmp .-48 ; 0x1fb3a #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1fb6a: 80 91 99 04 lds r24, 0x0499 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.479> 1fb6e: 90 91 9a 04 lds r25, 0x049A ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 1fb72: 0f 94 fa 4a call 0x295f4 ; 0x295f4 1fb76: 20 e0 ldi r18, 0x00 ; 0 1fb78: 30 e0 ldi r19, 0x00 ; 0 1fb7a: 4a ef ldi r20, 0xFA ; 250 1fb7c: 52 e4 ldi r21, 0x42 ; 66 1fb7e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1fb82: 18 16 cp r1, r24 1fb84: 54 f4 brge .+20 ; 0x1fb9a #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1fb86: 80 91 99 04 lds r24, 0x0499 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.479> 1fb8a: 90 91 9a 04 lds r25, 0x049A ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 1fb8e: 40 96 adiw r24, 0x10 ; 16 1fb90: 90 93 9a 04 sts 0x049A, r25 ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 1fb94: 80 93 99 04 sts 0x0499, r24 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.479> 1fb98: e8 cf rjmp .-48 ; 0x1fb6a #endif } #endif //BED_MAXTEMP #ifdef AMBIENT_MINTEMP while(analog2tempAmbient(ambient_minttemp_raw) < AMBIENT_MINTEMP) { 1fb9a: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 1fb9e: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 1fba2: 0f 94 65 4a call 0x294ca ; 0x294ca 1fba6: 20 e0 ldi r18, 0x00 ; 0 1fba8: 30 e0 ldi r19, 0x00 ; 0 1fbaa: 40 ef ldi r20, 0xF0 ; 240 1fbac: 51 ec ldi r21, 0xC1 ; 193 1fbae: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 1fbb2: 87 ff sbrs r24, 7 1fbb4: 0a c0 rjmp .+20 ; 0x1fbca #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_minttemp_raw += OVERSAMPLENR; #else ambient_minttemp_raw -= OVERSAMPLENR; 1fbb6: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 1fbba: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 1fbbe: 40 97 sbiw r24, 0x10 ; 16 1fbc0: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 1fbc4: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 1fbc8: e8 cf rjmp .-48 ; 0x1fb9a #endif } #endif //AMBIENT_MINTEMP #ifdef AMBIENT_MAXTEMP while(analog2tempAmbient(ambient_maxttemp_raw) > AMBIENT_MAXTEMP) { 1fbca: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.480> 1fbce: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 1fbd2: 0f 94 65 4a call 0x294ca ; 0x294ca 1fbd6: 20 e0 ldi r18, 0x00 ; 0 1fbd8: 30 e0 ldi r19, 0x00 ; 0 1fbda: 40 ea ldi r20, 0xA0 ; 160 1fbdc: 52 e4 ldi r21, 0x42 ; 66 1fbde: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 1fbe2: 18 16 cp r1, r24 1fbe4: 54 f4 brge .+20 ; 0x1fbfa #if AMBIENT_RAW_LO_TEMP < AMBIENT_RAW_HI_TEMP ambient_maxttemp_raw -= OVERSAMPLENR; #else ambient_maxttemp_raw += OVERSAMPLENR; 1fbe6: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.480> 1fbea: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 1fbee: 40 96 adiw r24, 0x10 ; 16 1fbf0: 90 93 98 04 sts 0x0498, r25 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 1fbf4: 80 93 97 04 sts 0x0497, r24 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.480> 1fbf8: e8 cf rjmp .-48 ; 0x1fbca #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1fbfa: 9f b7 in r25, 0x3f ; 63 1fbfc: f8 94 cli TCNT0 = 0; 1fbfe: 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; 1fc00: 8f ef ldi r24, 0xFF ; 255 1fc02: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1fc04: 83 e3 ldi r24, 0x33 ; 51 1fc06: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1fc08: 12 e0 ldi r17, 0x02 ; 2 1fc0a: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1fc0c: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1fc10: 81 60 ori r24, 0x01 ; 1 1fc12: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1fc16: 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; 1fc18: 80 e8 ldi r24, 0x80 ; 128 1fc1a: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1fc1e: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1fc22: 84 60 ori r24, 0x04 ; 4 1fc24: 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; 1fc28: 2f b7 in r18, 0x3f ; 63 1fc2a: f8 94 cli SET_OUTPUT(BEEPER); 1fc2c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fc30: 84 60 ori r24, 0x04 ; 4 1fc32: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1fc36: 9f b7 in r25, 0x3f ; 63 1fc38: f8 94 cli 1fc3a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc3e: 8b 7f andi r24, 0xFB ; 251 1fc40: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fc44: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1fc46: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fc4a: 80 62 ori r24, 0x20 ; 32 1fc4c: 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); 1fc50: 81 e0 ldi r24, 0x01 ; 1 1fc52: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1fc56: 85 e1 ldi r24, 0x15 ; 21 1fc58: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1fc5c: 8f ef ldi r24, 0xFF ; 255 1fc5e: 90 e0 ldi r25, 0x00 ; 0 1fc60: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1fc64: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1fc68: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1fc6c: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1fc70: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1fc74: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1fc78: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1fc7c: 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")); 1fc7e: 82 e1 ldi r24, 0x12 ; 18 1fc80: 9f e8 ldi r25, 0x8F ; 143 1fc82: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1fc86: 8f e5 ldi r24, 0x5F ; 95 1fc88: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1fc8c: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1fc90: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1fc94: 80 64 ori r24, 0x40 ; 64 1fc96: 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); 1fc9a: 8f e9 ldi r24, 0x9F ; 159 1fc9c: 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(); 1fca0: 0e 94 84 8f call 0x11f08 ; 0x11f08 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1fca4: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1fca6: f8 94 cli // CTC TCCRxB &= ~(1< 1fcac: 8f 7e andi r24, 0xEF ; 239 1fcae: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB |= (1< 1fcb6: 88 60 ori r24, 0x08 ; 8 1fcb8: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxA &= ~(1< 1fcc0: 8d 7f andi r24, 0xFD ; 253 1fcc2: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(1< 1fcca: 8e 7f andi r24, 0xFE ; 254 1fccc: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1fcd4: 8f 73 andi r24, 0x3F ; 63 1fcd6: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> TCCRxA &= ~(3< 1fcde: 8f 7c andi r24, 0xCF ; 207 1fce0: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> // x/256 prescaler TCCRxB |= (1< 1fce8: 84 60 ori r24, 0x04 ; 4 1fcea: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fcf2: 8d 7f andi r24, 0xFD ; 253 1fcf4: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> TCCRxB &= ~(1< 1fcfc: 8e 7f andi r24, 0xFE ; 254 1fcfe: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> // reset counter TCNTx = 0; 1fd02: 10 92 25 01 sts 0x0125, r1 ; 0x800125 <__TEXT_REGION_LENGTH__+0x7c2125> 1fd06: 10 92 24 01 sts 0x0124, r1 ; 0x800124 <__TEXT_REGION_LENGTH__+0x7c2124> OCRxA = TEMP_TIM_OCRA_OVF; 1fd0a: 2b ee ldi r18, 0xEB ; 235 1fd0c: 31 e4 ldi r19, 0x41 ; 65 1fd0e: 30 93 29 01 sts 0x0129, r19 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1fd12: 20 93 28 01 sts 0x0128, r18 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1fd16: d1 9a sbi 0x1a, 1 ; 26 ENABLE_TEMP_MGR_INTERRUPT(); 1fd18: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 1fd1c: 82 60 ori r24, 0x02 ; 2 1fd1e: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fd22: 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: ")); 1fd24: 85 e4 ldi r24, 0x45 ; 69 1fd26: 9d e6 ldi r25, 0x6D ; 109 1fd28: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } bool extruder_altfan_detect() { // override isAltFan setting for detection altfanStatus.isAltfan = 0; 1fd2c: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> 1fd30: 8e 7f andi r24, 0xFE ; 254 1fd32: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> // During initialisation, use the EEPROM value altfanStatus.altfanOverride = eeprom_init_default_byte((uint8_t*)EEPROM_ALTFAN_OVERRIDE, 0); 1fd36: 60 e0 ldi r22, 0x00 ; 0 1fd38: 8b e2 ldi r24, 0x2B ; 43 1fd3a: 9d e0 ldi r25, 0x0D ; 13 1fd3c: 0e 94 94 77 call 0xef28 ; 0xef28 1fd40: 90 91 b9 04 lds r25, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> 1fd44: 80 fb bst r24, 0 1fd46: 91 f9 bld r25, 1 1fd48: 90 93 b9 04 sts 0x04B9, r25 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> setExtruderAutoFanState(3); 1fd4c: 83 e0 ldi r24, 0x03 ; 3 1fd4e: 0e 94 d1 76 call 0xeda2 ; 0xeda2 SET_INPUT(TACH_0); 1fd52: 6e 98 cbi 0x0d, 6 ; 13 CRITICAL_SECTION_START; 1fd54: 9f b7 in r25, 0x3f ; 63 1fd56: f8 94 cli EICRB &= ~(1 << ISC61); 1fd58: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fd5c: 8f 7d andi r24, 0xDF ; 223 1fd5e: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << ISC60); 1fd62: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 1fd66: 80 61 ori r24, 0x10 ; 16 1fd68: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EIMSK |= (1 << INT6); 1fd6c: ee 9a sbi 0x1d, 6 ; 29 fan_edge_counter[0] = 0; 1fd6e: 10 92 b6 04 sts 0x04B6, r1 ; 0x8004b6 1fd72: 10 92 b5 04 sts 0x04B5, r1 ; 0x8004b5 CRITICAL_SECTION_END; 1fd76: 9f bf out 0x3f, r25 ; 63 extruder_autofan_last_check = _millis(); 1fd78: 0f 94 8b 3f call 0x27f16 ; 0x27f16 1fd7c: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 1fd80: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 1fd84: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 1fd88: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f _delay(1000); 1fd8c: 68 ee ldi r22, 0xE8 ; 232 1fd8e: 73 e0 ldi r23, 0x03 ; 3 1fd90: 80 e0 ldi r24, 0x00 ; 0 1fd92: 90 e0 ldi r25, 0x00 ; 0 1fd94: 0f 94 92 3d call 0x27b24 ; 0x27b24 EIMSK &= ~(1 << INT6); 1fd98: ee 98 cbi 0x1d, 6 ; 29 countFanSpeed(); 1fd9a: 0e 94 5a 76 call 0xecb4 ; 0xecb4 // restore fan state altfanStatus.isAltfan = fan_speed[0] > 100; 1fd9e: 91 e0 ldi r25, 0x01 ; 1 1fda0: 20 91 b1 04 lds r18, 0x04B1 ; 0x8004b1 1fda4: 30 91 b2 04 lds r19, 0x04B2 ; 0x8004b2 1fda8: 25 36 cpi r18, 0x65 ; 101 1fdaa: 31 05 cpc r19, r1 1fdac: 0c f4 brge .+2 ; 0x1fdb0 1fdae: 90 e0 ldi r25, 0x00 ; 0 1fdb0: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> 1fdb4: 90 fb bst r25, 0 1fdb6: 80 f9 bld r24, 0 1fdb8: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> setExtruderAutoFanState(1); 1fdbc: 81 e0 ldi r24, 0x01 ; 1 1fdbe: 0e 94 d1 76 call 0xeda2 ; 0xeda2 return altfanStatus.isAltfan; 1fdc2: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> if (extruder_altfan_detect()) 1fdc6: 80 ff sbrs r24, 0 1fdc8: c4 c0 rjmp .+392 ; 0x1ff52 SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); 1fdca: 80 ea ldi r24, 0xA0 ; 160 1fdcc: 9f e8 ldi r25, 0x8F ; 143 else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1fdce: 0e 94 06 7b call 0xf60c ; 0xf60c // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1fdd2: 10 92 56 0e sts 0x0E56, r1 ; 0x800e56 block_buffer_tail = 0; 1fdd6: 10 92 57 0e sts 0x0E57, r1 ; 0x800e57 memset(position, 0, sizeof(position)); // clear position 1fdda: 80 e1 ldi r24, 0x10 ; 16 1fddc: e4 e5 ldi r30, 0x54 ; 84 1fdde: f7 e0 ldi r31, 0x07 ; 7 1fde0: df 01 movw r26, r30 1fde2: 28 2f mov r18, r24 1fde4: 1d 92 st X+, r1 1fde6: 2a 95 dec r18 1fde8: e9 f7 brne .-6 ; 0x1fde4 #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1fdea: e0 ed ldi r30, 0xD0 ; 208 1fdec: f4 e0 ldi r31, 0x04 ; 4 1fdee: df 01 movw r26, r30 1fdf0: 28 2f mov r18, r24 1fdf2: 1d 92 st X+, r1 1fdf4: 2a 95 dec r18 1fdf6: e9 f7 brne .-6 ; 0x1fdf2 #endif memset(previous_speed, 0, sizeof(previous_speed)); 1fdf8: e0 ec ldi r30, 0xC0 ; 192 1fdfa: f4 e0 ldi r31, 0x04 ; 4 1fdfc: df 01 movw r26, r30 1fdfe: 1d 92 st X+, r1 1fe00: 8a 95 dec r24 1fe02: e9 f7 brne .-6 ; 0x1fdfe previous_nominal_speed = 0.0; 1fe04: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507> 1fe08: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x1> 1fe0c: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.507+0x2> 1fe10: 10 92 bf 04 sts 0x04BF, r1 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.507+0x3> plan_reset_next_e_queue = false; 1fe14: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.505> plan_reset_next_e_sched = false; 1fe18: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.506> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1fe1c: 84 e0 ldi r24, 0x04 ; 4 1fe1e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 if (!READ(BTN_ENC)) 1fe22: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe26: 86 fd sbrc r24, 6 1fe28: cd c0 rjmp .+410 ; 0x1ffc4 1fe2a: bf ef ldi r27, 0xFF ; 255 1fe2c: e3 ed ldi r30, 0xD3 ; 211 1fe2e: f0 e3 ldi r31, 0x30 ; 48 1fe30: b1 50 subi r27, 0x01 ; 1 1fe32: e0 40 sbci r30, 0x00 ; 0 1fe34: f0 40 sbci r31, 0x00 ; 0 1fe36: e1 f7 brne .-8 ; 0x1fe30 1fe38: 00 c0 rjmp .+0 ; 0x1fe3a 1fe3a: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1fe3c: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe40: 86 fd sbrc r24, 6 1fe42: c0 c0 rjmp .+384 ; 0x1ffc4 { lcd_clear(); 1fe44: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_P(PSTR("Factory RESET")); 1fe48: 8c e6 ldi r24, 0x6C ; 108 1fe4a: 9f e8 ldi r25, 0x8F ; 143 1fe4c: 0e 94 80 6f call 0xdf00 ; 0xdf00 SET_OUTPUT(BEEPER); 1fe50: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1fe54: 84 60 ori r24, 0x04 ; 4 1fe56: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1fe5a: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 1fe5e: 82 30 cpi r24, 0x02 ; 2 1fe60: 41 f0 breq .+16 ; 0x1fe72 WRITE(BEEPER, HIGH); 1fe62: 9f b7 in r25, 0x3f ; 63 1fe64: f8 94 cli 1fe66: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe6a: 84 60 ori r24, 0x04 ; 4 1fe6c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe70: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1fe72: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1fe76: 86 ff sbrs r24, 6 1fe78: fc cf rjmp .-8 ; 0x1fe72 WRITE(BEEPER, LOW); 1fe7a: 9f b7 in r25, 0x3f ; 63 1fe7c: f8 94 cli 1fe7e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe82: 8b 7f andi r24, 0xFB ; 251 1fe84: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1fe88: 9f bf out 0x3f, r25 ; 63 1fe8a: 2f ef ldi r18, 0xFF ; 255 1fe8c: 37 ea ldi r19, 0xA7 ; 167 1fe8e: 81 e6 ldi r24, 0x61 ; 97 1fe90: 21 50 subi r18, 0x01 ; 1 1fe92: 30 40 sbci r19, 0x00 ; 0 1fe94: 80 40 sbci r24, 0x00 ; 0 1fe96: e1 f7 brne .-8 ; 0x1fe90 1fe98: 00 c0 rjmp .+0 ; 0x1fe9a 1fe9a: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1fe9c: 82 e5 ldi r24, 0x52 ; 82 1fe9e: 9f e8 ldi r25, 0x8F ; 143 1fea0: 9a 83 std Y+2, r25 ; 0x02 1fea2: 89 83 std Y+1, r24 ; 0x01 1fea4: 87 e4 ldi r24, 0x47 ; 71 1fea6: 9f e8 ldi r25, 0x8F ; 143 1fea8: 9c 83 std Y+4, r25 ; 0x04 1feaa: 8b 83 std Y+3, r24 ; 0x03 1feac: 89 e3 ldi r24, 0x39 ; 57 1feae: 9f e8 ldi r25, 0x8F ; 143 1feb0: 9e 83 std Y+6, r25 ; 0x06 1feb2: 8d 83 std Y+5, r24 ; 0x05 1feb4: 8c e2 ldi r24, 0x2C ; 44 1feb6: 9f e8 ldi r25, 0x8F ; 143 1feb8: 98 87 std Y+8, r25 ; 0x08 1feba: 8f 83 std Y+7, r24 ; 0x07 1febc: 83 e2 ldi r24, 0x23 ; 35 1febe: 9f e8 ldi r25, 0x8F ; 143 1fec0: 9a 87 std Y+10, r25 ; 0x0a 1fec2: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1fec4: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_putc_at(0, 0, '>'); 1fec8: 4e e3 ldi r20, 0x3E ; 62 1feca: 60 e0 ldi r22, 0x00 ; 0 1fecc: 80 e0 ldi r24, 0x00 ; 0 1fece: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_consume_click(); 1fed2: 0e 94 ad 71 call 0xe35a ; 0xe35a } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1fed6: 10 e0 ldi r17, 0x00 ; 0 1fed8: d1 2c mov r13, r1 1feda: 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]); 1fedc: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 1fee0: f6 01 movw r30, r12 1fee2: e8 0f add r30, r24 1fee4: f1 1d adc r31, r1 1fee6: 87 fd sbrc r24, 7 1fee8: fa 95 dec r31 1feea: ee 0f add r30, r30 1feec: ff 1f adc r31, r31 1feee: a1 e0 ldi r26, 0x01 ; 1 1fef0: b0 e0 ldi r27, 0x00 ; 0 1fef2: ac 0f add r26, r28 1fef4: bd 1f adc r27, r29 1fef6: ea 0f add r30, r26 1fef8: fb 1f adc r31, r27 1fefa: 40 81 ld r20, Z 1fefc: 51 81 ldd r21, Z+1 ; 0x01 1fefe: 6c 2d mov r22, r12 1ff00: 81 e0 ldi r24, 0x01 ; 1 1ff02: 0e 94 a9 6f call 0xdf52 ; 0xdf52 1ff06: bf ef ldi r27, 0xFF ; 255 1ff08: cb 1a sub r12, r27 1ff0a: 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++) { 1ff0c: e4 e0 ldi r30, 0x04 ; 4 1ff0e: ce 16 cp r12, r30 1ff10: d1 04 cpc r13, r1 1ff12: 21 f7 brne .-56 ; 0x1fedc lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1ff14: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 1ff18: 81 e0 ldi r24, 0x01 ; 1 1ff1a: 0e 94 e2 8b call 0x117c4 ; 0x117c4 if (lcd_encoder) { 1ff1e: 80 91 37 05 lds r24, 0x0537 ; 0x800537 1ff22: 90 91 38 05 lds r25, 0x0538 ; 0x800538 1ff26: 00 97 sbiw r24, 0x00 ; 0 1ff28: 89 f1 breq .+98 ; 0x1ff8c if (lcd_encoder < 0) { 1ff2a: 97 ff sbrs r25, 7 1ff2c: 15 c0 rjmp .+42 ; 0x1ff58 cursor_pos--; 1ff2e: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1ff30: 14 30 cpi r17, 0x04 ; 4 1ff32: 0c f4 brge .+2 ; 0x1ff36 1ff34: a9 c0 rjmp .+338 ; 0x20088 cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1ff36: 87 e0 ldi r24, 0x07 ; 7 1ff38: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1ff3c: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 1ff40: 18 16 cp r1, r24 1ff42: 2c f0 brlt .+10 ; 0x1ff4e first++; 1ff44: 8f 5f subi r24, 0xFF ; 255 1ff46: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 lcd_clear(); 1ff4a: 0e 94 c8 6f call 0xdf90 ; 0xdf90 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1ff4e: 13 e0 ldi r17, 0x03 ; 3 1ff50: 06 c0 rjmp .+12 ; 0x1ff5e #ifdef EXTRUDER_ALTFAN_DETECT SERIAL_ECHORPGM(_n("Hotend fan type: ")); if (extruder_altfan_detect()) SERIAL_ECHOLNRPGM(PSTR("ALTFAN")); else SERIAL_ECHOLNRPGM(PSTR("NOCTUA")); 1ff52: 89 e9 ldi r24, 0x99 ; 153 1ff54: 9f e8 ldi r25, 0x8F ; 143 1ff56: 3b cf rjmp .-394 ; 0x1fdce if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1ff58: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1ff5a: 14 30 cpi r17, 0x04 ; 4 1ff5c: 60 f7 brcc .-40 ; 0x1ff36 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1ff5e: 4b e1 ldi r20, 0x1B ; 27 1ff60: 5f e8 ldi r21, 0x8F ; 143 1ff62: 60 e0 ldi r22, 0x00 ; 0 1ff64: 80 e0 ldi r24, 0x00 ; 0 1ff66: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(0, cursor_pos); 1ff6a: 61 2f mov r22, r17 1ff6c: 80 e0 ldi r24, 0x00 ; 0 1ff6e: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_putc('>'); 1ff72: 8e e3 ldi r24, 0x3E ; 62 1ff74: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_encoder = 0; 1ff78: 10 92 38 05 sts 0x0538, r1 ; 0x800538 1ff7c: 10 92 37 05 sts 0x0537, r1 ; 0x800537 _delay(100); 1ff80: 64 e6 ldi r22, 0x64 ; 100 1ff82: 70 e0 ldi r23, 0x00 ; 0 1ff84: 80 e0 ldi r24, 0x00 ; 0 1ff86: 90 e0 ldi r25, 0x00 ; 0 1ff88: 0f 94 92 3d call 0x27b24 ; 0x27b24 } if (lcd_clicked()) { 1ff8c: 0e 94 b2 71 call 0xe364 ; 0xe364 1ff90: 88 23 and r24, r24 1ff92: 09 f4 brne .+2 ; 0x1ff96 1ff94: a1 cf rjmp .-190 ; 0x1fed8 return(cursor_pos + first); 1ff96: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 1ff9a: 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(); 1ff9c: 0e 94 c8 6f call 0xdf90 ; 0xdf90 Sound_MakeCustom(100,0,false); 1ffa0: 40 e0 ldi r20, 0x00 ; 0 1ffa2: 70 e0 ldi r23, 0x00 ; 0 1ffa4: 60 e0 ldi r22, 0x00 ; 0 1ffa6: 84 e6 ldi r24, 0x64 ; 100 1ffa8: 90 e0 ldi r25, 0x00 ; 0 1ffaa: 0f 94 a1 6a call 0x2d542 ; 0x2d542 switch (level) { 1ffae: 12 30 cpi r17, 0x02 ; 2 1ffb0: 09 f4 brne .+2 ; 0x1ffb4 1ffb2: a0 c0 rjmp .+320 ; 0x200f4 1ffb4: 08 f0 brcs .+2 ; 0x1ffb8 1ffb6: 79 c0 rjmp .+242 ; 0x200aa 1ffb8: 11 23 and r17, r17 1ffba: 09 f4 brne .+2 ; 0x1ffbe 1ffbc: 93 c0 rjmp .+294 ; 0x200e4 1ffbe: 11 30 cpi r17, 0x01 ; 1 1ffc0: 09 f4 brne .+2 ; 0x1ffc4 1ffc2: 93 c0 rjmp .+294 ; 0x200ea case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1ffc4: 82 e0 ldi r24, 0x02 ; 2 1ffc6: 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); 1ffca: 60 e0 ldi r22, 0x00 ; 0 1ffcc: 8f ef ldi r24, 0xFF ; 255 1ffce: 9f e0 ldi r25, 0x0F ; 15 1ffd0: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1ffd4: 61 e0 ldi r22, 0x01 ; 1 1ffd6: 8f e5 ldi r24, 0x5F ; 95 1ffd8: 9f e0 ldi r25, 0x0F ; 15 1ffda: 0e 94 94 77 call 0xef28 ; 0xef28 #ifdef TMC2130 uint8_t silentMode = eeprom_read_byte((uint8_t*)EEPROM_SILENT); 1ffde: 8f ef ldi r24, 0xFF ; 255 1ffe0: 9f e0 ldi r25, 0x0F ; 15 1ffe2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 1ffe6: 18 2f mov r17, r24 if (silentMode == 0xff) silentMode = 0; 1ffe8: 8f 3f cpi r24, 0xFF ; 255 1ffea: 09 f4 brne .+2 ; 0x1ffee 1ffec: 10 e0 ldi r17, 0x00 ; 0 tmc2130_mode = TMC2130_MODE_NORMAL; 1ffee: 10 92 6c 06 sts 0x066C, r1 ; 0x80066c tmc2130_sg_stop_on_crash = eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_DET, farm_mode ? false : true); 1fff2: 61 e0 ldi r22, 0x01 ; 1 1fff4: 89 e6 ldi r24, 0x69 ; 105 1fff6: 9f e0 ldi r25, 0x0F ; 15 1fff8: 0e 94 94 77 call 0xef28 ; 0xef28 1fffc: 91 e0 ldi r25, 0x01 ; 1 1fffe: 81 11 cpse r24, r1 20000: 01 c0 rjmp .+2 ; 0x20004 20002: 90 e0 ldi r25, 0x00 ; 0 20004: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c if (tmc2130_sg_stop_on_crash) { 20008: 88 23 and r24, r24 2000a: 09 f4 brne .+2 ; 0x2000e 2000c: 92 c0 rjmp .+292 ; 0x20132 puts_P(_N("CrashDetect ENABLED!")); 2000e: 80 e3 ldi r24, 0x30 ; 48 20010: 9d e6 ldi r25, 0x6D ; 109 } else { puts_P(_N("CrashDetect DISABLED")); 20012: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 } #ifdef TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[X_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_X_FAC); 20016: 87 ef ldi r24, 0xF7 ; 247 20018: 9e e0 ldi r25, 0x0E ; 14 2001a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2001e: c8 2e mov r12, r24 20020: 80 93 fc 04 sts 0x04FC, r24 ; 0x8004fc tmc2130_wave_fac[Y_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Y_FAC); 20024: 86 ef ldi r24, 0xF6 ; 246 20026: 9e e0 ldi r25, 0x0E ; 14 20028: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2002c: d8 2e mov r13, r24 2002e: 80 93 fd 04 sts 0x04FD, r24 ; 0x8004fd tmc2130_wave_fac[Z_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_Z_FAC); 20032: 85 ef ldi r24, 0xF5 ; 245 20034: 9e e0 ldi r25, 0x0E ; 14 20036: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2003a: e8 2e mov r14, r24 2003c: 80 93 fe 04 sts 0x04FE, r24 ; 0x8004fe #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_wave_fac[E_AXIS] = eeprom_read_byte((uint8_t*)EEPROM_TMC2130_WAVE_E_FAC); 20040: 84 ef ldi r24, 0xF4 ; 244 20042: 9e e0 ldi r25, 0x0E ; 14 20044: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 20048: 80 93 ff 04 sts 0x04FF, r24 ; 0x8004ff if (tmc2130_wave_fac[X_AXIS] == 0xff) tmc2130_wave_fac[X_AXIS] = 0; 2004c: 2f ef ldi r18, 0xFF ; 255 2004e: c2 12 cpse r12, r18 20050: 02 c0 rjmp .+4 ; 0x20056 20052: 10 92 fc 04 sts 0x04FC, r1 ; 0x8004fc if (tmc2130_wave_fac[Y_AXIS] == 0xff) tmc2130_wave_fac[Y_AXIS] = 0; 20056: 3f ef ldi r19, 0xFF ; 255 20058: d3 12 cpse r13, r19 2005a: 02 c0 rjmp .+4 ; 0x20060 2005c: 10 92 fd 04 sts 0x04FD, r1 ; 0x8004fd if (tmc2130_wave_fac[Z_AXIS] == 0xff) tmc2130_wave_fac[Z_AXIS] = 0; 20060: 9f ef ldi r25, 0xFF ; 255 20062: e9 12 cpse r14, r25 20064: 02 c0 rjmp .+4 ; 0x2006a 20066: 10 92 fe 04 sts 0x04FE, r1 ; 0x8004fe if (tmc2130_wave_fac[E_AXIS] == 0xff) tmc2130_wave_fac[E_AXIS] = 0; 2006a: 8f 3f cpi r24, 0xFF ; 255 2006c: 11 f4 brne .+4 ; 0x20072 2006e: 10 92 ff 04 sts 0x04FF, r1 ; 0x8004ff #endif //TMC2130_LINEARITY_CORRECTION #ifdef TMC2130_VARIABLE_RESOLUTION tmc2130_mres[X_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[X_AXIS]); 20072: 80 91 2a 07 lds r24, 0x072A ; 0x80072a 20076: 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--; 20078: 28 e0 ldi r18, 0x08 ; 8 2007a: 96 95 lsr r25 2007c: 87 95 ror r24 2007e: 00 97 sbiw r24, 0x00 ; 0 20080: 09 f4 brne .+2 ; 0x20084 20082: 5a c0 rjmp .+180 ; 0x20138 20084: 21 50 subi r18, 0x01 ; 1 20086: f9 cf rjmp .-14 ; 0x2007a first++; lcd_clear(); } } if (cursor_pos < 0) { 20088: 1f 3f cpi r17, 0xFF ; 255 2008a: 09 f0 breq .+2 ; 0x2008e 2008c: 68 cf rjmp .-304 ; 0x1ff5e cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 2008e: 87 e0 ldi r24, 0x07 ; 7 20090: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe if (first > 0) { 20094: 80 91 e0 04 lds r24, 0x04E0 ; 0x8004e0 20098: 18 16 cp r1, r24 2009a: 2c f4 brge .+10 ; 0x200a6 first--; 2009c: 81 50 subi r24, 0x01 ; 1 2009e: 80 93 e0 04 sts 0x04E0, r24 ; 0x8004e0 lcd_clear(); 200a2: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 200a6: 10 e0 ldi r17, 0x00 ; 0 200a8: 5a cf rjmp .-332 ; 0x1ff5e // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 200aa: 13 30 cpi r17, 0x03 ; 3 200ac: 29 f1 breq .+74 ; 0x200f8 200ae: 14 30 cpi r17, 0x04 ; 4 200b0: 09 f0 breq .+2 ; 0x200b4 200b2: 88 cf rjmp .-240 ; 0x1ffc4 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 200b4: 6b e5 ldi r22, 0x5B ; 91 200b6: 7f e8 ldi r23, 0x8F ; 143 200b8: 80 e0 ldi r24, 0x00 ; 0 200ba: 90 e1 ldi r25, 0x10 ; 16 200bc: 0f 94 72 cd call 0x39ae4 ; 0x39ae4 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 200c0: 10 e0 ldi r17, 0x00 ; 0 200c2: 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); 200c4: 6f ef ldi r22, 0xFF ; 255 200c6: c8 01 movw r24, r16 200c8: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 200cc: c8 01 movw r24, r16 200ce: 0f 94 43 cd call 0x39a86 ; 0x39a86 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 200d2: 0f 5f subi r16, 0xFF ; 255 200d4: 1f 4f sbci r17, 0xFF ; 255 200d6: 01 15 cp r16, r1 200d8: f0 e1 ldi r31, 0x10 ; 16 200da: 1f 07 cpc r17, r31 200dc: 99 f7 brne .-26 ; 0x200c4 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 200de: 0f 94 64 cd call 0x39ac8 ; 0x39ac8 200e2: e7 cb rjmp .-2098 ; 0x1f8b2 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 200e4: 0e 94 e1 71 call 0xe3c2 ; 0xe3c2 200e8: 6d cf rjmp .-294 ; 0x1ffc4 break; case 1: //Level 1: Reset statistics factory_reset_stats(); 200ea: 0e 94 c6 67 call 0xcf8c ; 0xcf8c lcd_menu_statistics(); 200ee: 0f 94 19 55 call 0x2aa32 ; 0x2aa32 200f2: 68 cf rjmp .-304 ; 0x1ffc4 break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 200f4: 0e 94 c6 67 call 0xcf8c ; 0xcf8c // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 200f8: 0e 94 e1 71 call 0xe3c2 ; 0xe3c2 // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 200fc: 84 e0 ldi r24, 0x04 ; 4 200fe: 0e 94 11 e7 call 0x1ce22 ; 0x1ce22 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); 20102: 62 e0 ldi r22, 0x02 ; 2 20104: 8f e5 ldi r24, 0x5F ; 95 20106: 9f e0 ldi r25, 0x0F ; 15 20108: 0f 94 d9 dd call 0x3bbb2 ; 0x3bbb2 eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 2010c: 81 e0 ldi r24, 0x01 ; 1 2010e: 0e 94 b4 75 call 0xeb68 ; 0xeb68 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 20112: 11 e0 ldi r17, 0x01 ; 1 20114: 10 93 89 17 sts 0x1789, r17 ; 0x801789 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20118: 61 e0 ldi r22, 0x01 ; 1 2011a: 87 e0 ldi r24, 0x07 ; 7 2011c: 9f e0 ldi r25, 0x0F ; 15 2011e: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 20122: 10 93 8a 17 sts 0x178A, r17 ; 0x80178a 20126: 61 e0 ldi r22, 0x01 ; 1 20128: 85 ed ldi r24, 0xD5 ; 213 2012a: 9e e0 ldi r25, 0x0E ; 14 2012c: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 20130: 49 cf rjmp .-366 ; 0x1ffc4 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")); 20132: 8b e1 ldi r24, 0x1B ; 27 20134: 9d e6 ldi r25, 0x6D ; 109 20136: 6d cf rjmp .-294 ; 0x20012 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]); 20138: 20 93 f8 04 sts 0x04F8, r18 ; 0x8004f8 tmc2130_mres[Y_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Y_AXIS]); 2013c: 80 91 2b 07 lds r24, 0x072B ; 0x80072b 20140: 90 e0 ldi r25, 0x00 ; 0 20142: 28 e0 ldi r18, 0x08 ; 8 20144: 96 95 lsr r25 20146: 87 95 ror r24 20148: 00 97 sbiw r24, 0x00 ; 0 2014a: 11 f0 breq .+4 ; 0x20150 2014c: 21 50 subi r18, 0x01 ; 1 2014e: fa cf rjmp .-12 ; 0x20144 20150: 20 93 f9 04 sts 0x04F9, r18 ; 0x8004f9 tmc2130_mres[Z_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[Z_AXIS]); 20154: 80 91 2c 07 lds r24, 0x072C ; 0x80072c 20158: 90 e0 ldi r25, 0x00 ; 0 2015a: 28 e0 ldi r18, 0x08 ; 8 2015c: 96 95 lsr r25 2015e: 87 95 ror r24 20160: 00 97 sbiw r24, 0x00 ; 0 20162: 11 f0 breq .+4 ; 0x20168 20164: 21 50 subi r18, 0x01 ; 1 20166: fa cf rjmp .-12 ; 0x2015c 20168: 20 93 fa 04 sts 0x04FA, r18 ; 0x8004fa tmc2130_mres[E_AXIS] = tmc2130_usteps2mres(cs.axis_ustep_resolution[E_AXIS]); 2016c: 80 91 2d 07 lds r24, 0x072D ; 0x80072d 20170: 90 e0 ldi r25, 0x00 ; 0 20172: 28 e0 ldi r18, 0x08 ; 8 20174: 96 95 lsr r25 20176: 87 95 ror r24 20178: 00 97 sbiw r24, 0x00 ; 0 2017a: 11 f0 breq .+4 ; 0x20180 2017c: 21 50 subi r18, 0x01 ; 1 2017e: fa cf rjmp .-12 ; 0x20174 20180: 20 93 fb 04 sts 0x04FB, r18 ; 0x8004fb return ( eeprom_read_byte((uint8_t *)EEPROM_ECOOL_ENABLE) == EEPROM_ECOOL_MAGIC_NUMBER ) && ( eeprom_read_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY) == 1 ); } bool FarmOrUserECool(){ return farm_mode || UserECoolEnabled(); 20184: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 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) { } 20188: 88 0f add r24, r24 #endif // LIN_ADVANCE void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); 2018a: 82 70 andi r24, 0x02 ; 2 2018c: 0f 94 21 3c call 0x27842 ; 0x27842 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 20190: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 20194: 81 60 ori r24, 0x01 ; 1 20196: 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); 2019a: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2019e: 82 60 ori r24, 0x02 ; 2 201a0: 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); 201a4: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 201a8: 84 60 ori r24, 0x04 ; 4 201aa: 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); 201ae: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 201b2: 80 64 ori r24, 0x40 ; 64 201b4: 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); 201b8: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 201ba: 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); 201bc: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 201be: 16 9a sbi 0x02, 6 ; 2 #endif #if defined(Z_ENABLE_PIN) && Z_ENABLE_PIN > -1 SET_OUTPUT(Z_ENABLE_PIN); 201c0: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 201c2: 15 9a sbi 0x02, 5 ; 2 #endif #if defined(E0_ENABLE_PIN) && (E0_ENABLE_PIN > -1) SET_OUTPUT(E0_ENABLE_PIN); 201c4: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 201c6: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 201c8: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 201ca: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 201cc: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 201ce: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 201d0: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 201d2: 2c 9a sbi 0x05, 4 ; 5 #endif #endif #if defined(X_MAX_PIN) && X_MAX_PIN > -1 SET_INPUT(X_MAX_PIN); 201d4: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 201d8: 8b 7f andi r24, 0xFB ; 251 201da: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_XMAX WRITE(X_MAX_PIN,HIGH); 201de: 9f b7 in r25, 0x3f ; 63 201e0: f8 94 cli 201e2: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201e6: 84 60 ori r24, 0x04 ; 4 201e8: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 201ec: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Y_MAX_PIN) && Y_MAX_PIN > -1 SET_INPUT(Y_MAX_PIN); 201ee: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 201f2: 8f 77 andi r24, 0x7F ; 127 201f4: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> #ifdef ENDSTOPPULLUP_YMAX WRITE(Y_MAX_PIN,HIGH); 201f8: 9f b7 in r25, 0x3f ; 63 201fa: f8 94 cli 201fc: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20200: 80 68 ori r24, 0x80 ; 128 20202: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 20206: 9f bf out 0x3f, r25 ; 63 #endif #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SET_INPUT(Z_MAX_PIN); 20208: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 2020a: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 2020c: 6e 98 cbi 0x0d, 6 ; 13 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 2020e: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 20210: 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(); 20212: 17 9a sbi 0x02, 7 ; 2 20214: 10 92 40 07 sts 0x0740, r1 ; 0x800740 SET_OUTPUT(X2_STEP_PIN); WRITE(X2_STEP_PIN,INVERT_X_STEP_PIN); disable_x(); #endif #if defined(Y_STEP_PIN) && (Y_STEP_PIN > -1) SET_OUTPUT(Y_STEP_PIN); 20218: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 2021a: 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(); 2021c: 16 9a sbi 0x02, 6 ; 2 2021e: 10 92 41 07 sts 0x0741, r1 ; 0x800741 #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 20222: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 20224: 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); 20226: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 20228: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 2022a: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 20230: 8f 7e andi r24, 0xEF ; 239 20232: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 2023a: 88 60 ori r24, 0x08 ; 8 2023c: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 20244: 8d 7f andi r24, 0xFD ; 253 20246: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 2024e: 8e 7f andi r24, 0xFE ; 254 20250: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 20258: 8f 73 andi r24, 0x3F ; 63 2025a: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 20262: 8f 7c andi r24, 0xCF ; 207 20264: 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< 2026c: 88 7f andi r24, 0xF8 ; 248 2026e: 82 60 ori r24, 0x02 ; 2 20270: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 20274: 80 e0 ldi r24, 0x00 ; 0 20276: 90 e4 ldi r25, 0x40 ; 64 20278: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2027c: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 20280: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 20284: 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; 20288: 10 92 e9 04 sts 0x04E9, r1 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2028c: 10 92 e8 04 sts 0x04E8, r1 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> nextAdvanceISR = ADV_NEVER; 20290: 8f ef ldi r24, 0xFF ; 255 20292: 9f ef ldi r25, 0xFF ; 255 20294: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 20298: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> main_Rate = ADV_NEVER; 2029c: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.494+0x1> 202a0: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.494> current_adv_steps = 0; 202a4: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 202a8: 10 92 e2 04 sts 0x04E2, r1 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 202ac: 81 e0 ldi r24, 0x01 ; 1 202ae: 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(); 202b2: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 202b6: 82 60 ori r24, 0x02 ; 2 202b8: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 202bc: 78 94 sei #endif //TMC2130 st_init(); // Initialize stepper, this enables interrupts! #ifdef TMC2130 tmc2130_mode = silentMode?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 202be: 81 e0 ldi r24, 0x01 ; 1 202c0: 11 11 cpse r17, r1 202c2: 01 c0 rjmp .+2 ; 0x202c6 202c4: 80 e0 ldi r24, 0x00 ; 0 202c6: 80 93 6c 06 sts 0x066C, r24 ; 0x80066c update_mode_profile(); 202ca: 0f 94 c7 aa call 0x3558e ; 0x3558e 202ce: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 202d2: 88 0f add r24, r24 tmc2130_init(TMCInitParams(false, FarmOrUserECool() )); 202d4: 82 70 andi r24, 0x02 ; 2 202d6: 0f 94 21 3c call 0x27842 ; 0x27842 setup_photpin(); // Reset the machine correction matrix. // It does not make sense to load the correction matrix until the machine is homed. world2machine_reset(); 202da: 0f 94 77 cb call 0x396ee ; 0x396ee // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 202de: 83 e4 ldi r24, 0x43 ; 67 202e0: 97 e0 ldi r25, 0x07 ; 7 202e2: 0e 94 7e 6c call 0xd8fc ; 0xd8fc plan_set_position_curposXYZE(); 202e6: 0f 94 53 b9 call 0x372a6 ; 0x372a6 // Show the xflash error message now that serial, lcd and encoder are available if (!xflash_success) 202ea: b1 10 cpse r11, r1 202ec: 08 c0 rjmp .+16 ; 0x202fe } static void xflash_err_msg() { puts_P(_n("XFLASH not responding.")); 202ee: 88 e7 ldi r24, 0x78 ; 120 202f0: 9c e6 ldi r25, 0x6C ; 108 202f2: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 lcd_show_fullscreen_message_and_wait_P(_n("External SPI flash\nXFLASH is not res-\nponding. Language\nswitch unavailable.")); 202f6: 8c e2 ldi r24, 0x2C ; 44 202f8: 9c e6 ldi r25, 0x6C ; 108 202fa: 0f 94 0c 36 call 0x26c18 ; 0x26c18 } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 202fe: 84 e9 ldi r24, 0x94 ; 148 20300: 9c e0 ldi r25, 0x0C ; 12 20302: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 20306: 82 34 cpi r24, 0x42 ; 66 20308: 59 f4 brne .+22 ; 0x20320 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); 2030a: 6f ef ldi r22, 0xFF ; 255 2030c: 84 e9 ldi r24, 0x94 ; 148 2030e: 9c e0 ldi r25, 0x0C ; 12 20310: 0f 94 d9 dd call 0x3bbb2 ; 0x3bbb2 // 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); 20314: 85 e9 ldi r24, 0x95 ; 149 20316: 9c e0 ldi r25, 0x0C ; 12 20318: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e lcd_show_fullscreen_message_and_wait_P(kill_msg); 2031c: 0f 94 0c 36 call 0x26c18 ; 0x26c18 // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 20320: 0f 94 74 87 call 0x30ee8 ; 0x30ee8 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 20324: 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); 20326: 8b eb ldi r24, 0xBB ; 187 20328: 9f e0 ldi r25, 0x0F ; 15 2032a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2032e: 91 e0 ldi r25, 0x01 ; 1 20330: 81 30 cpi r24, 0x01 ; 1 20332: 09 f0 breq .+2 ; 0x20336 20334: 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; } 20336: 90 93 df 16 sts 0x16DF, r25 ; 0x8016df // Force SD card update. Otherwise the SD card update is done from loop() on card.checkautostart(false), // but this times out if a blocking dialog is shown in setup(). card.mount(); 2033a: 81 e0 ldi r24, 0x01 ; 1 2033c: 0f 94 78 81 call 0x302f0 ; 0x302f0 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 20340: 60 e0 ldi r22, 0x00 ; 0 20342: 84 e6 ldi r24, 0x64 ; 100 20344: 9f e0 ldi r25, 0x0F ; 15 20346: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 2034a: 60 e0 ldi r22, 0x00 ; 0 2034c: 86 e6 ldi r24, 0x66 ; 102 2034e: 9f e0 ldi r25, 0x0F ; 15 20350: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 20354: 60 e0 ldi r22, 0x00 ; 0 20356: 88 e6 ldi r24, 0x68 ; 104 20358: 9f e0 ldi r25, 0x0F ; 15 2035a: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 2035e: 60 e0 ldi r22, 0x00 ; 0 20360: 85 e6 ldi r24, 0x65 ; 101 20362: 9f e0 ldi r25, 0x0F ; 15 20364: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 20368: 70 e0 ldi r23, 0x00 ; 0 2036a: 60 e0 ldi r22, 0x00 ; 0 2036c: 8f ef ldi r24, 0xFF ; 255 2036e: 9e e0 ldi r25, 0x0E ; 14 20370: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 20374: 70 e0 ldi r23, 0x00 ; 0 20376: 60 e0 ldi r22, 0x00 ; 0 20378: 85 e0 ldi r24, 0x05 ; 5 2037a: 9f e0 ldi r25, 0x0F ; 15 2037c: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 20380: 70 e0 ldi r23, 0x00 ; 0 20382: 60 e0 ldi r22, 0x00 ; 0 20384: 83 e0 ldi r24, 0x03 ; 3 20386: 9f e0 ldi r25, 0x0F ; 15 20388: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 2038c: 70 e0 ldi r23, 0x00 ; 0 2038e: 60 e0 ldi r22, 0x00 ; 0 20390: 81 e0 ldi r24, 0x01 ; 1 20392: 9f e0 ldi r25, 0x0F ; 15 20394: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 20398: 70 e0 ldi r23, 0x00 ; 0 2039a: 60 e0 ldi r22, 0x00 ; 0 2039c: 83 ed ldi r24, 0xD3 ; 211 2039e: 9e e0 ldi r25, 0x0E ; 14 203a0: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 203a4: 70 e0 ldi r23, 0x00 ; 0 203a6: 60 e0 ldi r22, 0x00 ; 0 203a8: 80 ed ldi r24, 0xD0 ; 208 203aa: 9e e0 ldi r25, 0x0E ; 14 203ac: 0e 94 7c 77 call 0xeef8 ; 0xeef8 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 203b0: 60 e0 ldi r22, 0x00 ; 0 203b2: 82 ed ldi r24, 0xD2 ; 210 203b4: 9e e0 ldi r25, 0x0E ; 14 203b6: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 203ba: 60 e0 ldi r22, 0x00 ; 0 203bc: 8f ec ldi r24, 0xCF ; 207 203be: 9e e0 ldi r25, 0x0E ; 14 203c0: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 203c4: 88 ea ldi r24, 0xA8 ; 168 203c6: 9c e0 ldi r25, 0x0C ; 12 203c8: 0f 94 81 7c call 0x2f902 ; 0x2f902 if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 203cc: 81 ea ldi r24, 0xA1 ; 161 203ce: 9d e0 ldi r25, 0x0D ; 13 203d0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 203d4: 8f 3f cpi r24, 0xFF ; 255 203d6: 71 f4 brne .+28 ; 0x203f4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 203d8: 60 e0 ldi r22, 0x00 ; 0 203da: 81 ea ldi r24, 0xA1 ; 161 203dc: 9d e0 ldi r25, 0x0D ; 13 203de: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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); 203e2: 88 ef ldi r24, 0xF8 ; 248 203e4: 9f e0 ldi r25, 0x0F ; 15 203e6: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 203ea: bc 01 movw r22, r24 203ec: 80 e5 ldi r24, 0x50 ; 80 203ee: 9d e0 ldi r25, 0x0D ; 13 203f0: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 203f4: 39 e4 ldi r19, 0x49 ; 73 203f6: c3 2e mov r12, r19 203f8: 3d e0 ldi r19, 0x0D ; 13 203fa: d3 2e mov r13, r19 203fc: 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); 203fe: be 01 movw r22, r28 20400: 6f 5f subi r22, 0xFF ; 255 20402: 7f 4f sbci r23, 0xFF ; 255 20404: 81 2f mov r24, r17 20406: 0e 94 fc 77 call 0xeff8 ; 0xeff8 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 2040a: ae 01 movw r20, r28 2040c: 4f 5f subi r20, 0xFF ; 255 2040e: 5f 4f sbci r21, 0xFF ; 255 20410: 67 e0 ldi r22, 0x07 ; 7 20412: 70 e0 ldi r23, 0x00 ; 0 20414: c6 01 movw r24, r12 20416: 0e 94 5d 77 call 0xeeba ; 0xeeba 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++) { 2041a: 1f 5f subi r17, 0xFF ; 255 2041c: ab e0 ldi r26, 0x0B ; 11 2041e: ca 0e add r12, r26 20420: d1 1c adc r13, r1 20422: 18 30 cpi r17, 0x08 ; 8 20424: 61 f7 brne .-40 ; 0x203fe 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)))) 20426: 81 ea ldi r24, 0xA1 ; 161 20428: 9d e0 ldi r25, 0x0D ; 13 2042a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2042e: 0e 94 cc 77 call 0xef98 ; 0xef98 20432: 81 11 cpse r24, r1 20434: 02 c0 rjmp .+4 ; 0x2043a { eeprom_switch_to_next_sheet(); 20436: 0e 94 ee 77 call 0xefdc ; 0xefdc } check_babystep(); 2043a: 0e 94 0a 7b call 0xf614 ; 0xf614 // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 2043e: 80 e8 ldi r24, 0x80 ; 128 20440: 9c e0 ldi r25, 0x0C ; 12 20442: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 20446: 8f 3f cpi r24, 0xFF ; 255 20448: 41 f4 brne .+16 ; 0x2045a #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); 2044a: 41 e1 ldi r20, 0x11 ; 17 2044c: 50 e0 ldi r21, 0x00 ; 0 2044e: 60 e8 ldi r22, 0x80 ; 128 20450: 7c e0 ldi r23, 0x0C ; 12 20452: 81 ee ldi r24, 0xE1 ; 225 20454: 92 e0 ldi r25, 0x02 ; 2 20456: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a #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); 2045a: 85 e0 ldi r24, 0x05 ; 5 2045c: 9d e0 ldi r25, 0x0D ; 13 2045e: 0f 94 81 7c call 0x2f902 ; 0x2f902 eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 20462: 8d ee ldi r24, 0xED ; 237 20464: 9f e0 ldi r25, 0x0F ; 15 20466: 0f 94 81 7c call 0x2f902 ; 0x2f902 eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 2046a: 81 ef ldi r24, 0xF1 ; 241 2046c: 9f e0 ldi r25, 0x0F ; 15 2046e: 0f 94 81 7c call 0x2f902 ; 0x2f902 eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 20472: 60 e0 ldi r22, 0x00 ; 0 20474: 8e ec ldi r24, 0xCE ; 206 20476: 9e e0 ldi r25, 0x0E ; 14 20478: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 2047c: 61 e0 ldi r22, 0x01 ; 1 2047e: 87 ea ldi r24, 0xA7 ; 167 20480: 9c e0 ldi r25, 0x0C ; 12 20482: 0e 94 94 77 call 0xef28 ; 0xef28 putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 20486: 8e ef ldi r24, 0xFE ; 254 20488: 9f e0 ldi r25, 0x0F ; 15 2048a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2048e: 0e 94 e9 72 call 0xe5d2 ; 0xe5d2 20492: 81 11 cpse r24, r1 20494: 02 c0 rjmp .+4 ; 0x2049a lcd_language(); 20496: 0f 94 64 27 call 0x24ec8 ; 0x24ec8 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 2049a: 60 e0 ldi r22, 0x00 ; 0 2049c: 8f ea ldi r24, 0xAF ; 175 2049e: 9f e0 ldi r25, 0x0F ; 15 204a0: 0e 94 94 77 call 0xef28 ; 0xef28 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 204a4: 86 ea ldi r24, 0xA6 ; 166 204a6: 9f e0 ldi r25, 0x0F ; 15 204a8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 204ac: 8f 3f cpi r24, 0xFF ; 255 204ae: d9 f4 brne .+54 ; 0x204e6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 204b0: 61 e0 ldi r22, 0x01 ; 1 204b2: 86 ea ldi r24, 0xA6 ; 166 204b4: 9f e0 ldi r25, 0x0F ; 15 204b6: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 204ba: 20 eb ldi r18, 0xB0 ; 176 204bc: c2 2e mov r12, r18 204be: 2f e0 ldi r18, 0x0F ; 15 204c0: 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); 204c2: 70 e0 ldi r23, 0x00 ; 0 204c4: 60 e0 ldi r22, 0x00 ; 0 204c6: c6 01 movw r24, r12 204c8: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 204cc: b2 e0 ldi r27, 0x02 ; 2 204ce: cb 0e add r12, r27 204d0: 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++) { 204d2: ea eb ldi r30, 0xBA ; 186 204d4: ce 16 cp r12, r30 204d6: ef e0 ldi r30, 0x0F ; 15 204d8: de 06 cpc r13, r30 204da: 99 f7 brne .-26 ; 0x204c2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 204dc: 60 e0 ldi r22, 0x00 ; 0 204de: 8f ea ldi r24, 0xAF ; 175 204e0: 9f e0 ldi r25, 0x0F ; 15 204e2: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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); 204e6: 60 e0 ldi r22, 0x00 ; 0 204e8: 85 ea ldi r24, 0xA5 ; 165 204ea: 9f e0 ldi r25, 0x0F ; 15 204ec: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 204f0: 60 e0 ldi r22, 0x00 ; 0 204f2: 8f e7 ldi r24, 0x7F ; 127 204f4: 9c e0 ldi r25, 0x0C ; 12 204f6: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 204fa: 60 e0 ldi r22, 0x00 ; 0 204fc: 89 e0 ldi r24, 0x09 ; 9 204fe: 9f e0 ldi r25, 0x0F ; 15 20500: 0e 94 94 77 call 0xef28 ; 0xef28 } 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); 20504: 61 e0 ldi r22, 0x01 ; 1 20506: 8c ea ldi r24, 0xAC ; 172 20508: 9d e0 ldi r25, 0x0D ; 13 2050a: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 2050e: 63 e0 ldi r22, 0x03 ; 3 20510: 8b ea ldi r24, 0xAB ; 171 20512: 9d e0 ldi r25, 0x0D ; 13 20514: 0e 94 94 77 call 0xef28 ; 0xef28 eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 20518: 63 e0 ldi r22, 0x03 ; 3 2051a: 8a ea ldi r24, 0xAA ; 170 2051c: 9d e0 ldi r25, 0x0D ; 13 2051e: 0e 94 94 77 call 0xef28 ; 0xef28 //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 20522: 61 e0 ldi r22, 0x01 ; 1 20524: 89 ea ldi r24, 0xA9 ; 169 20526: 9d e0 ldi r25, 0x0D ; 13 20528: 0e 94 94 77 call 0xef28 ; 0xef28 #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 2052c: 6f 98 cbi 0x0d, 7 ; 13 PORTE &= ~(1 << 7); //no internal pull-up 2052e: 77 98 cbi 0x0e, 7 ; 14 //start with sensing rising edge EICRB &= ~(1 << 6); 20530: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20534: 8f 7b andi r24, 0xBF ; 191 20536: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB |= (1 << 7); 2053a: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 2053e: 80 68 ori r24, 0x80 ; 128 20540: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> //enable INT7 interrupt EIMSK |= (1 << 7); 20544: 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); 20546: 84 e0 ldi r24, 0x04 ; 4 20548: 80 93 96 02 sts 0x0296, r24 ; 0x800296 void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 2054c: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2054e: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 20550: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 20552: 50 9a sbi 0x0a, 0 ; 10 20554: 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); 20556: 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); 20558: f5 e0 ldi r31, 0x05 ; 5 2055a: fa 95 dec r31 2055c: f1 f7 brne .-4 ; 0x2055a 2055e: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 20560: 58 98 cbi 0x0b, 0 ; 11 20562: 25 e0 ldi r18, 0x05 ; 5 20564: 2a 95 dec r18 20566: f1 f7 brne .-4 ; 0x20564 20568: 00 00 nop 2056a: 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++) { 2056c: a1 f7 brne .-24 ; 0x20556 WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2056e: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 20570: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 20572: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 20576: 8c 7f andi r24, 0xFC ; 252 20578: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 2057c: 8c e0 ldi r24, 0x0C ; 12 2057e: 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); 20582: 84 ea ldi r24, 0xA4 ; 164 20584: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 20588: 88 e0 ldi r24, 0x08 ; 8 2058a: 0f 94 f8 3f call 0x27ff0 ; 0x27ff0 2058e: 81 11 cpse r24, r1 20590: 14 c0 rjmp .+40 ; 0x205ba return 1; // send address TWDR = TW_WRITE | (address << 1); 20592: 8a ee ldi r24, 0xEA ; 234 20594: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 20598: 84 e8 ldi r24, 0x84 ; 132 2059a: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2059e: 88 e1 ldi r24, 0x18 ; 24 205a0: 0f 94 f8 3f call 0x27ff0 ; 0x27ff0 205a4: 81 11 cpse r24, r1 205a6: 09 c0 rjmp .+18 ; 0x205ba } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 205a8: 84 e9 ldi r24, 0x94 ; 148 205aa: 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)); 205ae: 84 e4 ldi r24, 0x44 ; 68 205b0: 91 e4 ldi r25, 0x41 ; 65 205b2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 205b6: 0f 94 0c 36 call 0x26c18 ; 0x26c18 #if defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) check_if_fw_is_on_right_printer(); #endif //defined(FILAMENT_SENSOR) && defined(FSENSOR_PROBING) } switch (hw_changed) { 205ba: 02 30 cpi r16, 0x02 ; 2 205bc: 81 f0 breq .+32 ; 0x205de 205be: 03 30 cpi r16, 0x03 ; 3 205c0: 09 f4 brne .+2 ; 0x205c4 205c2: 37 c1 rjmp .+622 ; 0x20832 205c4: 01 30 cpi r16, 0x01 ; 1 205c6: b9 f4 brne .+46 ; 0x205f6 //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)); 205c8: 86 e7 ldi r24, 0x76 ; 118 205ca: 93 e4 ldi r25, 0x43 ; 67 205cc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 205d0: 0f 94 0c 36 call 0x26c18 ; 0x26c18 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); 205d4: 66 e3 ldi r22, 0x36 ; 54 205d6: 71 e0 ldi r23, 0x01 ; 1 205d8: 8c ee ldi r24, 0xEC ; 236 205da: 9e e0 ldi r25, 0x0E ; 14 205dc: 0a c0 rjmp .+20 ; 0x205f2 eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; case(0b10): lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHANGED_PRINTER)); 205de: 85 e5 ldi r24, 0x55 ; 85 205e0: 93 e4 ldi r25, 0x43 ; 67 205e2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 205e6: 0f 94 0c 36 call 0x26c18 ; 0x26c18 205ea: 6e e2 ldi r22, 0x2E ; 46 205ec: 71 e0 ldi r23, 0x01 ; 1 205ee: 8e ee ldi r24, 0xEE ; 238 205f0: 9e e0 ldi r25, 0x0E ; 14 205f2: 0f 94 ef dd call 0x3bbde ; 0x3bbde eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 205f6: f1 10 cpse r15, r1 205f8: 08 c0 rjmp .+16 ; 0x2060a 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 205fa: 8e ed ldi r24, 0xDE ; 222 205fc: 92 e4 ldi r25, 0x42 ; 66 205fe: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20602: 0f 94 0c 36 call 0x26c18 ; 0x26c18 Config_StoreSettings(); 20606: 0e 94 cf 83 call 0x1079e ; 0x1079e } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 2060a: 80 e8 ldi r24, 0x80 ; 128 2060c: 0e 94 4b f9 call 0x1f296 ; 0x1f296 20610: 88 23 and r24, r24 20612: c9 f0 breq .+50 ; 0x20646 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 20614: 87 ef ldi r24, 0xF7 ; 247 20616: 9f e0 ldi r25, 0x0F ; 15 20618: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 2061c: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 2061e: 81 30 cpi r24, 0x01 ; 1 20620: 71 f4 brne .+28 ; 0x2063e // 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)) { 20622: 81 e9 ldi r24, 0x91 ; 145 20624: 9f e8 ldi r25, 0x8F ; 143 20626: 0e 94 ae d2 call 0x1a55c ; 0x1a55c 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); 2062a: 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)) { 2062c: 88 23 and r24, r24 2062e: 39 f0 breq .+14 ; 0x2063e // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 20630: 8c e9 ldi r24, 0x9C ; 156 20632: 92 e4 ldi r25, 0x42 ; 66 20634: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20638: 0f 94 0c 36 call 0x26c18 ; 0x26c18 calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 2063c: 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); 2063e: 86 ea ldi r24, 0xA6 ; 166 20640: 9c e0 ldi r25, 0x0C ; 12 20642: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 20646: 89 e8 ldi r24, 0x89 ; 137 20648: 9f e8 ldi r25, 0x8F ; 143 2064a: 0e 94 ae d2 call 0x1a55c ; 0x1a55c 2064e: f8 2e mov r15, r24 20650: 88 23 and r24, r24 20652: 31 f0 breq .+12 ; 0x20660 if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 20654: 8f e1 ldi r24, 0x1F ; 31 20656: 0e 94 4b f9 call 0x1f296 ; 0x1f296 2065a: 91 e0 ldi r25, 0x01 ; 1 2065c: f8 2e mov r15, r24 2065e: 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; 20660: 10 e0 ldi r17, 0x00 ; 0 20662: 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)); 20664: f8 01 movw r30, r16 20666: e6 58 subi r30, 0x86 ; 134 20668: f0 47 sbci r31, 0x70 ; 112 2066a: 64 91 lpm r22, Z 2066c: c8 01 movw r24, r16 2066e: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 20672: 0f 5f subi r16, 0xFF ; 255 20674: 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){ 20676: 0a 30 cpi r16, 0x0A ; 10 20678: 11 05 cpc r17, r1 2067a: a1 f7 brne .-24 ; 0x20664 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])); 2067c: e9 e8 ldi r30, 0x89 ; 137 2067e: ff e8 ldi r31, 0x8F ; 143 20680: 65 91 lpm r22, Z+ 20682: 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); 20684: 8a e0 ldi r24, 0x0A ; 10 20686: 90 e0 ldi r25, 0x00 ; 0 20688: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 2068c: eb e8 ldi r30, 0x8B ; 139 2068e: ff e8 ldi r31, 0x8F ; 143 20690: 65 91 lpm r22, Z+ 20692: 74 91 lpm r23, Z 20694: 8c e0 ldi r24, 0x0C ; 12 20696: 90 e0 ldi r25, 0x00 ; 0 20698: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 2069c: ed e8 ldi r30, 0x8D ; 141 2069e: ff e8 ldi r31, 0x8F ; 143 206a0: 65 91 lpm r22, Z+ 206a2: 74 91 lpm r23, Z 206a4: 8e e0 ldi r24, 0x0E ; 14 206a6: 90 e0 ldi r25, 0x00 ; 0 206a8: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 // 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])); 206ac: ef e8 ldi r30, 0x8F ; 143 206ae: ff e8 ldi r31, 0x8F ; 143 206b0: 65 91 lpm r22, Z+ 206b2: 74 91 lpm r23, Z 206b4: 80 e1 ldi r24, 0x10 ; 16 206b6: 90 e0 ldi r25, 0x00 ; 0 206b8: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 206bc: 8f e5 ldi r24, 0x5F ; 95 206be: 9f e0 ldi r25, 0x0F ; 15 206c0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 206c4: 88 23 and r24, r24 206c6: 09 f4 brne .+2 ; 0x206ca 206c8: c1 c0 rjmp .+386 ; 0x2084c // first time run of wizard or service prep lcd_wizard(WizState::Run); 206ca: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 206cc: 0f 94 0a 66 call 0x2cc14 ; 0x2cc14 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 206d0: 83 e0 ldi r24, 0x03 ; 3 206d2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 206d6: 81 e0 ldi r24, 0x01 ; 1 206d8: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); 206dc: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_update(2); 206e0: 82 e0 ldi r24, 0x02 ; 2 206e2: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 #ifdef TMC2130 tmc2130_home_origin[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, 0); 206e6: 60 e0 ldi r22, 0x00 ; 0 206e8: 8e ef ldi r24, 0xFE ; 254 206ea: 9e e0 ldi r25, 0x0E ; 14 206ec: 0e 94 94 77 call 0xef28 ; 0xef28 206f0: 80 93 f6 04 sts 0x04F6, r24 ; 0x8004f6 tmc2130_home_bsteps[X_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_X_BSTEPS, 48); 206f4: 60 e3 ldi r22, 0x30 ; 48 206f6: 8d ef ldi r24, 0xFD ; 253 206f8: 9e e0 ldi r25, 0x0E ; 14 206fa: 0e 94 94 77 call 0xef28 ; 0xef28 206fe: 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); 20702: 60 e3 ldi r22, 0x30 ; 48 20704: 8c ef ldi r24, 0xFC ; 252 20706: 9e e0 ldi r25, 0x0E ; 14 20708: 0e 94 94 77 call 0xef28 ; 0xef28 2070c: 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); 20710: 60 e0 ldi r22, 0x00 ; 0 20712: 8b ef ldi r24, 0xFB ; 251 20714: 9e e0 ldi r25, 0x0E ; 14 20716: 0e 94 94 77 call 0xef28 ; 0xef28 2071a: 80 93 f7 04 sts 0x04F7, r24 ; 0x8004f7 tmc2130_home_bsteps[Y_AXIS] = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_Y_BSTEPS, 48); 2071e: 60 e3 ldi r22, 0x30 ; 48 20720: 8a ef ldi r24, 0xFA ; 250 20722: 9e e0 ldi r25, 0x0E ; 14 20724: 0e 94 94 77 call 0xef28 ; 0xef28 20728: 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); 2072c: 60 e3 ldi r22, 0x30 ; 48 2072e: 89 ef ldi r24, 0xF9 ; 249 20730: 9e e0 ldi r25, 0x0E ; 14 20732: 0e 94 94 77 call 0xef28 ; 0xef28 20736: 80 93 59 02 sts 0x0259, r24 ; 0x800259 tmc2130_home_enabled = eeprom_init_default_byte((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 0); 2073a: 60 e0 ldi r22, 0x00 ; 0 2073c: 88 ef ldi r24, 0xF8 ; 248 2073e: 9e e0 ldi r25, 0x0E ; 14 20740: 0e 94 94 77 call 0xef28 ; 0xef28 20744: 80 93 f5 04 sts 0x04F5, r24 ; 0x8004f5 static void fw_crash_init() { #ifdef XFLASH_DUMP dump_crash_reason crash_reason; if(xfdump_check_state(&crash_reason)) 20748: ce 01 movw r24, r28 2074a: 01 96 adiw r24, 0x01 ; 1 2074c: 0e 94 87 e3 call 0x1c70e ; 0x1c70e 20750: 88 23 and r24, r24 20752: 89 f0 breq .+34 ; 0x20776 { // always signal to the host that a dump is available for retrieval puts_P(_N("//action:dump_available")); 20754: 83 e0 ldi r24, 0x03 ; 3 20756: 9d e6 ldi r25, 0x6D ; 109 20758: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && 2075c: 89 81 ldd r24, Y+1 ; 0x01 2075e: 88 23 and r24, r24 20760: 51 f0 breq .+20 ; 0x20776 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) 20762: 83 e0 ldi r24, 0x03 ; 3 20764: 9d e0 ldi r25, 0x0D ; 13 20766: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 { // 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 && 2076a: 8f 3f cpi r24, 0xFF ; 255 2076c: 21 f0 breq .+8 ; 0x20776 eeprom_read_byte((uint8_t*)EEPROM_FW_CRASH_FLAG) != 0xFF) { lcd_show_fullscreen_message_and_wait_P( 2076e: 8f e8 ldi r24, 0x8F ; 143 20770: 9c e6 ldi r25, 0x6C ; 108 20772: 0f 94 0c 36 call 0x26c18 ; 0x26c18 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 20776: 6f ef ldi r22, 0xFF ; 255 20778: 83 e0 ldi r24, 0x03 ; 3 2077a: 9d e0 ldi r25, 0x0D ; 13 2077c: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a // report crash failures fw_crash_init(); #ifdef UVLO_SUPPORT if (printer_recovering()) { //previous print was terminated by UVLO 20780: 0e 94 30 68 call 0xd060 ; 0xd060 20784: 88 23 and r24, r24 20786: d9 f1 breq .+118 ; 0x207fe manage_heater(); // Update temperatures 20788: 0f 94 a0 4e call 0x29d40 ; 0x29d40 //Restore printing type saved_printing_type = eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE); 2078c: 8c e8 ldi r24, 0x8C ; 140 2078e: 9f e0 ldi r25, 0x0F ; 15 20790: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 20794: 08 2f mov r16, r24 20796: 80 93 6a 02 sts 0x026A, r24 ; 0x80026a return current_temperature_bed_raw; }; #endif FORCE_INLINE float degBed() { return current_temperature_bed; 2079a: 80 90 f1 04 lds r8, 0x04F1 ; 0x8004f1 2079e: 90 90 f2 04 lds r9, 0x04F2 ; 0x8004f2 207a2: a0 90 f3 04 lds r10, 0x04F3 ; 0x8004f3 207a6: b0 90 f4 04 lds r11, 0x04F4 ; 0x8004f4 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER printf_P(_N("Power panic detected!\nCurrent bed temp:%d\nSaved bed temp:%d\n"), (int)degBed(), eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED)); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER uvlo_auto_recovery_ready = (degBed() > ( (float)eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED) - AUTOMATIC_UVLO_BED_TEMP_OFFSET)); 207aa: 8b e8 ldi r24, 0x8B ; 139 207ac: 9f e0 ldi r25, 0x0F ; 15 207ae: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 207b2: 68 2f mov r22, r24 207b4: 70 e0 ldi r23, 0x00 ; 0 207b6: 90 e0 ldi r25, 0x00 ; 0 207b8: 80 e0 ldi r24, 0x00 ; 0 207ba: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 207be: 20 e0 ldi r18, 0x00 ; 0 207c0: 30 e0 ldi r19, 0x00 ; 0 207c2: 40 ea ldi r20, 0xA0 ; 160 207c4: 50 e4 ldi r21, 0x40 ; 64 207c6: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 207ca: 6b 01 movw r12, r22 207cc: 7c 01 movw r14, r24 207ce: 11 e0 ldi r17, 0x01 ; 1 207d0: ac 01 movw r20, r24 207d2: 9b 01 movw r18, r22 207d4: c5 01 movw r24, r10 207d6: b4 01 movw r22, r8 207d8: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 207dc: 18 16 cp r1, r24 207de: 0c f0 brlt .+2 ; 0x207e2 207e0: 10 e0 ldi r17, 0x00 ; 0 207e2: 10 93 f0 04 sts 0x04F0, r17 ; 0x8004f0 <_ZL24uvlo_auto_recovery_ready.lto_priv.552> if (uvlo_auto_recovery_ready){ 207e6: a7 01 movw r20, r14 207e8: 96 01 movw r18, r12 207ea: c5 01 movw r24, r10 207ec: b4 01 movw r22, r8 207ee: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 207f2: 18 16 cp r1, r24 207f4: 0c f0 brlt .+2 ; 0x207f8 207f6: 58 c0 rjmp .+176 ; 0x208a8 #ifdef DEBUG_UVLO_AUTOMATIC_RECOVER puts_P(_N("Automatic recovery!")); #endif //DEBUG_UVLO_AUTOMATIC_RECOVER recover_print(1); 207f8: 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); 207fa: 0f 94 01 d3 call 0x3a602 ; 0x3a602 printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); uvlo_drain_reset(); } void setup_uvlo_interrupt() { DDRE &= ~(1 << 4); //input pin 207fe: 6c 98 cbi 0x0d, 4 ; 13 PORTE &= ~(1 << 4); //no internal pull-up 20800: 74 98 cbi 0x0e, 4 ; 14 // sensing falling edge EICRB |= (1 << 0); 20802: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20806: 81 60 ori r24, 0x01 ; 1 20808: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> EICRB &= ~(1 << 1); 2080c: 80 91 6a 00 lds r24, 0x006A ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> 20810: 8d 7f andi r24, 0xFD ; 253 20812: 80 93 6a 00 sts 0x006A, r24 ; 0x80006a <__TEXT_REGION_LENGTH__+0x7c206a> // enable INT4 interrupt EIMSK |= (1 << 4); 20816: ec 9a sbi 0x1d, 4 ; 29 // check if power was lost before we armed the interrupt if(!(PINE & (1 << 4)) && printer_recovering()) 20818: 64 99 sbic 0x0c, 4 ; 12 2081a: 57 c0 rjmp .+174 ; 0x208ca 2081c: 0e 94 30 68 call 0xd060 ; 0xd060 20820: 88 23 and r24, r24 20822: 09 f4 brne .+2 ; 0x20826 20824: 52 c0 rjmp .+164 ; 0x208ca { SERIAL_ECHOLNRPGM(MSG_INT4); 20826: 84 e8 ldi r24, 0x84 ; 132 20828: 9f e8 ldi r25, 0x8F ; 143 2082a: 0e 94 06 7b call 0xf60c ; 0xf60c uvlo_drain_reset(); 2082e: 0f 94 3a aa call 0x35474 ; 0x35474 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)); 20832: 8a e1 ldi r24, 0x1A ; 26 20834: 93 e4 ldi r25, 0x43 ; 67 20836: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2083a: 0f 94 0c 36 call 0x26c18 ; 0x26c18 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); 2083e: 6e e2 ldi r22, 0x2E ; 46 20840: 71 e0 ldi r23, 0x01 ; 1 20842: 8e ee ldi r24, 0xEE ; 238 20844: 9e e0 ldi r25, 0x0E ; 14 20846: 0f 94 ef dd call 0x3bbde ; 0x3bbde 2084a: c4 ce rjmp .-632 ; 0x205d4 // 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); 2084c: 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) { 2084e: f1 10 cpse r15, r1 20850: 3d cf rjmp .-390 ; 0x206cc // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 20852: 0e 94 4b f9 call 0x1f296 ; 0x1f296 20856: 81 11 cpse r24, r1 20858: 07 c0 rjmp .+14 ; 0x20868 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 2085a: 8c e2 ldi r24, 0x2C ; 44 2085c: 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)); 2085e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20862: 0f 94 0c 36 call 0x26c18 ; 0x26c18 20866: 34 cf rjmp .-408 ; 0x206d0 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)) { 20868: 84 e0 ldi r24, 0x04 ; 4 2086a: 0e 94 4b f9 call 0x1f296 ; 0x1f296 2086e: 81 11 cpse r24, r1 20870: 03 c0 rjmp .+6 ; 0x20878 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 20872: 84 eb ldi r24, 0xB4 ; 180 20874: 91 e4 ldi r25, 0x41 ; 65 20876: f3 cf rjmp .-26 ; 0x2085e } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 20878: 80 e1 ldi r24, 0x10 ; 16 2087a: 0e 94 4b f9 call 0x1f296 ; 0x1f296 2087e: 81 11 cpse r24, r1 20880: 06 c0 rjmp .+12 ; 0x2088e lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 20882: 8c e8 ldi r24, 0x8C ; 140 20884: 97 e4 ldi r25, 0x47 ; 71 20886: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2088a: 0f 94 0c 36 call 0x26c18 ; 0x26c18 #ifdef THERMAL_MODEL if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL) && thermal_model_enabled()) 2088e: 88 e0 ldi r24, 0x08 ; 8 20890: 0e 94 4b f9 call 0x1f296 ; 0x1f296 20894: 81 11 cpse r24, r1 20896: 1c cf rjmp .-456 ; 0x206d0 20898: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> 2089c: 88 23 and r24, r24 2089e: 09 f4 brne .+2 ; 0x208a2 208a0: 17 cf rjmp .-466 ; 0x206d0 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); 208a2: 80 e9 ldi r24, 0x90 ; 144 208a4: 91 e4 ldi r25, 0x41 ; 65 208a6: db cf rjmp .-74 ; 0x2085e 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) { 208a8: 01 30 cpi r16, 0x01 ; 1 208aa: 11 f4 brne .+4 ; 0x208b0 recover_print(0); 208ac: 80 e0 ldi r24, 0x00 ; 0 208ae: a5 cf rjmp .-182 ; 0x207fa } else { const uint8_t btn = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_RECOVER_PRINT), false); 208b0: 8c e6 ldi r24, 0x6C ; 108 208b2: 91 e4 ldi r25, 0x41 ; 65 208b4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 208b8: 41 e0 ldi r20, 0x01 ; 1 208ba: 60 e0 ldi r22, 0x00 ; 0 208bc: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 if ( btn == LCD_LEFT_BUTTON_CHOICE) { 208c0: 88 23 and r24, r24 208c2: a1 f3 breq .-24 ; 0x208ac recover_print(0); } else { // LCD_MIDDLE_BUTTON_CHOICE cancel_saved_printing(); 208c4: 0e 94 62 65 call 0xcac4 ; 0xcac4 208c8: 9a cf rjmp .-204 ; 0x207fe ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 208ca: 61 e0 ldi r22, 0x01 ; 1 208cc: 88 ea ldi r24, 0xA8 ; 168 208ce: 9d e0 ldi r25, 0x0D ; 13 208d0: 0e 94 94 77 call 0xef28 ; 0xef28 208d4: 80 93 ef 04 sts 0x04EF, r24 ; 0x8004ef if (farm_mode) { oCheckMode = ClCheckMode::_Strict; eeprom_update_byte_notify((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Strict); } oNozzleDiameter = (ClNozzleDiameter)eeprom_init_default_byte((uint8_t *)EEPROM_NOZZLE_DIAMETER, (uint8_t)ClNozzleDiameter::_Diameter_400); 208d8: 68 e2 ldi r22, 0x28 ; 40 208da: 87 ea ldi r24, 0xA7 ; 167 208dc: 9d e0 ldi r25, 0x0D ; 13 208de: 0e 94 94 77 call 0xef28 ; 0xef28 208e2: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 208e6: 60 e9 ldi r22, 0x90 ; 144 208e8: 71 e0 ldi r23, 0x01 ; 1 208ea: 85 ea ldi r24, 0xA5 ; 165 208ec: 9d e0 ldi r25, 0x0D ; 13 208ee: 0e 94 7c 77 call 0xeef8 ; 0xeef8 oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 208f2: 61 e0 ldi r22, 0x01 ; 1 208f4: 84 ea ldi r24, 0xA4 ; 164 208f6: 9d e0 ldi r25, 0x0D ; 13 208f8: 0e 94 94 77 call 0xef28 ; 0xef28 208fc: 80 93 ed 04 sts 0x04ED, r24 ; 0x8004ed oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 20900: 61 e0 ldi r22, 0x01 ; 1 20902: 83 ea ldi r24, 0xA3 ; 163 20904: 9d e0 ldi r25, 0x0D ; 13 20906: 0e 94 94 77 call 0xef28 ; 0xef28 2090a: 80 93 ec 04 sts 0x04EC, r24 ; 0x8004ec oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 2090e: 61 e0 ldi r22, 0x01 ; 1 20910: 82 ea ldi r24, 0xA2 ; 162 20912: 9d e0 ldi r25, 0x0D ; 13 20914: 0e 94 94 77 call 0xef28 ; 0xef28 20918: 80 93 eb 04 sts 0x04EB, r24 ; 0x8004eb oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 2091c: 61 e0 ldi r22, 0x01 ; 1 2091e: 80 e2 ldi r24, 0x20 ; 32 20920: 9c e0 ldi r25, 0x0C ; 12 20922: 0e 94 94 77 call 0xef28 ; 0xef28 20926: 80 93 ea 04 sts 0x04EA, r24 ; 0x8004ea // the entire state machine initialized. setup_uvlo_interrupt(); #endif //UVLO_SUPPORT fCheckModeInit(); KEEPALIVE_STATE(NOT_BUSY); 2092a: 81 e0 ldi r24, 0x01 ; 1 2092c: 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" ); 20930: 88 e1 ldi r24, 0x18 ; 24 20932: 98 e2 ldi r25, 0x28 ; 40 20934: 0f b6 in r0, 0x3f ; 63 20936: f8 94 cli 20938: a8 95 wdr 2093a: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2093e: 0f be out 0x3f, r0 ; 63 20940: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 20944: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 20948: 80 64 ori r24, 0x40 ; 64 2094a: 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; 2094e: 85 e0 ldi r24, 0x05 ; 5 20950: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 20952: 00 e0 ldi r16, 0x00 ; 0 20954: 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); 20956: cc 24 eor r12, r12 20958: 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); 2095a: 94 e0 ldi r25, 0x04 ; 4 2095c: 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; 2095e: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d if(Stopped) { 20962: 80 91 14 05 lds r24, 0x0514 ; 0x800514 20966: 88 23 and r24, r24 20968: 09 f4 brne .+2 ; 0x2096c 2096a: c4 c0 rjmp .+392 ; 0x20af4 // 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); 2096c: 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. 20970: 0e 94 3a 68 call 0xd074 ; 0xd074 20974: 88 23 and r24, r24 20976: 09 f4 brne .+2 ; 0x2097a 20978: c0 c0 rjmp .+384 ; 0x20afa 2097a: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 2097e: 81 30 cpi r24, 0x01 ; 1 20980: 09 f0 breq .+2 ; 0x20984 20982: bb c0 rjmp .+374 ; 0x20afa usb_timer.start(); 20984: 81 e1 ldi r24, 0x11 ; 17 20986: 95 e0 ldi r25, 0x05 ; 5 20988: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> } else #endif { get_command(); 2098c: 0e 94 4b 84 call 0x10896 ; 0x10896 // 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) 20990: 80 91 69 02 lds r24, 0x0269 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.572> 20994: 88 23 and r24, r24 20996: 89 f0 breq .+34 ; 0x209ba return; if(autostart_atmillis.expired(5000)) 20998: 68 e8 ldi r22, 0x88 ; 136 2099a: 73 e1 ldi r23, 0x13 ; 19 2099c: 8f e7 ldi r24, 0x7F ; 127 2099e: 97 e1 ldi r25, 0x17 ; 23 209a0: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 209a4: 81 11 cpse r24, r1 209a6: 09 c0 rjmp .+18 ; 0x209ba return; } autostart_stilltocheck = false; 209a8: 10 92 69 02 sts 0x0269, r1 ; 0x800269 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.572> if(!mounted) 209ac: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 209b0: 88 23 and r24, r24 209b2: 09 f4 brne .+2 ; 0x209b6 209b4: ae c0 rjmp .+348 ; 0x20b12 209b6: 0f 94 db 77 call 0x2efb6 ; 0x2efb6 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 209ba: 80 91 81 10 lds r24, 0x1081 ; 0x801081 209be: 90 91 82 10 lds r25, 0x1082 ; 0x801082 209c2: 89 2b or r24, r25 209c4: 09 f4 brne .+2 ; 0x209c8 209c6: 61 c0 rjmp .+194 ; 0x20a8a { cmdbuffer_front_already_processed = false; 209c8: 10 92 80 10 sts 0x1080, r1 ; 0x801080 #ifdef SDSUPPORT if(card.saving) 209cc: 80 91 6c 14 lds r24, 0x146C ; 0x80146c 209d0: 88 23 and r24, r24 209d2: d1 f1 breq .+116 ; 0x20a48 { // 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) { 209d4: 80 91 70 12 lds r24, 0x1270 ; 0x801270 209d8: 90 91 71 12 lds r25, 0x1271 ; 0x801271 209dc: dc 01 movw r26, r24 209de: aa 57 subi r26, 0x7A ; 122 209e0: bf 4e sbci r27, 0xEF ; 239 209e2: 7d 01 movw r14, r26 209e4: 62 e3 ldi r22, 0x32 ; 50 209e6: 70 e9 ldi r23, 0x90 ; 144 209e8: cd 01 movw r24, r26 209ea: 0f 94 98 db call 0x3b730 ; 0x3b730 209ee: 89 2b or r24, r25 209f0: 09 f0 breq .+2 ; 0x209f4 209f2: 9c c0 rjmp .+312 ; 0x20b2c else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 209f4: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe /** Write a string to a file. Used by the Arduino Print class. * \param[in] str Pointer to the string. * Use writeError to check for errors. */ void SdFile::write(const char* str) { SdBaseFile::write(str, strlen(str)); 209f8: f7 01 movw r30, r14 209fa: 01 90 ld r0, Z+ 209fc: 00 20 and r0, r0 209fe: e9 f7 brne .-6 ; 0x209fa 20a00: 31 97 sbiw r30, 0x01 ; 1 20a02: bf 01 movw r22, r30 20a04: 6e 19 sub r22, r14 20a06: 7f 09 sbc r23, r15 20a08: c7 01 movw r24, r14 20a0a: 0f 94 16 84 call 0x3082c ; 0x3082c 20a0e: 62 e0 ldi r22, 0x02 ; 2 20a10: 70 e0 ldi r23, 0x00 ; 0 20a12: 82 ef ldi r24, 0xF2 ; 242 20a14: 92 e0 ldi r25, 0x02 ; 2 20a16: 0f 94 16 84 call 0x3082c ; 0x3082c file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 20a1a: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 20a1e: 88 23 and r24, r24 20a20: 41 f0 breq .+16 ; 0x20a32 { SERIAL_ERROR_START; 20a22: 8a ec ldi r24, 0xCA ; 202 20a24: 99 ea ldi r25, 0xA9 ; 169 20a26: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 20a2a: 82 ee ldi r24, 0xE2 ; 226 20a2c: 9d e6 ldi r25, 0x6D ; 109 20a2e: 0e 94 06 7b call 0xf60c ; 0xf60c card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 20a32: 80 91 6d 14 lds r24, 0x146D ; 0x80146d 20a36: 88 23 and r24, r24 20a38: 09 f4 brne .+2 ; 0x20a3c 20a3a: 73 c0 rjmp .+230 ; 0x20b22 */ void process_commands() { if (!buflen) return; //empty command 20a3c: 80 91 81 10 lds r24, 0x1081 ; 0x801081 20a40: 90 91 82 10 lds r25, 0x1082 ; 0x801082 20a44: 89 2b or r24, r25 20a46: 11 f0 breq .+4 ; 0x20a4c 20a48: 0e 94 28 97 call 0x12e50 ; 0x12e50 } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 20a4c: 80 91 80 10 lds r24, 0x1080 ; 0x801080 20a50: 81 11 cpse r24, r1 20a52: 19 c0 rjmp .+50 ; 0x20a86 20a54: 80 91 81 10 lds r24, 0x1081 ; 0x801081 20a58: 90 91 82 10 lds r25, 0x1082 ; 0x801082 20a5c: 89 2b or r24, r25 20a5e: 99 f0 breq .+38 ; 0x20a86 { // 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; 20a60: e0 91 70 12 lds r30, 0x1270 ; 0x801270 20a64: f0 91 71 12 lds r31, 0x1271 ; 0x801271 20a68: ed 57 subi r30, 0x7D ; 125 20a6a: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 20a6c: 80 81 ld r24, Z 20a6e: 82 30 cpi r24, 0x02 ; 2 20a70: 09 f0 breq .+2 ; 0x20a74 20a72: 6b c0 rjmp .+214 ; 0x20b4a { // 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(); 20a74: 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; 20a76: 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); 20a78: 81 81 ldd r24, Z+1 ; 0x01 20a7a: 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); 20a7c: 0f 94 6c aa call 0x354d8 ; 0x354d8 sei(); 20a80: 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(); 20a82: 0e 94 47 78 call 0xf08e ; 0xf08e } host_keepalive(); 20a86: 0e 94 32 81 call 0x10264 ; 0x10264 } } //check heater every n milliseconds manage_heater(); 20a8a: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(printingIsPaused()); 20a8e: 0e 94 3a 68 call 0xd074 ; 0xd074 20a92: 0e 94 e2 8b call 0x117c4 ; 0x117c4 //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 20a96: 80 91 0e 05 lds r24, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.496> 20a9a: 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; 20a9c: 10 92 0e 05 sts 0x050E, r1 ; 0x80050e <_ZL11endstop_hit.lto_priv.496> checkHitEndstops(); lcd_update(0); 20aa0: 80 e0 ldi r24, 0x00 ; 0 20aa2: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 #ifdef TMC2130 tmc2130_check_overtemp(); 20aa6: 0f 94 26 40 call 0x2804c ; 0x2804c if (tmc2130_sg_crash) 20aaa: 80 91 10 05 lds r24, 0x0510 ; 0x800510 20aae: 88 23 and r24, r24 20ab0: 79 f0 breq .+30 ; 0x20ad0 { uint8_t crash = tmc2130_sg_crash; tmc2130_sg_crash = 0; 20ab2: 10 92 10 05 sts 0x0510, r1 ; 0x800510 // crashdet_stop_and_save_print(); switch (crash) 20ab6: 82 30 cpi r24, 0x02 ; 2 20ab8: 09 f4 brne .+2 ; 0x20abc 20aba: 53 c0 rjmp .+166 ; 0x20b62 20abc: 83 30 cpi r24, 0x03 ; 3 20abe: 09 f4 brne .+2 ; 0x20ac2 20ac0: 54 c0 rjmp .+168 ; 0x20b6a 20ac2: 81 30 cpi r24, 0x01 ; 1 20ac4: 29 f4 brne .+10 ; 0x20ad0 { case 1: enquecommand_P((PSTR("CRASH_DETECTEDX"))); break; 20ac6: 61 e0 ldi r22, 0x01 ; 1 20ac8: 82 e2 ldi r24, 0x22 ; 34 20aca: 90 e9 ldi r25, 0x90 ; 144 case 2: enquecommand_P((PSTR("CRASH_DETECTEDY"))); break; case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20acc: 0e 94 4b 89 call 0x11296 ; 0x11296 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) { 20ad0: 80 91 0f 05 lds r24, 0x050F ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> 20ad4: 81 11 cpse r24, r1 20ad6: 07 c0 rjmp .+14 ; 0x20ae6 return; } avoidRecursion = true; 20ad8: c0 92 0f 05 sts 0x050F, r12 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> mmu_loop_inner(true); 20adc: 81 e0 ldi r24, 0x01 ; 1 20ade: 0f 94 2e 9a call 0x3345c ; 0x3345c avoidRecursion = false; 20ae2: 10 92 0f 05 sts 0x050F, r1 ; 0x80050f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.561> 20ae6: 01 15 cp r16, r1 20ae8: 11 05 cpc r17, r1 20aea: 09 f4 brne .+2 ; 0x20aee 20aec: 38 cf rjmp .-400 ; 0x2095e 20aee: 0e 94 00 00 call 0 ; 0x0 <__vectors> 20af2: 35 cf rjmp .-406 ; 0x2095e // 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); 20af4: c0 92 96 02 sts 0x0296, r12 ; 0x800296 20af8: 3b cf rjmp .-394 ; 0x20970 } 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. 20afa: 60 e1 ldi r22, 0x10 ; 16 20afc: 77 e2 ldi r23, 0x27 ; 39 20afe: 81 e1 ldi r24, 0x11 ; 17 20b00: 95 e0 ldi r25, 0x05 ; 5 20b02: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 20b06: 88 23 and r24, r24 20b08: 09 f4 brne .+2 ; 0x20b0c 20b0a: 40 cf rjmp .-384 ; 0x2098c } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 20b0c: b0 92 67 0e sts 0x0E67, r11 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 20b10: 3d cf rjmp .-390 ; 0x2098c return; } autostart_stilltocheck = false; if(!mounted) { mount(); 20b12: 81 e0 ldi r24, 0x01 ; 1 20b14: 0f 94 78 81 call 0x302f0 ; 0x302f0 if(!mounted) //fail 20b18: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 20b1c: 81 11 cpse r24, r1 20b1e: 4b cf rjmp .-362 ; 0x209b6 20b20: 4c cf rjmp .-360 ; 0x209ba 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); 20b22: 8a e0 ldi r24, 0x0A ; 10 20b24: 9e e6 ldi r25, 0x6E ; 110 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 20b26: 0e 94 06 7b call 0xf60c ; 0xf60c 20b2a: 90 cf rjmp .-224 ; 0x20a4c lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 20b2c: 8e ef ldi r24, 0xFE ; 254 20b2e: 96 e1 ldi r25, 0x16 ; 22 20b30: 0f 94 7c 6e call 0x2dcf8 ; 0x2dcf8 file.close(); 20b34: 8e ef ldi r24, 0xFE ; 254 20b36: 96 e1 ldi r25, 0x16 ; 22 20b38: 0f 94 74 a4 call 0x348e8 ; 0x348e8 saving = false; 20b3c: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 20b40: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d 20b44: 88 ef ldi r24, 0xF8 ; 248 20b46: 9d e6 ldi r25, 0x6D ; 109 20b48: ee cf rjmp .-36 ; 0x20b26 // 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){ 20b4a: 86 30 cpi r24, 0x06 ; 6 20b4c: 09 f0 breq .+2 ; 0x20b50 20b4e: 99 cf rjmp .-206 ; 0x20a82 20b50: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 20b54: 81 11 cpse r24, r1 20b56: 95 cf rjmp .-214 ; 0x20a82 cli(); 20b58: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 20b5a: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 20b5c: 81 e0 ldi r24, 0x01 ; 1 20b5e: 90 e0 ldi r25, 0x00 ; 0 20b60: 8d cf rjmp .-230 ; 0x20a7c 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; 20b62: 61 e0 ldi r22, 0x01 ; 1 20b64: 82 e1 ldi r24, 0x12 ; 18 20b66: 90 e9 ldi r25, 0x90 ; 144 20b68: b1 cf rjmp .-158 ; 0x20acc case 3: enquecommand_P((PSTR("CRASH_DETECTEDXY"))); break; 20b6a: 61 e0 ldi r22, 0x01 ; 1 20b6c: 81 e0 ldi r24, 0x01 ; 1 20b6e: 90 e9 ldi r25, 0x90 ; 144 20b70: ad cf rjmp .-166 ; 0x20acc { 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; 20b72: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 20b74: 86 33 cpi r24, 0x36 ; 54 20b76: 91 40 sbci r25, 0x01 ; 1 20b78: 09 f0 breq .+2 ; 0x20b7c 20b7a: 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(); 20b7c: 0e 94 b7 83 call 0x1076e ; 0x1076e 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; 20b80: 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; 20b82: 82 ea ldi r24, 0xA2 ; 162 20b84: 92 ea ldi r25, 0xA2 ; 162 20b86: a0 e0 ldi r26, 0x00 ; 0 20b88: b0 e0 ldi r27, 0x00 ; 0 20b8a: 80 93 39 18 sts 0x1839, r24 ; 0x801839 <__bss_end+0x20> 20b8e: 90 93 3a 18 sts 0x183A, r25 ; 0x80183a <__bss_end+0x21> 20b92: a0 93 3b 18 sts 0x183B, r26 ; 0x80183b <__bss_end+0x22> 20b96: b0 93 3c 18 sts 0x183C, r27 ; 0x80183c <__bss_end+0x23> // Finish init of mult extruder arrays for(int e = 0; e < EXTRUDERS; e++) { // populate with the first value maxttemp[e] = maxttemp[0]; #ifdef PIDTEMP iState_sum_min[e] = 0.0; 20b9a: 10 92 ad 04 sts 0x04AD, r1 ; 0x8004ad <_ZL14iState_sum_min.lto_priv.483> 20b9e: 10 92 ae 04 sts 0x04AE, r1 ; 0x8004ae <_ZL14iState_sum_min.lto_priv.483+0x1> 20ba2: 10 92 af 04 sts 0x04AF, r1 ; 0x8004af <_ZL14iState_sum_min.lto_priv.483+0x2> 20ba6: 10 92 b0 04 sts 0x04B0, r1 ; 0x8004b0 <_ZL14iState_sum_min.lto_priv.483+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 20baa: 20 91 da 06 lds r18, 0x06DA ; 0x8006da 20bae: 30 91 db 06 lds r19, 0x06DB ; 0x8006db 20bb2: 40 91 dc 06 lds r20, 0x06DC ; 0x8006dc 20bb6: 50 91 dd 06 lds r21, 0x06DD ; 0x8006dd 20bba: 60 e0 ldi r22, 0x00 ; 0 20bbc: 70 e0 ldi r23, 0x00 ; 0 20bbe: 8f e7 ldi r24, 0x7F ; 127 20bc0: 93 e4 ldi r25, 0x43 ; 67 20bc2: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 20bc6: 60 93 a9 04 sts 0x04A9, r22 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.484> 20bca: 70 93 aa 04 sts 0x04AA, r23 ; 0x8004aa <_ZL14iState_sum_max.lto_priv.484+0x1> 20bce: 80 93 ab 04 sts 0x04AB, r24 ; 0x8004ab <_ZL14iState_sum_max.lto_priv.484+0x2> 20bd2: 90 93 ac 04 sts 0x04AC, r25 ; 0x8004ac <_ZL14iState_sum_max.lto_priv.484+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 20bd6: 10 92 a5 04 sts 0x04A5, r1 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.481> 20bda: 10 92 a6 04 sts 0x04A6, r1 ; 0x8004a6 <_ZL19temp_iState_min_bed.lto_priv.481+0x1> 20bde: 10 92 a7 04 sts 0x04A7, r1 ; 0x8004a7 <_ZL19temp_iState_min_bed.lto_priv.481+0x2> 20be2: 10 92 a8 04 sts 0x04A8, r1 ; 0x8004a8 <_ZL19temp_iState_min_bed.lto_priv.481+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 20be6: 20 91 e6 06 lds r18, 0x06E6 ; 0x8006e6 20bea: 30 91 e7 06 lds r19, 0x06E7 ; 0x8006e7 20bee: 40 91 e8 06 lds r20, 0x06E8 ; 0x8006e8 20bf2: 50 91 e9 06 lds r21, 0x06E9 ; 0x8006e9 20bf6: 60 e0 ldi r22, 0x00 ; 0 20bf8: 70 e0 ldi r23, 0x00 ; 0 20bfa: 8f e7 ldi r24, 0x7F ; 127 20bfc: 93 e4 ldi r25, 0x43 ; 67 20bfe: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 20c02: 60 93 a1 04 sts 0x04A1, r22 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.482> 20c06: 70 93 a2 04 sts 0x04A2, r23 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.482+0x1> 20c0a: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 <_ZL19temp_iState_max_bed.lto_priv.482+0x2> 20c0e: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 <_ZL19temp_iState_max_bed.lto_priv.482+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 20c12: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 20c14: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 20c16: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 20c1a: 88 60 ori r24, 0x08 ; 8 20c1c: 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)); 20c20: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 20c24: 90 e0 ldi r25, 0x00 ; 0 20c26: b4 e0 ldi r27, 0x04 ; 4 20c28: 95 95 asr r25 20c2a: 87 95 ror r24 20c2c: ba 95 dec r27 20c2e: e1 f7 brne .-8 ; 0x20c28 20c30: 80 93 9f 04 sts 0x049F, r24 ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.475> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 20c34: 8a e0 ldi r24, 0x0A ; 10 20c36: 90 e0 ldi r25, 0x00 ; 0 20c38: 90 93 9e 04 sts 0x049E, r25 ; 0x80049e <_ZL8minttemp.lto_priv.476+0x1> 20c3c: 80 93 9d 04 sts 0x049D, r24 ; 0x80049d <_ZL8minttemp.lto_priv.476> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 20c40: c0 90 54 02 lds r12, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.487> 20c44: d0 90 55 02 lds r13, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.487+0x1> 20c48: c6 01 movw r24, r12 20c4a: 0e 94 8e da call 0x1b51c ; 0x1b51c 20c4e: 20 e0 ldi r18, 0x00 ; 0 20c50: 30 e0 ldi r19, 0x00 ; 0 20c52: 40 e2 ldi r20, 0x20 ; 32 20c54: 51 e4 ldi r21, 0x41 ; 65 20c56: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 20c5a: 87 fd sbrc r24, 7 20c5c: 02 c0 rjmp .+4 ; 0x20c62 20c5e: 0c 94 80 fd jmp 0x1fb00 ; 0x1fb00 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 20c62: e0 e1 ldi r30, 0x10 ; 16 20c64: ce 1a sub r12, r30 20c66: d1 08 sbc r13, r1 20c68: d0 92 55 02 sts 0x0255, r13 ; 0x800255 <_ZL12minttemp_raw.lto_priv.487+0x1> 20c6c: c0 92 54 02 sts 0x0254, r12 ; 0x800254 <_ZL12minttemp_raw.lto_priv.487> 20c70: e7 cf rjmp .-50 ; 0x20c40 00020c72 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20c72: 0f 94 10 cf call 0x39e20 ; 0x39e20 20c76: 10 92 15 05 sts 0x0515, r1 ; 0x800515 20c7a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 20c7e: 84 30 cpi r24, 0x04 ; 4 20c80: 08 f0 brcs .+2 ; 0x20c84 20c82: 41 c0 rjmp .+130 ; 0x20d06 20c84: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_BACK)); 20c88: 89 e1 ldi r24, 0x19 ; 25 20c8a: 90 e4 ldi r25, 0x40 ; 64 20c8c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20c90: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 eeprom_update_byte_notify((uint8_t *)EEPROM_ALTFAN_OVERRIDE, altfanStatus.altfanOverride); } bool altfanOverride_get() { return altfanStatus.altfanOverride; 20c94: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> #ifdef EXTRUDER_ALTFAN_DETECT MENU_ITEM_TOGGLE_P(_N("ALTFAN det."), altfanOverride_get()?_T(MSG_OFF):_T(MSG_ON), altfanOverride_toggle);////MSG_MENU_ALTFAN c=18 20c98: 81 ff sbrs r24, 1 20c9a: 2f c0 rjmp .+94 ; 0x20cfa 20c9c: 82 e4 ldi r24, 0x42 ; 66 20c9e: 9d e5 ldi r25, 0x5D ; 93 20ca0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20ca4: 22 e0 ldi r18, 0x02 ; 2 20ca6: 48 ee ldi r20, 0xE8 ; 232 20ca8: 5c e5 ldi r21, 0x5C ; 92 20caa: bc 01 movw r22, r24 20cac: 89 ef ldi r24, 0xF9 ; 249 20cae: 9b e6 ldi r25, 0x6B ; 107 20cb0: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #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 20cb4: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 20cb8: 88 23 and r24, r24 20cba: 11 f1 breq .+68 ; 0x20d00 20cbc: 88 e4 ldi r24, 0x48 ; 72 20cbe: 9d e5 ldi r25, 0x5D ; 93 20cc0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20cc4: 22 e0 ldi r18, 0x02 ; 2 20cc6: 42 ea ldi r20, 0xA2 ; 162 20cc8: 5a e3 ldi r21, 0x3A ; 58 20cca: bc 01 movw r22, r24 20ccc: 8d ee ldi r24, 0xED ; 237 20cce: 9b e6 ldi r25, 0x6B ; 107 20cd0: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #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 20cd4: 6d e6 ldi r22, 0x6D ; 109 20cd6: 72 ed ldi r23, 0xD2 ; 210 20cd8: 8a ed ldi r24, 0xDA ; 218 20cda: 9b e6 ldi r25, 0x6B ; 107 20cdc: 0f 94 8d ce call 0x39d1a ; 0x39d1a #endif //PRUSA_SN_SUPPORT MENU_END(); 20ce0: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 20ce4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 20ce8: 8f 5f subi r24, 0xFF ; 255 20cea: 80 93 15 05 sts 0x0515, r24 ; 0x800515 20cee: 80 91 17 05 lds r24, 0x0517 ; 0x800517 20cf2: 8f 5f subi r24, 0xFF ; 255 20cf4: 80 93 17 05 sts 0x0517, r24 ; 0x800517 20cf8: c0 cf rjmp .-128 ; 0x20c7a 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 20cfa: 88 e4 ldi r24, 0x48 ; 72 20cfc: 9d e5 ldi r25, 0x5D ; 93 20cfe: d0 cf rjmp .-96 ; 0x20ca0 #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 20d00: 82 e4 ldi r24, 0x42 ; 66 20d02: 9d e5 ldi r25, 0x5D ; 93 20d04: dd cf rjmp .-70 ; 0x20cc0 #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(); } 20d06: 08 95 ret 00020d08 : prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); } #ifdef TMC2130 void UserECool_toggle(){ 20d08: 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(); 20d0a: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 20d0e: c1 e0 ldi r28, 0x01 ; 1 20d10: c8 27 eor r28, r24 eeprom_update_byte_notify((uint8_t *)EEPROM_ECOOL_ENABLE, enable ? EEPROM_ECOOL_MAGIC_NUMBER : EEPROM_EMPTY_VALUE); 20d12: 6f ef ldi r22, 0xFF ; 255 20d14: 09 f0 breq .+2 ; 0x20d18 20d16: 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); 20d18: 84 e0 ldi r24, 0x04 ; 4 20d1a: 9d e0 ldi r25, 0x0D ; 13 20d1c: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 1 #else 0 #endif ) , enableECool(enableECool) { } 20d20: 8c 2f mov r24, r28 20d22: 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)); 20d24: 82 70 andi r24, 0x02 ; 2 } 20d26: 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)); 20d28: 0d 94 21 3c jmp 0x27842 ; 0x27842 00020d2c : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 20d2c: 44 e1 ldi r20, 0x14 ; 20 20d2e: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 20d30: 66 23 and r22, r22 20d32: 89 f0 breq .+34 ; 0x20d56 strncpy_P(lcd_status_message, message, LCD_WIDTH); 20d34: bc 01 movw r22, r24 20d36: 8a e3 ldi r24, 0x3A ; 58 20d38: 95 e0 ldi r25, 0x05 ; 5 20d3a: 0f 94 7e db call 0x3b6fc ; 0x3b6fc else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 20d3e: 10 92 4e 05 sts 0x054E, r1 ; 0x80054e <_ZL18lcd_status_message.lto_priv.468+0x14> lcd_status_message_idx = 0; // Print message from beginning 20d42: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 20d46: 86 eb ldi r24, 0xB6 ; 182 20d48: 9b e6 ldi r25, 0x6B ; 107 20d4a: 0e 94 06 7b call 0xf60c ; 0xf60c // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 20d4e: 81 e0 ldi r24, 0x01 ; 1 20d50: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 20d54: 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); 20d56: bc 01 movw r22, r24 20d58: 8a e3 ldi r24, 0x3A ; 58 20d5a: 95 e0 ldi r25, 0x05 ; 5 20d5c: 0f 94 11 e4 call 0x3c822 ; 0x3c822 20d60: ee cf rjmp .-36 ; 0x20d3e 00020d62 : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 20d62: 90 91 d1 03 lds r25, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> 20d66: 89 17 cp r24, r25 20d68: 80 f4 brcc .+32 ; 0x20d8a return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 20d6a: 91 30 cpi r25, 0x01 ; 1 20d6c: 61 f4 brne .+24 ; 0x20d86 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 20d6e: 80 91 4f 05 lds r24, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.467> 20d72: 88 23 and r24, r24 20d74: 51 f0 breq .+20 ; 0x20d8a 20d76: 40 e2 ldi r20, 0x20 ; 32 20d78: 5e e4 ldi r21, 0x4E ; 78 20d7a: 60 e0 ldi r22, 0x00 ; 0 20d7c: 70 e0 ldi r23, 0x00 ; 0 20d7e: 8f e4 ldi r24, 0x4F ; 79 20d80: 95 e0 ldi r25, 0x05 ; 5 20d82: 0d 94 6f 40 jmp 0x280de ; 0x280de ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 20d86: 80 e0 ldi r24, 0x00 ; 0 20d88: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 20d8a: 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; } 20d8c: 08 95 ret 00020d8e : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 20d8e: ef 92 push r14 20d90: ff 92 push r15 20d92: 1f 93 push r17 20d94: cf 93 push r28 20d96: df 93 push r29 20d98: ec 01 movw r28, r24 20d9a: 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)) { 20d9c: 86 2f mov r24, r22 20d9e: 0f 94 b1 06 call 0x20d62 ; 0x20d62 20da2: 88 23 and r24, r24 20da4: e9 f0 breq .+58 ; 0x20de0 bool same = !(progmem? strcmp_P(lcd_status_message, message): 20da6: be 01 movw r22, r28 20da8: 8a e3 ldi r24, 0x3A ; 58 20daa: 95 e0 ldi r25, 0x05 ; 5 20dac: 0f 94 3f db call 0x3b67e ; 0x3b67e 20db0: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 20db2: 8f e4 ldi r24, 0x4F ; 79 20db4: 95 e0 ldi r25, 0x05 ; 5 20db6: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> lcd_status_message_level = severity; 20dba: 10 93 d1 03 sts 0x03D1, r17 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> custom_message_type = CustomMsg::Status; 20dbe: 10 92 75 07 sts 0x0775, r1 ; 0x800775 custom_message_state = 0; 20dc2: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 if (!same) { 20dc6: ef 28 or r14, r15 20dc8: 59 f0 breq .+22 ; 0x20de0 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 20dca: 61 e0 ldi r22, 0x01 ; 1 20dcc: ce 01 movw r24, r28 20dce: 0f 94 96 06 call 0x20d2c ; 0x20d2c } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20dd2: df 91 pop r29 20dd4: cf 91 pop r28 20dd6: 1f 91 pop r17 20dd8: ff 90 pop r15 20dda: 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(); 20ddc: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 20de0: df 91 pop r29 20de2: cf 91 pop r28 20de4: 1f 91 pop r17 20de6: ff 90 pop r15 20de8: ef 90 pop r14 20dea: 08 95 ret 00020dec : manage_heater(); manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) 20dec: 1f 93 push r17 20dee: cf 93 push r28 20df0: df 93 push r29 20df2: 18 2f mov r17, r24 20df4: eb 01 movw r28, r22 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 20df6: 80 e0 ldi r24, 0x00 ; 0 20df8: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe { lcd_beeper_quick_feedback(); FORCE_BL_ON_END; 20dfc: 80 e0 ldi r24, 0x00 ; 0 20dfe: 0e 94 7c 8b call 0x116f8 ; 0x116f8 target_temperature[0] = 0; 20e02: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 20e06: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d target_temperature_bed = 0; 20e0a: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 20e0e: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b manage_heater(); 20e12: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(); 20e16: 80 e0 ldi r24, 0x00 ; 0 20e18: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_clear(); 20e1c: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 20e20: 88 ef ldi r24, 0xF8 ; 248 20e22: 94 e4 ldi r25, 0x44 ; 68 20e24: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20e28: ac 01 movw r20, r24 20e2a: 60 e0 ldi r22, 0x00 ; 0 20e2c: 80 e0 ldi r24, 0x00 ; 0 20e2e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 20e32: 88 ee ldi r24, 0xE8 ; 232 20e34: 94 e4 ldi r25, 0x44 ; 68 20e36: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20e3a: ac 01 movw r20, r24 20e3c: 61 e0 ldi r22, 0x01 ; 1 20e3e: 80 e0 ldi r24, 0x00 ; 0 20e40: 0e 94 a9 6f call 0xdf52 ; 0xdf52 switch (testError) 20e44: 11 50 subi r17, 0x01 ; 1 20e46: 1c 30 cpi r17, 0x0C ; 12 20e48: a0 f4 brcc .+40 ; 0x20e72 20e4a: e1 2f mov r30, r17 20e4c: f0 e0 ldi r31, 0x00 ; 0 20e4e: 88 27 eor r24, r24 20e50: e3 5d subi r30, 0xD3 ; 211 20e52: f8 4f sbci r31, 0xF8 ; 248 20e54: 8e 4f sbci r24, 0xFE ; 254 20e56: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 20e5a: 76 39 cpi r23, 0x96 ; 150 20e5c: 0e 3a cpi r16, 0xAE ; 174 20e5e: ee 39 cpi r30, 0x9E ; 158 20e60: b8 3a cpi r27, 0xA8 ; 168 20e62: 90 39 cpi r25, 0x90 ; 144 20e64: 9a 39 cpi r25, 0x9A ; 154 20e66: d4 39 cpi r29, 0x94 ; 148 20e68: c6 3a cpi r28, 0xA6 ; 166 20e6a: 44 3a cpi r20, 0xA4 ; 164 20e6c: c4 39 cpi r28, 0x94 ; 148 20e6e: f4 3a cpi r31, 0xA4 ; 164 20e70: 70 39 cpi r23, 0x90 ; 144 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 20e72: 84 ed ldi r24, 0xD4 ; 212 20e74: 94 e4 ldi r25, 0x44 ; 68 20e76: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20e7a: ac 01 movw r20, r24 20e7c: 62 e0 ldi r22, 0x02 ; 2 20e7e: 80 e0 ldi r24, 0x00 ; 0 20e80: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 20e84: 84 ec ldi r24, 0xC4 ; 196 20e86: 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)); 20e88: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20e8c: ac 01 movw r20, r24 20e8e: 63 e0 ldi r22, 0x03 ; 3 20e90: 80 e0 ldi r24, 0x00 ; 0 20e92: 0e 94 a9 6f call 0xdf52 ; 0xdf52 20e96: 45 c0 rjmp .+138 ; 0x20f22 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)); 20e98: 87 eb ldi r24, 0xB7 ; 183 20e9a: 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)); 20e9c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20ea0: ac 01 movw r20, r24 20ea2: 62 e0 ldi r22, 0x02 ; 2 20ea4: 80 e0 ldi r24, 0x00 ; 0 20ea6: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20eaa: 88 ea ldi r24, 0xA8 ; 168 20eac: 94 e4 ldi r25, 0x44 ; 68 20eae: ec cf rjmp .-40 ; 0x20e88 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)); 20eb0: 8d e9 ldi r24, 0x9D ; 157 20eb2: 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)); 20eb4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20eb8: ac 01 movw r20, r24 20eba: 62 e0 ldi r22, 0x02 ; 2 20ebc: 80 e0 ldi r24, 0x00 ; 0 20ebe: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 20ec2: 88 ea ldi r24, 0xA8 ; 168 20ec4: 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)); 20ec6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20eca: ac 01 movw r20, r24 20ecc: 63 e0 ldi r22, 0x03 ; 3 20ece: 80 e0 ldi r24, 0x00 ; 0 20ed0: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(18, 3); 20ed4: 63 e0 ldi r22, 0x03 ; 3 20ed6: 82 e1 ldi r24, 0x12 ; 18 20ed8: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print(_error_1); 20edc: ce 01 movw r24, r28 20ede: 1f c0 rjmp .+62 ; 0x20f1e 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)); 20ee0: 85 e9 ldi r24, 0x95 ; 149 20ee2: 94 e4 ldi r25, 0x44 ; 68 20ee4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20ee8: ac 01 movw r20, r24 20eea: 62 e0 ldi r22, 0x02 ; 2 20eec: 80 e0 ldi r24, 0x00 ; 0 20eee: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(18, 2); 20ef2: 62 e0 ldi r22, 0x02 ; 2 20ef4: 82 e1 ldi r24, 0x12 ; 18 20ef6: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print(_error_1); 20efa: ce 01 movw r24, r28 20efc: 0e 94 9c 71 call 0xe338 ; 0xe338 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 20f00: 8b e8 ldi r24, 0x8B ; 139 20f02: 94 e4 ldi r25, 0x44 ; 68 20f04: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20f08: ac 01 movw r20, r24 20f0a: 63 e0 ldi r22, 0x03 ; 3 20f0c: 80 e0 ldi r24, 0x00 ; 0 20f0e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(18, 3); 20f12: 63 e0 ldi r22, 0x03 ; 3 20f14: 82 e1 ldi r24, 0x12 ; 18 20f16: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print(_error_2); 20f1a: 84 ef ldi r24, 0xF4 ; 244 20f1c: 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); 20f1e: 0e 94 9c 71 call 0xe338 ; 0xe338 lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 20f22: 68 ee ldi r22, 0xE8 ; 232 20f24: 73 e0 ldi r23, 0x03 ; 3 20f26: 80 e0 ldi r24, 0x00 ; 0 20f28: 90 e0 ldi r25, 0x00 ; 0 20f2a: 0f 94 92 3d call 0x27b24 ; 0x27b24 20f2e: 80 e0 ldi r24, 0x00 ; 0 20f30: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe lcd_beeper_quick_feedback(); do { _delay(100); 20f34: 64 e6 ldi r22, 0x64 ; 100 20f36: 70 e0 ldi r23, 0x00 ; 0 20f38: 80 e0 ldi r24, 0x00 ; 0 20f3a: 90 e0 ldi r25, 0x00 ; 0 20f3c: 0f 94 92 3d call 0x27b24 ; 0x27b24 manage_heater(); 20f40: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(); 20f44: 80 e0 ldi r24, 0x00 ; 0 20f46: 0e 94 e2 8b call 0x117c4 ; 0x117c4 } while (!lcd_clicked()); 20f4a: 0e 94 b2 71 call 0xe364 ; 0xe364 20f4e: 88 23 and r24, r24 20f50: 89 f3 breq .-30 ; 0x20f34 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 20f52: 88 ec ldi r24, 0xC8 ; 200 20f54: 93 e4 ldi r25, 0x43 ; 67 20f56: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20f5a: 62 e0 ldi r22, 0x02 ; 2 20f5c: 0f 94 c7 06 call 0x20d8e ; 0x20d8e lcd_return_to_status(); } 20f60: df 91 pop r29 20f62: cf 91 pop r28 20f64: 1f 91 pop r17 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 20f66: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 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)); 20f6a: 89 e7 ldi r24, 0x79 ; 121 20f6c: 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)); 20f6e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20f72: ac 01 movw r20, r24 20f74: 62 e0 ldi r22, 0x02 ; 2 20f76: 80 e0 ldi r24, 0x00 ; 0 20f78: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 20f7c: 85 e9 ldi r24, 0x95 ; 149 20f7e: 94 e4 ldi r25, 0x44 ; 68 20f80: a2 cf rjmp .-188 ; 0x20ec6 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)); 20f82: 86 e6 ldi r24, 0x66 ; 102 20f84: 94 e4 ldi r25, 0x44 ; 68 20f86: 96 cf rjmp .-212 ; 0x20eb4 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)); 20f88: 83 e5 ldi r24, 0x53 ; 83 20f8a: 94 e4 ldi r25, 0x44 ; 68 20f8c: 93 cf rjmp .-218 ; 0x20eb4 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)); 20f8e: 84 e4 ldi r24, 0x44 ; 68 20f90: 94 e4 ldi r25, 0x44 ; 68 20f92: ed cf rjmp .-38 ; 0x20f6e 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)); 20f94: 86 e3 ldi r24, 0x36 ; 54 20f96: 94 e4 ldi r25, 0x44 ; 68 20f98: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20f9c: ac 01 movw r20, r24 20f9e: 62 e0 ldi r22, 0x02 ; 2 20fa0: 80 e0 ldi r24, 0x00 ; 0 20fa2: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 20fa6: 8f e2 ldi r24, 0x2F ; 47 20fa8: 94 e4 ldi r25, 0x44 ; 68 20faa: 8d cf rjmp .-230 ; 0x20ec6 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 20fac: 8d e1 ldi r24, 0x1D ; 29 20fae: 94 e4 ldi r25, 0x44 ; 68 20fb0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20fb4: ac 01 movw r20, r24 20fb6: 62 e0 ldi r22, 0x02 ; 2 20fb8: 80 e0 ldi r24, 0x00 ; 0 20fba: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 20fbe: 83 e1 ldi r24, 0x13 ; 19 20fc0: 94 e4 ldi r25, 0x44 ; 68 20fc2: 81 cf rjmp .-254 ; 0x20ec6 lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20fc4: 81 e0 ldi r24, 0x01 ; 1 20fc6: 94 e4 ldi r25, 0x44 ; 68 20fc8: 69 cf rjmp .-302 ; 0x20e9c 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)); 20fca: 81 e0 ldi r24, 0x01 ; 1 20fcc: 94 e4 ldi r25, 0x44 ; 68 20fce: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20fd2: ac 01 movw r20, r24 20fd4: 62 e0 ldi r22, 0x02 ; 2 20fd6: 80 e0 ldi r24, 0x00 ; 0 20fd8: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 3, _T(MSG_FALSE_TRIGGERING)); 20fdc: 8e ee ldi r24, 0xEE ; 238 20fde: 93 e4 ldi r25, 0x43 ; 67 20fe0: 53 cf rjmp .-346 ; 0x20e88 break; case TestError::FsensorLevel: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 20fe2: 81 e0 ldi r24, 0x01 ; 1 20fe4: 94 e4 ldi r25, 0x44 ; 68 20fe6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 20fea: ac 01 movw r20, r24 20fec: 62 e0 ldi r22, 0x02 ; 2 20fee: 80 e0 ldi r24, 0x00 ; 0 20ff0: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(0, 3); 20ff4: 63 e0 ldi r22, 0x03 ; 3 20ff6: 80 e0 ldi r24, 0x00 ; 0 20ff8: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); 20ffc: 8a ed ldi r24, 0xDA ; 218 20ffe: 93 e4 ldi r25, 0x43 ; 67 21000: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 21004: df 93 push r29 21006: cf 93 push r28 21008: 9f 93 push r25 2100a: 8f 93 push r24 2100c: 0e 94 6e 6f call 0xdedc ; 0xdedc 21010: 0f 90 pop r0 21012: 0f 90 pop r0 21014: 0f 90 pop r0 21016: 0f 90 pop r0 21018: 84 cf rjmp .-248 ; 0x20f22 0002101a : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 2101a: 8f 92 push r8 2101c: 9f 92 push r9 2101e: af 92 push r10 21020: bf 92 push r11 21022: cf 92 push r12 21024: df 92 push r13 21026: ef 92 push r14 21028: ff 92 push r15 2102a: 0f 93 push r16 2102c: 1f 93 push r17 2102e: cf 93 push r28 21030: df 93 push r29 21032: f8 2e mov r15, r24 21034: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 21038: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2103c: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 21040: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 21044: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 21048: 4b 01 movw r8, r22 2104a: 6b 01 movw r12, r22 2104c: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 21050: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 21054: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 21058: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 2105c: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 21060: eb 01 movw r28, r22 uint8_t _progress = 0; int _checked_snapshot = (_isbed) ? degBed() : degHotend(0); 21062: ff 20 and r15, r15 21064: 09 f4 brne .+2 ; 0x21068 21066: a6 c0 rjmp .+332 ; 0x211b4 21068: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 2106a: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 2106c: 24 eb ldi r18, 0xB4 ; 180 2106e: 92 2e mov r9, r18 target_temperature[0] = (_isbed) ? 0 : 200; 21070: 90 e0 ldi r25, 0x00 ; 0 21072: 80 e0 ldi r24, 0x00 ; 0 21074: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 21078: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d target_temperature_bed = (_isbed) ? 100 : 0; 2107c: 84 e6 ldi r24, 0x64 ; 100 2107e: 90 e0 ldi r25, 0x00 ; 0 21080: f1 10 cpse r15, r1 21082: 02 c0 rjmp .+4 ; 0x21088 21084: 90 e0 ldi r25, 0x00 ; 0 21086: 80 e0 ldi r24, 0x00 ; 0 21088: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 2108c: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b thermal_model::reinitialize(); } bool thermal_model_enabled() { return thermal_model::enabled; 21090: e0 90 20 05 lds r14, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> #ifdef THERMAL_MODEL bool tm_was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); 21094: 80 e0 ldi r24, 0x00 ; 0 21096: 0f 94 81 48 call 0x29102 ; 0x29102 #endif //THERMAL_MODEL manage_heater(); 2109a: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 2109e: 81 e0 ldi r24, 0x01 ; 1 210a0: 0e 94 e2 8b call 0x117c4 ; 0x117c4 for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 210a4: b1 2c mov r11, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 210a6: 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 210a8: 85 e0 ldi r24, 0x05 ; 5 210aa: 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) 210ac: 80 91 14 05 lds r24, 0x0514 ; 0x800514 210b0: 81 11 cpse r24, r1 210b2: 1c c0 rjmp .+56 ; 0x210ec { manage_heater(); 210b4: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 210b8: 81 e0 ldi r24, 0x01 ; 1 210ba: 0e 94 e2 8b call 0x117c4 ; 0x117c4 _progress = (_isbed? 210be: 00 e9 ldi r16, 0x90 ; 144 210c0: 11 e0 ldi r17, 0x01 ; 1 210c2: 20 e0 ldi r18, 0x00 ; 0 210c4: 42 e0 ldi r20, 0x02 ; 2 210c6: 6a 2d mov r22, r10 210c8: 87 e0 ldi r24, 0x07 ; 7 210ca: f1 10 cpse r15, r1 210cc: 01 c0 rjmp .+2 ; 0x210d0 210ce: 88 e0 ldi r24, 0x08 ; 8 210d0: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 210d4: 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 210d6: 8b 2d mov r24, r11 210d8: 68 2d mov r22, r8 210da: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 210de: 91 11 cpse r25, r1 210e0: 02 c0 rjmp .+4 ; 0x210e6 210e2: 0e 94 e9 78 call 0xf1d2 ; 0xf1d2 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 210e6: b3 94 inc r11 210e8: b9 10 cpse r11, r9 210ea: e0 cf rjmp .-64 ; 0x210ac MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 210ec: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 210f0: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d target_temperature_bed = 0; 210f4: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 210f8: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b manage_heater(); 210fc: 0f 94 a0 4e call 0x29d40 ; 0x29d40 21100: b6 01 movw r22, r12 21102: dd 0c add r13, r13 21104: 88 0b sbc r24, r24 21106: 99 0b sbc r25, r25 21108: 4e 01 movw r8, r28 2110a: dd 0f add r29, r29 2110c: aa 08 sbc r10, r10 2110e: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 21110: ff 20 and r15, r15 21112: 09 f4 brne .+2 ; 0x21116 21114: 54 c0 rjmp .+168 ; 0x211be 21116: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 2111a: 9b 01 movw r18, r22 2111c: ac 01 movw r20, r24 2111e: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 21122: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 21126: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 2112a: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 2112e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 21132: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 21136: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 21138: c5 01 movw r24, r10 2113a: b4 01 movw r22, r8 2113c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 21140: 9b 01 movw r18, r22 21142: ac 01 movw r20, r24 21144: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 21148: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2114c: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 21150: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 21154: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 21158: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 2115c: 10 91 14 05 lds r17, 0x0514 ; 0x800514 21160: 11 11 cpse r17, r1 21162: 0c c0 rjmp .+24 ; 0x2117c 21164: f1 10 cpse r15, r1 21166: 4b c0 rjmp .+150 ; 0x211fe 21168: 69 30 cpi r22, 0x09 ; 9 2116a: 71 05 cpc r23, r1 2116c: 0c f0 brlt .+2 ; 0x21170 2116e: 4d c0 rjmp .+154 ; 0x2120a { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 21170: 8e e1 ldi r24, 0x1E ; 30 21172: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 21174: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 21176: c8 17 cp r28, r24 21178: d9 07 cpc r29, r25 2117a: 34 f4 brge .+12 ; 0x21188 _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 2117c: 64 ef ldi r22, 0xF4 ; 244 2117e: 72 e0 ldi r23, 0x02 ; 2 21180: 80 e0 ldi r24, 0x00 ; 0 21182: 0f 94 f6 06 call 0x20dec ; 0x20dec MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 21186: 10 e0 ldi r17, 0x00 ; 0 { lcd_selftest_error(TestError::Bed, "", ""); } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); 21188: 8e 2d mov r24, r14 2118a: 0f 94 81 48 call 0x29102 ; 0x29102 #endif //THERMAL_MODEL manage_heater(); 2118e: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 21192: 81 e0 ldi r24, 0x01 ; 1 21194: 0e 94 e2 8b call 0x117c4 ; 0x117c4 return _stepresult; } 21198: 81 2f mov r24, r17 2119a: df 91 pop r29 2119c: cf 91 pop r28 2119e: 1f 91 pop r17 211a0: 0f 91 pop r16 211a2: ff 90 pop r15 211a4: ef 90 pop r14 211a6: df 90 pop r13 211a8: cf 90 pop r12 211aa: bf 90 pop r11 211ac: af 90 pop r10 211ae: 9f 90 pop r9 211b0: 8f 90 pop r8 211b2: 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 211b4: 9c e3 ldi r25, 0x3C ; 60 211b6: 99 2e mov r9, r25 target_temperature[0] = (_isbed) ? 0 : 200; 211b8: 88 ec ldi r24, 0xC8 ; 200 211ba: 90 e0 ldi r25, 0x00 ; 0 211bc: 5b cf rjmp .-330 ; 0x21074 target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 211be: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 211c2: 9b 01 movw r18, r22 211c4: ac 01 movw r20, r24 211c6: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 211ca: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 211ce: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 211d2: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 211d6: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 211da: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 211de: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 211e0: c5 01 movw r24, r10 211e2: b4 01 movw r22, r8 211e4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 211e8: 9b 01 movw r18, r22 211ea: ac 01 movw r20, r24 211ec: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 211f0: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 211f4: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 211f8: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 211fc: ab cf rjmp .-170 ; 0x21154 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 211fe: 89 e0 ldi r24, 0x09 ; 9 21200: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 21202: 6e 31 cpi r22, 0x1E ; 30 21204: 71 05 cpc r23, r1 21206: 0c f4 brge .+2 ; 0x2120a 21208: b5 cf rjmp .-150 ; 0x21174 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 2120a: 64 ef ldi r22, 0xF4 ; 244 2120c: 72 e0 ldi r23, 0x02 ; 2 2120e: 81 e0 ldi r24, 0x01 ; 1 21210: 0f 94 f6 06 call 0x20dec ; 0x20dec 21214: b9 cf rjmp .-142 ; 0x21188 00021216 : plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); crashdet_use_eeprom_setting(); } static bool lcd_selfcheck_axis_sg(uint8_t axis) { 21216: 2f 92 push r2 21218: 3f 92 push r3 2121a: 4f 92 push r4 2121c: 5f 92 push r5 2121e: 6f 92 push r6 21220: 7f 92 push r7 21222: 8f 92 push r8 21224: 9f 92 push r9 21226: af 92 push r10 21228: bf 92 push r11 2122a: cf 92 push r12 2122c: df 92 push r13 2122e: ef 92 push r14 21230: ff 92 push r15 21232: 1f 93 push r17 21234: cf 93 push r28 21236: df 93 push r29 21238: 00 d0 rcall .+0 ; 0x2123a 2123a: 00 d0 rcall .+0 ; 0x2123c 2123c: 1f 92 push r1 2123e: cd b7 in r28, 0x3d ; 61 21240: de b7 in r29, 0x3e ; 62 21242: 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) { 21244: 68 2e mov r6, r24 21246: 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; 21248: 81 2c mov r8, r1 2124a: 20 e8 ldi r18, 0x80 ; 128 2124c: 92 2e mov r9, r18 2124e: 2c e5 ldi r18, 0x5C ; 92 21250: a2 2e mov r10, r18 21252: 23 e4 ldi r18, 0x43 ; 67 21254: 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) { 21256: 81 30 cpi r24, 0x01 ; 1 21258: 31 f0 breq .+12 ; 0x21266 case 0: axis_length = X_MAX_POS; break; 2125a: 81 2c mov r8, r1 2125c: 91 2c mov r9, r1 2125e: 9f e7 ldi r25, 0x7F ; 127 21260: a9 2e mov r10, r25 21262: 93 e4 ldi r25, 0x43 ; 67 21264: 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; 21266: 10 92 5c 02 sts 0x025C, r1 ; 0x80025c tmc2130_home_exit(); 2126a: 0f 94 64 3b call 0x276c8 ; 0x276c8 } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 2126e: 81 e0 ldi r24, 0x01 ; 1 21270: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> enable_endstops(true); raise_z_above(MESH_HOME_Z_SEARCH); 21274: 60 e0 ldi r22, 0x00 ; 0 21276: 70 e0 ldi r23, 0x00 ; 0 21278: 80 ea ldi r24, 0xA0 ; 160 2127a: 90 e4 ldi r25, 0x40 ; 64 2127c: 0e 94 15 6f call 0xde2a ; 0xde2a tmc2130_home_enter(1 << axis); 21280: 81 e0 ldi r24, 0x01 ; 1 21282: 01 2e mov r0, r17 21284: 01 c0 rjmp .+2 ; 0x21288 21286: 88 0f add r24, r24 21288: 0a 94 dec r0 2128a: ea f7 brpl .-6 ; 0x21286 2128c: 0f 94 93 3b call 0x27726 ; 0x27726 // first axis length measurement begin current_position[axis] -= (axis_length + margin); 21290: 20 e0 ldi r18, 0x00 ; 0 21292: 30 e0 ldi r19, 0x00 ; 0 21294: 40 e7 ldi r20, 0x70 ; 112 21296: 52 e4 ldi r21, 0x42 ; 66 21298: c5 01 movw r24, r10 2129a: b4 01 movw r22, r8 2129c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 212a0: 69 83 std Y+1, r22 ; 0x01 212a2: 7a 83 std Y+2, r23 ; 0x02 212a4: 8b 83 std Y+3, r24 ; 0x03 212a6: 9c 83 std Y+4, r25 ; 0x04 212a8: 13 01 movw r2, r6 212aa: 22 0c add r2, r2 212ac: 33 1c adc r3, r3 212ae: 22 0c add r2, r2 212b0: 33 1c adc r3, r3 212b2: c1 01 movw r24, r2 212b4: 8d 5b subi r24, 0xBD ; 189 212b6: 98 4f sbci r25, 0xF8 ; 248 212b8: 9e 83 std Y+6, r25 ; 0x06 212ba: 8d 83 std Y+5, r24 ; 0x05 212bc: 29 81 ldd r18, Y+1 ; 0x01 212be: 3a 81 ldd r19, Y+2 ; 0x02 212c0: 4b 81 ldd r20, Y+3 ; 0x03 212c2: 5c 81 ldd r21, Y+4 ; 0x04 212c4: fc 01 movw r30, r24 212c6: 60 81 ld r22, Z 212c8: 71 81 ldd r23, Z+1 ; 0x01 212ca: 82 81 ldd r24, Z+2 ; 0x02 212cc: 93 81 ldd r25, Z+3 ; 0x03 212ce: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 212d2: ed 81 ldd r30, Y+5 ; 0x05 212d4: fe 81 ldd r31, Y+6 ; 0x06 212d6: 60 83 st Z, r22 212d8: 71 83 std Z+1, r23 ; 0x01 212da: 82 83 std Z+2, r24 ; 0x02 212dc: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 212de: 60 e0 ldi r22, 0x00 ; 0 212e0: 70 e0 ldi r23, 0x00 ; 0 212e2: 84 e3 ldi r24, 0x34 ; 52 212e4: 92 e4 ldi r25, 0x42 ; 66 212e6: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 212ea: 0f 94 2c 59 call 0x2b258 ; 0x2b258 #endif } void tmc2130_sg_measure_start(uint8_t axis) { tmc2130_sg_measure = axis; 212ee: 10 93 3b 02 sts 0x023B, r17 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.489> tmc2130_sg_measure_cnt = 0; 212f2: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 212f6: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 212fa: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 212fe: 10 92 cc 03 sts 0x03CC, r1 ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> tmc2130_sg_measure_val = 0; 21302: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490> 21306: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 2130a: 10 92 cf 03 sts 0x03CF, r1 ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 2130e: 10 92 d0 03 sts 0x03D0, r1 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> tmc2130_sg_measure_start(axis); current_position_init = st_get_position_mm(axis); 21312: 81 2f mov r24, r17 21314: 0f 94 18 59 call 0x2b230 ; 0x2b230 21318: 6b 01 movw r12, r22 2131a: 7c 01 movw r14, r24 current_position[axis] += 2 * margin; 2131c: 20 e0 ldi r18, 0x00 ; 0 2131e: 30 e0 ldi r19, 0x00 ; 0 21320: 40 ef ldi r20, 0xF0 ; 240 21322: 52 e4 ldi r21, 0x42 ; 66 21324: ed 81 ldd r30, Y+5 ; 0x05 21326: fe 81 ldd r31, Y+6 ; 0x06 21328: 60 81 ld r22, Z 2132a: 71 81 ldd r23, Z+1 ; 0x01 2132c: 82 81 ldd r24, Z+2 ; 0x02 2132e: 93 81 ldd r25, Z+3 ; 0x03 21330: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 21334: ed 81 ldd r30, Y+5 ; 0x05 21336: fe 81 ldd r31, Y+6 ; 0x06 21338: 60 83 st Z, r22 2133a: 71 83 std Z+1, r23 ; 0x01 2133c: 82 83 std Z+2, r24 ; 0x02 2133e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21340: 60 e0 ldi r22, 0x00 ; 0 21342: 70 e0 ldi r23, 0x00 ; 0 21344: 84 e3 ldi r24, 0x34 ; 52 21346: 92 e4 ldi r25, 0x42 ; 66 21348: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 2134c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[axis] += axis_length; 21350: a5 01 movw r20, r10 21352: 94 01 movw r18, r8 21354: ed 81 ldd r30, Y+5 ; 0x05 21356: fe 81 ldd r31, Y+6 ; 0x06 21358: 60 81 ld r22, Z 2135a: 71 81 ldd r23, Z+1 ; 0x01 2135c: 82 81 ldd r24, Z+2 ; 0x02 2135e: 93 81 ldd r25, Z+3 ; 0x03 21360: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 21364: ed 81 ldd r30, Y+5 ; 0x05 21366: fe 81 ldd r31, Y+6 ; 0x06 21368: 60 83 st Z, r22 2136a: 71 83 std Z+1, r23 ; 0x01 2136c: 82 83 std Z+2, r24 ; 0x02 2136e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21370: 60 e0 ldi r22, 0x00 ; 0 21372: 70 e0 ldi r23, 0x00 ; 0 21374: 84 e3 ldi r24, 0x34 ; 52 21376: 92 e4 ldi r25, 0x42 ; 66 21378: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 2137c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } uint16_t tmc2130_sg_measure_stop() { tmc2130_sg_measure = 0xff; 21380: 8f ef ldi r24, 0xFF ; 255 21382: 80 93 3b 02 sts 0x023B, r24 ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.489> return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; 21386: 60 91 cd 03 lds r22, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490> 2138a: 70 91 ce 03 lds r23, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 2138e: 80 91 cf 03 lds r24, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 21392: 90 91 d0 03 lds r25, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> 21396: 20 91 c9 03 lds r18, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 2139a: 30 91 ca 03 lds r19, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 2139e: 40 91 cb 03 lds r20, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 213a2: 50 91 cc 03 lds r21, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> 213a6: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 213aa: 2d 83 std Y+5, r18 ; 0x05 213ac: 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); 213ae: 3f 93 push r19 213b0: 2f 93 push r18 213b2: f8 e5 ldi r31, 0x58 ; 88 213b4: 6f 0e add r6, r31 213b6: 71 1c adc r7, r1 213b8: 7f 92 push r7 213ba: 6f 92 push r6 213bc: 89 ef ldi r24, 0xF9 ; 249 213be: 9b e8 ldi r25, 0x8B ; 139 213c0: 9f 93 push r25 213c2: 8f 93 push r24 213c4: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 eeprom_write_word_notify(((uint16_t*)((axis == X_AXIS)?EEPROM_BELTSTATUS_X:EEPROM_BELTSTATUS_Y)), sg1); 213c8: 0f 90 pop r0 213ca: 0f 90 pop r0 213cc: 0f 90 pop r0 213ce: 0f 90 pop r0 213d0: 0f 90 pop r0 213d2: 0f 90 pop r0 213d4: 8b e5 ldi r24, 0x5B ; 91 213d6: 9f e0 ldi r25, 0x0F ; 15 213d8: 11 11 cpse r17, r1 213da: 02 c0 rjmp .+4 ; 0x213e0 213dc: 8d e5 ldi r24, 0x5D ; 93 213de: 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); 213e0: 6d 81 ldd r22, Y+5 ; 0x05 213e2: 7f 81 ldd r23, Y+7 ; 0x07 213e4: 0f 94 ef dd call 0x3bbde ; 0x3bbde current_position_final = st_get_position_mm(axis); 213e8: 81 2f mov r24, r17 213ea: 0f 94 18 59 call 0x2b230 ; 0x2b230 213ee: 2b 01 movw r4, r22 213f0: 3c 01 movw r6, r24 measured_axis_length[0] = fabs(current_position_final - current_position_init); 213f2: a7 01 movw r20, r14 213f4: 96 01 movw r18, r12 213f6: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 213fa: 6b 01 movw r12, r22 213fc: 7c 01 movw r14, r24 213fe: e8 94 clt 21400: f7 f8 bld r15, 7 // first measurement end and second measurement begin current_position[axis] -= margin; 21402: c1 01 movw r24, r2 21404: 8d 5b subi r24, 0xBD ; 189 21406: 98 4f sbci r25, 0xF8 ; 248 21408: 9e 83 std Y+6, r25 ; 0x06 2140a: 8d 83 std Y+5, r24 ; 0x05 2140c: 20 e0 ldi r18, 0x00 ; 0 2140e: 30 e0 ldi r19, 0x00 ; 0 21410: 40 e7 ldi r20, 0x70 ; 112 21412: 52 e4 ldi r21, 0x42 ; 66 21414: fc 01 movw r30, r24 21416: 60 81 ld r22, Z 21418: 71 81 ldd r23, Z+1 ; 0x01 2141a: 82 81 ldd r24, Z+2 ; 0x02 2141c: 93 81 ldd r25, Z+3 ; 0x03 2141e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 21422: ed 81 ldd r30, Y+5 ; 0x05 21424: fe 81 ldd r31, Y+6 ; 0x06 21426: 60 83 st Z, r22 21428: 71 83 std Z+1, r23 ; 0x01 2142a: 82 83 std Z+2, r24 ; 0x02 2142c: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 2142e: 60 e0 ldi r22, 0x00 ; 0 21430: 70 e0 ldi r23, 0x00 ; 0 21432: 84 e3 ldi r24, 0x34 ; 52 21434: 92 e4 ldi r25, 0x42 ; 66 21436: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 2143a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[axis] -= (axis_length + margin); 2143e: 29 81 ldd r18, Y+1 ; 0x01 21440: 3a 81 ldd r19, Y+2 ; 0x02 21442: 4b 81 ldd r20, Y+3 ; 0x03 21444: 5c 81 ldd r21, Y+4 ; 0x04 21446: ed 81 ldd r30, Y+5 ; 0x05 21448: fe 81 ldd r31, Y+6 ; 0x06 2144a: 60 81 ld r22, Z 2144c: 71 81 ldd r23, Z+1 ; 0x01 2144e: 82 81 ldd r24, Z+2 ; 0x02 21450: 93 81 ldd r25, Z+3 ; 0x03 21452: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 21456: ed 81 ldd r30, Y+5 ; 0x05 21458: fe 81 ldd r31, Y+6 ; 0x06 2145a: 60 83 st Z, r22 2145c: 71 83 std Z+1, r23 ; 0x01 2145e: 82 83 std Z+2, r24 ; 0x02 21460: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 21462: 60 e0 ldi r22, 0x00 ; 0 21464: 70 e0 ldi r23, 0x00 ; 0 21466: 84 e3 ldi r24, 0x34 ; 52 21468: 92 e4 ldi r25, 0x42 ; 66 2146a: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 2146e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position_init = st_get_position_mm(axis); 21472: 81 2f mov r24, r17 21474: 0f 94 18 59 call 0x2b230 ; 0x2b230 21478: 9b 01 movw r18, r22 2147a: ac 01 movw r20, r24 measured_axis_length[1] = fabs(current_position_final - current_position_init); 2147c: c3 01 movw r24, r6 2147e: b2 01 movw r22, r4 21480: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 21484: 2b 01 movw r4, r22 21486: 3c 01 movw r6, r24 21488: e8 94 clt 2148a: 77 f8 bld r7, 7 tmc2130_home_exit(); 2148c: 0f 94 64 3b call 0x276c8 ; 0x276c8 //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]); 21490: ff 92 push r15 21492: ef 92 push r14 21494: df 92 push r13 21496: cf 92 push r12 21498: 88 e9 ldi r24, 0x98 ; 152 2149a: 9b e6 ldi r25, 0x6B ; 107 2149c: 9f 93 push r25 2149e: 8f 93 push r24 214a0: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 214a4: a5 01 movw r20, r10 214a6: 94 01 movw r18, r8 214a8: c7 01 movw r24, r14 214aa: b6 01 movw r22, r12 214ac: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 214b0: 9f 77 andi r25, 0x7F ; 127 214b2: 0f 90 pop r0 214b4: 0f 90 pop r0 214b6: 0f 90 pop r0 214b8: 0f 90 pop r0 214ba: 0f 90 pop r0 214bc: 0f 90 pop r0 214be: 20 e0 ldi r18, 0x00 ; 0 214c0: 30 e0 ldi r19, 0x00 ; 0 214c2: 40 ea ldi r20, 0xA0 ; 160 214c4: 50 e4 ldi r21, 0x40 ; 64 214c6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 214ca: 18 16 cp r1, r24 214cc: 0c f4 brge .+2 ; 0x214d0 214ce: 53 c0 rjmp .+166 ; 0x21576 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]); 214d0: 7f 92 push r7 214d2: 6f 92 push r6 214d4: 5f 92 push r5 214d6: 4f 92 push r4 214d8: 88 e9 ldi r24, 0x98 ; 152 214da: 9b e6 ldi r25, 0x6B ; 107 214dc: 9f 93 push r25 214de: 8f 93 push r24 214e0: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if (fabs(measured_axis_length[i] - axis_length) > max_error_mm) { 214e4: a5 01 movw r20, r10 214e6: 94 01 movw r18, r8 214e8: c3 01 movw r24, r6 214ea: b2 01 movw r22, r4 214ec: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 214f0: 9f 77 andi r25, 0x7F ; 127 214f2: 0f 90 pop r0 214f4: 0f 90 pop r0 214f6: 0f 90 pop r0 214f8: 0f 90 pop r0 214fa: 0f 90 pop r0 214fc: 0f 90 pop r0 214fe: 20 e0 ldi r18, 0x00 ; 0 21500: 30 e0 ldi r19, 0x00 ; 0 21502: 40 ea ldi r20, 0xA0 ; 160 21504: 50 e4 ldi r21, 0x40 ; 64 21506: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 2150a: 18 16 cp r1, r24 2150c: a4 f1 brlt .+104 ; 0x21576 endstops_hit_on_purpose(); return false; } } printf_P(_N("Axis length difference:%.3f\n"), fabs(measured_axis_length[0] - measured_axis_length[1])); 2150e: a3 01 movw r20, r6 21510: 92 01 movw r18, r4 21512: c7 01 movw r24, r14 21514: b6 01 movw r22, r12 21516: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 2151a: 6b 01 movw r12, r22 2151c: 7c 01 movw r14, r24 2151e: e8 94 clt 21520: f7 f8 bld r15, 7 21522: ff 92 push r15 21524: ef 92 push r14 21526: df 92 push r13 21528: cf 92 push r12 2152a: 8b e7 ldi r24, 0x7B ; 123 2152c: 9b e6 ldi r25, 0x6B ; 107 2152e: 9f 93 push r25 21530: 8f 93 push r24 21532: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if (fabs(measured_axis_length[0] - measured_axis_length[1]) > 1) { //check if difference between first and second measurement is low 21536: 0f 90 pop r0 21538: 0f 90 pop r0 2153a: 0f 90 pop r0 2153c: 0f 90 pop r0 2153e: 0f 90 pop r0 21540: 0f 90 pop r0 21542: 20 e0 ldi r18, 0x00 ; 0 21544: 30 e0 ldi r19, 0x00 ; 0 21546: 40 e8 ldi r20, 0x80 ; 128 21548: 5f e3 ldi r21, 0x3F ; 63 2154a: c7 01 movw r24, r14 2154c: b6 01 movw r22, r12 2154e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 21552: 18 16 cp r1, r24 21554: 0c f4 brge .+2 ; 0x21558 21556: 44 c0 rjmp .+136 ; 0x215e0 plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return false; } current_position[axis] = 0; 21558: ed 81 ldd r30, Y+5 ; 0x05 2155a: fe 81 ldd r31, Y+6 ; 0x06 2155c: 10 82 st Z, r1 2155e: 11 82 std Z+1, r1 ; 0x01 21560: 12 82 std Z+2, r1 ; 0x02 21562: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 21564: 0f 94 53 b9 call 0x372a6 ; 0x372a6 reset_crash_det(axis); 21568: 81 2f mov r24, r17 2156a: 0e 94 44 d7 call 0x1ae88 ; 0x1ae88 endstops_hit_on_purpose(); 2156e: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec return true; 21572: 81 e0 ldi r24, 0x01 ; 1 21574: 1d c0 rjmp .+58 ; 0x215b0 21576: 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"; 2157a: 67 ef ldi r22, 0xF7 ; 247 2157c: 72 e0 ldi r23, 0x02 ; 2 2157e: 11 30 cpi r17, 0x01 ; 1 21580: 11 f0 breq .+4 ; 0x21586 21582: 65 ef ldi r22, 0xF5 ; 245 21584: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Axis, _error_1, ""); 21586: 88 e0 ldi r24, 0x08 ; 8 21588: 0f 94 f6 06 call 0x20dec ; 0x20dec current_position[axis] = 0; 2158c: f1 01 movw r30, r2 2158e: ed 5b subi r30, 0xBD ; 189 21590: f8 4f sbci r31, 0xF8 ; 248 21592: 10 82 st Z, r1 21594: 11 82 std Z+1, r1 ; 0x01 21596: 12 82 std Z+2, r1 ; 0x02 21598: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2159a: 0f 94 53 b9 call 0x372a6 ; 0x372a6 reset_crash_det(axis); 2159e: 81 2f mov r24, r17 215a0: 0e 94 44 d7 call 0x1ae88 ; 0x1ae88 215a4: 81 e0 ldi r24, 0x01 ; 1 215a6: 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(); 215aa: 0f 94 76 64 call 0x2c8ec ; 0x2c8ec return false; 215ae: 80 e0 ldi r24, 0x00 ; 0 current_position[axis] = 0; plan_set_position_curposXYZE(); reset_crash_det(axis); endstops_hit_on_purpose(); return true; } 215b0: 27 96 adiw r28, 0x07 ; 7 215b2: 0f b6 in r0, 0x3f ; 63 215b4: f8 94 cli 215b6: de bf out 0x3e, r29 ; 62 215b8: 0f be out 0x3f, r0 ; 63 215ba: cd bf out 0x3d, r28 ; 61 215bc: df 91 pop r29 215be: cf 91 pop r28 215c0: 1f 91 pop r17 215c2: ff 90 pop r15 215c4: ef 90 pop r14 215c6: df 90 pop r13 215c8: cf 90 pop r12 215ca: bf 90 pop r11 215cc: af 90 pop r10 215ce: 9f 90 pop r9 215d0: 8f 90 pop r8 215d2: 7f 90 pop r7 215d4: 6f 90 pop r6 215d6: 5f 90 pop r5 215d8: 4f 90 pop r4 215da: 3f 90 pop r3 215dc: 2f 90 pop r2 215de: 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"; 215e0: 67 ef ldi r22, 0xF7 ; 247 215e2: 72 e0 ldi r23, 0x02 ; 2 215e4: 11 30 cpi r17, 0x01 ; 1 215e6: 11 f0 breq .+4 ; 0x215ec 215e8: 65 ef ldi r22, 0xF5 ; 245 215ea: 72 e0 ldi r23, 0x02 ; 2 if (axis == Z_AXIS) _error_1 = "Z"; lcd_selftest_error(TestError::Pulley, _error_1, ""); 215ec: 87 e0 ldi r24, 0x07 ; 7 215ee: 0f 94 f6 06 call 0x20dec ; 0x20dec current_position[axis] = 0; 215f2: f1 01 movw r30, r2 215f4: ed 5b subi r30, 0xBD ; 189 215f6: f8 4f sbci r31, 0xF8 ; 248 215f8: 10 82 st Z, r1 215fa: 11 82 std Z+1, r1 ; 0x01 215fc: 12 82 std Z+2, r1 ; 0x02 215fe: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 21600: 0f 94 53 b9 call 0x372a6 ; 0x372a6 reset_crash_det(axis); 21604: 81 2f mov r24, r17 21606: 0e 94 44 d7 call 0x1ae88 ; 0x1ae88 2160a: cf cf rjmp .-98 ; 0x215aa 0002160c : default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } #ifdef TMC2130 static void lcd_belttest_v() { 2160c: 0f 93 push r16 2160e: 1f 93 push r17 21610: cf 93 push r28 21612: df 93 push r29 menu_back_if_clicked(); } void lcd_belttest() { lcd_clear(); 21614: 0e 94 c8 6f call 0xdf90 ; 0xdf90 // Belttest requires high power mode. Enable it. FORCE_HIGH_POWER_START; 21618: 81 e0 ldi r24, 0x01 ; 1 2161a: 0e 94 65 67 call 0xceca ; 0xceca uint16_t X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 2161e: 8d e5 ldi r24, 0x5D ; 93 21620: 9f e0 ldi r25, 0x0F ; 15 21622: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 21626: ec 01 movw r28, r24 uint16_t Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 21628: 8b e5 ldi r24, 0x5B ; 91 2162a: 9f e0 ldi r25, 0x0F ; 15 2162c: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 21630: 18 2f mov r17, r24 21632: 09 2f mov r16, r25 lcd_puts_P(_T(MSG_CHECKING_X)); 21634: 84 ee ldi r24, 0xE4 ; 228 21636: 9f e3 ldi r25, 0x3F ; 63 21638: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2163c: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_set_cursor(0,1), lcd_printf_P(PSTR("X: %u -> ..."),X); 21640: 61 e0 ldi r22, 0x01 ; 1 21642: 80 e0 ldi r24, 0x00 ; 0 21644: 0e 94 95 6f call 0xdf2a ; 0xdf2a 21648: df 93 push r29 2164a: cf 93 push r28 2164c: 84 e5 ldi r24, 0x54 ; 84 2164e: 9b e8 ldi r25, 0x8B ; 139 21650: 9f 93 push r25 21652: 8f 93 push r24 21654: 0e 94 6e 6f call 0xdedc ; 0xdedc KEEPALIVE_STATE(IN_HANDLER); 21658: 82 e0 ldi r24, 0x02 ; 2 2165a: 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)){ 2165e: 80 e0 ldi r24, 0x00 ; 0 21660: 0f 94 0b 09 call 0x21216 ; 0x21216 21664: 0f 90 pop r0 21666: 0f 90 pop r0 21668: 0f 90 pop r0 2166a: 0f 90 pop r0 2166c: 88 23 and r24, r24 2166e: 09 f4 brne .+2 ; 0x21672 21670: 45 c0 rjmp .+138 ; 0x216fc X = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_X)); 21672: 8d e5 ldi r24, 0x5D ; 93 21674: 9f e0 ldi r25, 0x0F ; 15 21676: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 2167a: ec 01 movw r28, r24 lcd_set_cursor(10, 1); 2167c: 61 e0 ldi r22, 0x01 ; 1 2167e: 8a e0 ldi r24, 0x0A ; 10 21680: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 21684: be 01 movw r22, r28 21686: 90 e0 ldi r25, 0x00 ; 0 21688: 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); 2168a: 4a e0 ldi r20, 0x0A ; 10 2168c: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 lcd_print(X); // Show new X value next to old one. lcd_puts_at_P(0, 2, _T(MSG_CHECKING_Y)); 21690: 82 ed ldi r24, 0xD2 ; 210 21692: 9f e3 ldi r25, 0x3F ; 63 21694: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 21698: ac 01 movw r20, r24 2169a: 62 e0 ldi r22, 0x02 ; 2 2169c: 80 e0 ldi r24, 0x00 ; 0 2169e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(0, 3), lcd_printf_P(PSTR("Y: %u -> ..."),Y); 216a2: 63 e0 ldi r22, 0x03 ; 3 216a4: 80 e0 ldi r24, 0x00 ; 0 216a6: 0e 94 95 6f call 0xdf2a ; 0xdf2a 216aa: 0f 93 push r16 216ac: 1f 93 push r17 216ae: 87 e4 ldi r24, 0x47 ; 71 216b0: 9b e8 ldi r25, 0x8B ; 139 216b2: 9f 93 push r25 216b4: 8f 93 push r24 216b6: 0e 94 6e 6f call 0xdedc ; 0xdedc if (lcd_selfcheck_axis_sg(Y_AXIS)) 216ba: 81 e0 ldi r24, 0x01 ; 1 216bc: 0f 94 0b 09 call 0x21216 ; 0x21216 216c0: 0f 90 pop r0 216c2: 0f 90 pop r0 216c4: 0f 90 pop r0 216c6: 0f 90 pop r0 216c8: 88 23 and r24, r24 216ca: c1 f0 breq .+48 ; 0x216fc { Y = eeprom_read_word((uint16_t*)(EEPROM_BELTSTATUS_Y)); 216cc: 8b e5 ldi r24, 0x5B ; 91 216ce: 9f e0 ldi r25, 0x0F ; 15 216d0: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 216d4: ec 01 movw r28, r24 lcd_set_cursor(10, 3); 216d6: 63 e0 ldi r22, 0x03 ; 3 216d8: 8a e0 ldi r24, 0x0A ; 10 216da: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print((long) n, base); } void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); 216de: be 01 movw r22, r28 216e0: 90 e0 ldi r25, 0x00 ; 0 216e2: 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); 216e4: 4a e0 ldi r20, 0x0A ; 10 216e6: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 lcd_print(Y); lcd_putc_at(19, 3, LCD_STR_UPLEVEL[0]); 216ea: 43 e8 ldi r20, 0x83 ; 131 216ec: 63 e0 ldi r22, 0x03 ; 3 216ee: 83 e1 ldi r24, 0x13 ; 19 216f0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_wait_for_click_delay(10); 216f4: 8a e0 ldi r24, 0x0A ; 10 216f6: 90 e0 ldi r25, 0x00 ; 0 216f8: 0f 94 73 50 call 0x2a0e6 ; 0x2a0e6 } } FORCE_HIGH_POWER_END; 216fc: 80 e0 ldi r24, 0x00 ; 0 216fe: 0e 94 65 67 call 0xceca ; 0xceca KEEPALIVE_STATE(NOT_BUSY); 21702: 81 e0 ldi r24, 0x01 ; 1 21704: 80 93 96 02 sts 0x0296, r24 ; 0x800296 #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); } 21708: df 91 pop r29 2170a: cf 91 pop r28 2170c: 1f 91 pop r17 2170e: 0f 91 pop r16 } #ifdef TMC2130 static void lcd_belttest_v() { lcd_belttest(); menu_back_if_clicked(); 21710: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00021714 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 21714: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 21718: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 2171c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> lcd_reset_alert_level(); // ensure thermal issues (temp or fan) are resolved before we allow to resume if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() 21720: 81 11 cpse r24, r1 21722: 32 c0 rjmp .+100 ; 0x21788 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 21724: 80 91 38 02 lds r24, 0x0238 ; 0x800238 21728: 81 11 cpse r24, r1 2172a: 02 c0 rjmp .+4 ; 0x21730 #endif ) { return false; // abort if error persists } return true; 2172c: 81 e0 ldi r24, 0x01 ; 1 2172e: 08 95 ret static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); 21730: 8f ef ldi r24, 0xFF ; 255 21732: 0e 94 96 d0 call 0x1a12c ; 0x1a12c setExtruderAutoFanState(3); //force enables the hotend fan 21736: 83 e0 ldi r24, 0x03 ; 3 21738: 0e 94 d1 76 call 0xeda2 ; 0xeda2 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 2173c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 21740: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 21744: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 21748: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 2174c: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f fan_measuring = true; 21750: 81 e0 ldi r24, 0x01 ; 1 21752: 80 93 36 05 sts 0x0536, r24 ; 0x800536 #endif //FAN_SOFT_PWM _delay(1000); //delay_keep_alive would turn off hotend fan, because temerature is too low (maybe) 21756: 68 ee ldi r22, 0xE8 ; 232 21758: 73 e0 ldi r23, 0x03 ; 3 2175a: 80 e0 ldi r24, 0x00 ; 0 2175c: 90 e0 ldi r25, 0x00 ; 0 2175e: 0f 94 92 3d call 0x27b24 ; 0x27b24 manage_heater(); 21762: 0f 94 a0 4e call 0x29d40 ; 0x29d40 setExtruderAutoFanState(1); //releases lock on the hotend fan 21766: 81 e0 ldi r24, 0x01 ; 1 21768: 0e 94 d1 76 call 0xeda2 ; 0xeda2 lcd_selftest_setfan(0); 2176c: 80 e0 ldi r24, 0x00 ; 0 2176e: 0e 94 96 d0 call 0x1a12c ; 0x1a12c #ifdef TACH_0 if (fan_speed[0] <= 20) { //hotend fan error 21772: 80 91 b1 04 lds r24, 0x04B1 ; 0x8004b1 21776: 90 91 b2 04 lds r25, 0x04B2 ; 0x8004b2 2177a: 45 97 sbiw r24, 0x15 ; 21 2177c: 3c f4 brge .+14 ; 0x2178c LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 2177e: 62 e0 ldi r22, 0x02 ; 2 21780: 8f e0 ldi r24, 0x0F ; 15 21782: 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); 21784: 0f 94 c7 06 call 0x20d8e ; 0x20d8e if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 21788: 80 e0 ldi r24, 0x00 ; 0 } return true; } 2178a: 08 95 ret LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); return 1; } #endif #ifdef TACH_1 if (fan_speed[1] <= 20) { //print fan error 2178c: 80 91 b3 04 lds r24, 0x04B3 ; 0x8004b3 21790: 90 91 b4 04 lds r25, 0x04B4 ; 0x8004b4 21794: 45 97 sbiw r24, 0x15 ; 21 21796: 54 f6 brge .-108 ; 0x2172c LCD_ALERTMESSAGERPGM(MSG_FANCHECK_PRINT); 21798: 62 e0 ldi r22, 0x02 ; 2 2179a: 8b ef ldi r24, 0xFB ; 251 2179c: 9a e6 ldi r25, 0x6A ; 106 2179e: f2 cf rjmp .-28 ; 0x21784 000217a0 : //! @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; 217a0: 0f 94 8a 0b call 0x21714 ; 0x21714 217a4: 88 23 and r24, r24 217a6: 21 f0 breq .+8 ; 0x217b0 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 217a8: 85 e3 ldi r24, 0x35 ; 53 217aa: 9b e6 ldi r25, 0x6B ; 107 217ac: 0c 94 06 7b jmp 0xf60c ; 0xf60c } 217b0: 08 95 ret 000217b2 : if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); } void lcd_setstatus_serial(const char* message) { 217b2: cf 93 push r28 217b4: df 93 push r29 217b6: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 217b8: 80 e0 ldi r24, 0x00 ; 0 217ba: 0f 94 b1 06 call 0x20d62 ; 0x20d62 217be: 88 23 and r24, r24 217c0: 21 f0 breq .+8 ; 0x217ca lcd_updatestatus(message); 217c2: 60 e0 ldi r22, 0x00 ; 0 217c4: ce 01 movw r24, r28 217c6: 0f 94 96 06 call 0x20d2c ; 0x20d2c SERIAL_ECHOLN(message); 217ca: ce 01 movw r24, r28 } 217cc: df 91 pop r29 217ce: cf 91 pop r28 void lcd_setstatus_serial(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); SERIAL_ECHOLN(message); 217d0: 0d 94 96 d6 jmp 0x3ad2c ; 0x3ad2c 000217d4 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 217d4: cf 93 push r28 217d6: df 93 push r29 217d8: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 217da: 80 e0 ldi r24, 0x00 ; 0 217dc: 0f 94 b1 06 call 0x20d62 ; 0x20d62 217e0: 88 23 and r24, r24 217e2: 31 f0 breq .+12 ; 0x217f0 lcd_updatestatus(message, true); 217e4: 61 e0 ldi r22, 0x01 ; 1 217e6: ce 01 movw r24, r28 } 217e8: df 91 pop r29 217ea: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 217ec: 0d 94 96 06 jmp 0x20d2c ; 0x20d2c } 217f0: df 91 pop r29 217f2: cf 91 pop r28 217f4: 08 95 ret 000217f6 : } } void lcd_print_stop_finish(); void lcd_commands() 217f6: 2f 92 push r2 217f8: 3f 92 push r3 217fa: 4f 92 push r4 217fc: 5f 92 push r5 217fe: 6f 92 push r6 21800: 7f 92 push r7 21802: 8f 92 push r8 21804: 9f 92 push r9 21806: af 92 push r10 21808: bf 92 push r11 2180a: cf 92 push r12 2180c: df 92 push r13 2180e: ef 92 push r14 21810: ff 92 push r15 21812: 0f 93 push r16 21814: 1f 93 push r17 21816: cf 93 push r28 21818: 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) 2181a: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 2181e: 81 30 cpi r24, 0x01 ; 1 21820: 09 f0 breq .+2 ; 0x21824 21822: 61 c0 rjmp .+194 ; 0x218e6 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); 21824: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 21828: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 { if (!blocks_queued() && !homing_flag) 2182c: 98 13 cpse r25, r24 2182e: 5b c0 rjmp .+182 ; 0x218e6 21830: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 21834: 81 11 cpse r24, r1 21836: 57 c0 rjmp .+174 ; 0x218e6 { custom_message_type = CustomMsg::Status; 21838: 10 92 75 07 sts 0x0775, r1 ; 0x800775 lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 2183c: 8b e9 ldi r24, 0x9B ; 155 2183e: 90 e4 ldi r25, 0x40 ; 64 21840: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 21844: 0f 94 ea 0b call 0x217d4 ; 0x217d4 lcd_commands_type = LcdCommands::Idle; 21848: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 2184c: 82 e0 ldi r24, 0x02 ; 2 2184e: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 21852: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 #endif //COMMUNITY_PREVENT_OOZE // continue stopping the print from the main loop after lcd_print_stop() is called void lcd_print_stop_finish() { print_job_timer.stop(); 21856: 0f 94 f5 58 call 0x2b1ea ; 0x2b1ea save_statistics(); 2185a: 0e 94 d4 66 call 0xcda8 ; 0xcda8 // lift Z raise_z(10); 2185e: 60 e0 ldi r22, 0x00 ; 0 21860: 70 e0 ldi r23, 0x00 ; 0 21862: 80 e2 ldi r24, 0x20 ; 32 21864: 91 e4 ldi r25, 0x41 ; 65 21866: 0e 94 96 6e call 0xdd2c ; 0xdd2c // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 2186a: 80 91 40 07 lds r24, 0x0740 ; 0x800740 2186e: 88 23 and r24, r24 21870: 21 f1 breq .+72 ; 0x218ba 21872: 80 91 41 07 lds r24, 0x0741 ; 0x800741 21876: 88 23 and r24, r24 21878: 01 f1 breq .+64 ; 0x218ba current_position[X_AXIS] = X_CANCEL_POS; 2187a: 80 e0 ldi r24, 0x00 ; 0 2187c: 90 e0 ldi r25, 0x00 ; 0 2187e: a8 e4 ldi r26, 0x48 ; 72 21880: b2 e4 ldi r27, 0x42 ; 66 21882: 80 93 43 07 sts 0x0743, r24 ; 0x800743 21886: 90 93 44 07 sts 0x0744, r25 ; 0x800744 2188a: a0 93 45 07 sts 0x0745, r26 ; 0x800745 2188e: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = Y_CANCEL_POS; 21892: 80 e0 ldi r24, 0x00 ; 0 21894: 90 e0 ldi r25, 0x00 ; 0 21896: ae e3 ldi r26, 0x3E ; 62 21898: b3 e4 ldi r27, 0x43 ; 67 2189a: 80 93 47 07 sts 0x0747, r24 ; 0x800747 2189e: 90 93 48 07 sts 0x0748, r25 ; 0x800748 218a2: a0 93 49 07 sts 0x0749, r26 ; 0x800749 218a6: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 218aa: 60 e0 ldi r22, 0x00 ; 0 218ac: 70 e0 ldi r23, 0x00 ; 0 218ae: 84 e3 ldi r24, 0x34 ; 52 218b0: 92 e4 ldi r25, 0x42 ; 66 218b2: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 218b6: 0f 94 2c 59 call 0x2b258 ; 0x2b258 218ba: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE // did we come here from a thermal error? if(get_temp_error()) { 218be: 88 23 and r24, r24 218c0: 09 f4 brne .+2 ; 0x218c4 218c2: c8 c0 rjmp .+400 ; 0x21a54 // time to stop the error beep WRITE(BEEPER, LOW); 218c4: 9f b7 in r25, 0x3f ; 63 218c6: f8 94 cli 218c8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 218cc: 8b 7f andi r24, 0xFB ; 251 218ce: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 218d2: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 218d4: 0f 94 6c 45 call 0x28ad8 ; 0x28ad8 finishAndDisableSteppers(); //M84 218d8: 0e 94 93 83 call 0x10726 ; 0x10726 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 218dc: 88 e0 ldi r24, 0x08 ; 8 218de: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 did_pause_print = false; // Clear pause state in case the print was aborted while paused 218e2: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 218e6: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 218ea: 82 30 cpi r24, 0x02 ; 2 218ec: 09 f0 breq .+2 ; 0x218f0 218ee: 6a c0 rjmp .+212 ; 0x219c4 218f0: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 218f4: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 { if (!blocks_queued() && !homing_flag) 218f8: 98 13 cpse r25, r24 218fa: 64 c0 rjmp .+200 ; 0x219c4 218fc: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 21900: 81 11 cpse r24, r1 21902: 60 c0 rjmp .+192 ; 0x219c4 { if (custom_message_type != CustomMsg::M117) 21904: 80 91 75 07 lds r24, 0x0775 ; 0x800775 21908: 87 30 cpi r24, 0x07 ; 7 2190a: 41 f0 breq .+16 ; 0x2191c { custom_message_type = CustomMsg::Status; 2190c: 10 92 75 07 sts 0x0775, r1 ; 0x800775 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 21910: 8c e8 ldi r24, 0x8C ; 140 21912: 90 e4 ldi r25, 0x40 ; 64 21914: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 21918: 0f 94 ea 0b call 0x217d4 ; 0x217d4 } lcd_commands_type = LcdCommands::Idle; 2191c: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 21920: 82 e0 ldi r24, 0x02 ; 2 21922: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 21926: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 2192a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 2192e: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21932: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 21936: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 2193a: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.497+0x8> 2193e: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.497+0x9> 21942: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.497+0xa> 21946: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.497+0xb> 2194a: 0e 94 96 6e call 0xdd2c ; 0xdd2c // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 2194e: 80 91 40 07 lds r24, 0x0740 ; 0x800740 21952: 88 23 and r24, r24 21954: 51 f1 breq .+84 ; 0x219aa 21956: 80 91 41 07 lds r24, 0x0741 ; 0x800741 2195a: 88 23 and r24, r24 2195c: 31 f1 breq .+76 ; 0x219aa current_position[X_AXIS] = pause_position[X_AXIS]; 2195e: 80 91 3f 02 lds r24, 0x023F ; 0x80023f <_ZL14pause_position.lto_priv.497> 21962: 90 91 40 02 lds r25, 0x0240 ; 0x800240 <_ZL14pause_position.lto_priv.497+0x1> 21966: a0 91 41 02 lds r26, 0x0241 ; 0x800241 <_ZL14pause_position.lto_priv.497+0x2> 2196a: b0 91 42 02 lds r27, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.497+0x3> 2196e: 80 93 43 07 sts 0x0743, r24 ; 0x800743 21972: 90 93 44 07 sts 0x0744, r25 ; 0x800744 21976: a0 93 45 07 sts 0x0745, r26 ; 0x800745 2197a: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pause_position[Y_AXIS]; 2197e: 80 91 43 02 lds r24, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.497+0x4> 21982: 90 91 44 02 lds r25, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.497+0x5> 21986: a0 91 45 02 lds r26, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.497+0x6> 2198a: b0 91 46 02 lds r27, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.497+0x7> 2198e: 80 93 47 07 sts 0x0747, r24 ; 0x800747 21992: 90 93 48 07 sts 0x0748, r25 ; 0x800748 21996: a0 93 49 07 sts 0x0749, r26 ; 0x800749 2199a: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a plan_buffer_line_curposXYZE(50); 2199e: 60 e0 ldi r22, 0x00 ; 0 219a0: 70 e0 ldi r23, 0x00 ; 0 219a2: 88 e4 ldi r24, 0x48 ; 72 219a4: 92 e4 ldi r25, 0x42 ; 66 219a6: 0f 94 93 ba call 0x37526 ; 0x37526 219aa: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> } // did we come here from a thermal error? if(get_temp_error()) { 219ae: 88 23 and r24, r24 219b0: 09 f4 brne .+2 ; 0x219b4 219b2: 77 c0 rjmp .+238 ; 0x21aa2 // time to stop the error beep WRITE(BEEPER, LOW); 219b4: 9f b7 in r25, 0x3f ; 63 219b6: f8 94 cli 219b8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 219bc: 8b 7f andi r24, 0xFB ; 251 219be: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 219c2: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 219c4: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 219c8: 84 30 cpi r24, 0x04 ; 4 219ca: 09 f0 breq .+2 ; 0x219ce 219cc: a4 c0 rjmp .+328 ; 0x21b16 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 219ce: 85 ea ldi r24, 0xA5 ; 165 219d0: 9d e0 ldi r25, 0x0D ; 13 219d2: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 219d6: 30 91 56 0e lds r19, 0x0E56 ; 0x800e56 219da: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 const float extrusion_width = (nozzle_dia + 20)/1000.0f; const float layer_height = 0.2f; if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 219de: 32 13 cpse r19, r18 219e0: 71 c1 rjmp .+738 ; 0x21cc4 219e2: 20 91 81 10 lds r18, 0x1081 ; 0x801081 219e6: 30 91 82 10 lds r19, 0x1082 ; 0x801082 219ea: 23 2b or r18, r19 219ec: 09 f0 breq .+2 ; 0x219f0 219ee: 6a c1 rjmp .+724 ; 0x21cc4 219f0: c0 91 5a 0e lds r28, 0x0E5A ; 0x800e5a 219f4: c1 11 cpse r28, r1 219f6: 66 c1 rjmp .+716 ; 0x21cc4 { if (lcd_commands_step == 0) 219f8: 20 91 f7 03 lds r18, 0x03F7 ; 0x8003f7 219fc: 21 11 cpse r18, r1 219fe: 54 c0 rjmp .+168 ; 0x21aa8 lcd_commands_step = 12; 21a00: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 21a02: 20 93 f7 03 sts 0x03F7, r18 ; 0x8003f7 } if (lcd_commands_type == LcdCommands::Layer1Cal) { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); const float extrusion_width = (nozzle_dia + 20)/1000.0f; 21a06: 44 96 adiw r24, 0x14 ; 20 21a08: bc 01 movw r22, r24 21a0a: 90 e0 ldi r25, 0x00 ; 0 21a0c: 80 e0 ldi r24, 0x00 ; 0 21a0e: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 21a12: 20 e0 ldi r18, 0x00 ; 0 21a14: 30 e0 ldi r19, 0x00 ; 0 21a16: 4a e7 ldi r20, 0x7A ; 122 21a18: 54 e4 ldi r21, 0x44 ; 68 21a1a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 21a1e: 4b 01 movw r8, r22 21a20: 5c 01 movw r10, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 21a22: e0 91 f7 03 lds r30, 0x03F7 ; 0x8003f7 21a26: e1 50 subi r30, 0x01 ; 1 21a28: ec 30 cpi r30, 0x0C ; 12 21a2a: 08 f0 brcs .+2 ; 0x21a2e 21a2c: 74 c0 rjmp .+232 ; 0x21b16 21a2e: f0 e0 ldi r31, 0x00 ; 0 21a30: 88 27 eor r24, r24 21a32: e2 5e subi r30, 0xE2 ; 226 21a34: f2 4f sbci r31, 0xF2 ; 242 21a36: 8e 4f sbci r24, 0xFE ; 254 21a38: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 21a3c: e6 3a cpi r30, 0xA6 ; 166 21a3e: dc 3a cpi r29, 0xAC ; 172 21a40: ca 39 cpi r28, 0x9A ; 154 21a42: ca 39 cpi r28, 0x9A ; 154 21a44: ca 39 cpi r28, 0x9A ; 154 21a46: ca 39 cpi r28, 0x9A ; 154 21a48: 22 3a cpi r18, 0xA2 ; 162 21a4a: da 39 cpi r29, 0x9A ; 154 21a4c: fa 3a cpi r31, 0xAA ; 170 21a4e: 1c 3b cpi r17, 0xBC ; 188 21a50: 54 3b cpi r21, 0xB4 ; 180 21a52: 24 3b cpi r18, 0xB4 ; 180 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 21a54: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 // restore the auto hotend state hotendDefaultAutoFanState(); 21a58: 0e 94 23 77 call 0xee46 ; 0xee46 if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21a5c: 80 91 98 13 lds r24, 0x1398 ; 0x801398 21a60: 81 30 cpi r24, 0x01 ; 1 21a62: 09 f0 breq .+2 ; 0x21a66 21a64: 37 cf rjmp .-402 ; 0x218d4 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 21a66: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 21a6a: 88 23 and r24, r24 21a6c: 09 f4 brne .+2 ; 0x21a70 21a6e: 32 cf rjmp .-412 ; 0x218d4 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 21a70: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 21a74: 82 30 cpi r24, 0x02 ; 2 21a76: 09 f4 brne .+2 ; 0x21a7a 21a78: 2d cf rjmp .-422 ; 0x218d4 #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()) 21a7a: 0e 94 3a 68 call 0xd074 ; 0xd074 21a7e: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 21a80: 0e 94 7e 65 call 0xcafc ; 0xcafc } // 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) { 21a84: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 21a88: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 21a8c: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 21a90: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 21a94: 28 17 cp r18, r24 21a96: 39 07 cpc r19, r25 21a98: 0c f4 brge .+2 ; 0x21a9c 21a9a: 1c cf rjmp .-456 ; 0x218d4 MMU2::mmu2.unload(); // M702 21a9c: 0f 94 6d a0 call 0x340da ; 0x340da 21aa0: 19 cf rjmp .-462 ; 0x218d4 } else { // Turn off the print fan fanSpeed = 0; 21aa2: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 21aa6: 8e cf rjmp .-228 ; 0x219c4 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 21aa8: 21 50 subi r18, 0x01 ; 1 21aaa: ab cf rjmp .-170 ; 0x21a02 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 21aac: 65 e0 ldi r22, 0x05 ; 5 21aae: 8d eb ldi r24, 0xBD ; 189 21ab0: 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]))); 21ab2: 0e 94 ca 89 call 0x11394 ; 0x11394 21ab6: 2f c0 rjmp .+94 ; 0x21b16 //! @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()) 21ab8: 80 91 98 13 lds r24, 0x1398 ; 0x801398 21abc: 81 30 cpi r24, 0x01 ; 1 21abe: 49 f5 brne .+82 ; 0x21b12 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 21ac0: d0 91 f6 03 lds r29, 0x03F6 ; 0x8003f6 <_ZL16lay1cal_filament.lto_priv.456> { enquecommand_P(MSG_M83); 21ac4: 61 e0 ldi r22, 0x01 ; 1 21ac6: 8d e1 ldi r24, 0x1D ; 29 21ac8: 9c e6 ldi r25, 0x6C ; 108 21aca: 0e 94 4b 89 call 0x11296 ; 0x11296 enquecommand_P(PSTR("G1Y-3F1000")); 21ace: 61 e0 ldi r22, 0x01 ; 1 21ad0: 82 eb ldi r24, 0xB2 ; 178 21ad2: 9c e8 ldi r25, 0x8C ; 140 21ad4: 0e 94 4b 89 call 0x11296 ; 0x11296 enquecommand_P(PSTR("G1Z0.4")); 21ad8: 61 e0 ldi r22, 0x01 ; 1 21ada: 8b ea ldi r24, 0xAB ; 171 21adc: 9c e8 ldi r25, 0x8C ; 140 21ade: 0e 94 4b 89 call 0x11296 ; 0x11296 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 21ae2: 0f 94 dd 76 call 0x2edba ; 0x2edba if(currentTool == filament ){ 21ae6: d8 17 cp r29, r24 21ae8: a1 f0 breq .+40 ; 0x21b12 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 21aea: 8f 3f cpi r24, 0xFF ; 255 21aec: 29 f0 breq .+10 ; 0x21af8 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 21aee: 61 e0 ldi r22, 0x01 ; 1 21af0: 88 e1 ldi r24, 0x18 ; 24 21af2: 9c e6 ldi r25, 0x6C ; 108 21af4: 0e 94 4b 89 call 0x11296 ; 0x11296 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 21af8: 1f 92 push r1 21afa: df 93 push r29 21afc: 87 ea ldi r24, 0xA7 ; 167 21afe: 9c e8 ldi r25, 0x8C ; 140 21b00: 9f 93 push r25 21b02: 8f 93 push r24 21b04: 0e 94 e9 89 call 0x113d2 ; 0x113d2 21b08: 0f 90 pop r0 21b0a: 0f 90 pop r0 21b0c: 0f 90 pop r0 21b0e: 0f 90 pop r0 return true; 21b10: c1 e0 ldi r28, 0x01 ; 1 21b12: c0 93 f5 03 sts 0x03F5, r28 ; 0x8003f5 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 21b16: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 21b1a: 83 30 cpi r24, 0x03 ; 3 21b1c: 09 f0 breq .+2 ; 0x21b20 21b1e: d2 c0 rjmp .+420 ; 0x21cc4 if (lcd_commands_step == 0) { 21b20: 90 91 f7 03 lds r25, 0x03F7 ; 0x8003f7 21b24: 91 11 cpse r25, r1 21b26: 09 c0 rjmp .+18 ; 0x21b3a custom_message_type = CustomMsg::PidCal; 21b28: 80 93 75 07 sts 0x0775, r24 ; 0x800775 custom_message_state = 1; 21b2c: 91 e0 ldi r25, 0x01 ; 1 21b2e: 90 93 f3 03 sts 0x03F3, r25 ; 0x8003f3 lcd_draw_update = 3; 21b32: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_commands_step = 3; 21b36: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 21b3a: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21b3e: 83 30 cpi r24, 0x03 ; 3 21b40: 19 f5 brne .+70 ; 0x21b88 21b42: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 21b46: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 21b4a: 98 13 cpse r25, r24 21b4c: 1d c0 rjmp .+58 ; 0x21b88 return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 21b4e: 0f 94 57 45 call 0x28aae ; 0x28aae pid_tuning_finished = false; 21b52: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> preparePidTuning(); // ensure we don't move to the next step early // setting the correct target temperature (for visualization) is done in PID_autotune enquecommandf_P(PSTR("M303 E0 S%3u"), pid_temp); 21b56: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 21b5a: 8f 93 push r24 21b5c: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.457> 21b60: 8f 93 push r24 21b62: 88 e4 ldi r24, 0x48 ; 72 21b64: 9d e8 ldi r25, 0x8D ; 141 21b66: 9f 93 push r25 21b68: 8f 93 push r24 21b6a: 0e 94 e9 89 call 0x113d2 ; 0x113d2 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 21b6e: 81 e8 ldi r24, 0x81 ; 129 21b70: 90 e4 ldi r25, 0x40 ; 64 21b72: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 21b76: 0f 94 ea 0b call 0x217d4 ; 0x217d4 lcd_commands_step = 2; 21b7a: 82 e0 ldi r24, 0x02 ; 2 21b7c: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 21b80: 0f 90 pop r0 21b82: 0f 90 pop r0 21b84: 0f 90 pop r0 21b86: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 21b88: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21b8c: 82 30 cpi r24, 0x02 ; 2 21b8e: 09 f0 breq .+2 ; 0x21b92 21b90: 7a c0 rjmp .+244 ; 0x21c86 21b92: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> 21b96: 88 23 and r24, r24 21b98: 09 f4 brne .+2 ; 0x21b9c 21b9a: 75 c0 rjmp .+234 ; 0x21c86 custom_message_state = 0; 21b9c: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 21ba0: 8d e6 ldi r24, 0x6D ; 109 21ba2: 90 e4 ldi r25, 0x40 ; 64 21ba4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 21ba8: 0f 94 ea 0b call 0x217d4 ; 0x217d4 21bac: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 21bb0: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 21bb4: c0 91 ef 03 lds r28, 0x03EF ; 0x8003ef <_Kp> 21bb8: d0 91 f0 03 lds r29, 0x03F0 ; 0x8003f0 <_Kp+0x1> 21bbc: 10 91 f1 03 lds r17, 0x03F1 ; 0x8003f1 <_Kp+0x2> 21bc0: 00 91 f2 03 lds r16, 0x03F2 ; 0x8003f2 <_Kp+0x3> 21bc4: 20 e0 ldi r18, 0x00 ; 0 21bc6: 30 e0 ldi r19, 0x00 ; 0 21bc8: a9 01 movw r20, r18 21bca: f8 01 movw r30, r16 21bcc: 6c 2f mov r22, r28 21bce: 7d 2f mov r23, r29 21bd0: 8f 2f mov r24, r31 21bd2: 9e 2f mov r25, r30 21bd4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 21bd8: 81 11 cpse r24, r1 21bda: 1f c0 rjmp .+62 ; 0x21c1a 21bdc: 20 e0 ldi r18, 0x00 ; 0 21bde: 30 e0 ldi r19, 0x00 ; 0 21be0: a9 01 movw r20, r18 21be2: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Ki> 21be6: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Ki+0x1> 21bea: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Ki+0x2> 21bee: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Ki+0x3> 21bf2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 21bf6: 81 11 cpse r24, r1 21bf8: 10 c0 rjmp .+32 ; 0x21c1a 21bfa: 20 e0 ldi r18, 0x00 ; 0 21bfc: 30 e0 ldi r19, 0x00 ; 0 21bfe: a9 01 movw r20, r18 21c00: 60 91 e7 03 lds r22, 0x03E7 ; 0x8003e7 <_Kd> 21c04: 70 91 e8 03 lds r23, 0x03E8 ; 0x8003e8 <_Kd+0x1> 21c08: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Kd+0x2> 21c0c: 90 91 ea 03 lds r25, 0x03EA ; 0x8003ea <_Kd+0x3> 21c10: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 21c14: 88 23 and r24, r24 21c16: 09 f4 brne .+2 ; 0x21c1a 21c18: 7e c2 rjmp .+1276 ; 0x22116 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 21c1a: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea <_Kd+0x3> 21c1e: 8f 93 push r24 21c20: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Kd+0x2> 21c24: 8f 93 push r24 21c26: 80 91 e8 03 lds r24, 0x03E8 ; 0x8003e8 <_Kd+0x1> 21c2a: 8f 93 push r24 21c2c: 80 91 e7 03 lds r24, 0x03E7 ; 0x8003e7 <_Kd> 21c30: 8f 93 push r24 21c32: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee <_Ki+0x3> 21c36: 8f 93 push r24 21c38: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Ki+0x2> 21c3c: 8f 93 push r24 21c3e: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec <_Ki+0x1> 21c42: 8f 93 push r24 21c44: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb <_Ki> 21c48: 8f 93 push r24 21c4a: 0f 93 push r16 21c4c: 1f 93 push r17 21c4e: df 93 push r29 21c50: cf 93 push r28 21c52: 81 e3 ldi r24, 0x31 ; 49 21c54: 9d e8 ldi r25, 0x8D ; 141 21c56: 9f 93 push r25 21c58: 8f 93 push r24 21c5a: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommand_P(MSG_M500); 21c5e: 61 e0 ldi r22, 0x01 ; 1 21c60: 87 e2 ldi r24, 0x27 ; 39 21c62: 9c e6 ldi r25, 0x6C ; 108 21c64: 0e 94 4b 89 call 0x11296 ; 0x11296 21c68: 8d b7 in r24, 0x3d ; 61 21c6a: 9e b7 in r25, 0x3e ; 62 21c6c: 0e 96 adiw r24, 0x0e ; 14 21c6e: 0f b6 in r0, 0x3f ; 63 21c70: f8 94 cli 21c72: 9e bf out 0x3e, r25 ; 62 21c74: 0f be out 0x3f, r0 ; 63 21c76: 8d bf out 0x3d, r24 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 21c78: 84 ee ldi r24, 0xE4 ; 228 21c7a: 93 e0 ldi r25, 0x03 ; 3 21c7c: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> lcd_commands_step = 1; 21c80: 81 e0 ldi r24, 0x01 ; 1 21c82: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 21c86: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21c8a: 81 30 cpi r24, 0x01 ; 1 21c8c: d9 f4 brne .+54 ; 0x21cc4 21c8e: 60 ed ldi r22, 0xD0 ; 208 21c90: 77 e0 ldi r23, 0x07 ; 7 21c92: 84 ee ldi r24, 0xE4 ; 228 21c94: 93 e0 ldi r25, 0x03 ; 3 21c96: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 21c9a: 88 23 and r24, r24 21c9c: 99 f0 breq .+38 ; 0x21cc4 lcd_setstatuspgm(MSG_WELCOME); 21c9e: 8a e6 ldi r24, 0x6A ; 106 21ca0: 90 e7 ldi r25, 0x70 ; 112 21ca2: 0f 94 ea 0b call 0x217d4 ; 0x217d4 custom_message_type = CustomMsg::Status; 21ca6: 10 92 75 07 sts 0x0775, r1 ; 0x800775 pid_temp = DEFAULT_PID_TEMP; 21caa: 82 ed ldi r24, 0xD2 ; 210 21cac: 90 e0 ldi r25, 0x00 ; 0 21cae: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 21cb2: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.457> lcd_commands_step = 0; 21cb6: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 21cba: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 21cbe: 82 e0 ldi r24, 0x02 ; 2 21cc0: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); } } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) 21cc4: 90 91 65 0e lds r25, 0x0E65 ; 0x800e65 21cc8: 95 30 cpi r25, 0x05 ; 5 21cca: 99 f4 brne .+38 ; 0x21cf2 21ccc: 20 91 81 10 lds r18, 0x1081 ; 0x801081 21cd0: 30 91 82 10 lds r19, 0x1082 ; 0x801082 21cd4: 23 2b or r18, r19 21cd6: 79 f5 brne .+94 ; 0x21d36 { switch (lcd_commands_step) 21cd8: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21cdc: 82 30 cpi r24, 0x02 ; 2 21cde: 09 f4 brne .+2 ; 0x21ce2 21ce0: 43 c2 rjmp .+1158 ; 0x22168 21ce2: 08 f0 brcs .+2 ; 0x21ce6 21ce4: 1d c2 rjmp .+1082 ; 0x22120 21ce6: 88 23 and r24, r24 21ce8: 09 f4 brne .+2 ; 0x21cec 21cea: 2e c2 rjmp .+1116 ; 0x22148 21cec: 81 30 cpi r24, 0x01 ; 1 21cee: 09 f4 brne .+2 ; 0x21cf2 21cf0: 46 c2 rjmp .+1164 ; 0x2217e break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 21cf2: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 21cf6: 86 30 cpi r24, 0x06 ; 6 21cf8: f1 f4 brne .+60 ; 0x21d36 21cfa: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 21cfe: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 21d02: 98 13 cpse r25, r24 21d04: 18 c0 rjmp .+48 ; 0x21d36 21d06: 80 91 81 10 lds r24, 0x1081 ; 0x801081 21d0a: 90 91 82 10 lds r25, 0x1082 ; 0x801082 21d0e: 89 2b or r24, r25 21d10: 91 f4 brne .+36 ; 0x21d36 21d12: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 21d16: 81 11 cpse r24, r1 21d18: 0e c0 rjmp .+28 ; 0x21d36 #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) 21d1a: 80 91 f7 03 lds r24, 0x03F7 ; 0x8003f7 21d1e: 81 30 cpi r24, 0x01 ; 1 21d20: 09 f4 brne .+2 ; 0x21d24 21d22: 85 c2 rjmp .+1290 ; 0x2222e 21d24: 08 f4 brcc .+2 ; 0x21d28 21d26: 45 c2 rjmp .+1162 ; 0x221b2 21d28: 82 30 cpi r24, 0x02 ; 2 21d2a: 09 f4 brne .+2 ; 0x21d2e 21d2c: 6d c2 rjmp .+1242 ; 0x22208 was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); #endif //THERMAL_MODEL #else //nozzle change without heating while((int)degHotend(active_extruder)>40) { //check temp fanSpeed = 255; //turn on fan 21d2e: cf ef ldi r28, 0xFF ; 255 #ifndef QUICK_NOZZLE_CHANGE //thermal model can be ignored if a quickchange nozzle is in use, no heatup necessary #ifdef THERMAL_MODEL static bool was_enabled; #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) 21d30: 83 30 cpi r24, 0x03 ; 3 21d32: 09 f4 brne .+2 ; 0x21d36 21d34: 42 c2 rjmp .+1156 ; 0x221ba menu_depth = 3; break; } } } } 21d36: df 91 pop r29 21d38: cf 91 pop r28 21d3a: 1f 91 pop r17 21d3c: 0f 91 pop r16 21d3e: ff 90 pop r15 21d40: ef 90 pop r14 21d42: df 90 pop r13 21d44: cf 90 pop r12 21d46: bf 90 pop r11 21d48: af 90 pop r10 21d4a: 9f 90 pop r9 21d4c: 8f 90 pop r8 21d4e: 7f 90 pop r7 21d50: 6f 90 pop r6 21d52: 5f 90 pop r5 21d54: 4f 90 pop r4 21d56: 3f 90 pop r3 21d58: 2f 90 pop r2 21d5a: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 21d5c: 0e 94 c8 6f call 0xdf90 ; 0xdf90 menu_depth = 0; 21d60: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 menu_submenu(lcd_babystep_z, true); 21d64: 61 e0 ldi r22, 0x01 ; 1 21d66: 84 ee ldi r24, 0xE4 ; 228 21d68: 99 e3 ldi r25, 0x39 ; 57 21d6a: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa cmd_intro_mmu_9, cmd_intro_mmu_10, cmd_intro_mmu_11, }; if (MMU2::mmu2.Enabled()) 21d6e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 21d72: 81 30 cpi r24, 0x01 ; 1 21d74: b9 f4 brne .+46 ; 0x21da4 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(cmd_intro_mmu)/sizeof(cmd_intro_mmu[0])); ++i) 21d76: 80 91 f5 03 lds r24, 0x03F5 ; 0x8003f5 21d7a: 10 e0 ldi r17, 0x00 ; 0 21d7c: 81 11 cpse r24, r1 21d7e: 01 c0 rjmp .+2 ; 0x21d82 21d80: 12 e0 ldi r17, 0x02 ; 2 21d82: c1 2f mov r28, r17 21d84: d0 e0 ldi r29, 0x00 ; 0 21d86: cc 0f add r28, r28 21d88: dd 1f adc r29, r29 21d8a: cb 56 subi r28, 0x6B ; 107 21d8c: d3 47 sbci r29, 0x73 ; 115 { enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); 21d8e: fe 01 movw r30, r28 21d90: 85 91 lpm r24, Z+ 21d92: 94 91 lpm r25, Z 21d94: 61 e0 ldi r22, 0x01 ; 1 21d96: 0e 94 4b 89 call 0x11296 ; 0x11296 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) 21d9a: 1f 5f subi r17, 0xFF ; 255 21d9c: 22 96 adiw r28, 0x02 ; 2 21d9e: 19 30 cpi r17, 0x09 ; 9 21da0: b1 f7 brne .-20 ; 0x21d8e 21da2: b9 ce rjmp .-654 ; 0x21b16 enquecommand_P(static_cast(pgm_read_ptr(&cmd_intro_mmu[i]))); } } else { enquecommand_P(feedrate_F1080); //fixed velocity for the intro line 21da4: 61 e0 ldi r22, 0x01 ; 1 21da6: 8d e8 ldi r24, 0x8D ; 141 21da8: 9c e8 ldi r25, 0x8C ; 140 21daa: 0e 94 4b 89 call 0x11296 ; 0x11296 enquecommandf_P(extrude_fmt_X, 60.f, count_e(layer_height, extrusion_width * 4.f, 60)); 21dae: 20 e0 ldi r18, 0x00 ; 0 21db0: 30 e0 ldi r19, 0x00 ; 0 21db2: 40 e8 ldi r20, 0x80 ; 128 21db4: 50 e4 ldi r21, 0x40 ; 64 21db6: c5 01 movw r24, r10 21db8: b4 01 movw r22, r8 21dba: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 21dbe: 20 e0 ldi r18, 0x00 ; 0 21dc0: 30 e0 ldi r19, 0x00 ; 0 21dc2: 40 e7 ldi r20, 0x70 ; 112 21dc4: 52 e4 ldi r21, 0x42 ; 66 21dc6: 0f 94 96 87 call 0x30f2c ; 0x30f2c 21dca: 9f 93 push r25 21dcc: 8f 93 push r24 21dce: 7f 93 push r23 21dd0: 6f 93 push r22 21dd2: 82 e4 ldi r24, 0x42 ; 66 21dd4: 8f 93 push r24 21dd6: 80 e7 ldi r24, 0x70 ; 112 21dd8: 8f 93 push r24 21dda: 1f 92 push r1 21ddc: 1f 92 push r1 21dde: c0 e8 ldi r28, 0x80 ; 128 21de0: dc e8 ldi r29, 0x8C ; 140 21de2: df 93 push r29 21de4: cf 93 push r28 21de6: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_X, 202.5f, count_e(layer_height, extrusion_width * 8.f, 142.5)); 21dea: 20 e0 ldi r18, 0x00 ; 0 21dec: 30 e0 ldi r19, 0x00 ; 0 21dee: 40 e0 ldi r20, 0x00 ; 0 21df0: 51 e4 ldi r21, 0x41 ; 65 21df2: c5 01 movw r24, r10 21df4: b4 01 movw r22, r8 21df6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 21dfa: 20 e0 ldi r18, 0x00 ; 0 21dfc: 30 e8 ldi r19, 0x80 ; 128 21dfe: 4e e0 ldi r20, 0x0E ; 14 21e00: 53 e4 ldi r21, 0x43 ; 67 21e02: 0f 94 96 87 call 0x30f2c ; 0x30f2c 21e06: 9f 93 push r25 21e08: 8f 93 push r24 21e0a: 7f 93 push r23 21e0c: 6f 93 push r22 21e0e: 83 e4 ldi r24, 0x43 ; 67 21e10: 8f 93 push r24 21e12: 8a e4 ldi r24, 0x4A ; 74 21e14: 8f 93 push r24 21e16: 80 e8 ldi r24, 0x80 ; 128 21e18: 8f 93 push r24 21e1a: 1f 92 push r1 21e1c: df 93 push r29 21e1e: cf 93 push r28 21e20: 0e 94 e9 89 call 0x113d2 ; 0x113d2 21e24: 8d b7 in r24, 0x3d ; 61 21e26: 9e b7 in r25, 0x3e ; 62 21e28: 44 96 adiw r24, 0x14 ; 20 21e2a: 0f b6 in r0, 0x3f ; 63 21e2c: f8 94 cli 21e2e: 9e bf out 0x3e, r25 ; 62 21e30: 0f be out 0x3f, r0 ; 63 21e32: 8d bf out 0x3d, r24 ; 61 21e34: 70 ce rjmp .-800 ; 0x21b16 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]))); 21e36: 66 e0 ldi r22, 0x06 ; 6 21e38: 84 e7 ldi r24, 0x74 ; 116 21e3a: 9c e8 ldi r25, 0x8C ; 140 21e3c: 3a ce rjmp .-908 ; 0x21ab2 //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { #ifndef NEW_FIRST_LAYER_CAL enquecommand_P(PSTR("G1X50Y155")); 21e3e: 61 e0 ldi r22, 0x01 ; 1 21e40: 8a e6 ldi r24, 0x6A ; 106 21e42: 9c e8 ldi r25, 0x8C ; 140 21e44: 0e 94 4b 89 call 0x11296 ; 0x11296 #endif //_NEW_FIRST_LAYER_CAL static const char fmt1[] PROGMEM = "G1Z%.2f"; enquecommandf_P(fmt1, layer_height); 21e48: 8e e3 ldi r24, 0x3E ; 62 21e4a: 8f 93 push r24 21e4c: 8c e4 ldi r24, 0x4C ; 76 21e4e: 8f 93 push r24 21e50: 8c ec ldi r24, 0xCC ; 204 21e52: 8f 93 push r24 21e54: 8d ec ldi r24, 0xCD ; 205 21e56: 8f 93 push r24 21e58: 82 e6 ldi r24, 0x62 ; 98 21e5a: 9c e8 ldi r25, 0x8C ; 140 21e5c: 9f 93 push r25 21e5e: 8f 93 push r24 21e60: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommand_P(feedrate_F1080); 21e64: 61 e0 ldi r22, 0x01 ; 1 21e66: 8d e8 ldi r24, 0x8D ; 141 21e68: 9c e8 ldi r25, 0x8C ; 140 21e6a: 0e 94 4b 89 call 0x11296 ; 0x11296 enquecommand_P(MSG_G91); //enable relative XYZ 21e6e: 61 e0 ldi r22, 0x01 ; 1 21e70: 84 e1 ldi r24, 0x14 ; 20 21e72: 9c e6 ldi r25, 0x6C ; 108 21e74: 0e 94 4b 89 call 0x11296 ; 0x11296 #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)); 21e78: 20 e0 ldi r18, 0x00 ; 0 21e7a: 30 e0 ldi r19, 0x00 ; 0 21e7c: 40 e8 ldi r20, 0x80 ; 128 21e7e: 50 e4 ldi r21, 0x40 ; 64 21e80: c5 01 movw r24, r10 21e82: b4 01 movw r22, r8 21e84: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 21e88: 20 e0 ldi r18, 0x00 ; 0 21e8a: 30 e0 ldi r19, 0x00 ; 0 21e8c: 48 ec ldi r20, 0xC8 ; 200 21e8e: 51 e4 ldi r21, 0x41 ; 65 21e90: 0f 94 96 87 call 0x30f2c ; 0x30f2c 21e94: 9f 93 push r25 21e96: 8f 93 push r24 21e98: 7f 93 push r23 21e9a: 6f 93 push r22 21e9c: 01 e4 ldi r16, 0x41 ; 65 21e9e: 0f 93 push r16 21ea0: 18 ec ldi r17, 0xC8 ; 200 21ea2: 1f 93 push r17 21ea4: 1f 92 push r1 21ea6: 1f 92 push r1 21ea8: c0 e8 ldi r28, 0x80 ; 128 21eaa: dc e8 ldi r29, 0x8C ; 140 21eac: df 93 push r29 21eae: cf 93 push r28 21eb0: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_X, 25.f*invert, count_e(layer_height, extrusion_width * 2.f, 25)); 21eb4: a5 01 movw r20, r10 21eb6: 94 01 movw r18, r8 21eb8: c5 01 movw r24, r10 21eba: b4 01 movw r22, r8 21ebc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 21ec0: 20 e0 ldi r18, 0x00 ; 0 21ec2: 30 e0 ldi r19, 0x00 ; 0 21ec4: 48 ec ldi r20, 0xC8 ; 200 21ec6: 51 e4 ldi r21, 0x41 ; 65 21ec8: 0f 94 96 87 call 0x30f2c ; 0x30f2c 21ecc: 9f 93 push r25 21ece: 8f 93 push r24 21ed0: 7f 93 push r23 21ed2: 6f 93 push r22 21ed4: 0f 93 push r16 21ed6: 1f 93 push r17 21ed8: 1f 92 push r1 21eda: 1f 92 push r1 21edc: df 93 push r29 21ede: cf 93 push r28 21ee0: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_X, 100.f*invert, count_e(layer_height, extrusion_width, 100)); 21ee4: 20 e0 ldi r18, 0x00 ; 0 21ee6: 30 e0 ldi r19, 0x00 ; 0 21ee8: 48 ec ldi r20, 0xC8 ; 200 21eea: 52 e4 ldi r21, 0x42 ; 66 21eec: c5 01 movw r24, r10 21eee: b4 01 movw r22, r8 21ef0: 0f 94 96 87 call 0x30f2c ; 0x30f2c 21ef4: 9f 93 push r25 21ef6: 8f 93 push r24 21ef8: 7f 93 push r23 21efa: 6f 93 push r22 21efc: 82 e4 ldi r24, 0x42 ; 66 21efe: 8f 93 push r24 21f00: 1f 93 push r17 21f02: 1f 92 push r1 21f04: 1f 92 push r1 21f06: df 93 push r29 21f08: cf 93 push r28 21f0a: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_Y, -20.f*invert, count_e(layer_height, extrusion_width, 20)); 21f0e: 8d b7 in r24, 0x3d ; 61 21f10: 9e b7 in r25, 0x3e ; 62 21f12: 84 96 adiw r24, 0x24 ; 36 21f14: 0f b6 in r0, 0x3f ; 63 21f16: f8 94 cli 21f18: 9e bf out 0x3e, r25 ; 62 21f1a: 0f be out 0x3f, r0 ; 63 21f1c: 8d bf out 0x3d, r24 ; 61 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 96 87 call 0x30f2c ; 0x30f2c 21f2e: 9f 93 push r25 21f30: 8f 93 push r24 21f32: 7f 93 push r23 21f34: 6f 93 push r22 21f36: 81 ec ldi r24, 0xC1 ; 193 21f38: 8f 93 push r24 21f3a: 80 ea ldi r24, 0xA0 ; 160 21f3c: 8f 93 push r24 21f3e: 1f 92 push r1 21f40: 1f 92 push r1 21f42: 85 e5 ldi r24, 0x55 ; 85 21f44: 9c e8 ldi r25, 0x8C ; 140 21f46: 9f 93 push r25 21f48: 8f 93 push r24 21f4a: 0e 94 e9 89 call 0x113d2 ; 0x113d2 21f4e: 8d b7 in r24, 0x3d ; 61 21f50: 9e b7 in r25, 0x3e ; 62 21f52: 0a 96 adiw r24, 0x0a ; 10 21f54: 0f b6 in r0, 0x3f ; 63 21f56: f8 94 cli 21f58: 9e bf out 0x3e, r25 ; 62 21f5a: 0f be out 0x3f, r0 ; 63 21f5c: 8d bf out 0x3d, r24 ; 61 21f5e: db cd rjmp .-1098 ; 0x21b16 //! @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); 21f60: 20 e0 ldi r18, 0x00 ; 0 21f62: 30 e0 ldi r19, 0x00 ; 0 21f64: 46 e1 ldi r20, 0x16 ; 22 21f66: 53 e4 ldi r21, 0x43 ; 67 21f68: c5 01 movw r24, r10 21f6a: b4 01 movw r22, r8 21f6c: 0f 94 96 87 call 0x30f2c ; 0x30f2c 21f70: 76 2e mov r7, r22 21f72: 67 2e mov r6, r23 21f74: 58 2e mov r5, r24 21f76: 49 2e mov r4, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 21f78: 20 e0 ldi r18, 0x00 ; 0 21f7a: 30 e0 ldi r19, 0x00 ; 0 21f7c: 40 ea ldi r20, 0xA0 ; 160 21f7e: 51 e4 ldi r21, 0x41 ; 65 21f80: c5 01 movw r24, r10 21f82: b4 01 movw r22, r8 21f84: 0f 94 96 87 call 0x30f2c ; 0x30f2c 21f88: b6 2e mov r11, r22 21f8a: a7 2e mov r10, r23 21f8c: 98 2e mov r9, r24 21f8e: 89 2e mov r8, r25 21f90: c5 e0 ldi r28, 0x05 ; 5 for(int8_t i = 0, xdir = -invert; i <= 4; i++, xdir = -xdir) 21f92: df ef ldi r29, 0xFF ; 255 { enquecommandf_P(extrude_fmt_X, xdir * long_length, long_extrusion); 21f94: 20 e8 ldi r18, 0x80 ; 128 21f96: e2 2e mov r14, r18 21f98: 2c e8 ldi r18, 0x8C ; 140 21f9a: f2 2e mov r15, r18 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 21f9c: 31 ec ldi r19, 0xC1 ; 193 21f9e: c3 2e mov r12, r19 21fa0: 40 ea ldi r20, 0xA0 ; 160 21fa2: d4 2e mov r13, r20 21fa4: 05 e5 ldi r16, 0x55 ; 85 21fa6: 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); 21fa8: 4f 92 push r4 21faa: 5f 92 push r5 21fac: 6f 92 push r6 21fae: 7f 92 push r7 21fb0: 6d 2f mov r22, r29 21fb2: 0d 2e mov r0, r29 21fb4: 00 0c add r0, r0 21fb6: 77 0b sbc r23, r23 21fb8: 88 0b sbc r24, r24 21fba: 99 0b sbc r25, r25 21fbc: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 21fc0: 20 e0 ldi r18, 0x00 ; 0 21fc2: 30 e0 ldi r19, 0x00 ; 0 21fc4: 46 e1 ldi r20, 0x16 ; 22 21fc6: 53 e4 ldi r21, 0x43 ; 67 21fc8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 21fcc: 9f 93 push r25 21fce: 8f 93 push r24 21fd0: 7f 93 push r23 21fd2: 6f 93 push r22 21fd4: ff 92 push r15 21fd6: ef 92 push r14 21fd8: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_Y, invert * -short_length, short_extrusion); 21fdc: 8f 92 push r8 21fde: 9f 92 push r9 21fe0: af 92 push r10 21fe2: bf 92 push r11 21fe4: cf 92 push r12 21fe6: df 92 push r13 21fe8: 1f 92 push r1 21fea: 1f 92 push r1 21fec: 1f 93 push r17 21fee: 0f 93 push r16 21ff0: 0e 94 e9 89 call 0x113d2 ; 0x113d2 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) 21ff4: d1 95 neg r29 21ff6: c1 50 subi r28, 0x01 ; 1 21ff8: 8d b7 in r24, 0x3d ; 61 21ffa: 9e b7 in r25, 0x3e ; 62 21ffc: 44 96 adiw r24, 0x14 ; 20 21ffe: 0f b6 in r0, 0x3f ; 63 22000: f8 94 cli 22002: 9e bf out 0x3e, r25 ; 62 22004: 0f be out 0x3f, r0 ; 63 22006: 8d bf out 0x3d, r24 ; 61 22008: c1 11 cpse r28, r1 2200a: ce cf rjmp .-100 ; 0x21fa8 2200c: 84 cd rjmp .-1272 ; 0x21b16 //! @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); 2200e: 23 e4 ldi r18, 0x43 ; 67 22010: 3d ec ldi r19, 0xCD ; 205 22012: 4f e2 ldi r20, 0x2F ; 47 22014: 5d e3 ldi r21, 0x3D ; 61 22016: c5 01 movw r24, r10 22018: b4 01 movw r22, r8 2201a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 2201e: 6b 01 movw r12, r22 22020: 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); 22022: 20 e0 ldi r18, 0x00 ; 0 22024: 30 e0 ldi r19, 0x00 ; 0 22026: 40 ea ldi r20, 0xA0 ; 160 22028: 51 e4 ldi r21, 0x41 ; 65 2202a: c5 01 movw r24, r10 2202c: b4 01 movw r22, r8 2202e: 0f 94 96 87 call 0x30f2c ; 0x30f2c 22032: 66 2e mov r6, r22 22034: 57 2e mov r5, r23 22036: 48 2e mov r4, r24 22038: 39 2e mov r3, r25 const float short_extrusion = count_e(layer_height, extrusion_width, Y_spacing); 2203a: a7 01 movw r20, r14 2203c: 96 01 movw r18, r12 2203e: c5 01 movw r24, r10 22040: b4 01 movw r22, r8 22042: 0f 94 96 87 call 0x30f2c ; 0x30f2c 22046: 26 2e mov r2, r22 22048: a7 2e mov r10, r23 2204a: 98 2e mov r9, r24 2204c: 89 2e mov r8, r25 2204e: 84 e0 ldi r24, 0x04 ; 4 22050: b8 2e mov r11, r24 for (uint8_t i = 0; i < 4; i++) { enquecommandf_P(extrude_fmt_X, square_width*invert, long_extrusion); 22052: 90 ea ldi r25, 0xA0 ; 160 22054: 79 2e mov r7, r25 22056: 00 e8 ldi r16, 0x80 ; 128 22058: 1c e8 ldi r17, 0x8C ; 140 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 2205a: f7 fa bst r15, 7 2205c: f0 94 com r15 2205e: f7 f8 bld r15, 7 22060: f0 94 com r15 22062: c5 e5 ldi r28, 0x55 ; 85 22064: 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); 22066: 3f 92 push r3 22068: 4f 92 push r4 2206a: 5f 92 push r5 2206c: 6f 92 push r6 2206e: 91 e4 ldi r25, 0x41 ; 65 22070: 9f 93 push r25 22072: 7f 92 push r7 22074: 1f 92 push r1 22076: 1f 92 push r1 22078: 1f 93 push r17 2207a: 0f 93 push r16 2207c: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 22080: 8f 92 push r8 22082: 9f 92 push r9 22084: af 92 push r10 22086: 2f 92 push r2 22088: ff 92 push r15 2208a: ef 92 push r14 2208c: df 92 push r13 2208e: cf 92 push r12 22090: df 93 push r29 22092: cf 93 push r28 22094: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_X, -square_width*invert, long_extrusion); 22098: 3f 92 push r3 2209a: 4f 92 push r4 2209c: 5f 92 push r5 2209e: 6f 92 push r6 220a0: 81 ec ldi r24, 0xC1 ; 193 220a2: 8f 93 push r24 220a4: 7f 92 push r7 220a6: 1f 92 push r1 220a8: 1f 92 push r1 220aa: 1f 93 push r17 220ac: 0f 93 push r16 220ae: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(extrude_fmt_Y, -Y_spacing*invert, short_extrusion); 220b2: 8f 92 push r8 220b4: 9f 92 push r9 220b6: af 92 push r10 220b8: 2f 92 push r2 220ba: ff 92 push r15 220bc: ef 92 push r14 220be: df 92 push r13 220c0: cf 92 push r12 220c2: df 93 push r29 220c4: cf 93 push r28 220c6: 0e 94 e9 89 call 0x113d2 ; 0x113d2 220ca: 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++) 220cc: 8d b7 in r24, 0x3d ; 61 220ce: 9e b7 in r25, 0x3e ; 62 220d0: 88 96 adiw r24, 0x28 ; 40 220d2: 0f b6 in r0, 0x3f ; 63 220d4: f8 94 cli 220d6: 9e bf out 0x3e, r25 ; 62 220d8: 0f be out 0x3f, r0 ; 63 220da: 8d bf out 0x3d, r24 ; 61 220dc: b1 10 cpse r11, r1 220de: c3 cf rjmp .-122 ; 0x22066 220e0: 1a cd rjmp .-1484 ; 0x21b16 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]))); 220e2: 69 e0 ldi r22, 0x09 ; 9 220e4: 83 e4 ldi r24, 0x43 ; 67 220e6: 9c e8 ldi r25, 0x8C ; 140 220e8: e4 cc rjmp .-1592 ; 0x21ab2 break; case 2: lay1cal_finish(); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 220ea: 8a e6 ldi r24, 0x6A ; 106 220ec: 90 e7 ldi r25, 0x70 ; 112 220ee: 0f 94 ea 0b call 0x217d4 ; 0x217d4 lcd_commands_step = 0; 220f2: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 220f6: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 220fa: 82 e0 ldi r24, 0x02 ; 2 220fc: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 22100: 8f e5 ldi r24, 0x5F ; 95 22102: 9f e0 ldi r25, 0x0F ; 15 22104: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 22108: 88 23 and r24, r24 2210a: 09 f4 brne .+2 ; 0x2210e 2210c: db cd rjmp .-1098 ; 0x21cc4 lcd_wizard(WizState::RepeatLay1Cal); 2210e: 8c e0 ldi r24, 0x0C ; 12 22110: 0f 94 0a 66 call 0x2cc14 ; 0x2cc14 22114: 00 cd rjmp .-1536 ; 0x21b16 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."); 22116: 81 e0 ldi r24, 0x01 ; 1 22118: 9d e8 ldi r25, 0x8D ; 141 2211a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2211e: ac cd rjmp .-1192 ; 0x21c78 } #ifdef THERMAL_MODEL if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) 22120: 84 30 cpi r24, 0x04 ; 4 22122: a9 f0 breq .+42 ; 0x2214e 22124: c0 f0 brcs .+48 ; 0x22156 22126: 85 30 cpi r24, 0x05 ; 5 22128: 09 f0 breq .+2 ; 0x2212c 2212a: e3 cd rjmp .-1082 ; 0x21cf2 case 0: lcd_commands_step = 5; [[fallthrough]]; case 5: enquecommand_P(G28W); 2212c: 61 e0 ldi r22, 0x01 ; 1 2212e: 81 e2 ldi r24, 0x21 ; 33 22130: 9c e6 ldi r25, 0x6C ; 108 22132: 0e 94 4b 89 call 0x11296 ; 0x11296 enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); 22136: 61 e0 ldi r22, 0x01 ; 1 22138: 8b ee ldi r24, 0xEB ; 235 2213a: 9c e8 ldi r25, 0x8C ; 140 2213c: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_commands_step = 4; 22140: 84 e0 ldi r24, 0x04 ; 4 break; case 4: st_synchronize(); lcd_commands_step = 3; 22142: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 22146: d5 cd rjmp .-1110 ; 0x21cf2 if (lcd_commands_type == LcdCommands::ThermalModel && cmd_buffer_empty()) { switch (lcd_commands_step) { case 0: lcd_commands_step = 5; 22148: 90 93 f7 03 sts 0x03F7, r25 ; 0x8003f7 2214c: ef cf rjmp .-34 ; 0x2212c enquecommand_P(PSTR("G1 X125 Y105 Z1 F8000")); lcd_commands_step = 4; break; case 4: st_synchronize(); 2214e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 lcd_commands_step = 3; 22152: 83 e0 ldi r24, 0x03 ; 3 22154: f6 cf rjmp .-20 ; 0x22142 SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); } void thermal_model_set_warn_beep(bool enabled) { thermal_model::warn_beep = enabled; 22156: 10 92 3d 02 sts 0x023D, r1 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> break; case 3: thermal_model_set_warn_beep(false); enquecommand_P(PSTR("M310 A F1")); 2215a: 61 e0 ldi r22, 0x01 ; 1 2215c: 81 ee ldi r24, 0xE1 ; 225 2215e: 9c e8 ldi r25, 0x8C ; 140 22160: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_commands_step = 2; 22164: 82 e0 ldi r24, 0x02 ; 2 22166: ed cf rjmp .-38 ; 0x22142 break; case 2: if (thermal_model_autotune_result()) 22168: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> 2216c: 81 11 cpse r24, r1 2216e: 05 c0 rjmp .+10 ; 0x2217a enquecommand_P(MSG_M500); 22170: 61 e0 ldi r22, 0x01 ; 1 22172: 87 e2 ldi r24, 0x27 ; 39 22174: 9c e6 ldi r25, 0x6C ; 108 22176: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_commands_step = 1; 2217a: 81 e0 ldi r24, 0x01 ; 1 2217c: e2 cf rjmp .-60 ; 0x22142 break; case 1: lcd_commands_step = 0; 2217e: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 22182: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 22186: 92 e0 ldi r25, 0x02 ; 2 22188: 90 93 67 0e sts 0x0E67, r25 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 2218c: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> SetPrinterState(PrinterState::Idle); thermal_model_set_warn_beep(true); bool res = thermal_model_autotune_result(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 22190: 8f e5 ldi r24, 0x5F ; 95 22192: 9f e0 ldi r25, 0x0F ; 15 22194: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 22198: 88 23 and r24, r24 2219a: 09 f4 brne .+2 ; 0x2219e 2219c: cc cd rjmp .-1128 ; 0x21d36 // resume the wizard lcd_wizard(res ? WizState::Restore : WizState::Failed); 2219e: 80 91 3c 02 lds r24, 0x023C ; 0x80023c <_ZL26thermal_model_autotune_err.lto_priv.557> 221a2: 81 11 cpse r24, r1 221a4: 04 c0 rjmp .+8 ; 0x221ae 221a6: 81 e0 ldi r24, 0x01 ; 1 221a8: 0f 94 0a 66 call 0x2cc14 ; 0x2cc14 221ac: a2 cd rjmp .-1212 ; 0x21cf2 221ae: 8e e0 ldi r24, 0x0E ; 14 221b0: fb cf rjmp .-10 ; 0x221a8 #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 221b2: 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; 221b4: 80 93 f7 03 sts 0x03F7, r24 ; 0x8003f7 221b8: be cd rjmp .-1156 ; 0x21d36 #ifdef THERMAL_MODEL was_enabled = thermal_model_enabled(); thermal_model_set_enabled(false); #endif //THERMAL_MODEL #else //nozzle change without heating while((int)degHotend(active_extruder)>40) { //check temp 221ba: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 221be: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 221c2: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 221c6: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 221ca: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 221ce: 69 32 cpi r22, 0x29 ; 41 221d0: 71 05 cpc r23, r1 221d2: 74 f0 brlt .+28 ; 0x221f0 fanSpeed = 255; //turn on fan 221d4: c0 93 e3 03 sts 0x03E3, r28 ; 0x8003e3 disable_heater(); 221d8: 0f 94 57 45 call 0x28aae ; 0x28aae uint8_t choice = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_COOLDOWN), true, LCD_LEFT_BUTTON_CHOICE); 221dc: 89 e4 ldi r24, 0x49 ; 73 221de: 90 e4 ldi r25, 0x40 ; 64 221e0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 221e4: 40 e0 ldi r20, 0x00 ; 0 221e6: 61 e0 ldi r22, 0x01 ; 1 221e8: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 221ec: 81 30 cpi r24, 0x01 ; 1 221ee: 29 f7 brne .-54 ; 0x221ba break; } } enquecommand_P(G28W); //home 221f0: 61 e0 ldi r22, 0x01 ; 1 221f2: 81 e2 ldi r24, 0x21 ; 33 221f4: 9c e6 ldi r25, 0x6C ; 108 221f6: 0e 94 4b 89 call 0x11296 ; 0x11296 enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center 221fa: 61 e0 ldi r22, 0x01 ; 1 221fc: 8e ec ldi r24, 0xCE ; 206 221fe: 9c e8 ldi r25, 0x8C ; 140 22200: 0e 94 4b 89 call 0x11296 ; 0x11296 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 22204: 82 e0 ldi r24, 0x02 ; 2 22206: d6 cf rjmp .-84 ; 0x221b4 break; case 2: enquecommand_P(PSTR("M84 XY")); 22208: 61 e0 ldi r22, 0x01 ; 1 2220a: 87 ec ldi r24, 0xC7 ; 199 2220c: 9c e8 ldi r25, 0x8C ; 140 2220e: 0e 94 4b 89 call 0x11296 ; 0x11296 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 22212: 87 e3 ldi r24, 0x37 ; 55 22214: 90 e4 ldi r25, 0x40 ; 64 22216: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2221a: 41 e0 ldi r20, 0x01 ; 1 2221c: 60 e0 ldi r22, 0x00 ; 0 2221e: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 22222: 81 11 cpse r24, r1 22224: 88 cd rjmp .-1264 ; 0x21d36 setTargetHotend(0); #ifdef THERMAL_MODEL thermal_model_set_enabled(was_enabled); #endif //THERMAL_MODEL #else fanSpeed = 0; //turn off fan 22226: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 1; 2222a: 81 e0 ldi r24, 0x01 ; 1 2222c: c3 cf rjmp .-122 ; 0x221b4 } break; case 1: lcd_commands_step = 0; 2222e: 10 92 f7 03 sts 0x03F7, r1 ; 0x8003f7 lcd_commands_type = LcdCommands::Idle; 22232: 10 92 65 0e sts 0x0E65, r1 ; 0x800e65 22236: 82 e0 ldi r24, 0x02 ; 2 22238: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 2223c: 20 e0 ldi r18, 0x00 ; 0 2223e: 41 e0 ldi r20, 0x01 ; 1 22240: 62 e0 ldi r22, 0x02 ; 2 22242: 70 e0 ldi r23, 0x00 ; 0 22244: 8c e0 ldi r24, 0x0C ; 12 22246: 9b e3 ldi r25, 0x3B ; 59 22248: 0f 94 3a cf call 0x39e74 ; 0x39e74 menu_depth = 3; 2224c: 83 e0 ldi r24, 0x03 ; 3 2224e: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 22252: 71 cd rjmp .-1310 ; 0x21d36 00022254 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 22254: 0f 93 push r16 22256: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 22258: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2225c: 80 95 com r24 2225e: 81 70 andi r24, 0x01 ; 1 22260: 90 91 0e 04 lds r25, 0x040E ; 0x80040e 22264: 89 17 cp r24, r25 22266: a1 f1 breq .+104 ; 0x222d0 { if(menu_menu == lcd_sdcard_menu) { 22268: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 2226c: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 22270: 8c 56 subi r24, 0x6C ; 108 22272: 99 43 sbci r25, 0x39 ; 57 22274: 11 f4 brne .+4 ; 0x2227a // 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(); 22276: 0f 94 d8 d1 call 0x3a3b0 ; 0x3a3b0 } lcd_draw_update = 2; 2227a: 82 e0 ldi r24, 0x02 ; 2 2227c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_oldcardstatus = IS_SD_INSERTED; 22280: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 22284: 80 95 com r24 22286: 81 70 andi r24, 0x01 ; 1 22288: 80 93 0e 04 sts 0x040E, r24 ; 0x80040e lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2228c: 0e 94 41 70 call 0xe082 ; 0xe082 backlight_wake(); 22290: 80 e0 ldi r24, 0x00 ; 0 22292: 0e 94 a0 8b call 0x11740 ; 0x11740 if (lcd_oldcardstatus) 22296: 80 91 0e 04 lds r24, 0x040E ; 0x80040e 2229a: 88 23 and r24, r24 2229c: 09 f4 brne .+2 ; 0x222a0 2229e: 71 c0 rjmp .+226 ; 0x22382 { if (!card.mounted) 222a0: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 222a4: 81 11 cpse r24, r1 222a6: 05 c0 rjmp .+10 ; 0x222b2 { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 222a8: 0f 94 78 81 call 0x302f0 ; 0x302f0 card.presort_flag = true; //force sorting of the SD menu 222ac: 81 e0 ldi r24, 0x01 ; 1 222ae: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd } LCD_MESSAGERPGM(MSG_WELCOME); 222b2: 8a e6 ldi r24, 0x6A ; 106 222b4: 90 e7 ldi r25, 0x70 ; 112 222b6: 0f 94 ea 0b call 0x217d4 ; 0x217d4 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 222ba: 10 92 dd 03 sts 0x03DD, r1 ; 0x8003dd menu_submenu(lcd_sdcard_menu, true); 222be: 61 e0 ldi r22, 0x01 ; 1 222c0: 8c e6 ldi r24, 0x6C ; 108 222c2: 99 e3 ldi r25, 0x39 ; 57 222c4: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa lcd_timeoutToStatus.start(); 222c8: 88 ed ldi r24, 0xD8 ; 216 222ca: 93 e0 ldi r25, 0x03 ; 3 222cc: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 222d0: 0f 94 8b 3f call 0x27f16 ; 0x27f16 222d4: 00 91 d4 03 lds r16, 0x03D4 ; 0x8003d4 222d8: 10 91 d5 03 lds r17, 0x03D5 ; 0x8003d5 222dc: 20 91 d6 03 lds r18, 0x03D6 ; 0x8003d6 222e0: 30 91 d7 03 lds r19, 0x03D7 ; 0x8003d7 222e4: 06 17 cp r16, r22 222e6: 17 07 cpc r17, r23 222e8: 28 07 cpc r18, r24 222ea: 39 07 cpc r19, r25 222ec: e8 f5 brcc .+122 ; 0x22368 { if (lcd_draw_update) { 222ee: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 222f2: 88 23 and r24, r24 222f4: 31 f0 breq .+12 ; 0x22302 lcd_timeoutToStatus.start(); 222f6: 88 ed ldi r24, 0xD8 ; 216 222f8: 93 e0 ldi r25, 0x03 ; 3 222fa: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> lcd_frame_start(); 222fe: 0e 94 49 6f call 0xde92 ; 0xde92 } (*menu_menu)(); 22302: e0 91 69 0e lds r30, 0x0E69 ; 0x800e69 22306: f0 91 6a 0e lds r31, 0x0E6A ; 0x800e6a 2230a: 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)))); 2230c: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 22310: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a 22314: 84 5e subi r24, 0xE4 ; 228 22316: 99 43 sbci r25, 0x39 ; 57 22318: 09 f4 brne .+2 ; 0x2231c 2231a: 46 c0 rjmp .+140 ; 0x223a8 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 2231c: 80 91 69 0e lds r24, 0x0E69 ; 0x800e69 22320: 90 91 6a 0e lds r25, 0x0E6A ; 0x800e6a && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 22324: 2a e3 ldi r18, 0x3A ; 58 22326: 8c 33 cpi r24, 0x3C ; 60 22328: 92 07 cpc r25, r18 2232a: 09 f0 breq .+2 ; 0x2232e 2232c: 5e c0 rjmp .+188 ; 0x223ea } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 2232e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22332: 82 30 cpi r24, 0x02 ; 2 22334: 21 f4 brne .+8 ; 0x2233e #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 22336: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_status_message_idx = 0; // Re-draw message from beginning 2233a: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 2233e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22342: 88 23 and r24, r24 22344: 19 f0 breq .+6 ; 0x2234c 22346: 81 50 subi r24, 0x01 ; 1 22348: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 2234c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 22350: 6c 59 subi r22, 0x9C ; 156 22352: 7f 4f sbci r23, 0xFF ; 255 22354: 8f 4f sbci r24, 0xFF ; 255 22356: 9f 4f sbci r25, 0xFF ; 255 22358: 60 93 d4 03 sts 0x03D4, r22 ; 0x8003d4 2235c: 70 93 d5 03 sts 0x03D5, r23 ; 0x8003d5 22360: 80 93 d6 03 sts 0x03D6, r24 ; 0x8003d6 22364: 90 93 d7 03 sts 0x03D7, r25 ; 0x8003d7 } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 22368: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 2236c: 84 30 cpi r24, 0x04 ; 4 2236e: 09 f0 breq .+2 ; 0x22372 22370: 53 c0 rjmp .+166 ; 0x22418 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) { 22372: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 22376: 81 11 cpse r24, r1 22378: 4f c0 rjmp .+158 ; 0x22418 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(); } 2237a: 1f 91 pop r17 2237c: 0f 91 pop r16 2237e: 0d 94 fb 0b jmp 0x217f6 ; 0x217f6 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 22382: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e mounted = false; 22386: 10 92 6f 14 sts 0x146F, r1 ; 0x80146f SERIAL_ECHO_START; 2238a: 82 ef ldi r24, 0xF2 ; 242 2238c: 99 ea ldi r25, 0xA9 ; 169 2238e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 22392: 89 ec ldi r24, 0xC9 ; 201 22394: 9b e6 ldi r25, 0x6B ; 107 22396: 0e 94 06 7b call 0xf60c ; 0xf60c lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 2239a: 8a e0 ldi r24, 0x0A ; 10 2239c: 90 e4 ldi r25, 0x40 ; 64 2239e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 223a2: 0f 94 ea 0b call 0x217d4 ; 0x217d4 223a6: 94 cf rjmp .-216 ; 0x222d0 // 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)))); 223a8: 0e 94 54 68 call 0xd0a8 ; 0xd0a8 223ac: 81 11 cpse r24, r1 223ae: 0e c0 rjmp .+28 ; 0x223cc 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) 223b0: e0 91 69 0e lds r30, 0x0E69 ; 0x800e69 223b4: f0 91 6a 0e lds r31, 0x0E6A ; 0x800e6a 223b8: 30 97 sbiw r30, 0x00 ; 0 223ba: 39 f5 brne .+78 ; 0x2240a { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 223bc: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_return_to_status(); 223c0: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_draw_update = 2; 223c4: 82 e0 ldi r24, 0x02 ; 2 223c6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d 223ca: b1 cf rjmp .-158 ; 0x2232e // 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)))); 223cc: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 223d0: 81 11 cpse r24, r1 223d2: a4 cf rjmp .-184 ; 0x2231c 223d4: 40 e9 ldi r20, 0x90 ; 144 223d6: 5f e5 ldi r21, 0x5F ; 95 223d8: 61 e0 ldi r22, 0x01 ; 1 223da: 70 e0 ldi r23, 0x00 ; 0 223dc: 88 ed ldi r24, 0xD8 ; 216 223de: 93 e0 ldi r25, 0x03 ; 3 223e0: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 223e4: 81 11 cpse r24, r1 223e6: e4 cf rjmp .-56 ; 0x223b0 223e8: 99 cf rjmp .-206 ; 0x2231c } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 223ea: 84 5e subi r24, 0xE4 ; 228 223ec: 99 43 sbci r25, 0x39 ; 57 223ee: 09 f4 brne .+2 ; 0x223f2 223f0: 9e cf rjmp .-196 ; 0x2232e && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 223f2: 40 e3 ldi r20, 0x30 ; 48 223f4: 55 e7 ldi r21, 0x75 ; 117 223f6: 60 e0 ldi r22, 0x00 ; 0 223f8: 70 e0 ldi r23, 0x00 ; 0 223fa: 88 ed ldi r24, 0xD8 ; 216 223fc: 93 e0 ldi r25, 0x03 ; 3 223fe: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 22402: 88 23 and r24, r24 22404: 09 f4 brne .+2 ; 0x22408 22406: 93 cf rjmp .-218 ; 0x2232e 22408: d3 cf rjmp .-90 ; 0x223b0 // 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; 2240a: 81 e0 ldi r24, 0x01 ; 1 2240c: 80 93 d3 03 sts 0x03D3, r24 ; 0x8003d3 (*menu_menu)(); 22410: 19 95 eicall menu_leaving = 0; 22412: 10 92 d3 03 sts 0x03D3, r1 ; 0x8003d3 22416: d2 cf rjmp .-92 ; 0x223bc 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(); } 22418: 1f 91 pop r17 2241a: 0f 91 pop r16 2241c: 08 95 ret 0002241e : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 2241e: 2f 92 push r2 22420: 3f 92 push r3 22422: 4f 92 push r4 22424: 5f 92 push r5 22426: 6f 92 push r6 22428: 7f 92 push r7 2242a: 8f 92 push r8 2242c: 9f 92 push r9 2242e: af 92 push r10 22430: bf 92 push r11 22432: cf 92 push r12 22434: df 92 push r13 22436: ef 92 push r14 22438: ff 92 push r15 2243a: 0f 93 push r16 2243c: 1f 93 push r17 2243e: cf 93 push r28 22440: df 93 push r29 22442: cd b7 in r28, 0x3d ; 61 22444: de b7 in r29, 0x3e ; 62 22446: 2d 97 sbiw r28, 0x0d ; 13 22448: 0f b6 in r0, 0x3f ; 63 2244a: f8 94 cli 2244c: de bf out 0x3e, r29 ; 62 2244e: 0f be out 0x3f, r0 ; 63 22450: 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) 22452: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 22456: 81 30 cpi r24, 0x01 ; 1 22458: 31 f1 breq .+76 ; 0x224a6 2245a: 30 f0 brcs .+12 ; 0x22468 2245c: 82 30 cpi r24, 0x02 ; 2 2245e: 09 f4 brne .+2 ; 0x22462 22460: 7d c2 rjmp .+1274 ; 0x2295c { _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. 22462: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 22466: fe c0 rjmp .+508 ; 0x22664 switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 22468: 80 91 bd 14 lds r24, 0x14BD ; 0x8014bd 2246c: 88 23 and r24, r24 2246e: 49 f0 breq .+18 ; 0x22482 { card.presort_flag = false; 22470: 10 92 bd 14 sts 0x14BD, r1 ; 0x8014bd lcd_update_enabled = false; 22474: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e card.presort(); 22478: 0f 94 48 7d call 0x2fa90 ; 0x2fa90 lcd_update_enabled = true; 2247c: 81 e0 ldi r24, 0x01 ; 1 2247e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } _md->fileCnt = card.getnrfilenames(); 22482: 0f 94 f8 7b call 0x2f7f0 ; 0x2f7f0 22486: 90 93 b1 03 sts 0x03B1, r25 ; 0x8003b1 2248a: 80 93 b0 03 sts 0x03B0, r24 ; 0x8003b0 _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2248e: 89 e0 ldi r24, 0x09 ; 9 22490: 9f e0 ldi r25, 0x0F ; 15 22492: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 22496: 80 93 b3 03 sts 0x03B3, r24 ; 0x8003b3 _md->menuState = _standard; 2249a: 81 e0 ldi r24, 0x01 ; 1 2249c: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->row = -1; // assume that no SD file/dir is currently selected. Once they are rendered, it will be changed to the correct row for the _scrolling state. 224a0: 8f ef ldi r24, 0xFF ; 255 224a2: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 } // FALLTHRU case _standard: //normal menu structure. { if (!_md->lcd_scrollTimer.running()) //if the timer is not running, then the menu state was just switched, so redraw the screen. 224a6: 80 91 b4 03 lds r24, 0x03B4 ; 0x8003b4 224aa: 81 11 cpse r24, r1 224ac: 07 c0 rjmp .+14 ; 0x224bc { _md->lcd_scrollTimer.start(); 224ae: 84 eb ldi r24, 0xB4 ; 180 224b0: 93 e0 ldi r25, 0x03 ; 3 224b2: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> lcd_draw_update = 1; 224b6: 81 e0 ldi r24, 0x01 ; 1 224b8: 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. 224bc: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 224c0: 81 11 cpse r24, r1 224c2: 21 c0 rjmp .+66 ; 0x22506 224c4: 64 ef ldi r22, 0xF4 ; 244 224c6: 71 e0 ldi r23, 0x01 ; 1 224c8: 84 eb ldi r24, 0xB4 ; 180 224ca: 93 e0 ldi r25, 0x03 ; 3 224cc: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 224d0: 88 23 and r24, r24 224d2: a1 f0 breq .+40 ; 0x224fc 224d4: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 224d8: 8f 3f cpi r24, 0xFF ; 255 224da: 81 f0 breq .+32 ; 0x224fc { _md->menuState = _scrolling; 224dc: 82 e0 ldi r24, 0x02 ; 2 224de: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->offset = 0; 224e2: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->scrollPointer = NULL; 224e6: 10 92 ad 03 sts 0x03AD, r1 ; 0x8003ad 224ea: 10 92 ac 03 sts 0x03AC, r1 ; 0x8003ac _md->lcd_scrollTimer.start(); 224ee: 84 eb ldi r24, 0xB4 ; 180 224f0: 93 e0 ldi r25, 0x03 ; 3 224f2: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 224f6: 81 e0 ldi r24, 0x01 ; 1 224f8: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update == 0 && !lcd_clicked()) 224fc: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 22500: 88 23 and r24, r24 22502: 09 f4 brne .+2 ; 0x22506 22504: ab c0 rjmp .+342 ; 0x2265c 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. 22506: 8f ef ldi r24, 0xFF ; 255 22508: 80 93 b2 03 sts 0x03B2, r24 ; 0x8003b2 //if we reached this point it means that the encoder moved or clicked or the state is being switched. Reset the scrollTimer. _md->lcd_scrollTimer.start(); 2250c: 84 eb ldi r24, 0xB4 ; 180 2250e: 93 e0 ldi r25, 0x03 ; 3 22510: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> MENU_BEGIN(); 22514: 0f 94 10 cf call 0x39e20 ; 0x39e20 22518: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if(eFilamentAction != FilamentAction::None) return; // Create a copy of card.filename on the stack since card.filename pointer // will be modified by the SD card library when searching for the file char selected_filename[FILENAME_LENGTH]; strcpy(selected_filename, filename); 2251c: ce 01 movw r24, r28 2251e: 01 96 adiw r24, 0x01 ; 1 22520: 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); 22522: fd ee ldi r31, 0xED ; 237 22524: 2f 2e mov r2, r31 22526: f0 e7 ldi r31, 0x70 ; 112 22528: 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(); 2252a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2252e: 84 30 cpi r24, 0x04 ; 4 22530: 08 f0 brcs .+2 ; 0x22534 22532: 98 c0 rjmp .+304 ; 0x22664 22534: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(bMain?MSG_MAIN:MSG_BACK)); // i.e. default menu-item / menu-item after card insertion 22538: 80 91 dd 03 lds r24, 0x03DD ; 0x8003dd 2253c: 88 23 and r24, r24 2253e: 09 f4 brne .+2 ; 0x22542 22540: aa c0 rjmp .+340 ; 0x22696 22542: 88 eb ldi r24, 0xB8 ; 184 22544: 9d e3 ldi r25, 0x3D ; 61 22546: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2254a: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 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;}; 2254e: 60 e7 ldi r22, 0x70 ; 112 22550: 74 e1 ldi r23, 0x14 ; 20 22552: 89 e1 ldi r24, 0x19 ; 25 22554: 95 e1 ldi r25, 0x15 ; 21 22556: 0f 94 97 a4 call 0x3492e ; 0x3492e card.getWorkDirName(); if (card.filename[0] == '/') 2255a: 80 91 70 14 lds r24, 0x1470 ; 0x801470 2255e: 8f 32 cpi r24, 0x2F ; 47 22560: 09 f0 breq .+2 ; 0x22564 22562: 9c c0 rjmp .+312 ; 0x2269c { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 22564: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 22568: 88 23 and r24, r24 2256a: 41 f0 breq .+16 ; 0x2257c MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 2256c: 8d ea ldi r24, 0xAD ; 173 2256e: 9d e3 ldi r25, 0x3D ; 61 22570: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22574: 66 e6 ldi r22, 0x66 ; 102 22576: 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. 22578: 0f 94 8d ce call 0x39d1a ; 0x39d1a for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 2257c: c0 90 b0 03 lds r12, 0x03B0 ; 0x8003b0 22580: d0 90 b1 03 lds r13, 0x03B1 ; 0x8003b1 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 22584: 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. 22586: 91 e0 ldi r25, 0x01 ; 1 22588: c9 1a sub r12, r25 2258a: d1 08 sbc r13, r1 2258c: 08 f4 brcc .+2 ; 0x22590 2258e: d9 c1 rjmp .+946 ; 0x22942 { if (menu_item == menu_line) //If the file is on the screen. 22590: 80 91 18 05 lds r24, 0x0518 ; 0x800518 22594: 90 91 17 05 lds r25, 0x0517 ; 0x800517 22598: 89 13 cpse r24, r25 2259a: cf c1 rjmp .+926 ; 0x2293a { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 2259c: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 225a0: c6 01 movw r24, r12 225a2: 0f 94 b6 85 call 0x30b6c ; 0x30b6c #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 225a6: 80 91 18 05 lds r24, 0x0518 ; 0x800518 225aa: 90 e0 ldi r25, 0x00 ; 0 225ac: 20 91 37 05 lds r18, 0x0537 ; 0x800537 225b0: 30 91 38 05 lds r19, 0x0538 ; 0x800538 225b4: 10 91 ba 14 lds r17, 0x14BA ; 0x8014ba 225b8: 82 17 cp r24, r18 225ba: 93 07 cpc r25, r19 225bc: 51 f4 brne .+20 ; 0x225d2 { _md->selectedFileID = i; 225be: d0 92 af 03 sts 0x03AF, r13 ; 0x8003af 225c2: c0 92 ae 03 sts 0x03AE, r12 ; 0x8003ae _md->isDir = card.filenameIsDir; 225c6: 10 93 ab 03 sts 0x03AB, r17 ; 0x8003ab _md->row = menu_row; 225ca: 40 91 15 05 lds r20, 0x0515 ; 0x800515 225ce: 40 93 b2 03 sts 0x03B2, r20 ; 0x8003b2 225d2: 40 91 6d 02 lds r20, 0x026D ; 0x80026d } if (card.filenameIsDir) 225d6: 11 23 and r17, r17 225d8: 09 f4 brne .+2 ; 0x225dc 225da: 65 c0 rjmp .+202 ; 0x226a6 #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) 225dc: 44 23 and r20, r20 225de: e9 f0 breq .+58 ; 0x2261a { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 225e0: 40 91 85 14 lds r20, 0x1485 ; 0x801485 225e4: e0 e7 ldi r30, 0x70 ; 112 225e6: ae 2e mov r10, r30 225e8: e4 e1 ldi r30, 0x14 ; 20 225ea: be 2e mov r11, r30 225ec: 44 23 and r20, r20 225ee: 21 f0 breq .+8 ; 0x225f8 225f0: 75 e8 ldi r23, 0x85 ; 133 225f2: a7 2e mov r10, r23 225f4: 74 e1 ldi r23, 0x14 ; 20 225f6: b7 2e mov r11, r23 225f8: 60 91 15 05 lds r22, 0x0515 ; 0x800515 } static void lcd_implementation_drawmenu_sddirectory(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 2; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 225fc: 4e e3 ldi r20, 0x3E ; 62 225fe: 82 17 cp r24, r18 22600: 93 07 cpc r25, r19 22602: 09 f0 breq .+2 ; 0x22606 22604: 40 e2 ldi r20, 0x20 ; 32 22606: 80 e0 ldi r24, 0x00 ; 0 22608: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_putc(LCD_STR_FOLDER[0]); 2260c: 85 e8 ldi r24, 0x85 ; 133 2260e: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_print_pad(longFilename, len); 22612: 62 e1 ldi r22, 0x12 ; 18 22614: c5 01 movw r24, r10 22616: 0e 94 84 71 call 0xe308 ; 0xe308 2261a: 80 91 18 05 lds r24, 0x0518 ; 0x800518 { if (lcd_draw_update) { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 2261e: 90 91 16 05 lds r25, 0x0516 ; 0x800516 22622: 99 23 and r25, r25 22624: 09 f4 brne .+2 ; 0x22628 22626: 89 c1 rjmp .+786 ; 0x2293a 22628: 20 91 37 05 lds r18, 0x0537 ; 0x800537 2262c: 30 91 38 05 lds r19, 0x0538 ; 0x800538 22630: 82 17 cp r24, r18 22632: 13 06 cpc r1, r19 22634: 09 f0 breq .+2 ; 0x22638 22636: 81 c1 rjmp .+770 ; 0x2293a { lcd_update_enabled = false; 22638: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 2263c: 61 e0 ldi r22, 0x01 ; 1 2263e: 80 e7 ldi r24, 0x70 ; 112 22640: 94 e1 ldi r25, 0x14 ; 20 22642: 0f 94 ca 7e call 0x2fd94 ; 0x2fd94 lcd_encoder = 0; 22646: 10 92 38 05 sts 0x0538, r1 ; 0x800538 2264a: 10 92 37 05 sts 0x0537, r1 ; 0x800537 menu_data_reset(); //Forces reloading of cached variables. 2264e: 0f 94 32 cf call 0x39e64 ; 0x39e64 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 22652: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e menu_item_ret(); 22656: 0f 94 f6 cd call 0x39bec ; 0x39bec 2265a: 95 cf rjmp .-214 ; 0x22586 _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()) 2265c: 0e 94 b2 71 call 0xe364 ; 0xe364 22660: 81 11 cpse r24, r1 22662: 51 cf rjmp .-350 ; 0x22506 _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 22664: 2d 96 adiw r28, 0x0d ; 13 22666: 0f b6 in r0, 0x3f ; 63 22668: f8 94 cli 2266a: de bf out 0x3e, r29 ; 62 2266c: 0f be out 0x3f, r0 ; 63 2266e: cd bf out 0x3d, r28 ; 61 22670: df 91 pop r29 22672: cf 91 pop r28 22674: 1f 91 pop r17 22676: 0f 91 pop r16 22678: ff 90 pop r15 2267a: ef 90 pop r14 2267c: df 90 pop r13 2267e: cf 90 pop r12 22680: bf 90 pop r11 22682: af 90 pop r10 22684: 9f 90 pop r9 22686: 8f 90 pop r8 22688: 7f 90 pop r7 2268a: 6f 90 pop r6 2268c: 5f 90 pop r5 2268e: 4f 90 pop r4 22690: 3f 90 pop r3 22692: 2f 90 pop r2 22694: 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 22696: 89 e1 ldi r24, 0x19 ; 25 22698: 90 e4 ldi r25, 0x40 ; 64 2269a: 55 cf rjmp .-342 ; 0x22546 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. 2269c: 60 e7 ldi r22, 0x70 ; 112 2269e: 77 ed ldi r23, 0xD7 ; 215 226a0: 83 e4 ldi r24, 0x43 ; 67 226a2: 9b e8 ldi r25, 0x8B ; 139 226a4: 69 cf rjmp .-302 ; 0x22578 menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 226a6: 44 23 and r20, r20 226a8: d1 f0 breq .+52 ; 0x226de { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 226aa: 40 91 85 14 lds r20, 0x1485 ; 0x801485 226ae: 60 e7 ldi r22, 0x70 ; 112 226b0: a6 2e mov r10, r22 226b2: 64 e1 ldi r22, 0x14 ; 20 226b4: b6 2e mov r11, r22 226b6: 44 23 and r20, r20 226b8: 21 f0 breq .+8 ; 0x226c2 226ba: 55 e8 ldi r21, 0x85 ; 133 226bc: a5 2e mov r10, r21 226be: 54 e1 ldi r21, 0x14 ; 20 226c0: b5 2e mov r11, r21 226c2: 60 91 15 05 lds r22, 0x0515 ; 0x800515 bool bSettings; // flag (i.e. 'fake parameter') for 'lcd_hw_setup_menu()' function static void lcd_implementation_drawmenu_sdfile(uint8_t row, const char* longFilename) { uint8_t len = LCD_WIDTH - 1; lcd_putc_at(0, row, (lcd_encoder == menu_item)?'>':' '); 226c6: 4e e3 ldi r20, 0x3E ; 62 226c8: 82 17 cp r24, r18 226ca: 93 07 cpc r25, r19 226cc: 09 f0 breq .+2 ; 0x226d0 226ce: 40 e2 ldi r20, 0x20 ; 32 226d0: 80 e0 ldi r24, 0x00 ; 0 226d2: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_pad(longFilename, len); 226d6: 63 e1 ldi r22, 0x13 ; 19 226d8: c5 01 movw r24, r10 226da: 0e 94 84 71 call 0xe308 ; 0xe308 226de: 80 91 18 05 lds r24, 0x0518 ; 0x800518 { if (lcd_draw_update) { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); } if (menu_clicked && (lcd_encoder == menu_item)) 226e2: 90 91 16 05 lds r25, 0x0516 ; 0x800516 226e6: 99 23 and r25, r25 226e8: 09 f4 brne .+2 ; 0x226ec 226ea: 27 c1 rjmp .+590 ; 0x2293a 226ec: 20 91 37 05 lds r18, 0x0537 ; 0x800537 226f0: 30 91 38 05 lds r19, 0x0538 ; 0x800538 226f4: 82 17 cp r24, r18 226f6: 13 06 cpc r1, r19 226f8: 09 f0 breq .+2 ; 0x226fc 226fa: 1f c1 rjmp .+574 ; 0x2293a { lcd_update_enabled = false; 226fc: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 22700: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 22704: 81 11 cpse r24, r1 22706: a5 cf rjmp .-182 ; 0x22652 // 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); 22708: 60 e7 ldi r22, 0x70 ; 112 2270a: 74 e1 ldi r23, 0x14 ; 20 2270c: c7 01 movw r24, r14 2270e: 0f 94 fc e3 call 0x3c7f8 ; 0x3c7f8 22712: 47 01 movw r8, r14 22714: 45 e9 ldi r20, 0x95 ; 149 22716: a4 2e mov r10, r20 22718: 4f e0 ldi r20, 0x0F ; 15 2271a: 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] == '.') { 2271c: f4 01 movw r30, r8 2271e: 61 91 ld r22, Z+ 22720: 4f 01 movw r8, r30 22722: 66 23 and r22, r22 22724: 19 f0 breq .+6 ; 0x2272c 22726: 6e 32 cpi r22, 0x2E ; 46 22728: 09 f0 breq .+2 ; 0x2272c 2272a: 4b c0 rjmp .+150 ; 0x227c2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2272c: 60 e0 ldi r22, 0x00 ; 0 2272e: c5 01 movw r24, r10 22730: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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, '.'); 22734: 6e e2 ldi r22, 0x2E ; 46 22736: 70 e0 ldi r23, 0x00 ; 0 22738: c7 01 movw r24, r14 2273a: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 2273e: 3c 01 movw r6, r24 if (extension_ptr) { 22740: 89 2b or r24, r25 22742: 19 f0 breq .+6 ; 0x2274a extension_ptr++; // skip the '.' 22744: 8f ef ldi r24, 0xFF ; 255 22746: 68 1a sub r6, r24 22748: 78 0a sbc r7, r24 2274a: 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); 2274c: 31 e9 ldi r19, 0x91 ; 145 2274e: a3 2e mov r10, r19 22750: 3c e0 ldi r19, 0x0C ; 12 22752: 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') { 22754: 61 14 cp r6, r1 22756: 71 04 cpc r7, r1 22758: 21 f0 breq .+8 ; 0x22762 2275a: f4 01 movw r30, r8 2275c: 60 81 ld r22, Z 2275e: 61 11 cpse r22, r1 22760: 01 c0 rjmp .+2 ; 0x22764 22762: 60 e0 ldi r22, 0x00 ; 0 22764: c5 01 movw r24, r10 22766: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 2276a: ff ef ldi r31, 0xFF ; 255 2276c: af 1a sub r10, r31 2276e: bf 0a sbc r11, r31 22770: 2f ef ldi r18, 0xFF ; 255 22772: 82 1a sub r8, r18 22774: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 22776: 84 e9 ldi r24, 0x94 ; 148 22778: a8 16 cp r10, r24 2277a: 8c e0 ldi r24, 0x0C ; 12 2277c: b8 06 cpc r11, r24 2277e: 51 f7 brne .-44 ; 0x22754 { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 22780: 60 90 0e 16 lds r6, 0x160E ; 0x80160e 22784: 66 2d mov r22, r6 22786: 8a e5 ldi r24, 0x5A ; 90 22788: 9f e0 ldi r25, 0x0F ; 15 2278a: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 2278e: 8c e6 ldi r24, 0x6C ; 108 22790: 94 e1 ldi r25, 0x14 ; 20 22792: 2a e0 ldi r18, 0x0A ; 10 22794: a2 2e mov r10, r18 22796: 2f e0 ldi r18, 0x0F ; 15 22798: 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++) { 2279a: 71 2c mov r7, r1 2279c: 4c 01 movw r8, r24 2279e: e9 e0 ldi r30, 0x09 ; 9 227a0: 8e 0e add r8, r30 227a2: 91 1c adc r9, r1 227a4: 76 14 cp r7, r6 227a6: d1 f0 breq .+52 ; 0x227dc #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); 227a8: 48 e0 ldi r20, 0x08 ; 8 227aa: 50 e0 ldi r21, 0x00 ; 0 227ac: b5 01 movw r22, r10 227ae: 8e 5a subi r24, 0xAE ; 174 227b0: 9f 4f sbci r25, 0xFF ; 255 227b2: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 227b6: 73 94 inc r7 227b8: f8 e0 ldi r31, 0x08 ; 8 227ba: af 0e add r10, r31 227bc: b1 1c adc r11, r1 227be: c4 01 movw r24, r8 227c0: ed cf rjmp .-38 ; 0x2279c if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 227c2: c5 01 movw r24, r10 227c4: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 227c8: ff ef ldi r31, 0xFF ; 255 227ca: af 1a sub r10, r31 227cc: 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++) { 227ce: 2d e9 ldi r18, 0x9D ; 157 227d0: a2 16 cp r10, r18 227d2: 2f e0 ldi r18, 0x0F ; 15 227d4: b2 06 cpc r11, r18 227d6: 09 f0 breq .+2 ; 0x227da 227d8: a1 cf rjmp .-190 ; 0x2271c 227da: ac cf rjmp .-168 ; 0x22734 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 227dc: 61 e0 ldi r22, 0x01 ; 1 227de: c7 01 movw r24, r14 227e0: 0f 94 01 80 call 0x30002 ; 0x30002 } uint32_t CardReader::getFileSize() { return filesize; 227e4: 40 90 7b 17 lds r4, 0x177B ; 0x80177b 227e8: 50 90 7c 17 lds r5, 0x177C ; 0x80177c 227ec: 60 90 7d 17 lds r6, 0x177D ; 0x80177d 227f0: 70 90 7e 17 lds r7, 0x177E ; 0x80177e bool result = false; const uint32_t filesize = card.getFileSize(); uint32_t startPos = 0; const uint16_t bytesToCheck = min(END_FILE_SECTION, filesize); 227f4: 94 2d mov r25, r4 227f6: 85 2d mov r24, r5 227f8: 21 e0 ldi r18, 0x01 ; 1 227fa: 42 16 cp r4, r18 227fc: 28 e7 ldi r18, 0x78 ; 120 227fe: 52 06 cpc r5, r18 22800: 61 04 cpc r6, r1 22802: 71 04 cpc r7, r1 22804: 10 f0 brcs .+4 ; 0x2280a 22806: 90 e0 ldi r25, 0x00 ; 0 22808: 88 e7 ldi r24, 0x78 ; 120 2280a: a9 2e mov r10, r25 2280c: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 2280e: 81 e0 ldi r24, 0x01 ; 1 22810: 48 16 cp r4, r24 22812: 88 e7 ldi r24, 0x78 ; 120 22814: 58 06 cpc r5, r24 22816: 61 04 cpc r6, r1 22818: 71 04 cpc r7, r1 2281a: 08 f4 brcc .+2 ; 0x2281e 2281c: 5d c0 rjmp .+186 ; 0x228d8 startPos = filesize - END_FILE_SECTION; 2281e: 98 e7 ldi r25, 0x78 ; 120 22820: 59 1a sub r5, r25 22822: 61 08 sbc r6, r1 22824: 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);}; 22826: 40 92 82 17 sts 0x1782, r4 ; 0x801782 2282a: 50 92 83 17 sts 0x1783, r5 ; 0x801783 2282e: 60 92 84 17 sts 0x1784, r6 ; 0x801784 22832: 70 92 85 17 sts 0x1785, r7 ; 0x801785 22836: c3 01 movw r24, r6 22838: b2 01 movw r22, r4 2283a: 0f 94 c0 77 call 0x2ef80 ; 0x2ef80 card.setIndex(startPos); } cmdqueue_reset(); 2283e: 0e 94 cf 80 call 0x1019e ; 0x1019e cmdqueue_serial_disabled = true; 22842: 00 93 a6 03 sts 0x03A6, r16 ; 0x8003a6 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 22846: 8a e8 ldi r24, 0x8A ; 138 22848: 9d e3 ldi r25, 0x3D ; 61 2284a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2284e: bc 01 movw r22, r24 22850: c5 01 movw r24, r10 22852: 0f 94 72 cd call 0x39ae4 ; 0x39ae4 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; } 22856: 80 91 82 17 lds r24, 0x1782 ; 0x801782 2285a: 90 91 83 17 lds r25, 0x1783 ; 0x801783 2285e: a0 91 84 17 lds r26, 0x1784 ; 0x801784 22862: b0 91 85 17 lds r27, 0x1785 ; 0x801785 while (!card.eof() && !result) { 22866: 40 91 7b 17 lds r20, 0x177B ; 0x80177b 2286a: 50 91 7c 17 lds r21, 0x177C ; 0x80177c 2286e: 60 91 7d 17 lds r22, 0x177D ; 0x80177d 22872: 70 91 7e 17 lds r23, 0x177E ; 0x80177e 22876: 84 17 cp r24, r20 22878: 95 07 cpc r25, r21 2287a: a6 07 cpc r26, r22 2287c: b7 07 cpc r27, r23 2287e: 80 f5 brcc .+96 ; 0x228e0 22880: 11 11 cpse r17, r1 22882: 2e c0 rjmp .+92 ; 0x228e0 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); }; 22884: 20 91 01 17 lds r18, 0x1701 ; 0x801701 22888: 21 11 cpse r18, r1 2288a: 03 c0 rjmp .+6 ; 0x22892 2288c: 80 e0 ldi r24, 0x00 ; 0 2288e: 90 e0 ldi r25, 0x00 ; 0 22890: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 22892: 84 19 sub r24, r4 22894: 95 09 sbc r25, r5 22896: 0f 94 43 cd call 0x39a86 ; 0x39a86 card.sdprinting = true; 2289a: 00 93 6e 14 sts 0x146E, r16 ; 0x80146e get_command(); 2289e: 0e 94 4b 84 call 0x10896 ; 0x10896 #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 228a2: 80 91 81 10 lds r24, 0x1081 ; 0x801081 228a6: 90 91 82 10 lds r25, 0x1082 ; 0x801082 228aa: 89 2b or r24, r25 228ac: a1 f2 breq .-88 ; 0x22856 { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 228ae: 87 e7 ldi r24, 0x77 ; 119 228b0: 9b e6 ldi r25, 0x6B ; 107 228b2: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 228b6: 81 11 cpse r24, r1 228b8: 05 c0 rjmp .+10 ; 0x228c4 228ba: 8e e3 ldi r24, 0x3E ; 62 228bc: 9b e8 ldi r25, 0x8B ; 139 228be: 0e 94 db 68 call 0xd1b6 ; 0xd1b6 228c2: 81 11 cpse r24, r1 228c4: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 228c6: 80 91 80 10 lds r24, 0x1080 ; 0x801080 228ca: 81 11 cpse r24, r1 228cc: 02 c0 rjmp .+4 ; 0x228d2 cmdqueue_pop_front(); 228ce: 0e 94 47 78 call 0xf08e ; 0xf08e cmdbuffer_front_already_processed = false; 228d2: 10 92 80 10 sts 0x1080, r1 ; 0x801080 228d6: e5 cf rjmp .-54 ; 0x228a2 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; 228d8: 41 2c mov r4, r1 228da: 51 2c mov r5, r1 228dc: 32 01 movw r6, r4 228de: af cf rjmp .-162 ; 0x2283e // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 228e0: 0f 94 64 cd call 0x39ac8 ; 0x39ac8 cmdqueue_serial_disabled = false; 228e4: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 card.printingHasFinished(); 228e8: 0f 94 39 81 call 0x30272 ; 0x30272 lcd_setstatuspgm(MSG_WELCOME); 228ec: 8a e6 ldi r24, 0x6A ; 106 228ee: 90 e7 ldi r25, 0x70 ; 112 228f0: 0f 94 ea 0b call 0x217d4 ; 0x217d4 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)) { 228f4: 11 23 and r17, r17 228f6: 91 f0 breq .+36 ; 0x2291c 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); 228f8: ff 92 push r15 228fa: ef 92 push r14 228fc: 3f 92 push r3 228fe: 2f 92 push r2 22900: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommand_P(MSG_M24); 22904: 61 e0 ldi r22, 0x01 ; 1 22906: 89 ee ldi r24, 0xE9 ; 233 22908: 90 e7 ldi r25, 0x70 ; 112 2290a: 0e 94 4b 89 call 0x11296 ; 0x11296 2290e: 0f 90 pop r0 22910: 0f 90 pop r0 22912: 0f 90 pop r0 22914: 0f 90 pop r0 } lcd_return_to_status(); 22916: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 2291a: 9b ce rjmp .-714 ; 0x22652 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); 2291c: 8a e9 ldi r24, 0x9A ; 154 2291e: 9d e3 ldi r25, 0x3D ; 61 22920: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22924: 41 e0 ldi r20, 0x01 ; 1 22926: 60 e0 ldi r22, 0x00 ; 0 22928: 0f 94 b8 65 call 0x2cb70 ; 0x2cb70 2292c: 18 2f mov r17, r24 lcd_update_enable(true); 2292e: 81 e0 ldi r24, 0x01 ; 1 22930: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 } if (result) { 22934: 11 23 and r17, r17 22936: 01 f3 breq .-64 ; 0x228f8 22938: ee cf rjmp .-36 ; 0x22916 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 2293a: 8f 5f subi r24, 0xFF ; 255 2293c: 80 93 18 05 sts 0x0518, r24 ; 0x800518 22940: 22 ce rjmp .-956 ; 0x22586 else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 22942: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 _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(); 22946: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2294a: 8f 5f subi r24, 0xFF ; 255 2294c: 80 93 15 05 sts 0x0515, r24 ; 0x800515 22950: 80 91 17 05 lds r24, 0x0517 ; 0x800517 22954: 8f 5f subi r24, 0xFF ; 255 22956: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2295a: e7 cd rjmp .-1074 ; 0x2252a 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. 2295c: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 22960: 11 e0 ldi r17, 0x01 ; 1 22962: 81 11 cpse r24, r1 22964: 05 c0 rjmp .+10 ; 0x22970 22966: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2296a: 81 11 cpse r24, r1 2296c: 01 c0 rjmp .+2 ; 0x22970 2296e: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 22970: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 22974: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 22978: 89 2b or r24, r25 2297a: 91 f4 brne .+36 ; 0x229a0 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 2297c: 60 91 b3 03 lds r22, 0x03B3 ; 0x8003b3 22980: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 22984: 90 91 af 03 lds r25, 0x03AF ; 0x8003af 22988: 0f 94 b6 85 call 0x30b6c ; 0x30b6c #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 2298c: 80 91 85 14 lds r24, 0x1485 ; 0x801485 22990: 81 11 cpse r24, r1 22992: 46 c0 rjmp .+140 ; 0x22a20 22994: 80 e7 ldi r24, 0x70 ; 112 22996: 94 e1 ldi r25, 0x14 ; 20 22998: 90 93 ad 03 sts 0x03AD, r25 ; 0x8003ad 2299c: 80 93 ac 03 sts 0x03AC, r24 ; 0x8003ac } if (rewindFlag) 229a0: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 229a2: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 229a6: 6c e2 ldi r22, 0x2C ; 44 229a8: 71 e0 ldi r23, 0x01 ; 1 229aa: 84 eb ldi r24, 0xB4 ; 180 229ac: 93 e0 ldi r25, 0x03 ; 3 229ae: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 229b2: 81 11 cpse r24, r1 229b4: 03 c0 rjmp .+6 ; 0x229bc 229b6: 11 23 and r17, r17 229b8: 09 f4 brne .+2 ; 0x229bc 229ba: 54 ce rjmp .-856 ; 0x22664 { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 229bc: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 229c0: 02 e1 ldi r16, 0x12 ; 18 229c2: 81 11 cpse r24, r1 229c4: 01 c0 rjmp .+2 ; 0x229c8 229c6: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 229c8: 4e e3 ldi r20, 0x3E ; 62 229ca: 60 91 b2 03 lds r22, 0x03B2 ; 0x8003b2 229ce: 80 e0 ldi r24, 0x00 ; 0 229d0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a if (_md->isDir) 229d4: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 229d8: 88 23 and r24, r24 229da: 19 f0 breq .+6 ; 0x229e2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 229dc: 85 e8 ldi r24, 0x85 ; 133 229de: 0e 94 44 70 call 0xe088 ; 0xe088 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 229e2: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 229e6: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 229ea: 90 91 ad 03 lds r25, 0x03AD ; 0x8003ad 229ee: 60 2f mov r22, r16 229f0: 82 0f add r24, r18 229f2: 91 1d adc r25, r1 229f4: 0e 94 84 71 call 0xe308 ; 0xe308 229f8: 81 11 cpse r24, r1 229fa: 15 c0 rjmp .+42 ; 0x22a26 { _md->lcd_scrollTimer.start(); 229fc: 84 eb ldi r24, 0xB4 ; 180 229fe: 93 e0 ldi r25, 0x03 ; 3 22a00: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> _md->offset++; 22a04: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 22a08: 8f 5f subi r24, 0xFF ; 255 22a0a: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } else { // stop at the end of the string _md->lcd_scrollTimer.stop(); } } if (rewindFlag) //go back to sd_menu. 22a0e: 11 23 and r17, r17 22a10: 09 f4 brne .+2 ; 0x22a14 22a12: 28 ce rjmp .-944 ; 0x22664 22a14: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 22a18: 81 e0 ldi r24, 0x01 ; 1 22a1a: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 22a1e: 22 ce rjmp .-956 ; 0x22664 #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; 22a20: 85 e8 ldi r24, 0x85 ; 133 22a22: 94 e1 ldi r25, 0x14 ; 20 22a24: b9 cf rjmp .-142 ; 0x22998 22a26: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 22a2a: f1 cf rjmp .-30 ; 0x22a0e 00022a2c : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 22a2c: 61 e0 ldi r22, 0x01 ; 1 22a2e: 8f e7 ldi r24, 0x7F ; 127 22a30: 90 e7 ldi r25, 0x70 ; 112 22a32: 0e 94 4b 89 call 0x11296 ; 0x11296 custom_message_type = CustomMsg::FilamentLoading; //just print status message 22a36: 82 e0 ldi r24, 0x02 ; 2 22a38: 80 93 75 07 sts 0x0775, r24 ; 0x800775 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 22a3c: 8f e2 ldi r24, 0x2F ; 47 22a3e: 99 e5 ldi r25, 0x59 ; 89 22a40: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22a44: 0f 94 ea 0b call 0x217d4 ; 0x217d4 lcd_return_to_status(); 22a48: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_draw_update = 3; 22a4c: 83 e0 ldi r24, 0x03 ; 3 22a4e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } 22a52: 08 95 ret 00022a54 : //! @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; 22a54: 0f 94 8a 0b call 0x21714 ; 0x21714 22a58: 88 23 and r24, r24 22a5a: 39 f1 breq .+78 ; 0x22aaa cmdqueue_serial_disabled = false; 22a5c: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 22a60: 8f e2 ldi r24, 0x2F ; 47 22a62: 99 e5 ldi r25, 0x59 ; 89 22a64: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22a68: 0f 94 ea 0b call 0x217d4 ; 0x217d4 st_synchronize(); 22a6c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 custom_message_type = CustomMsg::Resuming; 22a70: 88 e0 ldi r24, 0x08 ; 8 22a72: 80 93 75 07 sts 0x0775, r24 ; 0x800775 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); 22a76: 0e 94 23 77 call 0xee46 ; 0xee46 Stopped = false; 22a7a: 10 92 14 05 sts 0x0514, r1 ; 0x800514 restore_print_from_ram_and_continue(default_retraction); 22a7e: 60 e0 ldi r22, 0x00 ; 0 22a80: 70 e0 ldi r23, 0x00 ; 0 22a82: 80 e8 ldi r24, 0x80 ; 128 22a84: 9f e3 ldi r25, 0x3F ; 63 22a86: 0e 94 f9 68 call 0xd1f2 ; 0xd1f2 did_pause_print = false; 22a8a: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 // Resume the print job timer if it was running if (print_job_timer.isPaused()) print_job_timer.start(); 22a8e: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 22a92: 82 30 cpi r24, 0x02 ; 2 22a94: 11 f4 brne .+4 ; 0x22a9a 22a96: 0f 94 d1 58 call 0x2b1a2 ; 0x2b1a2 refresh_cmd_timeout(); 22a9a: 0e 94 78 67 call 0xcef0 ; 0xcef0 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 22a9e: 84 e2 ldi r24, 0x24 ; 36 22aa0: 9b e6 ldi r25, 0x6B ; 107 22aa2: 0e 94 06 7b call 0xf60c ; 0xf60c custom_message_type = CustomMsg::Status; 22aa6: 10 92 75 07 sts 0x0775, r1 ; 0x800775 } 22aaa: 08 95 ret 00022aac : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 22aac: cf 93 push r28 22aae: df 93 push r29 22ab0: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 22ab2: 80 e0 ldi r24, 0x00 ; 0 22ab4: 0f 94 b1 06 call 0x20d62 ; 0x20d62 22ab8: 88 23 and r24, r24 22aba: 31 f0 breq .+12 ; 0x22ac8 lcd_updatestatus(message); 22abc: 60 e0 ldi r22, 0x00 ; 0 22abe: ce 01 movw r24, r28 } 22ac0: df 91 pop r29 22ac2: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 22ac4: 0d 94 96 06 jmp 0x20d2c ; 0x20d2c } 22ac8: df 91 pop r29 22aca: cf 91 pop r28 22acc: 08 95 ret 00022ace : #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()); 22ace: 0f 94 ef 7c call 0x2f9de ; 0x2f9de 22ad2: 9f 93 push r25 22ad4: 8f 93 push r24 22ad6: 81 e6 ldi r24, 0x61 ; 97 22ad8: 9b e8 ldi r25, 0x8B ; 139 22ada: 9f 93 push r25 22adc: 8f 93 push r24 22ade: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 22ae2: 0f 90 pop r0 22ae4: 0f 90 pop r0 22ae6: 0f 90 pop r0 22ae8: 0f 90 pop r0 } 22aea: 08 95 ret 00022aec : printf_IRSensorAnalogBoardChange(); } return true; } static void lcd_detect_IRsensor(){ 22aec: ef 92 push r14 22aee: ff 92 push r15 22af0: 0f 93 push r16 22af2: 1f 93 push r17 22af4: cf 93 push r28 22af6: 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(); 22af8: 0e 94 bc e4 call 0x1c978 ; 0x1c978 22afc: c8 2f mov r28, r24 if(loaded){ lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 22afe: 8c eb ldi r24, 0xBC ; 188 22b00: 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){ 22b02: c1 11 cpse r28, r1 22b04: 8a c0 rjmp .+276 ; 0x22c1a 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)); 22b06: 87 e7 ldi r24, 0x77 ; 119 22b08: 9e e3 ldi r25, 0x3E ; 62 22b0a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22b0e: 0f 94 0c 36 call 0x26c18 ; 0x26c18 22b12: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22b16: 10 92 89 17 sts 0x1789, r1 ; 0x801789 22b1a: d0 91 91 17 lds r29, 0x1791 ; 0x801791 static bool lcd_selftest_IRsensor(bool bStandalone) { FSensorBlockRunout fsBlockRunout; IR_sensor_analog::SensorRevision oldSensorRevision = fsensor.getSensorRevision(); IR_sensor_analog::SensorRevision newSensorRevision; uint16_t volt_IR_int = fsensor.getVoltRaw(); 22b1e: 0f 94 e7 7c call 0x2f9ce ; 0x2f9ce 22b22: 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)); 22b24: bc 01 movw r22, r24 22b26: 90 e0 ldi r25, 0x00 ; 0 22b28: 80 e0 ldi r24, 0x00 ; 0 22b2a: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 22b2e: 20 e0 ldi r18, 0x00 ; 0 22b30: 30 ec ldi r19, 0xC0 ; 192 22b32: 4f e7 ldi r20, 0x7F ; 127 22b34: 56 e4 ldi r21, 0x46 ; 70 22b36: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 22b3a: 20 e0 ldi r18, 0x00 ; 0 22b3c: 30 e0 ldi r19, 0x00 ; 0 22b3e: 40 ea ldi r20, 0xA0 ; 160 22b40: 50 e4 ldi r21, 0x40 ; 64 22b42: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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) ); 22b46: 9f 93 push r25 22b48: 8f 93 push r24 22b4a: 7f 93 push r23 22b4c: 6f 93 push r22 22b4e: 80 ec ldi r24, 0xC0 ; 192 22b50: 9b e8 ldi r25, 0x8B ; 139 22b52: 9f 93 push r25 22b54: 8f 93 push r24 22b56: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if(volt_IR_int < fsensor.IRsensor_Hmin_TRESHOLD){ 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: 0f 90 pop r0 22b66: 0d 35 cpi r16, 0x5D ; 93 22b68: 86 e2 ldi r24, 0x26 ; 38 22b6a: 18 07 cpc r17, r24 22b6c: 08 f4 brcc .+2 ; 0x22b70 22b6e: 3f c0 rjmp .+126 ; 0x22bee if(!bStandalone) lcd_selftest_error(TestError::FsensorLevel,"HIGH",""); return false; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_INSERT_FIL)); 22b70: 8f eb ldi r24, 0xBF ; 191 22b72: 9d e3 ldi r25, 0x3D ; 61 22b74: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22b78: 0f 94 0c 36 call 0x26c18 ; 0x26c18 volt_IR_int = fsensor.getVoltRaw(); 22b7c: 0f 94 e7 7c call 0x2f9ce ; 0x2f9ce 22b80: 7c 01 movw r14, r24 22b82: bc 01 movw r22, r24 22b84: 90 e0 ldi r25, 0x00 ; 0 22b86: 80 e0 ldi r24, 0x00 ; 0 22b88: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 22b8c: 20 e0 ldi r18, 0x00 ; 0 22b8e: 30 ec ldi r19, 0xC0 ; 192 22b90: 4f e7 ldi r20, 0x7F ; 127 22b92: 56 e4 ldi r21, 0x46 ; 70 22b94: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 22b98: 20 e0 ldi r18, 0x00 ; 0 22b9a: 30 e0 ldi r19, 0x00 ; 0 22b9c: 40 ea ldi r20, 0xA0 ; 160 22b9e: 50 e4 ldi r21, 0x40 ; 64 22ba0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> printf_P(PSTR("Measured filament sensor low level: %4.2fV\n"), Raw2Voltage(volt_IR_int)); 22ba4: 9f 93 push r25 22ba6: 8f 93 push r24 22ba8: 7f 93 push r23 22baa: 6f 93 push r22 22bac: 84 e9 ldi r24, 0x94 ; 148 22bae: 9b e8 ldi r25, 0x8B ; 139 22bb0: 9f 93 push r25 22bb2: 8f 93 push r24 22bb4: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if(volt_IR_int > (fsensor.IRsensor_Lmax_TRESHOLD)){ 22bb8: 0f 90 pop r0 22bba: 0f 90 pop r0 22bbc: 0f 90 pop r0 22bbe: 0f 90 pop r0 22bc0: 0f 90 pop r0 22bc2: 0f 90 pop r0 22bc4: 8f e2 ldi r24, 0x2F ; 47 22bc6: e8 16 cp r14, r24 22bc8: 83 e1 ldi r24, 0x13 ; 19 22bca: f8 06 cpc r15, r24 22bcc: 80 f4 brcc .+32 ; 0x22bee 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; 22bce: 61 e0 ldi r22, 0x01 ; 1 22bd0: 03 3d cpi r16, 0xD3 ; 211 22bd2: 1a 43 sbci r17, 0x3A ; 58 22bd4: 08 f0 brcs .+2 ; 0x22bd8 22bd6: 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) { 22bd8: d6 17 cp r29, r22 22bda: 41 f0 breq .+16 ; 0x22bec return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 22bdc: 60 93 91 17 sts 0x1791, r22 ; 0x801791 22be0: 88 e4 ldi r24, 0x48 ; 72 22be2: 9d e0 ldi r25, 0x0D ; 13 22be4: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a fsensor.setSensorRevision(newSensorRevision, true); printf_IRSensorAnalogBoardChange(); 22be8: 0f 94 67 15 call 0x22ace ; 0x22ace } return true; 22bec: 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(); } 22bee: 88 e8 ldi r24, 0x88 ; 136 22bf0: 97 e1 ldi r25, 0x17 ; 23 22bf2: 0e 94 84 75 call 0xeb08 ; 0xeb08 } 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)); 22bf6: 8d e3 ldi r24, 0x3D ; 61 22bf8: 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){ 22bfa: cc 23 and r28, r28 22bfc: 71 f0 breq .+28 ; 0x22c1a lcd_show_fullscreen_message_and_wait_P(_T(MSG_FS_VERIFIED)); 22bfe: 81 e1 ldi r24, 0x11 ; 17 22c00: 9e e3 ldi r25, 0x3E ; 62 22c02: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22c06: 0f 94 0c 36 call 0x26c18 ; 0x26c18 fsensor.init(); } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); } } 22c0a: df 91 pop r29 22c0c: cf 91 pop r28 22c0e: 1f 91 pop r17 22c10: 0f 91 pop r16 22c12: ff 90 pop r15 22c14: 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(); 22c16: 0d 94 74 87 jmp 0x30ee8 ; 0x30ee8 } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_FIL_FAILED)); 22c1a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 } } 22c1e: df 91 pop r29 22c20: cf 91 pop r28 22c22: 1f 91 pop r17 22c24: 0f 91 pop r16 22c26: ff 90 pop r15 22c28: 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)); 22c2a: 0d 94 0c 36 jmp 0x26c18 ; 0x26c18 00022c2e : 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) { 22c2e: cf 93 push r28 22c30: df 93 push r29 22c32: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 22c34: 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) { 22c36: 66 23 and r22, r22 22c38: d9 f1 breq .+118 ; 0x22cb0 22c3a: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 22c3c: 0f 94 57 45 call 0x28aae ; 0x28aae cancel_heatup = true; 22c40: 81 e0 ldi r24, 0x01 ; 1 22c42: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.404> heating_status = HeatingStatus::NO_HEATING; 22c46: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // Clear any saved printing state cancel_saved_printing(); 22c4a: 0e 94 62 65 call 0xcac4 ; 0xcac4 // Abort the planner planner_abort_hard(); 22c4e: 0f 94 0d bc call 0x3781a ; 0x3781a // Reset the queue cmdqueue_reset(); 22c52: 0e 94 cf 80 call 0x1019e ; 0x1019e cmdqueue_serial_disabled = false; 22c56: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 22c5a: 0f 94 86 59 call 0x2b30c ; 0x2b30c CRITICAL_SECTION_END; 22c5e: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 22c60: 10 92 e0 03 sts 0x03E0, r1 ; 0x8003e0 print_job_timer.stop(); 22c64: 0f 94 f5 58 call 0x2b1ea ; 0x2b1ea } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 22c68: 80 91 01 17 lds r24, 0x1701 ; 0x801701 22c6c: 88 23 and r24, r24 22c6e: 71 f0 breq .+28 ; 0x22c8c // Reset the sd status card.sdprinting = false; 22c70: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 22c74: 8e ef ldi r24, 0xFE ; 254 22c76: 96 e1 ldi r25, 0x16 ; 22 22c78: 0f 94 7c 6e call 0x2dcf8 ; 0x2dcf8 file.close(); 22c7c: 8e ef ldi r24, 0xFE ; 254 22c7e: 96 e1 ldi r25, 0x16 ; 22 22c80: 0f 94 74 a4 call 0x348e8 ; 0x348e8 saving = false; 22c84: 10 92 6c 14 sts 0x146C, r1 ; 0x80146c logging = false; 22c88: 10 92 6d 14 sts 0x146D, r1 ; 0x80146d card.closefile(); } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 22c8c: 87 e6 ldi r24, 0x67 ; 103 22c8e: 9b e6 ldi r25, 0x6B ; 107 22c90: 0e 94 06 7b call 0xf60c ; 0xf60c #ifdef MESH_BED_LEVELING mbl.active = false; 22c94: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 #endif if (interactive) { 22c98: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 22c9a: 10 92 14 05 sts 0x0514, r1 ; 0x800514 } // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::StopPrint; 22c9e: 81 e0 ldi r24, 0x01 ; 1 22ca0: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 22ca4: 10 92 67 0e sts 0x0E67, r1 ; 0x800e67 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 22ca8: df 91 pop r29 22caa: 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(); 22cac: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 } void ConditionalStop() { CRITICAL_SECTION_START; 22cb0: 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; 22cb2: 81 e0 ldi r24, 0x01 ; 1 22cb4: 80 93 66 0e sts 0x0E66, r24 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.404> heating_status = HeatingStatus::NO_HEATING; 22cb8: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df // Clear any saved printing state cancel_saved_printing(); 22cbc: 0e 94 62 65 call 0xcac4 ; 0xcac4 // Abort the planner planner_abort_hard(); 22cc0: 0f 94 0d bc call 0x3781a ; 0x3781a // Reset the queue cmdqueue_reset(); 22cc4: 0e 94 cf 80 call 0x1019e ; 0x1019e cmdqueue_serial_disabled = false; 22cc8: 10 92 a6 03 sts 0x03A6, r1 ; 0x8003a6 st_reset_timer(); 22ccc: 0f 94 86 59 call 0x2b30c ; 0x2b30c CRITICAL_SECTION_END; 22cd0: df bf out 0x3f, r29 ; 63 22cd2: ca cf rjmp .-108 ; 0x22c68 00022cd4 : } void lcd_print_stop() { print_stop(true); 22cd4: 60 e0 ldi r22, 0x00 ; 0 22cd6: 81 e0 ldi r24, 0x01 ; 1 22cd8: 0d 94 17 16 jmp 0x22c2e ; 0x22c2e 00022cdc : } static void render_M862_warnings(const char* warning, const char* strict, uint8_t check) { if (check == 1) { // Warning, stop print if user selects 'No' 22cdc: 41 30 cpi r20, 0x01 ; 1 22cde: 41 f4 brne .+16 ; 0x22cf0 if (lcd_show_multiscreen_message_cont_cancel_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 22ce0: 40 e0 ldi r20, 0x00 ; 0 22ce2: 61 e0 ldi r22, 0x01 ; 1 22ce4: 0f 94 b8 65 call 0x2cb70 ; 0x2cb70 22ce8: 81 30 cpi r24, 0x01 ; 1 22cea: 41 f4 brne .+16 ; 0x22cfc lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 22cec: 0d 94 6a 16 jmp 0x22cd4 ; 0x22cd4 { 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 22cf0: 42 30 cpi r20, 0x02 ; 2 22cf2: 21 f4 brne .+8 ; 0x22cfc lcd_show_fullscreen_message_and_wait_P(strict); 22cf4: cb 01 movw r24, r22 22cf6: 0f 94 0c 36 call 0x26c18 ; 0x26c18 22cfa: f8 cf rjmp .-16 ; 0x22cec lcd_print_stop(); } } 22cfc: 08 95 ret 00022cfe : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 22cfe: 0f 93 push r16 22d00: 1f 93 push r17 22d02: 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)) { 22d04: 8c ea ldi r24, 0xAC ; 172 22d06: 9c e0 ldi r25, 0x0C ; 12 22d08: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 22d0c: 88 23 and r24, r24 22d0e: 29 f0 breq .+10 ; 0x22d1a return false; } } done: return true; 22d10: 81 e0 ldi r24, 0x01 ; 1 } 22d12: cf 91 pop r28 22d14: 1f 91 pop r17 22d16: 0f 91 pop r16 22d18: 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()) { 22d1a: 80 91 88 17 lds r24, 0x1788 ; 0x801788 22d1e: 88 23 and r24, r24 22d20: b9 f3 breq .-18 ; 0x22d10 22d22: 0e 94 bc e4 call 0x1c978 ; 0x1c978 22d26: 81 11 cpse r24, r1 22d28: f3 cf rjmp .-26 ; 0x22d10 if (oCheckFilament == ClCheckMode::_None) { 22d2a: c0 91 ea 04 lds r28, 0x04EA ; 0x8004ea 22d2e: cc 23 and r28, r28 22d30: 79 f3 breq .-34 ; 0x22d10 goto done; } render_M862_warnings( 22d32: 85 e2 ldi r24, 0x25 ; 37 22d34: 91 e4 ldi r25, 0x41 ; 65 22d36: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22d3a: 8c 01 movw r16, r24 22d3c: 85 e2 ldi r24, 0x25 ; 37 22d3e: 91 e4 ldi r25, 0x41 ; 65 22d40: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22d44: 4c 2f mov r20, r28 22d46: b8 01 movw r22, r16 22d48: 0f 94 6e 16 call 0x22cdc ; 0x22cdc _T(MSG_MISSING_FILAMENT) ,_T(MSG_MISSING_FILAMENT) //Identical messages ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 22d4c: 81 e0 ldi r24, 0x01 ; 1 22d4e: 90 91 65 0e lds r25, 0x0E65 ; 0x800e65 22d52: 91 30 cpi r25, 0x01 ; 1 22d54: f1 f6 brne .-68 ; 0x22d12 22d56: 80 e0 ldi r24, 0x00 ; 0 22d58: dc cf rjmp .-72 ; 0x22d12 00022d5a : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 22d5a: 1f 93 push r17 22d5c: cf 93 push r28 22d5e: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 22d60: 10 91 ef 04 lds r17, 0x04EF ; 0x8004ef 22d64: 11 23 and r17, r17 22d66: f9 f0 breq .+62 ; 0x22da6 22d68: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 22d6a: 85 ea ldi r24, 0xA5 ; 165 22d6c: 9d e0 ldi r25, 0x0D ; 13 22d6e: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e if (nDiameter == nDiameter_um) 22d72: 8c 17 cp r24, r28 22d74: 9d 07 cpc r25, r29 22d76: b9 f0 breq .+46 ; 0x22da6 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 22d78: 86 ed ldi r24, 0xD6 ; 214 22d7a: 90 e4 ldi r25, 0x40 ; 64 22d7c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22d80: ec 01 movw r28, r24 22d82: 8b ea ldi r24, 0xAB ; 171 22d84: 90 e4 ldi r25, 0x40 ; 64 22d86: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22d8a: 41 2f mov r20, r17 22d8c: be 01 movw r22, r28 22d8e: 0f 94 6e 16 call 0x22cdc ; 0x22cdc ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 22d92: 10 92 f8 03 sts 0x03F8, r1 ; 0x8003f8 menu_submenu(lcd_hw_setup_menu); 22d96: 60 e0 ldi r22, 0x00 ; 0 22d98: 8c e0 ldi r24, 0x0C ; 12 22d9a: 9b e3 ldi r25, 0x3B ; 59 } } 22d9c: df 91 pop r29 22d9e: cf 91 pop r28 22da0: 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); 22da2: 0d 94 7d d0 jmp 0x3a0fa ; 0x3a0fa } } 22da6: df 91 pop r29 22da8: cf 91 pop r28 22daa: 1f 91 pop r17 22dac: 08 95 ret 00022dae : } /// @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) { 22dae: cf 92 push r12 22db0: df 92 push r13 22db2: ef 92 push r14 22db4: ff 92 push r15 22db6: cf 93 push r28 22db8: 6b 01 movw r12, r22 22dba: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 22dbc: 82 e0 ldi r24, 0x02 ; 2 22dbe: 80 93 75 07 sts 0x0775, r24 ; 0x800775 lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 22dc2: 82 ed ldi r24, 0xD2 ; 210 22dc4: 98 e5 ldi r25, 0x58 ; 88 22dc6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22dca: 0f 94 ea 0b call 0x217d4 ; 0x217d4 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 22dce: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 22dd2: 10 92 89 17 sts 0x1789, r1 ; 0x801789 FSensorBlockRunout fsBlockRunout; current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 22dd6: 20 e0 ldi r18, 0x00 ; 0 22dd8: 30 e0 ldi r19, 0x00 ; 0 22dda: 44 e3 ldi r20, 0x34 ; 52 22ddc: 52 e4 ldi r21, 0x42 ; 66 22dde: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 22de2: 70 91 50 07 lds r23, 0x0750 ; 0x800750 22de6: 80 91 51 07 lds r24, 0x0751 ; 0x800751 22dea: 90 91 52 07 lds r25, 0x0752 ; 0x800752 22dee: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 22df2: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 22df6: 70 93 50 07 sts 0x0750, r23 ; 0x800750 22dfa: 80 93 51 07 sts 0x0751, r24 ; 0x800751 22dfe: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 22e02: 6a e0 ldi r22, 0x0A ; 10 22e04: 77 e5 ldi r23, 0x57 ; 87 22e06: 8d ea ldi r24, 0xAD ; 173 22e08: 92 e4 ldi r25, 0x42 ; 66 22e0a: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 22e0e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 22e12: 20 e0 ldi r18, 0x00 ; 0 22e14: 30 e0 ldi r19, 0x00 ; 0 22e16: 4c e0 ldi r20, 0x0C ; 12 22e18: 52 e4 ldi r21, 0x42 ; 66 22e1a: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 22e1e: 70 91 50 07 lds r23, 0x0750 ; 0x800750 22e22: 80 91 51 07 lds r24, 0x0751 ; 0x800751 22e26: 90 91 52 07 lds r25, 0x0752 ; 0x800752 22e2a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 22e2e: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 22e32: 70 93 50 07 sts 0x0750, r23 ; 0x800750 22e36: 80 93 51 07 sts 0x0751, r24 ; 0x800751 22e3a: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 22e3e: 69 e2 ldi r22, 0x29 ; 41 22e40: 7c e5 ldi r23, 0x5C ; 92 22e42: 85 e8 ldi r24, 0x85 ; 133 22e44: 91 e4 ldi r25, 0x41 ; 65 22e46: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 22e4a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 22e4e: 20 e0 ldi r18, 0x00 ; 0 22e50: 30 e0 ldi r19, 0x00 ; 0 22e52: a9 01 movw r20, r18 22e54: c7 01 movw r24, r14 22e56: b6 01 movw r22, r12 22e58: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 22e5c: 88 23 and r24, r24 22e5e: e1 f0 breq .+56 ; 0x22e98 { current_position[E_AXIS] += unloadLength; 22e60: a7 01 movw r20, r14 22e62: 96 01 movw r18, r12 22e64: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 22e68: 70 91 50 07 lds r23, 0x0750 ; 0x800750 22e6c: 80 91 51 07 lds r24, 0x0751 ; 0x800751 22e70: 90 91 52 07 lds r25, 0x0752 ; 0x800752 22e74: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 22e78: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 22e7c: 70 93 50 07 sts 0x0750, r23 ; 0x800750 22e80: 80 93 51 07 sts 0x0751, r24 ; 0x800751 22e84: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 22e88: 60 e0 ldi r22, 0x00 ; 0 22e8a: 70 e0 ldi r23, 0x00 ; 0 22e8c: 80 e2 ldi r24, 0x20 ; 32 22e8e: 91 e4 ldi r25, 0x41 ; 65 22e90: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 22e94: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 22e98: 89 ee ldi r24, 0xE9 ; 233 22e9a: 9a e3 ldi r25, 0x3A ; 58 22e9c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 22ea0: 0f 94 85 35 call 0x26b0a ; 0x26b0a //disable extruder steppers so filament can be removed disable_e0(); 22ea4: 14 9a sbi 0x02, 4 ; 2 _delay(100); 22ea6: 64 e6 ldi r22, 0x64 ; 100 22ea8: 70 e0 ldi r23, 0x00 ; 0 22eaa: 80 e0 ldi r24, 0x00 ; 0 22eac: 90 e0 ldi r25, 0x00 ; 0 22eae: 0f 94 92 3d call 0x27b24 ; 0x27b24 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 22eb2: 82 e0 ldi r24, 0x02 ; 2 22eb4: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe 22eb8: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 22eba: 0e 94 b2 71 call 0xe364 ; 0xe364 22ebe: 81 11 cpse r24, r1 22ec0: 07 c0 rjmp .+14 ; 0x22ed0 22ec2: c1 50 subi r28, 0x01 ; 1 22ec4: 29 f0 breq .+10 ; 0x22ed0 delay_keep_alive(100); 22ec6: 84 e6 ldi r24, 0x64 ; 100 22ec8: 90 e0 ldi r25, 0x00 ; 0 22eca: 0e 94 87 8e call 0x11d0e ; 0x11d0e 22ece: f5 cf rjmp .-22 ; 0x22eba counterBeep++; } st_synchronize(); 22ed0: 0f 94 2c 59 call 0x2b258 ; 0x2b258 while (lcd_clicked()) delay_keep_alive(100); 22ed4: 0e 94 b2 71 call 0xe364 ; 0xe364 22ed8: 88 23 and r24, r24 22eda: 29 f0 breq .+10 ; 0x22ee6 22edc: 84 e6 ldi r24, 0x64 ; 100 22ede: 90 e0 ldi r25, 0x00 ; 0 22ee0: 0e 94 87 8e call 0x11d0e ; 0x11d0e 22ee4: f7 cf rjmp .-18 ; 0x22ed4 lcd_update_enable(true); 22ee6: 81 e0 ldi r24, 0x01 ; 1 22ee8: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_setstatuspgm(MSG_WELCOME); 22eec: 8a e6 ldi r24, 0x6A ; 106 22eee: 90 e7 ldi r25, 0x70 ; 112 22ef0: 0f 94 ea 0b call 0x217d4 ; 0x217d4 custom_message_type = CustomMsg::Status; 22ef4: 10 92 75 07 sts 0x0775, r1 ; 0x800775 clearFilamentAction(); 22ef8: 0f 94 f4 36 call 0x26de8 ; 0x26de8 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 22efc: 88 e8 ldi r24, 0x88 ; 136 22efe: 97 e1 ldi r25, 0x17 ; 23 } 22f00: cf 91 pop r28 22f02: ff 90 pop r15 22f04: ef 90 pop r14 22f06: df 90 pop r13 22f08: cf 90 pop r12 22f0a: 0c 94 84 75 jmp 0xeb08 ; 0xeb08 00022f0e : 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() 22f0e: 2f 92 push r2 22f10: 3f 92 push r3 22f12: 4f 92 push r4 22f14: 5f 92 push r5 22f16: 6f 92 push r6 22f18: 7f 92 push r7 22f1a: 8f 92 push r8 22f1c: 9f 92 push r9 22f1e: af 92 push r10 22f20: bf 92 push r11 22f22: cf 92 push r12 22f24: df 92 push r13 22f26: ef 92 push r14 22f28: ff 92 push r15 22f2a: 0f 93 push r16 22f2c: 1f 93 push r17 22f2e: cf 93 push r28 22f30: df 93 push r29 22f32: 00 d0 rcall .+0 ; 0x22f34 22f34: 00 d0 rcall .+0 ; 0x22f36 22f36: 00 d0 rcall .+0 ; 0x22f38 22f38: cd b7 in r28, 0x3d ; 61 22f3a: de b7 in r29, 0x3e ; 62 22f3c: 00 ea ldi r16, 0xA0 ; 160 22f3e: 13 e1 ldi r17, 0x13 ; 19 22f40: 1f 83 std Y+7, r17 ; 0x07 22f42: 0e 83 std Y+6, r16 ; 0x06 22f44: 2e 80 ldd r2, Y+6 ; 0x06 22f46: 3f 80 ldd r3, Y+7 ; 0x07 22f48: 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])) 22f4a: f1 01 movw r30, r2 22f4c: 61 81 ldd r22, Z+1 ; 0x01 22f4e: 72 81 ldd r23, Z+2 ; 0x02 22f50: 83 81 ldd r24, Z+3 ; 0x03 22f52: 94 81 ldd r25, Z+4 ; 0x04 22f54: 9b 01 movw r18, r22 22f56: ac 01 movw r20, r24 22f58: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 22f5c: 88 23 and r24, r24 22f5e: 09 f4 brne .+2 ; 0x22f62 22f60: 7c c0 rjmp .+248 ; 0x2305a mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 22f62: 89 81 ldd r24, Y+1 ; 0x01 22f64: 0f 94 af c7 call 0x38f5e ; 0x38f5e 22f68: 20 e0 ldi r18, 0x00 ; 0 22f6a: 30 e0 ldi r19, 0x00 ; 0 22f6c: 48 eb ldi r20, 0xB8 ; 184 22f6e: 51 e4 ldi r21, 0x41 ; 65 22f70: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 22f74: 6b 01 movw r12, r22 22f76: 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)) + 22f78: 20 e0 ldi r18, 0x00 ; 0 22f7a: 30 e0 ldi r19, 0x00 ; 0 22f7c: 4c ef ldi r20, 0xFC ; 252 22f7e: 52 e4 ldi r21, 0x42 ; 66 22f80: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 22f84: 2b 01 movw r4, r22 22f86: 3c 01 movw r6, r24 22f88: 20 e0 ldi r18, 0x00 ; 0 22f8a: 30 e0 ldi r19, 0x00 ; 0 22f8c: 44 e6 ldi r20, 0x64 ; 100 22f8e: 53 e4 ldi r21, 0x43 ; 67 22f90: c7 01 movw r24, r14 22f92: b6 01 movw r22, r12 22f94: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 22f98: 4b 01 movw r8, r22 22f9a: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22f9c: 20 e0 ldi r18, 0x00 ; 0 22f9e: 30 e0 ldi r19, 0x00 ; 0 22fa0: 40 ec ldi r20, 0xC0 ; 192 22fa2: 51 e4 ldi r21, 0x41 ; 65 22fa4: c7 01 movw r24, r14 22fa6: b6 01 movw r22, r12 22fa8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 22fac: 6b 01 movw r12, r22 22fae: 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)) + 22fb0: ee 81 ldd r30, Y+6 ; 0x06 22fb2: ff 81 ldd r31, Y+7 ; 0x07 22fb4: 21 81 ldd r18, Z+1 ; 0x01 22fb6: 32 81 ldd r19, Z+2 ; 0x02 22fb8: 43 81 ldd r20, Z+3 ; 0x03 22fba: 54 81 ldd r21, Z+4 ; 0x04 22fbc: c3 01 movw r24, r6 22fbe: b2 01 movw r22, r4 22fc0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 22fc4: a5 01 movw r20, r10 22fc6: 94 01 movw r18, r8 22fc8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 22fcc: 20 e0 ldi r18, 0x00 ; 0 22fce: 30 e9 ldi r19, 0x90 ; 144 22fd0: 42 ea ldi r20, 0xA2 ; 162 22fd2: 56 e4 ldi r21, 0x46 ; 70 22fd4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 22fd8: 6a 83 std Y+2, r22 ; 0x02 22fda: 7b 83 std Y+3, r23 ; 0x03 22fdc: 8c 83 std Y+4, r24 ; 0x04 22fde: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 22fe0: ee 81 ldd r30, Y+6 ; 0x06 22fe2: ff 81 ldd r31, Y+7 ; 0x07 22fe4: 25 85 ldd r18, Z+13 ; 0x0d 22fe6: 36 85 ldd r19, Z+14 ; 0x0e 22fe8: 47 85 ldd r20, Z+15 ; 0x0f 22fea: 50 89 ldd r21, Z+16 ; 0x10 22fec: c7 01 movw r24, r14 22fee: b6 01 movw r22, r12 22ff0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 22ff4: a5 01 movw r20, r10 22ff6: 94 01 movw r18, r8 22ff8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 22ffc: 20 e0 ldi r18, 0x00 ; 0 22ffe: 30 e9 ldi r19, 0x90 ; 144 23000: 42 e2 ldi r20, 0x22 ; 34 23002: 56 ec ldi r21, 0xC6 ; 198 23004: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 23008: 9b 01 movw r18, r22 2300a: 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)) + 2300c: 6a 81 ldd r22, Y+2 ; 0x02 2300e: 7b 81 ldd r23, Y+3 ; 0x03 23010: 8c 81 ldd r24, Y+4 ; 0x04 23012: 9d 81 ldd r25, Y+5 ; 0x05 23014: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 23018: 4b 01 movw r8, r22 2301a: 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)); 2301c: ee 81 ldd r30, Y+6 ; 0x06 2301e: ff 81 ldd r31, Y+7 ; 0x07 23020: 21 8d ldd r18, Z+25 ; 0x19 23022: 32 8d ldd r19, Z+26 ; 0x1a 23024: 43 8d ldd r20, Z+27 ; 0x1b 23026: 54 8d ldd r21, Z+28 ; 0x1c 23028: c7 01 movw r24, r14 2302a: b6 01 movw r22, r12 2302c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23030: a3 01 movw r20, r6 23032: 92 01 movw r18, r4 23034: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23038: 20 e0 ldi r18, 0x00 ; 0 2303a: 30 e9 ldi r19, 0x90 ; 144 2303c: 42 ea ldi r20, 0xA2 ; 162 2303e: 56 e4 ldi r21, 0x46 ; 70 23040: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 23044: 9b 01 movw r18, r22 23046: 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)) + 23048: c5 01 movw r24, r10 2304a: b4 01 movw r22, r8 2304c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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] = 23050: f1 01 movw r30, r2 23052: 61 83 std Z+1, r22 ; 0x01 23054: 72 83 std Z+2, r23 ; 0x02 23056: 83 83 std Z+3, r24 ; 0x03 23058: 94 83 std Z+4, r25 ; 0x04 2305a: f4 e0 ldi r31, 0x04 ; 4 2305c: 2f 0e add r2, r31 2305e: 31 1c adc r3, r1 23060: 29 81 ldd r18, Y+1 ; 0x01 23062: 2f 5f subi r18, 0xFF ; 255 23064: 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) { 23066: 27 30 cpi r18, 0x07 ; 7 23068: 09 f0 breq .+2 ; 0x2306c 2306a: 6f cf rjmp .-290 ; 0x22f4a 2306c: 8e 81 ldd r24, Y+6 ; 0x06 2306e: 9f 81 ldd r25, Y+7 ; 0x07 23070: 4c 96 adiw r24, 0x1c ; 28 23072: 9f 83 std Y+7, r25 ; 0x07 23074: 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) { 23076: 84 56 subi r24, 0x64 ; 100 23078: 94 41 sbci r25, 0x14 ; 20 2307a: 09 f0 breq .+2 ; 0x2307e 2307c: 63 cf rjmp .-314 ; 0x22f44 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() 2307e: 19 87 std Y+9, r17 ; 0x09 23080: 08 87 std Y+8, r16 ; 0x08 23082: f1 e0 ldi r31, 0x01 ; 1 23084: 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)) + 23086: c8 01 movw r24, r16 23088: 8b 5a subi r24, 0xAB ; 171 2308a: 9f 4f sbci r25, 0xFF ; 255 2308c: 9f 83 std Y+7, r25 ; 0x07 2308e: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 23090: 18 01 movw r2, r16 23092: 99 ea ldi r25, 0xA9 ; 169 23094: 29 0e add r2, r25 23096: 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])) 23098: e8 85 ldd r30, Y+8 ; 0x08 2309a: f9 85 ldd r31, Y+9 ; 0x09 2309c: 65 8d ldd r22, Z+29 ; 0x1d 2309e: 76 8d ldd r23, Z+30 ; 0x1e 230a0: 87 8d ldd r24, Z+31 ; 0x1f 230a2: 90 a1 ldd r25, Z+32 ; 0x20 230a4: 9b 01 movw r18, r22 230a6: ac 01 movw r20, r24 230a8: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 230ac: 88 23 and r24, r24 230ae: 09 f4 brne .+2 ; 0x230b2 230b0: 79 c0 rjmp .+242 ; 0x231a4 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 230b2: 89 81 ldd r24, Y+1 ; 0x01 230b4: 0f 94 af c7 call 0x38f5e ; 0x38f5e 230b8: 20 e0 ldi r18, 0x00 ; 0 230ba: 30 e0 ldi r19, 0x00 ; 0 230bc: 40 ea ldi r20, 0xA0 ; 160 230be: 50 e4 ldi r21, 0x40 ; 64 230c0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 230c4: 6b 01 movw r12, r22 230c6: 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)) + 230c8: 20 e0 ldi r18, 0x00 ; 0 230ca: 30 e0 ldi r19, 0x00 ; 0 230cc: 48 ed ldi r20, 0xD8 ; 216 230ce: 52 e4 ldi r21, 0x42 ; 66 230d0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 230d4: 2b 01 movw r4, r22 230d6: 3c 01 movw r6, r24 230d8: 20 e0 ldi r18, 0x00 ; 0 230da: 30 e0 ldi r19, 0x00 ; 0 230dc: 42 e5 ldi r20, 0x52 ; 82 230de: 53 e4 ldi r21, 0x43 ; 67 230e0: c7 01 movw r24, r14 230e2: b6 01 movw r22, r12 230e4: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 230e8: 4b 01 movw r8, r22 230ea: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 230ec: 20 e0 ldi r18, 0x00 ; 0 230ee: 30 e0 ldi r19, 0x00 ; 0 230f0: 40 ec ldi r20, 0xC0 ; 192 230f2: 50 e4 ldi r21, 0x40 ; 64 230f4: c7 01 movw r24, r14 230f6: b6 01 movw r22, r12 230f8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 230fc: 6b 01 movw r12, r22 230fe: 7c 01 movw r14, r24 23100: ee 81 ldd r30, Y+6 ; 0x06 23102: ff 81 ldd r31, Y+7 ; 0x07 23104: 20 81 ld r18, Z 23106: 31 81 ldd r19, Z+1 ; 0x01 23108: 42 81 ldd r20, Z+2 ; 0x02 2310a: 53 81 ldd r21, Z+3 ; 0x03 2310c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23110: a5 01 movw r20, r10 23112: 94 01 movw r18, r8 23114: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23118: 20 e0 ldi r18, 0x00 ; 0 2311a: 30 e9 ldi r19, 0x90 ; 144 2311c: 42 e2 ldi r20, 0x22 ; 34 2311e: 56 ec ldi r21, 0xC6 ; 198 23120: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 23124: 6a 83 std Y+2, r22 ; 0x02 23126: 7b 83 std Y+3, r23 ; 0x03 23128: 8c 83 std Y+4, r24 ; 0x04 2312a: 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)) + 2312c: f8 01 movw r30, r16 2312e: 21 81 ldd r18, Z+1 ; 0x01 23130: 32 81 ldd r19, Z+2 ; 0x02 23132: 43 81 ldd r20, Z+3 ; 0x03 23134: 54 81 ldd r21, Z+4 ; 0x04 23136: c3 01 movw r24, r6 23138: b2 01 movw r22, r4 2313a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2313e: a5 01 movw r20, r10 23140: 94 01 movw r18, r8 23142: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23146: 20 e0 ldi r18, 0x00 ; 0 23148: 30 e9 ldi r19, 0x90 ; 144 2314a: 42 ea ldi r20, 0xA2 ; 162 2314c: 56 e4 ldi r21, 0x46 ; 70 2314e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 23152: 9b 01 movw r18, r22 23154: ac 01 movw r20, r24 23156: 6a 81 ldd r22, Y+2 ; 0x02 23158: 7b 81 ldd r23, Y+3 ; 0x03 2315a: 8c 81 ldd r24, Y+4 ; 0x04 2315c: 9d 81 ldd r25, Y+5 ; 0x05 2315e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 23162: 4b 01 movw r8, r22 23164: 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)); 23166: f1 01 movw r30, r2 23168: 20 81 ld r18, Z 2316a: 31 81 ldd r19, Z+1 ; 0x01 2316c: 42 81 ldd r20, Z+2 ; 0x02 2316e: 53 81 ldd r21, Z+3 ; 0x03 23170: c7 01 movw r24, r14 23172: b6 01 movw r22, r12 23174: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23178: a3 01 movw r20, r6 2317a: 92 01 movw r18, r4 2317c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23180: 20 e0 ldi r18, 0x00 ; 0 23182: 30 e9 ldi r19, 0x90 ; 144 23184: 42 ea ldi r20, 0xA2 ; 162 23186: 56 e4 ldi r21, 0x46 ; 70 23188: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2318c: 9b 01 movw r18, r22 2318e: 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)) + 23190: c5 01 movw r24, r10 23192: b4 01 movw r22, r8 23194: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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] = 23198: e8 85 ldd r30, Y+8 ; 0x08 2319a: f9 85 ldd r31, Y+9 ; 0x09 2319c: 65 8f std Z+29, r22 ; 0x1d 2319e: 76 8f std Z+30, r23 ; 0x1e 231a0: 87 8f std Z+31, r24 ; 0x1f 231a2: 90 a3 std Z+32, r25 ; 0x20 231a4: 88 85 ldd r24, Y+8 ; 0x08 231a6: 99 85 ldd r25, Y+9 ; 0x09 231a8: 4c 96 adiw r24, 0x1c ; 28 231aa: 99 87 std Y+9, r25 ; 0x09 231ac: 88 87 std Y+8, r24 ; 0x08 231ae: 99 81 ldd r25, Y+1 ; 0x01 231b0: 9f 5f subi r25, 0xFF ; 255 231b2: 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) { 231b4: 96 30 cpi r25, 0x06 ; 6 231b6: 09 f0 breq .+2 ; 0x231ba 231b8: 6f cf rjmp .-290 ; 0x23098 231ba: 0c 5f subi r16, 0xFC ; 252 231bc: 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) { 231be: e3 e1 ldi r30, 0x13 ; 19 231c0: 0c 3b cpi r16, 0xBC ; 188 231c2: 1e 07 cpc r17, r30 231c4: 09 f0 breq .+2 ; 0x231c8 231c6: 5b cf rjmp .-330 ; 0x2307e z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 231c8: 29 96 adiw r28, 0x09 ; 9 231ca: 0f b6 in r0, 0x3f ; 63 231cc: f8 94 cli 231ce: de bf out 0x3e, r29 ; 62 231d0: 0f be out 0x3f, r0 ; 63 231d2: cd bf out 0x3d, r28 ; 61 231d4: df 91 pop r29 231d6: cf 91 pop r28 231d8: 1f 91 pop r17 231da: 0f 91 pop r16 231dc: ff 90 pop r15 231de: ef 90 pop r14 231e0: df 90 pop r13 231e2: cf 90 pop r12 231e4: bf 90 pop r11 231e6: af 90 pop r10 231e8: 9f 90 pop r9 231ea: 8f 90 pop r8 231ec: 7f 90 pop r7 231ee: 6f 90 pop r6 231f0: 5f 90 pop r5 231f2: 4f 90 pop r4 231f4: 3f 90 pop r3 231f6: 2f 90 pop r2 231f8: 08 95 ret 000231fa : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 231fa: 2f 92 push r2 231fc: 3f 92 push r3 231fe: 4f 92 push r4 23200: 5f 92 push r5 23202: 6f 92 push r6 23204: 7f 92 push r7 23206: 8f 92 push r8 23208: 9f 92 push r9 2320a: af 92 push r10 2320c: bf 92 push r11 2320e: cf 92 push r12 23210: df 92 push r13 23212: ef 92 push r14 23214: ff 92 push r15 23216: 0f 93 push r16 23218: 1f 93 push r17 2321a: cf 93 push r28 2321c: df 93 push r29 2321e: cd b7 in r28, 0x3d ; 61 23220: de b7 in r29, 0x3e ; 62 23222: 67 97 sbiw r28, 0x17 ; 23 23224: 0f b6 in r0, 0x3f ; 63 23226: f8 94 cli 23228: de bf out 0x3e, r29 ; 62 2322a: 0f be out 0x3f, r0 ; 63 2322c: cd bf out 0x3d, r28 ; 61 2322e: 08 2f mov r16, r24 23230: ce 01 movw r24, r28 23232: 46 96 adiw r24, 0x16 ; 22 23234: 9f 8b std Y+23, r25 ; 0x17 23236: 8e 8b std Y+22, r24 ; 0x16 23238: 83 e0 ldi r24, 0x03 ; 3 2323a: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 2323c: 95 e1 ldi r25, 0x15 ; 21 2323e: 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 23240: 0f 94 2e c3 call 0x3865c ; 0x3865c tool_change_extruder = slot; 23244: 00 93 80 13 sts 0x1380, r16 ; 0x801380 state = State::Stopped; currentScope = Scope::Stopped; } void ProtocolLogic::ToolChange(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Tool, slot)); 23248: 40 2f mov r20, r16 2324a: 64 e5 ldi r22, 0x54 ; 84 2324c: ce 01 movw r24, r28 2324e: 01 96 adiw r24, 0x01 ; 1 23250: 0f 94 0c c3 call 0x38618 ; 0x38618 23254: 49 81 ldd r20, Y+1 ; 0x01 23256: 5a 81 ldd r21, Y+2 ; 0x02 23258: 6b 81 ldd r22, Y+3 ; 0x03 2325a: 7c 81 ldd r23, Y+4 ; 0x04 2325c: 8d 81 ldd r24, Y+5 ; 0x05 2325e: 0f 94 7e 98 call 0x330fc ; 0x330fc logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 23262: 61 e0 ldi r22, 0x01 ; 1 23264: 81 e0 ldi r24, 0x01 ; 1 23266: 0f 94 a2 9f call 0x33f44 ; 0x33f44 2326a: 18 2f mov r17, r24 2326c: 81 11 cpse r24, r1 2326e: 07 c0 rjmp .+14 ; 0x2327e break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 23270: 0f 94 70 c2 call 0x384e0 ; 0x384e0 // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 23274: 0f 94 40 9f call 0x33e80 ; 0x33e80 // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 23278: 0f 94 30 a0 call 0x34060 ; 0x34060 2327c: e1 cf rjmp .-62 ; 0x23240 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2327e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 23282: 0f 94 64 c3 call 0x386c8 ; 0x386c8 23286: 81 30 cpi r24, 0x01 ; 1 23288: 79 f1 breq .+94 ; 0x232e8 // 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(); 2328a: 0f 94 30 a0 call 0x34060 ; 0x34060 if (retries == 2 && cutter_enabled()) { 2328e: 92 e0 ldi r25, 0x02 ; 2 23290: f9 12 cpse r15, r25 23292: 09 c0 rjmp .+18 ; 0x232a6 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; 23294: 8e ec ldi r24, 0xCE ; 206 23296: 9e e0 ldi r25, 0x0E ; 14 23298: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2329c: 81 30 cpi r24, 0x01 ; 1 2329e: 19 f4 brne .+6 ; 0x232a6 CutFilamentInner(slot); // try cutting filament tip at the last attempt 232a0: 80 2f mov r24, r16 232a2: 0f 94 1b a1 call 0x34236 ; 0x34236 232a6: 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) { 232a8: f1 10 cpse r15, r1 232aa: ca cf rjmp .-108 ; 0x23240 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()) { 232ac: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 232b0: 88 23 and r24, r24 232b2: 09 f4 brne .+2 ; 0x232b6 232b4: ef c0 rjmp .+478 ; 0x23494 SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 232b6: 67 96 adiw r28, 0x17 ; 23 232b8: 0f b6 in r0, 0x3f ; 63 232ba: f8 94 cli 232bc: de bf out 0x3e, r29 ; 62 232be: 0f be out 0x3f, r0 ; 63 232c0: cd bf out 0x3d, r28 ; 61 232c2: df 91 pop r29 232c4: cf 91 pop r28 232c6: 1f 91 pop r17 232c8: 0f 91 pop r16 232ca: ff 90 pop r15 232cc: ef 90 pop r14 232ce: df 90 pop r13 232d0: cf 90 pop r12 232d2: bf 90 pop r11 232d4: af 90 pop r10 232d6: 9f 90 pop r9 232d8: 8f 90 pop r8 232da: 7f 90 pop r7 232dc: 6f 90 pop r6 232de: 5f 90 pop r5 232e0: 4f 90 pop r4 232e2: 3f 90 pop r3 232e4: 2f 90 pop r2 232e6: 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(); 232e8: 60 91 75 13 lds r22, 0x1375 ; 0x801375 232ec: 70 e0 ldi r23, 0x00 ; 0 232ee: 90 e0 ldi r25, 0x00 ; 0 232f0: 80 e0 ldi r24, 0x00 ; 0 232f2: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 232f6: 9b 01 movw r18, r22 232f8: ac 01 movw r20, r24 232fa: 60 e0 ldi r22, 0x00 ; 0 232fc: 70 e0 ldi r23, 0x00 ; 0 232fe: 8c e5 ldi r24, 0x5C ; 92 23300: 92 e4 ldi r25, 0x42 ; 66 23302: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 23306: 36 2e mov r3, r22 23308: 87 2e mov r8, r23 2330a: 98 2e mov r9, r24 2330c: 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)) 2330e: 26 2f mov r18, r22 23310: 37 2f mov r19, r23 23312: 48 2f mov r20, r24 23314: 59 2f mov r21, r25 23316: 60 e0 ldi r22, 0x00 ; 0 23318: 70 e0 ldi r23, 0x00 ; 0 2331a: 80 e2 ldi r24, 0x20 ; 32 2331c: 91 e4 ldi r25, 0x41 ; 65 2331e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 23322: 2b 01 movw r4, r22 23324: 3c 01 movw r6, r24 23326: ea e3 ldi r30, 0x3A ; 58 23328: f5 e0 ldi r31, 0x05 ; 5 2332a: 82 2d mov r24, r2 2332c: 11 92 st Z+, r1 2332e: 8a 95 dec r24 23330: e9 f7 brne .-6 ; 0x2332c lcd_status_message_idx = 0; 23332: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> bool filament_inserted = true; // expect success // Pixel index will go from 0 to 10, then back from 10 to 0 // The change in this number is used to indicate a new pixel // should be drawn on the display for (uint8_t move = 0; move < 2; move++) { extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 23336: 83 2d mov r24, r3 23338: 98 2d mov r25, r8 2333a: a9 2d mov r26, r9 2333c: be 2d mov r27, r14 2333e: bc 01 movw r22, r24 23340: 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++) { 23342: 91 2c mov r9, r1 23344: 31 2c mov r3, r1 23346: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 23348: 5b 01 movw r10, r22 2334a: 6c 01 movw r12, r24 2334c: d7 fa bst r13, 7 2334e: d0 94 com r13 23350: d7 f8 bld r13, 7 23352: d0 94 com r13 23354: 20 e0 ldi r18, 0x00 ; 0 23356: 30 e0 ldi r19, 0x00 ; 0 23358: 48 e4 ldi r20, 0x48 ; 72 2335a: 52 e4 ldi r21, 0x42 ; 66 2335c: 0f 94 30 c3 call 0x38660 ; 0x38660 23360: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 23364: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 while (planner_any_moves()) { 23368: 98 17 cp r25, r24 2336a: 09 f4 brne .+2 ; 0x2336e 2336c: 49 c0 rjmp .+146 ; 0x23400 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 2336e: 11 23 and r17, r17 23370: 31 f0 breq .+12 ; 0x2337e 23372: 0f 94 64 c3 call 0x386c8 ; 0x386c8 23376: 11 e0 ldi r17, 0x01 ; 1 23378: 81 30 cpi r24, 0x01 ; 1 2337a: 09 f0 breq .+2 ; 0x2337e 2337c: 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); 2337e: 83 e0 ldi r24, 0x03 ; 3 23380: 0f 94 18 59 call 0x2b230 ; 0x2b230 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); 23384: 20 91 4f 07 lds r18, 0x074F ; 0x80074f 23388: 30 91 50 07 lds r19, 0x0750 ; 0x800750 2338c: 40 91 51 07 lds r20, 0x0751 ; 0x800751 23390: 50 91 52 07 lds r21, 0x0752 ; 0x800752 23394: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 23398: a3 01 movw r20, r6 2339a: 92 01 movw r18, r4 2339c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 233a0: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 233a4: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 233a8: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 233aa: e6 16 cp r14, r22 233ac: c1 f0 breq .+48 ; 0x233de 233ae: e3 2d mov r30, r3 233b0: e4 31 cpi r30, 0x14 ; 20 233b2: 08 f0 brcs .+2 ; 0x233b6 233b4: 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); 233b6: 33 24 eor r3, r3 233b8: 33 94 inc r3 233ba: 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] : '-'); 233bc: 8f ef ldi r24, 0xFF ; 255 233be: 11 11 cpse r17, r1 233c0: 01 c0 rjmp .+2 ; 0x233c4 233c2: 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; 233c4: f0 e0 ldi r31, 0x00 ; 0 233c6: e6 5c subi r30, 0xC6 ; 198 233c8: fa 4f sbci r31, 0xFA ; 250 233ca: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 233cc: 91 e0 ldi r25, 0x01 ; 1 233ce: 90 93 6d 02 sts 0x026D, r25 ; 0x80026d if (!lcd_update_enabled) lcdui_print_status_line(); 233d2: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 233d6: 81 11 cpse r24, r1 233d8: 02 c0 rjmp .+4 ; 0x233de 233da: 0f 94 b2 40 call 0x28164 ; 0x28164 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 233de: 90 e0 ldi r25, 0x00 ; 0 233e0: 80 e0 ldi r24, 0x00 ; 0 233e2: 0e 94 87 8e call 0x11d0e ; 0x11d0e } 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); 233e6: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 233e8: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 233ec: 88 23 and r24, r24 233ee: 09 f4 brne .+2 ; 0x233f2 233f0: b7 cf rjmp .-146 ; 0x23360 return false; // power panic or a similar issue happened, bail out fast 233f2: 10 e0 ldi r17, 0x00 ; 0 233f4: 37 c0 rjmp .+110 ; 0x23464 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); 233f6: c6 01 movw r24, r12 233f8: b5 01 movw r22, r10 233fa: 99 24 eor r9, r9 233fc: 93 94 inc r9 233fe: aa cf rjmp .-172 ; 0x23354 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++) { 23400: 91 e0 ldi r25, 0x01 ; 1 23402: 99 12 cpse r9, r25 23404: f8 cf rjmp .-16 ; 0x233f6 return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 23406: 0f 94 2e c3 call 0x3865c ; 0x3865c if (!filament_inserted) { 2340a: 11 11 cpse r17, r1 2340c: 08 c0 rjmp .+16 ; 0x2341e eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 2340e: 8f ec ldi r24, 0xCF ; 207 23410: 9e e0 ldi r25, 0x0E ; 14 23412: 0e 94 b3 77 call 0xef66 ; 0xef66 eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 23416: 80 ed ldi r24, 0xD0 ; 208 23418: 9e e0 ldi r25, 0x0E ; 14 2341a: 0e 94 a6 77 call 0xef4c ; 0xef4c 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); 2341e: 44 e1 ldi r20, 0x14 ; 20 23420: 50 e0 ldi r21, 0x00 ; 0 23422: 6a e3 ldi r22, 0x3A ; 58 23424: 75 e0 ldi r23, 0x05 ; 5 23426: ce 01 movw r24, r28 23428: 01 96 adiw r24, 0x01 ; 1 2342a: 0f 94 11 e4 call 0x3c822 ; 0x3c822 2342e: fe 01 movw r30, r28 23430: 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'; 23432: 81 91 ld r24, Z+ 23434: 87 fd sbrc r24, 7 23436: 2c c0 rjmp .+88 ; 0x23490 23438: 80 e3 ldi r24, 0x30 ; 48 2343a: df 01 movw r26, r30 2343c: 11 97 sbiw r26, 0x01 ; 1 2343e: 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++) { 23440: 8e 89 ldd r24, Y+22 ; 0x16 23442: 9f 89 ldd r25, Y+23 ; 0x17 23444: 8e 17 cp r24, r30 23446: 9f 07 cpc r25, r31 23448: a1 f7 brne .-24 ; 0x23432 // 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; 2344a: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 2344c: 82 ef ldi r24, 0xF2 ; 242 2344e: 99 ea ldi r25, 0xA9 ; 169 23450: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 23454: 8d e8 ldi r24, 0x8D ; 141 23456: 90 e9 ldi r25, 0x90 ; 144 23458: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2345c: ce 01 movw r24, r28 2345e: 01 96 adiw r24, 0x01 ; 1 23460: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 23464: 8f e4 ldi r24, 0x4F ; 79 23466: 95 e0 ldi r25, 0x05 ; 5 23468: 0f 94 2e 42 call 0x2845c ; 0x2845c ::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()) { 2346c: 11 23 and r17, r17 2346e: 09 f4 brne .+2 ; 0x23472 23470: 0c cf rjmp .-488 ; 0x2328a // 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 23472: 80 2f mov r24, r16 23474: 0f 94 d5 87 call 0x30faa ; 0x30faa } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 23478: 00 93 27 13 sts 0x1327, r16 ; 0x801327 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 2347c: 80 91 9c 13 lds r24, 0x139C ; 0x80139c 23480: 90 91 9d 13 lds r25, 0x139D ; 0x80139d 23484: 01 96 adiw r24, 0x01 ; 1 23486: 90 93 9d 13 sts 0x139D, r25 ; 0x80139d 2348a: 80 93 9c 13 sts 0x139C, r24 ; 0x80139c 2348e: 13 cf rjmp .-474 ; 0x232b6 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'; 23490: 81 e3 ldi r24, 0x31 ; 49 23492: d3 cf rjmp .-90 ; 0x2343a void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 23494: 8a e2 ldi r24, 0x2A ; 42 23496: 90 e8 ldi r25, 0x80 ; 128 23498: 90 93 2a 13 sts 0x132A, r25 ; 0x80132a 2349c: 80 93 29 13 sts 0x1329, r24 ; 0x801329 logic.SetPrinterError(ErrorCode::LOAD_TO_EXTRUDER_FAILED); // We only have to wait for the user to fix the issue and press "Retry". // Please see CheckUserInput() for details how we "leave" manage_response. // If manage_response returns false at this spot (MMU operation interrupted aka MMU reset) // we can safely continue because the MMU is not doing an operation now. static_cast(manage_response(true, true)); // yes, I'd like to silence [[nodiscard]] warning at this spot by casting to void 234a0: 61 e0 ldi r22, 0x01 ; 1 234a2: 81 e0 ldi r24, 0x01 ; 1 234a4: 0f 94 a2 9f call 0x33f44 ; 0x33f44 234a8: c7 ce rjmp .-626 ; 0x23238 000234aa : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 234aa: cf 93 push r28 234ac: df 93 push r29 234ae: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 234b0: 0f 94 56 88 call 0x310ac ; 0x310ac 234b4: c8 2f mov r28, r24 234b6: 88 23 and r24, r24 234b8: d9 f0 breq .+54 ; 0x234f0 return false; } if (slot != extruder) { 234ba: 80 91 7f 13 lds r24, 0x137F ; 0x80137f 234be: 8d 17 cp r24, r29 234c0: b9 f0 breq .+46 ; 0x234f0 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(); 234c2: 0e 94 96 68 call 0xd12c ; 0xd12c if (/*FindaDetectsFilament()*/ 234c6: 81 11 cpse r24, r1 234c8: 02 c0 rjmp .+4 ; 0x234ce /*!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(); 234ca: 0f 94 6d a0 call 0x340da ; 0x340da struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 234ce: 0f 94 ca 87 call 0x30f94 ; 0x30f94 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 234d2: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 234d6: 10 92 89 17 sts 0x1789, r1 ; 0x801789 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 234da: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); 234de: 8d 2f mov r24, r29 234e0: 0f 94 fd 18 call 0x231fa ; 0x231fa #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 234e4: 88 e8 ldi r24, 0x88 ; 136 234e6: 97 e1 ldi r25, 0x17 ; 23 234e8: 0e 94 84 75 call 0xeb08 ; 0xeb08 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 234ec: 0f 94 4b 88 call 0x31096 ; 0x31096 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 234f0: 8c 2f mov r24, r28 234f2: df 91 pop r29 234f4: cf 91 pop r28 234f6: 08 95 ret 000234f8 : { (void)lcd_selftest(); } bool lcd_selftest() { 234f8: cf 92 push r12 234fa: df 92 push r13 234fc: ef 92 push r14 234fe: ff 92 push r15 23500: 0f 93 push r16 23502: 1f 93 push r17 23504: cf 93 push r28 23506: df 93 push r29 23508: 00 d0 rcall .+0 ; 0x2350a 2350a: 1f 92 push r1 2350c: cd b7 in r28, 0x3d ; 61 2350e: 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) { 23510: 80 91 91 17 lds r24, 0x1791 ; 0x801791 23514: 8f 3f cpi r24, 0xFF ; 255 23516: 31 f4 brne .+12 ; 0x23524 if (!MMU2::mmu2.Enabled()) { 23518: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2351c: 81 30 cpi r24, 0x01 ; 1 2351e: 11 f0 breq .+4 ; 0x23524 lcd_detect_IRsensor(); 23520: 0f 94 76 15 call 0x22aec ; 0x22aec 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(); 23524: 0f 94 57 45 call 0x28aae ; 0x28aae uint8_t fanSpeedBckp = fanSpeed; 23528: d0 90 e3 03 lds r13, 0x03E3 ; 0x8003e3 fanSpeed = 255; 2352c: 8f ef ldi r24, 0xFF ; 255 2352e: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) { lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 23532: 83 ef ldi r24, 0xF3 ; 243 23534: e8 2e mov r14, r24 23536: 8b e8 ldi r24, 0x8B ; 139 23538: 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()); 2353a: 0d ee ldi r16, 0xED ; 237 2353c: 1b e8 ldi r17, 0x8B ; 139 void lcd_wait_for_cool_down() { disable_heater(); uint8_t fanSpeedBckp = fanSpeed; fanSpeed = 255; while ((degHotend(0)>MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) { 2353e: 20 e0 ldi r18, 0x00 ; 0 23540: 30 e0 ldi r19, 0x00 ; 0 23542: 48 e4 ldi r20, 0x48 ; 72 23544: 52 e4 ldi r21, 0x42 ; 66 23546: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2354a: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2354e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 23552: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 23556: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 2355a: 18 16 cp r1, r24 2355c: 8c f0 brlt .+34 ; 0x23580 2355e: 20 e0 ldi r18, 0x00 ; 0 23560: 30 e0 ldi r19, 0x00 ; 0 23562: 48 e4 ldi r20, 0x48 ; 72 23564: 52 e4 ldi r21, 0x42 ; 66 23566: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 2356a: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 2356e: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 23572: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 23576: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 2357a: 18 16 cp r1, r24 2357c: 0c f0 brlt .+2 ; 0x23580 2357e: 42 c0 rjmp .+132 ; 0x23604 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 23580: 89 ef ldi r24, 0xF9 ; 249 23582: 9e e3 ldi r25, 0x3E ; 62 23584: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 23588: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 2358c: 42 e8 ldi r20, 0x82 ; 130 2358e: 64 e0 ldi r22, 0x04 ; 4 23590: 80 e0 ldi r24, 0x00 ; 0 23592: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 23596: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2359a: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2359e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 235a2: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 235a6: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 235aa: 7f 93 push r23 235ac: 6f 93 push r22 235ae: ff 92 push r15 235b0: ef 92 push r14 235b2: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(LCD_STR_DEGREE[0]); 235b6: 81 e8 ldi r24, 0x81 ; 129 235b8: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 235bc: 40 e8 ldi r20, 0x80 ; 128 235be: 64 e0 ldi r22, 0x04 ; 4 235c0: 89 e0 ldi r24, 0x09 ; 9 235c2: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 235c6: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 235ca: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 235ce: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 235d2: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 235d6: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 235da: 7f 93 push r23 235dc: 6f 93 push r22 235de: 1f 93 push r17 235e0: 0f 93 push r16 235e2: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(LCD_STR_DEGREE[0]); 235e6: 81 e8 ldi r24, 0x81 ; 129 235e8: 0e 94 84 6f call 0xdf08 ; 0xdf08 delay_keep_alive(1000); 235ec: 88 ee ldi r24, 0xE8 ; 232 235ee: 93 e0 ldi r25, 0x03 ; 3 235f0: 0e 94 87 8e call 0x11d0e ; 0x11d0e serialecho_temperatures(); 235f4: 0e 94 e9 78 call 0xf1d2 ; 0xf1d2 235f8: 0f b6 in r0, 0x3f ; 63 235fa: f8 94 cli 235fc: de bf out 0x3e, r29 ; 62 235fe: 0f be out 0x3f, r0 ; 63 23600: cd bf out 0x3d, r28 ; 61 23602: 9d cf rjmp .-198 ; 0x2353e } fanSpeed = fanSpeedBckp; 23604: d0 92 e3 03 sts 0x03E3, r13 ; 0x8003e3 lcd_update_enable(true); 23608: 81 e0 ldi r24, 0x01 ; 1 2360a: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 2360e: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 23612: 8f e3 ldi r24, 0x3F ; 63 23614: 9f e3 ldi r25, 0x3F ; 63 23616: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2361a: ac 01 movw r20, r24 2361c: 60 e0 ldi r22, 0x00 ; 0 2361e: 80 e0 ldi r24, 0x00 ; 0 23620: 0e 94 a9 6f call 0xdf52 ; 0xdf52 #ifdef TMC2130 FORCE_HIGH_POWER_START; 23624: 81 e0 ldi r24, 0x01 ; 1 23626: 0e 94 65 67 call 0xceca ; 0xceca #endif // TMC2130 FORCE_BL_ON_START; 2362a: 81 e0 ldi r24, 0x01 ; 1 2362c: 0e 94 7c 8b call 0x116f8 ; 0x116f8 _delay(2000); 23630: 60 ed ldi r22, 0xD0 ; 208 23632: 77 e0 ldi r23, 0x07 ; 7 23634: 80 e0 ldi r24, 0x00 ; 0 23636: 90 e0 ldi r25, 0x00 ; 0 23638: 0f 94 92 3d call 0x27b24 ; 0x27b24 KEEPALIVE_STATE(IN_HANDLER); 2363c: 82 e0 ldi r24, 0x02 ; 2 2363e: 80 93 96 02 sts 0x0296, r24 ; 0x800296 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 23642: 00 ed ldi r16, 0xD0 ; 208 23644: 17 e0 ldi r17, 0x07 ; 7 23646: 21 e0 ldi r18, 0x01 ; 1 23648: 43 e0 ldi r20, 0x03 ; 3 2364a: 60 e0 ldi r22, 0x00 ; 0 2364c: 80 e0 ldi r24, 0x00 ; 0 2364e: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 23652: 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 23654: 83 e0 ldi r24, 0x03 ; 3 23656: 0e 94 d1 76 call 0xeda2 ; 0xeda2 lcd_selftest_setfan(0); // print fan off 2365a: 80 e0 ldi r24, 0x00 ; 0 2365c: 0e 94 96 d0 call 0x1a12c ; 0x1a12c lcd_selftest_measure_fans(2, 18, 2); 23660: 62 e0 ldi r22, 0x02 ; 2 23662: 82 e0 ldi r24, 0x02 ; 2 23664: 0e 94 2a d1 call 0x1a254 ; 0x1a254 setExtruderAutoFanState(0); // hotend fan off 23668: 80 e0 ldi r24, 0x00 ; 0 2366a: 0e 94 d1 76 call 0xeda2 ; 0xeda2 if (fan_speed[0] < failThr) { 2366e: c0 90 b1 04 lds r12, 0x04B1 ; 0x8004b1 23672: d0 90 b2 04 lds r13, 0x04B2 ; 0x8004b2 23676: 94 e1 ldi r25, 0x14 ; 20 23678: c9 16 cp r12, r25 2367a: d1 04 cpc r13, r1 2367c: 5c f1 brlt .+86 ; 0x236d4 lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 2367e: 21 e0 ldi r18, 0x01 ; 1 23680: 43 e0 ldi r20, 0x03 ; 3 23682: 6f 2d mov r22, r15 23684: 81 e0 ldi r24, 0x01 ; 1 23686: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 2368a: f8 2e mov r15, r24 return FanCheck::SwappedFan; } break; case 1: lcd_selftest_setfan(255); 2368c: 8f ef ldi r24, 0xFF ; 255 2368e: 0e 94 96 d0 call 0x1a12c ; 0x1a12c lcd_selftest_measure_fans(5, 18, 3); 23692: 63 e0 ldi r22, 0x03 ; 3 23694: 85 e0 ldi r24, 0x05 ; 5 23696: 0e 94 2a d1 call 0x1a254 ; 0x1a254 lcd_selftest_setfan(0); 2369a: 80 e0 ldi r24, 0x00 ; 0 2369c: 0e 94 96 d0 call 0x1a12c ; 0x1a12c if (fan_speed[1] < failThr) { 236a0: 80 91 b3 04 lds r24, 0x04B3 ; 0x8004b3 236a4: 90 91 b4 04 lds r25, 0x04B4 ; 0x8004b4 236a8: 84 31 cpi r24, 0x14 ; 20 236aa: 91 05 cpc r25, r1 236ac: cc f4 brge .+50 ; 0x236e0 #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 236ae: 64 ef ldi r22, 0xF4 ; 244 236b0: 72 e0 ldi r23, 0x02 ; 2 236b2: 85 e0 ldi r24, 0x05 ; 5 236b4: 0f 94 f6 06 call 0x20dec ; 0x20dec } } if (_swapped_fan) { 236b8: 96 e4 ldi r25, 0x46 ; 70 236ba: c9 16 cp r12, r25 236bc: d1 04 cpc r13, r1 236be: 9c f4 brge .+38 ; 0x236e6 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 236c0: 08 e8 ldi r16, 0x88 ; 136 236c2: 13 e1 ldi r17, 0x13 ; 19 236c4: 21 e0 ldi r18, 0x01 ; 1 236c6: 43 e0 ldi r20, 0x03 ; 3 236c8: 6f 2d mov r22, r15 236ca: 8d e0 ldi r24, 0x0D ; 13 236cc: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 236d0: e1 2c mov r14, r1 236d2: 5d c1 rjmp .+698 ; 0x2398e #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 236d4: 64 ef ldi r22, 0xF4 ; 244 236d6: 72 e0 ldi r23, 0x02 ; 2 236d8: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 236da: 0f 94 f6 06 call 0x20dec ; 0x20dec 236de: f0 cf rjmp .-32 ; 0x236c0 lcd_selftest_measure_fans(5, 18, 3); lcd_selftest_setfan(0); if (fan_speed[1] < failThr) { return FanCheck::PrintFan; } if (fan_speed[1] < printFanThr) { 236e0: 86 34 cpi r24, 0x46 ; 70 236e2: 91 05 cpc r25, r1 236e4: 54 f4 brge .+20 ; 0x236fa } } if (_swapped_fan) { //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 236e6: 60 e0 ldi r22, 0x00 ; 0 236e8: 81 e0 ldi r24, 0x01 ; 1 236ea: 0e 94 9c d0 call 0x1a138 ; 0x1a138 if (_result) { 236ee: 81 11 cpse r24, r1 236f0: 7c c1 rjmp .+760 ; 0x239ea lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 236f2: 64 ef ldi r22, 0xF4 ; 244 236f4: 72 e0 ldi r23, 0x02 ; 2 236f6: 89 e0 ldi r24, 0x09 ; 9 236f8: f0 cf rjmp .-32 ; 0x236da { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 236fa: 86 e4 ldi r24, 0x46 ; 70 236fc: c8 16 cp r12, r24 236fe: d1 04 cpc r13, r1 23700: 94 f7 brge .-28 ; 0x236e6 } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 23702: 00 ed ldi r16, 0xD0 ; 208 23704: 17 e0 ldi r17, 0x07 ; 7 23706: 21 e0 ldi r18, 0x01 ; 1 23708: 43 e0 ldi r20, 0x03 ; 3 2370a: 6f 2d mov r22, r15 2370c: 82 e0 ldi r24, 0x02 ; 2 2370e: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 23712: f8 2e mov r15, r24 static bool lcd_selfcheck_endstops() { bool _result = true; if ( 23714: 1c 9b sbis 0x03, 4 ; 3 23716: 18 c0 rjmp .+48 ; 0x23748 { #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; 23718: 1c 9b sbis 0x03, 4 ; 3 2371a: 16 c0 rjmp .+44 ; 0x23748 2371c: 20 e0 ldi r18, 0x00 ; 0 2371e: 30 e0 ldi r19, 0x00 ; 0 23720: 40 e2 ldi r20, 0x20 ; 32 23722: 51 e4 ldi r21, 0x41 ; 65 23724: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 23728: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 2372c: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 23730: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 23734: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 23738: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 2373c: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 23740: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 23744: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 23748: 60 e0 ldi r22, 0x00 ; 0 2374a: 70 e0 ldi r23, 0x00 ; 0 2374c: 84 e3 ldi r24, 0x34 ; 52 2374e: 92 e4 ldi r25, 0x42 ; 66 23750: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 23754: 0f 94 2c 59 call 0x2b258 ; 0x2b258 if ( 23758: 1c 9b sbis 0x03, 4 ; 3 2375a: 51 c1 rjmp .+674 ; 0x239fe ((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] = ""; 2375c: 1a 82 std Y+2, r1 ; 0x02 2375e: 19 82 std Y+1, r1 ; 0x01 23760: 1c 82 std Y+4, r1 ; 0x04 23762: 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"); 23764: 1c 9b sbis 0x03, 4 ; 3 23766: 06 c0 rjmp .+12 ; 0x23774 23768: 69 ef ldi r22, 0xF9 ; 249 2376a: 72 e0 ldi r23, 0x02 ; 2 2376c: ce 01 movw r24, r28 2376e: 01 96 adiw r24, 0x01 ; 1 23770: 0f 94 dd e3 call 0x3c7ba ; 0x3c7ba lcd_selftest_error(TestError::Endstops, _error, ""); 23774: be 01 movw r22, r28 23776: 6f 5f subi r22, 0xFF ; 255 23778: 7f 4f sbci r23, 0xFF ; 255 2377a: 82 e0 ldi r24, 0x02 ; 2 2377c: 0f 94 f6 06 call 0x20dec ; 0x20dec ((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; 23780: 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(); 23782: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 23786: 81 e0 ldi r24, 0x01 ; 1 23788: 0e 94 e2 8b call 0x117c4 ; 0x117c4 { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 2378c: 11 23 and r17, r17 2378e: 09 f4 brne .+2 ; 0x23792 23790: 97 cf rjmp .-210 ; 0x236c0 { //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); 23792: 00 ed ldi r16, 0xD0 ; 208 23794: 17 e0 ldi r17, 0x07 ; 7 23796: 21 e0 ldi r18, 0x01 ; 1 23798: 43 e0 ldi r20, 0x03 ; 3 2379a: 6f 2d mov r22, r15 2379c: 84 e0 ldi r24, 0x04 ; 4 2379e: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 237a2: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); 237a4: 80 e0 ldi r24, 0x00 ; 0 237a6: 0f 94 0b 09 call 0x21216 ; 0x21216 } if (_result) 237aa: 88 23 and r24, r24 237ac: 09 f4 brne .+2 ; 0x237b0 237ae: 88 cf rjmp .-240 ; 0x236c0 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 237b0: 10 e0 ldi r17, 0x00 ; 0 237b2: 00 e0 ldi r16, 0x00 ; 0 237b4: 21 e0 ldi r18, 0x01 ; 1 237b6: 43 e0 ldi r20, 0x03 ; 3 237b8: 6f 2d mov r22, r15 237ba: 84 e0 ldi r24, 0x04 ; 4 237bc: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e } if (_result) { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 237c0: 0c ed ldi r16, 0xDC ; 220 237c2: 15 e0 ldi r17, 0x05 ; 5 237c4: 21 e0 ldi r18, 0x01 ; 1 237c6: 43 e0 ldi r20, 0x03 ; 3 237c8: 68 2f mov r22, r24 237ca: 85 e0 ldi r24, 0x05 ; 5 237cc: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 237d0: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); 237d2: 81 e0 ldi r24, 0x01 ; 1 237d4: 0f 94 0b 09 call 0x21216 ; 0x21216 #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); #endif // TMC2130 } if (_result) 237d8: 88 23 and r24, r24 237da: 09 f4 brne .+2 ; 0x237de 237dc: 71 cf rjmp .-286 ; 0x236c0 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 237de: 10 e0 ldi r17, 0x00 ; 0 237e0: 00 e0 ldi r16, 0x00 ; 0 237e2: 21 e0 ldi r18, 0x01 ; 1 237e4: 43 e0 ldi r20, 0x03 ; 3 237e6: 6f 2d mov r22, r15 237e8: 86 e0 ldi r24, 0x06 ; 6 237ea: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 237ee: f8 2e mov r15, r24 if (_result) { #ifdef TMC2130 tmc2130_home_exit(); 237f0: 0f 94 64 3b call 0x276c8 ; 0x276c8 237f4: 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); 237f8: ef e1 ldi r30, 0x1F ; 31 237fa: f2 e9 ldi r31, 0x92 ; 146 237fc: 85 91 lpm r24, Z+ 237fe: 95 91 lpm r25, Z+ 23800: a5 91 lpm r26, Z+ 23802: b4 91 lpm r27, Z 23804: 80 93 43 07 sts 0x0743, r24 ; 0x800743 23808: 90 93 44 07 sts 0x0744, r25 ; 0x800744 2380c: a0 93 45 07 sts 0x0745, r26 ; 0x800745 23810: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 23814: e3 e2 ldi r30, 0x23 ; 35 23816: f2 e9 ldi r31, 0x92 ; 146 23818: 65 91 lpm r22, Z+ 2381a: 75 91 lpm r23, Z+ 2381c: 85 91 lpm r24, Z+ 2381e: 94 91 lpm r25, Z #ifdef TMC2130 //current_position[X_AXIS] += 0; current_position[Y_AXIS] += 4; 23820: 20 e0 ldi r18, 0x00 ; 0 23822: 30 e0 ldi r19, 0x00 ; 0 23824: 40 e8 ldi r20, 0x80 ; 128 23826: 50 e4 ldi r21, 0x40 ; 64 23828: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2382c: 60 93 47 07 sts 0x0747, r22 ; 0x800747 23830: 70 93 48 07 sts 0x0748, r23 ; 0x800748 23834: 80 93 49 07 sts 0x0749, r24 ; 0x800749 23838: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a #endif //TMC2130 raise_z(10); 2383c: 60 e0 ldi r22, 0x00 ; 0 2383e: 70 e0 ldi r23, 0x00 ; 0 23840: 80 e2 ldi r24, 0x20 ; 32 23842: 91 e4 ldi r25, 0x41 ; 65 23844: 0e 94 96 6e call 0xdd2c ; 0xdd2c set_destination_to_current(); 23848: 0e 94 ef 68 call 0xd1de ; 0xd1de _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 2384c: 0c ed ldi r16, 0xDC ; 220 2384e: 15 e0 ldi r17, 0x05 ; 5 23850: 21 e0 ldi r18, 0x01 ; 1 23852: 43 e0 ldi r20, 0x03 ; 3 23854: 6f 2d mov r22, r15 23856: 86 e0 ldi r24, 0x06 ; 6 23858: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e #ifdef TMC2130 homeaxis(Z_AXIS); //In case of failure, the code gets stuck in this function. 2385c: 50 e0 ldi r21, 0x00 ; 0 2385e: 40 e0 ldi r20, 0x00 ; 0 23860: 61 e0 ldi r22, 0x01 ; 1 23862: 82 e0 ldi r24, 0x02 ; 2 23864: 0e 94 f6 7b call 0xf7ec ; 0xf7ec #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); 23868: 60 e0 ldi r22, 0x00 ; 0 2386a: 70 e0 ldi r23, 0x00 ; 0 2386c: 80 ea ldi r24, 0xA0 ; 160 2386e: 91 e4 ldi r25, 0x41 ; 65 23870: 0e 94 96 6e call 0xdd2c ; 0xdd2c } #ifdef TMC2130 if (_result) { raise_z(10); 23874: 60 e0 ldi r22, 0x00 ; 0 23876: 70 e0 ldi r23, 0x00 ; 0 23878: 80 e2 ldi r24, 0x20 ; 32 2387a: 91 e4 ldi r25, 0x41 ; 65 2387c: 0e 94 96 6e call 0xdd2c ; 0xdd2c _progress = lcd_selftest_screen(TestScreen::Home, 0, 2, true, 0); 23880: 10 e0 ldi r17, 0x00 ; 0 23882: 00 e0 ldi r16, 0x00 ; 0 23884: 21 e0 ldi r18, 0x01 ; 1 23886: 42 e0 ldi r20, 0x02 ; 2 23888: 60 e0 ldi r22, 0x00 ; 0 2388a: 8e e0 ldi r24, 0x0E ; 14 2388c: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e bool bres = tmc2130_home_calibrate(X_AXIS); 23890: 80 e0 ldi r24, 0x00 ; 0 23892: 0f 94 56 38 call 0x270ac ; 0x270ac 23896: e8 2e mov r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 1, 2, true, 0); 23898: 21 e0 ldi r18, 0x01 ; 1 2389a: 42 e0 ldi r20, 0x02 ; 2 2389c: 61 e0 ldi r22, 0x01 ; 1 2389e: 8e e0 ldi r24, 0x0E ; 14 238a0: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e bres &= tmc2130_home_calibrate(Y_AXIS); 238a4: 81 e0 ldi r24, 0x01 ; 1 238a6: 0f 94 56 38 call 0x270ac ; 0x270ac 238aa: e8 22 and r14, r24 _progress = lcd_selftest_screen(TestScreen::Home, 2, 2, true, 0); 238ac: 21 e0 ldi r18, 0x01 ; 1 238ae: 42 e0 ldi r20, 0x02 ; 2 238b0: 62 e0 ldi r22, 0x02 ; 2 238b2: 8e e0 ldi r24, 0x0E ; 14 238b4: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 238b8: f8 2e mov r15, r24 if (bres) 238ba: ee 20 and r14, r14 238bc: 09 f4 brne .+2 ; 0x238c0 238be: 00 cf rjmp .-512 ; 0x236c0 238c0: 61 e0 ldi r22, 0x01 ; 1 238c2: 88 ef ldi r24, 0xF8 ; 248 238c4: 9e e0 ldi r25, 0x0E ; 14 238c6: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } #endif //TMC2130 if (_result) { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 238ca: 00 ed ldi r16, 0xD0 ; 208 238cc: 17 e0 ldi r17, 0x07 ; 7 238ce: 21 e0 ldi r18, 0x01 ; 1 238d0: 43 e0 ldi r20, 0x03 ; 3 238d2: 6f 2d mov r22, r15 238d4: 87 e0 ldi r24, 0x07 ; 7 238d6: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 238da: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 238dc: 81 e0 ldi r24, 0x01 ; 1 238de: 0f 94 0d 08 call 0x2101a ; 0x2101a } if (_result) 238e2: 88 23 and r24, r24 238e4: 09 f4 brne .+2 ; 0x238e8 238e6: ec ce rjmp .-552 ; 0x236c0 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 238e8: 08 ee ldi r16, 0xE8 ; 232 238ea: 13 e0 ldi r17, 0x03 ; 3 238ec: 21 e0 ldi r18, 0x01 ; 1 238ee: 43 e0 ldi r20, 0x03 ; 3 238f0: 6f 2d mov r22, r15 238f2: 88 e0 ldi r24, 0x08 ; 8 238f4: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 238f8: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 238fa: 80 e0 ldi r24, 0x00 ; 0 238fc: 0f 94 0d 08 call 0x2101a ; 0x2101a 23900: e8 2e mov r14, r24 } if (_result) 23902: 88 23 and r24, r24 23904: 09 f4 brne .+2 ; 0x23908 23906: dc ce rjmp .-584 ; 0x236c0 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 23908: 00 ed ldi r16, 0xD0 ; 208 2390a: 17 e0 ldi r17, 0x07 ; 7 2390c: 21 e0 ldi r18, 0x01 ; 1 2390e: 43 e0 ldi r20, 0x03 ; 3 23910: 6f 2d mov r22, r15 23912: 89 e0 ldi r24, 0x09 ; 9 23914: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e } #ifdef FILAMENT_SENSOR if (_result) { #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (MMU2::mmu2.Enabled()) 23918: 90 91 98 13 lds r25, 0x1398 ; 0x801398 2391c: 91 30 cpi r25, 0x01 ; 1 2391e: 79 f5 brne .+94 ; 0x2397e { _progress = lcd_selftest_screen(TestScreen::Fsensor, _progress, 3, true, 2000); //check filaments sensor 23920: 21 e0 ldi r18, 0x01 ; 1 23922: 43 e0 ldi r20, 0x03 ; 3 23924: 68 2f mov r22, r24 23926: 8a e0 ldi r24, 0x0A ; 10 23928: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e 2392c: 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); 2392e: 8e e1 ldi r24, 0x1E ; 30 23930: 9f e3 ldi r25, 0x3F ; 63 23932: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 23936: 70 e0 ldi r23, 0x00 ; 0 23938: 60 e0 ldi r22, 0x00 ; 0 2393a: 0e 94 ba d9 call 0x1b374 ; 0x1b374 2393e: d8 2e mov r13, r24 // Render self-test screen lcd_selftest_screen(TestScreen::Fsensor, 0, 1, true, 0); 23940: 10 e0 ldi r17, 0x00 ; 0 23942: 00 e0 ldi r16, 0x00 ; 0 23944: 21 e0 ldi r18, 0x01 ; 1 23946: 41 e0 ldi r20, 0x01 ; 1 23948: 60 e0 ldi r22, 0x00 ; 0 2394a: 8a e0 ldi r24, 0x0A ; 10 2394c: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 23950: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 23954: 10 92 6b 02 sts 0x026B, r1 ; 0x80026b // Run self-test set_extrude_min_temp(0); MMU2::mmu2.tool_change(slot); 23958: 8d 2d mov r24, r13 2395a: 0f 94 55 1a call 0x234aa ; 0x234aa MMU2::mmu2.unload(); //Unload filament 2395e: 0f 94 6d a0 call 0x340da ; 0x340da 23962: 8f ea ldi r24, 0xAF ; 175 23964: 90 e0 ldi r25, 0x00 ; 0 23966: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 2396a: 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 2396e: 00 ed ldi r16, 0xD0 ; 208 23970: 17 e0 ldi r17, 0x07 ; 7 23972: 21 e0 ldi r18, 0x01 ; 1 23974: 43 e0 ldi r20, 0x03 ; 3 23976: 6f 2d mov r22, r15 23978: 8b e0 ldi r24, 0x0B ; 11 2397a: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 2397e: 08 e8 ldi r16, 0x88 ; 136 23980: 13 e1 ldi r17, 0x13 ; 19 23982: 21 e0 ldi r18, 0x01 ; 1 23984: 43 e0 ldi r20, 0x03 ; 3 23986: 68 2f mov r22, r24 23988: 8c e0 ldi r24, 0x0C ; 12 2398a: 0e 94 af d5 call 0x1ab5e ; 0x1ab5e lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2398e: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 23992: 61 e0 ldi r22, 0x01 ; 1 23994: 87 e7 ldi r24, 0x77 ; 119 23996: 9b e6 ldi r25, 0x6B ; 107 23998: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_update_enable(true); 2399c: 81 e0 ldi r24, 0x01 ; 1 2399e: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 if (_result) 239a2: ee 20 and r14, r14 239a4: 71 f1 breq .+92 ; 0x23a02 { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 239a6: 81 e0 ldi r24, 0x01 ; 1 239a8: 0e 94 66 e7 call 0x1cecc ; 0x1cecc lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 239ac: 81 e3 ldi r24, 0x31 ; 49 239ae: 9f e3 ldi r25, 0x3F ; 63 239b0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 239b4: 0f 94 ea 0b call 0x217d4 ; 0x217d4 lcd_return_to_status(); 239b8: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); } #ifdef TMC2130 FORCE_HIGH_POWER_END; 239bc: 80 e0 ldi r24, 0x00 ; 0 239be: 0e 94 65 67 call 0xceca ; 0xceca #endif // TMC2130 FORCE_BL_ON_END; 239c2: 80 e0 ldi r24, 0x00 ; 0 239c4: 0e 94 7c 8b call 0x116f8 ; 0x116f8 KEEPALIVE_STATE(NOT_BUSY); 239c8: 81 e0 ldi r24, 0x01 ; 1 239ca: 80 93 96 02 sts 0x0296, r24 ; 0x800296 return(_result); } 239ce: 8e 2d mov r24, r14 239d0: 0f 90 pop r0 239d2: 0f 90 pop r0 239d4: 0f 90 pop r0 239d6: 0f 90 pop r0 239d8: df 91 pop r29 239da: cf 91 pop r28 239dc: 1f 91 pop r17 239de: 0f 91 pop r16 239e0: ff 90 pop r15 239e2: ef 90 pop r14 239e4: df 90 pop r13 239e6: cf 90 pop r12 239e8: 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); 239ea: 61 e0 ldi r22, 0x01 ; 1 239ec: 80 e0 ldi r24, 0x00 ; 0 239ee: 0e 94 9c d0 call 0x1a138 ; 0x1a138 if (!_result){ 239f2: 81 11 cpse r24, r1 239f4: 86 ce rjmp .-756 ; 0x23702 lcd_selftest_error(TestError::PrintFan, "", ""); 239f6: 64 ef ldi r22, 0xF4 ; 244 239f8: 72 e0 ldi r23, 0x02 ; 2 239fa: 85 e0 ldi r24, 0x05 ; 5 239fc: 6e ce rjmp .-804 ; 0x236da #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 239fe: 11 e0 ldi r17, 0x01 ; 1 23a00: c0 ce rjmp .-640 ; 0x23782 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 23a02: 88 ec ldi r24, 0xC8 ; 200 23a04: 93 e4 ldi r25, 0x43 ; 67 23a06: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 23a0a: 62 e0 ldi r22, 0x02 ; 2 23a0c: 0f 94 c7 06 call 0x20d8e ; 0x20d8e 23a10: d5 cf rjmp .-86 ; 0x239bc 00023a12 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 23a12: 0d 94 7c 1a jmp 0x234f8 ; 0x234f8 00023a16 : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 23a16: cf 93 push r28 23a18: 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); 23a1a: 8b ec ldi r24, 0xCB ; 203 23a1c: 9a e3 ldi r25, 0x3A ; 58 23a1e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 23a22: 6c 2f mov r22, r28 23a24: 0f 94 51 c2 call 0x384a2 ; 0x384a2 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 23a28: 8c 2f mov r24, r28 23a2a: 0f 94 55 1a call 0x234aa ; 0x234aa 23a2e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 planner_synchronize(); unload(); 23a32: 0f 94 6d a0 call 0x340da ; 0x340da ScreenUpdateEnable(); 23a36: 0f 94 4e c2 call 0x3849c ; 0x3849c MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 23a3a: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 23a3c: 0d 94 f4 36 jmp 0x26de8 ; 0x26de8 00023a40 : 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(){ 23a40: cf 93 push r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ 23a42: c0 e0 ldi r28, 0x00 ; 0 23a44: 8b ec ldi r24, 0xCB ; 203 23a46: 9a e3 ldi r25, 0x3A ; 58 23a48: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 23a4c: 6c 2f mov r22, r28 23a4e: 0f 94 51 c2 call 0x384a2 ; 0x384a2 return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 23a52: 8c 2f mov r24, r28 23a54: 0f 94 55 1a call 0x234aa ; 0x234aa 23a58: 0f 94 2c 59 call 0x2b258 ; 0x2b258 planner_synchronize(); unload(); 23a5c: 0f 94 6d a0 call 0x340da ; 0x340da ScreenUpdateEnable(); 23a60: 0f 94 4e c2 call 0x3849c ; 0x3849c 23a64: cf 5f subi r28, 0xFF ; 255 23a66: c5 30 cpi r28, 0x05 ; 5 23a68: 69 f7 brne .-38 ; 0x23a44 MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 23a6a: cf 91 pop r28 for(uint8_t i = 0; i < MMU_FILAMENT_COUNT; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 23a6c: 0d 94 f4 36 jmp 0x26de8 ; 0x26de8 00023a70 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 23a70: cf 93 push r28 23a72: df 93 push r29 23a74: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 23a76: 0f 94 56 88 call 0x310ac ; 0x310ac 23a7a: c8 2f mov r28, r24 23a7c: 88 23 and r24, r24 23a7e: 69 f1 breq .+90 ; 0x23ada safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 23a80: 88 ec ldi r24, 0xC8 ; 200 23a82: 90 e0 ldi r25, 0x00 ; 0 23a84: 0f 94 ad c6 call 0x38d5a ; 0x38d5a (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); 23a88: 82 e0 ldi r24, 0x02 ; 2 23a8a: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 23a8e: 86 e7 ldi r24, 0x76 ; 118 23a90: 9c e5 ldi r25, 0x5C ; 92 23a92: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 23a96: 6d 2f mov r22, r29 23a98: 0f 94 51 c2 call 0x384a2 ; 0x384a2 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 23a9c: 0f 94 ca 87 call 0x30f94 ; 0x30f94 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23aa0: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23aa4: 10 92 89 17 sts 0x1789, r1 ; 0x801789 { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 23aa8: 80 91 7f 13 lds r24, 0x137F ; 0x80137f 23aac: 83 36 cpi r24, 0x63 ; 99 23aae: 29 f0 breq .+10 ; 0x23aba return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 23ab0: 62 e1 ldi r22, 0x12 ; 18 23ab2: 84 e8 ldi r24, 0x84 ; 132 23ab4: 95 ea ldi r25, 0xA5 ; 165 23ab6: 0f 94 2d 88 call 0x3105a ; 0x3105a if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 23aba: 8d 2f mov r24, r29 23abc: 0f 94 fd 18 call 0x231fa ; 0x231fa // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 23ac0: 0e 94 5d d1 call 0x1a2ba ; 0x1a2ba 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); 23ac4: 83 e0 ldi r24, 0x03 ; 3 23ac6: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23aca: 88 e8 ldi r24, 0x88 ; 136 23acc: 97 e1 ldi r25, 0x17 ; 23 23ace: 0e 94 84 75 call 0xeb08 ; 0xeb08 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 23ad2: 0f 94 4b 88 call 0x31096 ; 0x31096 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 23ad6: 0f 94 4e c2 call 0x3849c ; 0x3849c return true; } 23ada: 8c 2f mov r24, r28 23adc: df 91 pop r29 23ade: cf 91 pop r28 23ae0: 08 95 ret 00023ae2 : /// 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) { 23ae2: 1f 93 push r17 23ae4: cf 93 push r28 23ae6: df 93 push r29 23ae8: c8 2f mov r28, r24 23aea: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 23aec: 0f 94 56 88 call 0x310ac ; 0x310ac 23af0: d8 2f mov r29, r24 23af2: 88 23 and r24, r24 23af4: a9 f0 breq .+42 ; 0x23b20 eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 23af6: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 23afa: 10 92 89 17 sts 0x1789, r1 ; 0x801789 return false; } FSensorBlockRunout blockRunout; switch (code) { 23afe: c3 36 cpi r28, 0x63 ; 99 23b00: 11 f1 breq .+68 ; 0x23b46 23b02: c8 37 cpi r28, 0x78 ; 120 23b04: 91 f0 breq .+36 ; 0x23b2a 23b06: cf 33 cpi r28, 0x3F ; 63 23b08: 39 f4 brne .+14 ; 0x23b18 case '?': { waitForHotendTargetTemp(100, [] {}); 23b0a: 84 e6 ldi r24, 0x64 ; 100 23b0c: 90 e0 ldi r25, 0x00 ; 0 23b0e: 0f 94 ad c6 call 0x38d5a ; 0x38d5a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> load_filament_to_nozzle(slot); 23b12: 81 2f mov r24, r17 23b14: 0f 94 38 1d call 0x23a70 ; 0x23a70 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 23b18: 88 e8 ldi r24, 0x88 ; 136 23b1a: 97 e1 ldi r25, 0x17 ; 23 23b1c: 0e 94 84 75 call 0xeb08 ; 0xeb08 execute_load_to_nozzle_sequence(); } break; } return true; } 23b20: 8d 2f mov r24, r29 23b22: df 91 pop r29 23b24: cf 91 pop r28 23b26: 1f 91 pop r17 23b28: 08 95 ret 23b2a: 10 92 6c 02 sts 0x026C, r1 ; 0x80026c 23b2e: 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); 23b32: 81 2f mov r24, r17 23b34: 0f 94 55 1a call 0x234aa ; 0x234aa 23b38: 8f ea ldi r24, 0xAF ; 175 23b3a: 90 e0 ldi r25, 0x00 ; 0 23b3c: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 23b40: 80 93 6b 02 sts 0x026B, r24 ; 0x80026b 23b44: e9 cf rjmp .-46 ; 0x23b18 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 23b46: 84 e6 ldi r24, 0x64 ; 100 23b48: 90 e0 ldi r25, 0x00 ; 0 23b4a: 0f 94 ad c6 call 0x38d5a ; 0x38d5a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> execute_load_to_nozzle_sequence(); 23b4e: 0e 94 5d d1 call 0x1a2ba ; 0x1a2ba 23b52: e2 cf rjmp .-60 ; 0x23b18 00023b54 : 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); 23b54: 0f 94 38 1d call 0x23a70 ; 0x23a70 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 23b58: 0e 94 48 65 call 0xca90 ; 0xca90 st_synchronize(); 23b5c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // Ask user if the extruded color is correct: lcd_return_to_status(); 23b60: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_load_filament_color_check(); 23b64: 0f 94 b7 68 call 0x2d16e ; 0x2d16e lcd_setstatuspgm(MSG_WELCOME); 23b68: 8a e6 ldi r24, 0x6A ; 106 23b6a: 90 e7 ldi r25, 0x70 ; 112 23b6c: 0f 94 ea 0b call 0x217d4 ; 0x217d4 custom_message_type = CustomMsg::Status; 23b70: 10 92 75 07 sts 0x0775, r1 ; 0x800775 // Clear the filament action clearFilamentAction(); 23b74: 0d 94 f4 36 jmp 0x26de8 ; 0x26de8 00023b78 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 23b78: cf 93 push r28 23b7a: df 93 push r29 23b7c: 00 d0 rcall .+0 ; 0x23b7e 23b7e: 1f 92 push r1 23b80: 1f 92 push r1 23b82: cd b7 in r28, 0x3d ; 61 23b84: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 23b86: 48 2f mov r20, r24 23b88: 68 e5 ldi r22, 0x58 ; 88 23b8a: ce 01 movw r24, r28 23b8c: 01 96 adiw r24, 0x01 ; 1 23b8e: 0f 94 0c c3 call 0x38618 ; 0x38618 23b92: 49 81 ldd r20, Y+1 ; 0x01 23b94: 5a 81 ldd r21, Y+2 ; 0x02 23b96: 6b 81 ldd r22, Y+3 ; 0x03 23b98: 7c 81 ldd r23, Y+4 ; 0x04 23b9a: 8d 81 ldd r24, Y+5 ; 0x05 23b9c: 0f 94 7e 98 call 0x330fc ; 0x330fc } 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: 08 95 ret 00023bb0 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 23bb0: 1f 93 push r17 23bb2: cf 93 push r28 23bb4: df 93 push r29 23bb6: 00 d0 rcall .+0 ; 0x23bb8 23bb8: 1f 92 push r1 23bba: 1f 92 push r1 23bbc: cd b7 in r28, 0x3d ; 61 23bbe: de b7 in r29, 0x3e ; 62 23bc0: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 23bc2: 0f 94 56 88 call 0x310ac ; 0x310ac 23bc6: 88 23 and r24, r24 23bc8: d9 f0 breq .+54 ; 0x23c00 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 23bca: 41 2f mov r20, r17 23bcc: 62 e5 ldi r22, 0x52 ; 82 23bce: ce 01 movw r24, r28 23bd0: 01 96 adiw r24, 0x01 ; 1 23bd2: 0f 94 0c c3 call 0x38618 ; 0x38618 23bd6: 49 81 ldd r20, Y+1 ; 0x01 23bd8: 5a 81 ldd r21, Y+2 ; 0x02 23bda: 6b 81 ldd r22, Y+3 ; 0x03 23bdc: 7c 81 ldd r23, Y+4 ; 0x04 23bde: 8d 81 ldd r24, Y+5 ; 0x05 23be0: 0f 94 7e 98 call 0x330fc ; 0x330fc 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)); 23be4: 60 e0 ldi r22, 0x00 ; 0 23be6: 80 e0 ldi r24, 0x00 ; 0 23be8: 0f 94 a2 9f call 0x33f44 ; 0x33f44 23bec: 88 23 and r24, r24 23bee: 69 f3 breq .-38 ; 0x23bca // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 23bf0: 20 91 44 13 lds r18, 0x1344 ; 0x801344 23bf4: 30 91 45 13 lds r19, 0x1345 ; 0x801345 23bf8: 30 93 95 13 sts 0x1395, r19 ; 0x801395 23bfc: 20 93 94 13 sts 0x1394, r18 ; 0x801394 return true; } 23c00: 0f 90 pop r0 23c02: 0f 90 pop r0 23c04: 0f 90 pop r0 23c06: 0f 90 pop r0 23c08: 0f 90 pop r0 23c0a: df 91 pop r29 23c0c: cf 91 pop r28 23c0e: 1f 91 pop r17 23c10: 08 95 ret 00023c12 : waiting_handler(); } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { 23c12: ff 92 push r15 23c14: 0f 93 push r16 23c16: 1f 93 push r17 23c18: cf 93 push r28 23c1a: df 93 push r29 23c1c: 1f 92 push r1 23c1e: cd b7 in r28, 0x3d ; 61 23c20: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 23c22: ce 01 movw r24, r28 23c24: 01 96 adiw r24, 0x01 ; 1 23c26: 0f 94 de 47 call 0x28fbc ; 0x28fbc uint16_t pos = 0; 23c2a: 10 e0 ldi r17, 0x00 ; 0 23c2c: 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]; 23c2e: 85 e0 ldi r24, 0x05 ; 5 23c30: 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()) { 23c32: d1 99 sbic 0x1a, 1 ; 26 23c34: 11 c0 rjmp .+34 ; 0x23c58 // temperatures not ready yet, just manage heaters while waiting to reduce jitter manage_heater(); 23c36: 0f 94 a0 4e call 0x29d40 ; 0x29d40 static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; uint16_t pos = 0; while(pos < samples) { 23c3a: 0e 3d cpi r16, 0xDE ; 222 23c3c: 11 05 cpc r17, r1 23c3e: c9 f7 brne .-14 ; 0x23c32 } set_fan_speed(old_speed); } static uint16_t record(uint16_t samples = REC_BUFFER_SIZE) { TempMgrGuard temp_mgr_guard; 23c40: ce 01 movw r24, r28 23c42: 01 96 adiw r24, 0x01 ; 1 23c44: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); } return pos; } 23c48: c8 01 movw r24, r16 23c4a: 0f 90 pop r0 23c4c: df 91 pop r29 23c4e: cf 91 pop r28 23c50: 1f 91 pop r17 23c52: 0f 91 pop r16 23c54: ff 90 pop r15 23c56: 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(); 23c58: d1 9a sbi 0x1a, 1 ; 26 // manually repeat what the regular isr would do if(adc_values_ready != true) continue; 23c5a: 80 91 1f 05 lds r24, 0x051F ; 0x80051f <_ZL16adc_values_ready.lto_priv.472> 23c5e: 88 23 and r24, r24 23c60: 61 f3 breq .-40 ; 0x23c3a adc_values_ready = false; 23c62: 10 92 1f 05 sts 0x051F, r1 ; 0x80051f <_ZL16adc_values_ready.lto_priv.472> adc_start_cycle(); 23c66: 0e 94 84 8f call 0x11f08 ; 0x11f08 temp_mgr_isr(); 23c6a: 0f 94 fd 4b call 0x297fa ; 0x297fa // stop recording for an hard error condition if(temp_error_state.v) 23c6e: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 23c72: 81 11 cpse r24, r1 23c74: 1b c0 rjmp .+54 ; 0x23cac return 0; // record a new entry rec_entry& entry = rec_buffer[pos]; 23c76: f0 9e mul r15, r16 23c78: f0 01 movw r30, r0 23c7a: f1 9e mul r15, r17 23c7c: f0 0d add r31, r0 23c7e: 11 24 eor r1, r1 23c80: ea 58 subi r30, 0x8A ; 138 23c82: f8 4f sbci r31, 0xF8 ; 248 entry.temp = current_temperature_isr[0]; 23c84: 80 91 1a 05 lds r24, 0x051A ; 0x80051a 23c88: 90 91 1b 05 lds r25, 0x051B ; 0x80051b 23c8c: a0 91 1c 05 lds r26, 0x051C ; 0x80051c 23c90: b0 91 1d 05 lds r27, 0x051D ; 0x80051d 23c94: 80 83 st Z, r24 23c96: 91 83 std Z+1, r25 ; 0x01 23c98: a2 83 std Z+2, r26 ; 0x02 23c9a: b3 83 std Z+3, r27 ; 0x03 entry.pwm = soft_pwm[0]; 23c9c: 80 91 19 05 lds r24, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 23ca0: 84 83 std Z+4, r24 ; 0x04 ++pos; 23ca2: 0f 5f subi r16, 0xFF ; 255 23ca4: 1f 4f sbci r17, 0xFF ; 255 // it's now safer to give regular serial/lcd updates a shot waiting_handler(); 23ca6: 0f 94 c8 50 call 0x2a190 ; 0x2a190 23caa: c7 cf rjmp .-114 ; 0x23c3a adc_start_cycle(); temp_mgr_isr(); // stop recording for an hard error condition if(temp_error_state.v) return 0; 23cac: 10 e0 ldi r17, 0x00 ; 0 23cae: 00 e0 ldi r16, 0x00 ; 0 23cb0: c7 cf rjmp .-114 ; 0x23c40 00023cb2 : 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) { 23cb2: fc 01 movw r30, r24 switch(*oCheckSetting) { 23cb4: 80 81 ld r24, Z 23cb6: 88 23 and r24, r24 23cb8: 21 f0 breq .+8 ; 0x23cc2 23cba: 81 30 cpi r24, 0x01 ; 1 23cbc: 29 f4 brne .+10 ; 0x23cc8 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23cbe: 82 e0 ldi r24, 0x02 ; 2 23cc0: 01 c0 rjmp .+2 ; 0x23cc4 while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 23cc2: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 23cc4: 80 83 st Z, r24 23cc6: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 23cc8: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 23cca: 08 95 ret 00023ccc : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 23ccc: fc 01 movw r30, r24 23cce: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 23cd0: 90 32 cpi r25, 0x20 ; 32 23cd2: 49 f0 breq .+18 ; 0x23ce6 23cd4: 87 ef ldi r24, 0xF7 ; 247 23cd6: 89 0f add r24, r25 23cd8: 82 30 cpi r24, 0x02 ; 2 23cda: 28 f0 brcs .+10 ; 0x23ce6 23cdc: 81 e0 ldi r24, 0x01 ; 1 23cde: 9d 30 cpi r25, 0x0D ; 13 23ce0: 19 f0 breq .+6 ; 0x23ce8 23ce2: 80 e0 ldi r24, 0x00 ; 0 23ce4: 08 95 ret 23ce6: 81 e0 ldi r24, 0x01 ; 1 } 23ce8: 08 95 ret 00023cea : 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; 23cea: 88 3e cpi r24, 0xE8 ; 232 23cec: 23 e0 ldi r18, 0x03 ; 3 23cee: 92 07 cpc r25, r18 23cf0: 10 f0 brcs .+4 ; 0x23cf6 23cf2: 87 ee ldi r24, 0xE7 ; 231 23cf4: 93 e0 ldi r25, 0x03 ; 3 } 23cf6: 08 95 ret 00023cf8 : return 0; } static int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 23cf8: 90 91 24 05 lds r25, 0x0524 ; 0x800524 23cfc: 80 91 23 05 lds r24, 0x0523 ; 0x800523 23d00: 2f ef ldi r18, 0xFF ; 255 23d02: 3f ef ldi r19, 0xFF ; 255 23d04: 89 17 cp r24, r25 23d06: 71 f0 breq .+28 ; 0x23d24 _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 23d08: e9 2f mov r30, r25 23d0a: f0 e0 ldi r31, 0x00 ; 0 23d0c: ea 5d subi r30, 0xDA ; 218 23d0e: fa 4f sbci r31, 0xFA ; 250 23d10: 20 81 ld r18, Z 23d12: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 23d14: 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 23d16: 80 91 22 05 lds r24, 0x0522 ; 0x800522 23d1a: 98 17 cp r25, r24 23d1c: 08 f0 brcs .+2 ; 0x23d20 23d1e: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 23d20: 90 93 24 05 sts 0x0524, r25 ; 0x800524 return rbuf_get(uart2_ibuf); } 23d24: c9 01 movw r24, r18 23d26: 08 95 ret 00023d28 : uint8_t uart2_ibuf[20] = {0, 0}; FILE _uart2io; static int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 23d28: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 23d2c: 95 ff sbrs r25, 5 23d2e: fc cf rjmp .-8 ; 0x23d28 UDR2 = c; // transmit byte 23d30: 80 93 d6 00 sts 0x00D6, r24 ; 0x8000d6 <__TEXT_REGION_LENGTH__+0x7c20d6> return 0; } 23d34: 90 e0 ldi r25, 0x00 ; 0 23d36: 80 e0 ldi r24, 0x00 ; 0 23d38: 08 95 ret 00023d3a : } 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) { 23d3a: cf 92 push r12 23d3c: df 92 push r13 23d3e: ef 92 push r14 23d40: ff 92 push r15 23d42: 0f 93 push r16 23d44: 1f 93 push r17 23d46: cf 93 push r28 23d48: df 93 push r29 23d4a: 8c 01 movw r16, r24 23d4c: ea 01 movw r28, r20 uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23d4e: 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; 23d50: 50 e0 ldi r21, 0x00 ; 0 for (uint8_t i = 0; i < (size - 1); i++) 23d52: 61 50 subi r22, 0x01 ; 1 23d54: 77 0b sbc r23, r23 23d56: 29 2f mov r18, r25 23d58: 30 e0 ldi r19, 0x00 ; 0 23d5a: 26 17 cp r18, r22 23d5c: 37 07 cpc r19, r23 23d5e: 2c f0 brlt .+10 ; 0x23d6a } void bubblesort_uint8(uint8_t* data, uint8_t size, uint8_t* data2) { uint8_t changed = 1; while (changed) 23d60: 55 23 and r21, r21 23d62: 19 f1 breq .+70 ; 0x23daa { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23d64: 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; 23d66: 50 e0 ldi r21, 0x00 ; 0 23d68: f6 cf rjmp .-20 ; 0x23d56 for (uint8_t i = 0; i < (size - 1); i++) if (data[i] > data[i+1]) 23d6a: 78 01 movw r14, r16 23d6c: e2 0e add r14, r18 23d6e: f3 1e adc r15, r19 23d70: f7 01 movw r30, r14 23d72: 80 81 ld r24, Z 23d74: d9 01 movw r26, r18 23d76: 11 96 adiw r26, 0x01 ; 1 23d78: 68 01 movw r12, r16 23d7a: ca 0e add r12, r26 23d7c: db 1e adc r13, r27 23d7e: f6 01 movw r30, r12 23d80: 40 81 ld r20, Z 23d82: 48 17 cp r20, r24 23d84: 80 f4 brcc .+32 ; 0x23da6 { uint8_t d = data[i]; data[i] = data[i+1]; 23d86: f7 01 movw r30, r14 23d88: 40 83 st Z, r20 data[i+1] = d; 23d8a: f6 01 movw r30, r12 23d8c: 80 83 st Z, r24 if (data2) 23d8e: 20 97 sbiw r28, 0x00 ; 0 23d90: 49 f0 breq .+18 ; 0x23da4 { d = data2[i]; 23d92: fe 01 movw r30, r28 23d94: e2 0f add r30, r18 23d96: f3 1f adc r31, r19 23d98: 80 81 ld r24, Z data2[i] = data2[i+1]; 23d9a: ac 0f add r26, r28 23d9c: bd 1f adc r27, r29 23d9e: 2c 91 ld r18, X 23da0: 20 83 st Z, r18 data2[i+1] = d; 23da2: 8c 93 st X, r24 } changed = 1; 23da4: 51 e0 ldi r21, 0x01 ; 1 { uint8_t changed = 1; while (changed) { changed = 0; for (uint8_t i = 0; i < (size - 1); i++) 23da6: 9f 5f subi r25, 0xFF ; 255 23da8: d6 cf rjmp .-84 ; 0x23d56 data2[i+1] = d; } changed = 1; } } } 23daa: df 91 pop r29 23dac: cf 91 pop r28 23dae: 1f 91 pop r17 23db0: 0f 91 pop r16 23db2: ff 90 pop r15 23db4: ef 90 pop r14 23db6: df 90 pop r13 23db8: cf 90 pop r12 23dba: 08 95 ret 00023dbc : } } inline void tmc2130_cs_high(uint8_t axis) { switch (axis) 23dbc: 81 30 cpi r24, 0x01 ; 1 23dbe: 41 f0 breq .+16 ; 0x23dd0 23dc0: 28 f0 brcs .+10 ; 0x23dcc 23dc2: 82 30 cpi r24, 0x02 ; 2 23dc4: 39 f0 breq .+14 ; 0x23dd4 23dc6: 83 30 cpi r24, 0x03 ; 3 23dc8: 71 f0 breq .+28 ; 0x23de6 23dca: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, HIGH); break; 23dcc: a0 9a sbi 0x14, 0 ; 20 23dce: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, HIGH); break; 23dd0: a2 9a sbi 0x14, 2 ; 20 23dd2: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, HIGH); break; 23dd4: 9f b7 in r25, 0x3f ; 63 23dd6: f8 94 cli 23dd8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23ddc: 80 62 ori r24, 0x20 ; 32 case E_AXIS: WRITE(E0_TMC2130_CS, HIGH); break; 23dde: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23de2: 9f bf out 0x3f, r25 ; 63 } } 23de4: 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; 23de6: 9f b7 in r25, 0x3f ; 63 23de8: f8 94 cli 23dea: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23dee: 80 61 ori r24, 0x10 ; 16 23df0: f6 cf rjmp .-20 ; 0x23dde 00023df2 : } inline void tmc2130_cs_low(uint8_t axis) { switch (axis) 23df2: 81 30 cpi r24, 0x01 ; 1 23df4: 41 f0 breq .+16 ; 0x23e06 23df6: 28 f0 brcs .+10 ; 0x23e02 23df8: 82 30 cpi r24, 0x02 ; 2 23dfa: 39 f0 breq .+14 ; 0x23e0a 23dfc: 83 30 cpi r24, 0x03 ; 3 23dfe: 71 f0 breq .+28 ; 0x23e1c 23e00: 08 95 ret { case X_AXIS: WRITE(X_TMC2130_CS, LOW); break; 23e02: a0 98 cbi 0x14, 0 ; 20 23e04: 08 95 ret case Y_AXIS: WRITE(Y_TMC2130_CS, LOW); break; 23e06: a2 98 cbi 0x14, 2 ; 20 23e08: 08 95 ret case Z_AXIS: WRITE(Z_TMC2130_CS, LOW); break; 23e0a: 9f b7 in r25, 0x3f ; 63 23e0c: f8 94 cli 23e0e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23e12: 8f 7d andi r24, 0xDF ; 223 case E_AXIS: WRITE(E0_TMC2130_CS, LOW); break; 23e14: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23e18: 9f bf out 0x3f, r25 ; 63 } } 23e1a: 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; 23e1c: 9f b7 in r25, 0x3f ; 63 23e1e: f8 94 cli 23e20: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 23e24: 8f 7e andi r24, 0xEF ; 239 23e26: f6 cf rjmp .-20 ; 0x23e14 00023e28 : } static inline uint8_t spi_txrx(uint8_t tx) { SPDR = tx; 23e28: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))); 23e2a: 0d b4 in r0, 0x2d ; 45 23e2c: 07 fe sbrs r0, 7 23e2e: fd cf rjmp .-6 ; 0x23e2a return SPDR; 23e30: 8e b5 in r24, 0x2e ; 46 } 23e32: 08 95 ret 00023e34 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 23e34: 2f 92 push r2 23e36: 3f 92 push r3 23e38: 4f 92 push r4 23e3a: 5f 92 push r5 23e3c: 6f 92 push r6 23e3e: 7f 92 push r7 23e40: 8f 92 push r8 23e42: 9f 92 push r9 23e44: af 92 push r10 23e46: bf 92 push r11 23e48: cf 92 push r12 23e4a: df 92 push r13 23e4c: ef 92 push r14 23e4e: ff 92 push r15 23e50: 0f 93 push r16 23e52: 1f 93 push r17 23e54: cf 93 push r28 23e56: df 93 push r29 23e58: cd b7 in r28, 0x3d ; 61 23e5a: de b7 in r29, 0x3e ; 62 23e5c: 2e 97 sbiw r28, 0x0e ; 14 23e5e: 0f b6 in r0, 0x3f ; 63 23e60: f8 94 cli 23e62: de bf out 0x3e, r29 ; 62 23e64: 0f be out 0x3f, r0 ; 63 23e66: 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]); 23e68: 20 90 1b 06 lds r2, 0x061B ; 0x80061b 23e6c: 30 90 1c 06 lds r3, 0x061C ; 0x80061c 23e70: 40 90 1a 05 lds r4, 0x051A ; 0x80051a 23e74: 50 90 1b 05 lds r5, 0x051B ; 0x80051b 23e78: 60 90 1c 05 lds r6, 0x051C ; 0x80051c 23e7c: 70 90 1d 05 lds r7, 0x051D ; 0x80051d #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 23e80: 21 14 cp r2, r1 23e82: 31 04 cpc r3, r1 23e84: 39 f4 brne .+14 ; 0x23e94 pid_output = 0; pid_reset[e] = true; 23e86: 81 e0 ldi r24, 0x01 ; 1 23e88: 80 93 f2 05 sts 0x05F2, r24 ; 0x8005f2 if (pid_output > PID_MAX) { if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration pid_output=PID_MAX; } else if (pid_output < 0) { if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration pid_output=0; 23e8c: 81 2c mov r8, r1 23e8e: 91 2c mov r9, r1 23e90: 54 01 movw r10, r8 23e92: f9 c0 rjmp .+498 ; 0x24086 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 23e94: b1 01 movw r22, r2 23e96: 03 2c mov r0, r3 23e98: 00 0c add r0, r0 23e9a: 88 0b sbc r24, r24 23e9c: 99 0b sbc r25, r25 23e9e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 23ea2: a3 01 movw r20, r6 23ea4: 92 01 movw r18, r4 23ea6: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 23eaa: 6b 01 movw r12, r22 23eac: 7c 01 movw r14, r24 if(pid_reset[e]) { 23eae: 80 91 f2 05 lds r24, 0x05F2 ; 0x8005f2 23eb2: 88 23 and r24, r24 23eb4: 91 f0 breq .+36 ; 0x23eda iState_sum[e] = 0.0; 23eb6: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 23eba: 10 92 ef 05 sts 0x05EF, r1 ; 0x8005ef 23ebe: 10 92 f0 05 sts 0x05F0, r1 ; 0x8005f0 23ec2: 10 92 f1 05 sts 0x05F1, r1 ; 0x8005f1 dTerm[e] = 0.0; // 'dState_last[e]' initial setting is not necessary (see end of if-statement) 23ec6: 10 92 ea 05 sts 0x05EA, r1 ; 0x8005ea 23eca: 10 92 eb 05 sts 0x05EB, r1 ; 0x8005eb 23ece: 10 92 ec 05 sts 0x05EC, r1 ; 0x8005ec 23ed2: 10 92 ed 05 sts 0x05ED, r1 ; 0x8005ed pid_reset[e] = false; 23ed6: 10 92 f2 05 sts 0x05F2, r1 ; 0x8005f2 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 23eda: 20 91 d6 06 lds r18, 0x06D6 ; 0x8006d6 23ede: 30 91 d7 06 lds r19, 0x06D7 ; 0x8006d7 23ee2: 40 91 d8 06 lds r20, 0x06D8 ; 0x8006d8 23ee6: 50 91 d9 06 lds r21, 0x06D9 ; 0x8006d9 23eea: c7 01 movw r24, r14 23eec: b6 01 movw r22, r12 23eee: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23ef2: 69 83 std Y+1, r22 ; 0x01 23ef4: 7a 83 std Y+2, r23 ; 0x02 23ef6: 8b 83 std Y+3, r24 ; 0x03 23ef8: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 23efa: 20 91 ee 05 lds r18, 0x05EE ; 0x8005ee 23efe: 30 91 ef 05 lds r19, 0x05EF ; 0x8005ef 23f02: 40 91 f0 05 lds r20, 0x05F0 ; 0x8005f0 23f06: 50 91 f1 05 lds r21, 0x05F1 ; 0x8005f1 23f0a: c7 01 movw r24, r14 23f0c: b6 01 movw r22, r12 23f0e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 23f12: 4b 01 movw r8, r22 23f14: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 23f16: 20 91 ad 04 lds r18, 0x04AD ; 0x8004ad <_ZL14iState_sum_min.lto_priv.483> 23f1a: 2d 87 std Y+13, r18 ; 0x0d 23f1c: 30 91 ae 04 lds r19, 0x04AE ; 0x8004ae <_ZL14iState_sum_min.lto_priv.483+0x1> 23f20: 39 87 std Y+9, r19 ; 0x09 23f22: 10 91 af 04 lds r17, 0x04AF ; 0x8004af <_ZL14iState_sum_min.lto_priv.483+0x2> 23f26: 00 91 b0 04 lds r16, 0x04B0 ; 0x8004b0 <_ZL14iState_sum_min.lto_priv.483+0x3> 23f2a: 41 2f mov r20, r17 23f2c: 50 2f mov r21, r16 23f2e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 23f32: 87 fd sbrc r24, 7 23f34: 17 c0 rjmp .+46 ; 0x23f64 23f36: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.484> 23f3a: 8d 87 std Y+13, r24 ; 0x0d 23f3c: 90 91 aa 04 lds r25, 0x04AA ; 0x8004aa <_ZL14iState_sum_max.lto_priv.484+0x1> 23f40: 99 87 std Y+9, r25 ; 0x09 23f42: 10 91 ab 04 lds r17, 0x04AB ; 0x8004ab <_ZL14iState_sum_max.lto_priv.484+0x2> 23f46: 00 91 ac 04 lds r16, 0x04AC ; 0x8004ac <_ZL14iState_sum_max.lto_priv.484+0x3> 23f4a: 9c 01 movw r18, r24 23f4c: 41 2f mov r20, r17 23f4e: 50 2f mov r21, r16 23f50: b4 01 movw r22, r8 23f52: c5 01 movw r24, r10 23f54: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 23f58: 18 16 cp r1, r24 23f5a: 24 f0 brlt .+8 ; 0x23f64 23f5c: 8d 86 std Y+13, r8 ; 0x0d 23f5e: 99 86 std Y+9, r9 ; 0x09 23f60: 1a 2d mov r17, r10 23f62: 0b 2d mov r16, r11 23f64: 8d 85 ldd r24, Y+13 ; 0x0d 23f66: 99 85 ldd r25, Y+9 ; 0x09 23f68: a1 2f mov r26, r17 23f6a: b0 2f mov r27, r16 23f6c: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee 23f70: 90 93 ef 05 sts 0x05EF, r25 ; 0x8005ef 23f74: a0 93 f0 05 sts 0x05F0, r26 ; 0x8005f0 23f78: b0 93 f1 05 sts 0x05F1, r27 ; 0x8005f1 iTerm[e] = cs.Ki * iState_sum[e]; 23f7c: 20 91 da 06 lds r18, 0x06DA ; 0x8006da 23f80: 30 91 db 06 lds r19, 0x06DB ; 0x8006db 23f84: 40 91 dc 06 lds r20, 0x06DC ; 0x8006dc 23f88: 50 91 dd 06 lds r21, 0x06DD ; 0x8006dd 23f8c: bc 01 movw r22, r24 23f8e: 81 2f mov r24, r17 23f90: 90 2f mov r25, r16 23f92: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23f96: 6d 83 std Y+5, r22 ; 0x05 23f98: 7e 83 std Y+6, r23 ; 0x06 23f9a: 8f 83 std Y+7, r24 ; 0x07 23f9c: 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 23f9e: 20 91 e6 05 lds r18, 0x05E6 ; 0x8005e6 23fa2: 30 91 e7 05 lds r19, 0x05E7 ; 0x8005e7 23fa6: 40 91 e8 05 lds r20, 0x05E8 ; 0x8005e8 23faa: 50 91 e9 05 lds r21, 0x05E9 ; 0x8005e9 23fae: c3 01 movw r24, r6 23fb0: b2 01 movw r22, r4 23fb2: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 23fb6: 20 91 de 06 lds r18, 0x06DE ; 0x8006de 23fba: 30 91 df 06 lds r19, 0x06DF ; 0x8006df 23fbe: 40 91 e0 06 lds r20, 0x06E0 ; 0x8006e0 23fc2: 50 91 e1 06 lds r21, 0x06E1 ; 0x8006e1 23fc6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23fca: 20 ed ldi r18, 0xD0 ; 208 23fcc: 3c ec ldi r19, 0xCC ; 204 23fce: 4c e4 ldi r20, 0x4C ; 76 23fd0: 5d e3 ldi r21, 0x3D ; 61 23fd2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23fd6: 4b 01 movw r8, r22 23fd8: 5c 01 movw r10, r24 23fda: 23 e3 ldi r18, 0x33 ; 51 23fdc: 33 e3 ldi r19, 0x33 ; 51 23fde: 43 e7 ldi r20, 0x73 ; 115 23fe0: 5f e3 ldi r21, 0x3F ; 63 23fe2: 60 91 ea 05 lds r22, 0x05EA ; 0x8005ea 23fe6: 70 91 eb 05 lds r23, 0x05EB ; 0x8005eb 23fea: 80 91 ec 05 lds r24, 0x05EC ; 0x8005ec 23fee: 90 91 ed 05 lds r25, 0x05ED ; 0x8005ed 23ff2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 23ff6: 9b 01 movw r18, r22 23ff8: ac 01 movw r20, r24 23ffa: c5 01 movw r24, r10 23ffc: b4 01 movw r22, r8 23ffe: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 24002: 4b 01 movw r8, r22 24004: 5c 01 movw r10, r24 24006: 80 92 ea 05 sts 0x05EA, r8 ; 0x8005ea 2400a: 90 92 eb 05 sts 0x05EB, r9 ; 0x8005eb 2400e: a0 92 ec 05 sts 0x05EC, r10 ; 0x8005ec 24012: b0 92 ed 05 sts 0x05ED, r11 ; 0x8005ed pid_output = pTerm[e] + iTerm[e] - dTerm[e]; // subtraction due to "Derivative on Measurement" method (i.e. derivative of input instead derivative of error is used) 24016: 2d 81 ldd r18, Y+5 ; 0x05 24018: 3e 81 ldd r19, Y+6 ; 0x06 2401a: 4f 81 ldd r20, Y+7 ; 0x07 2401c: 58 85 ldd r21, Y+8 ; 0x08 2401e: 69 81 ldd r22, Y+1 ; 0x01 24020: 7a 81 ldd r23, Y+2 ; 0x02 24022: 8b 81 ldd r24, Y+3 ; 0x03 24024: 9c 81 ldd r25, Y+4 ; 0x04 24026: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2402a: a5 01 movw r20, r10 2402c: 94 01 movw r18, r8 2402e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 24032: 4b 01 movw r8, r22 24034: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 24036: 20 e0 ldi r18, 0x00 ; 0 24038: 30 e0 ldi r19, 0x00 ; 0 2403a: 4f e7 ldi r20, 0x7F ; 127 2403c: 53 e4 ldi r21, 0x43 ; 67 2403e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 24042: 20 e0 ldi r18, 0x00 ; 0 24044: 30 e0 ldi r19, 0x00 ; 0 24046: 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) { 24048: 18 16 cp r1, r24 2404a: 0c f0 brlt .+2 ; 0x2404e 2404c: 6d c1 rjmp .+730 ; 0x24328 if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 2404e: c7 01 movw r24, r14 24050: b6 01 movw r22, r12 24052: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 24056: 18 16 cp r1, r24 24058: 84 f4 brge .+32 ; 0x2407a 2405a: a7 01 movw r20, r14 2405c: 96 01 movw r18, r12 2405e: 6d 85 ldd r22, Y+13 ; 0x0d 24060: 79 85 ldd r23, Y+9 ; 0x09 24062: 81 2f mov r24, r17 24064: 90 2f mov r25, r16 24066: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 2406a: 60 93 ee 05 sts 0x05EE, r22 ; 0x8005ee 2406e: 70 93 ef 05 sts 0x05EF, r23 ; 0x8005ef 24072: 80 93 f0 05 sts 0x05F0, r24 ; 0x8005f0 24076: 90 93 f1 05 sts 0x05F1, r25 ; 0x8005f1 pid_output=PID_MAX; 2407a: 81 2c mov r8, r1 2407c: 91 2c mov r9, r1 2407e: 3f e7 ldi r19, 0x7F ; 127 24080: a3 2e mov r10, r19 24082: 33 e4 ldi r19, 0x43 ; 67 24084: 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; 24086: 40 92 e6 05 sts 0x05E6, r4 ; 0x8005e6 2408a: 50 92 e7 05 sts 0x05E7, r5 ; 0x8005e7 2408e: 60 92 e8 05 sts 0x05E8, r6 ; 0x8005e8 24092: 70 92 e9 05 sts 0x05E9, r7 ; 0x8005e9 pid_output = PID_MAX; } #endif // Check if temperature is within the correct range if((current < maxttemp[e]) && (target != 0)) 24096: 60 91 56 02 lds r22, 0x0256 ; 0x800256 <_ZL8maxttemp.lto_priv.485> 2409a: 70 91 57 02 lds r23, 0x0257 ; 0x800257 <_ZL8maxttemp.lto_priv.485+0x1> 2409e: 07 2e mov r0, r23 240a0: 00 0c add r0, r0 240a2: 88 0b sbc r24, r24 240a4: 99 0b sbc r25, r25 240a6: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 240aa: 9b 01 movw r18, r22 240ac: ac 01 movw r20, r24 240ae: c3 01 movw r24, r6 240b0: b2 01 movw r22, r4 240b2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 240b6: 87 ff sbrs r24, 7 240b8: 57 c1 rjmp .+686 ; 0x24368 240ba: 23 28 or r2, r3 240bc: 09 f4 brne .+2 ; 0x240c0 240be: 54 c1 rjmp .+680 ; 0x24368 soft_pwm[e] = (int)pid_output >> 1; 240c0: c5 01 movw r24, r10 240c2: b4 01 movw r22, r8 240c4: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 240c8: 75 95 asr r23 240ca: 67 95 ror r22 240cc: 60 93 19 05 sts 0x0519, r22 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> static void temp_mgr_pid() { for(uint8_t e = 0; e < EXTRUDERS; e++) pid_heater(e, current_temperature_isr[e], target_temperature_isr[e]); pid_bed(current_temperature_bed_isr, target_temperature_bed_isr); 240d0: 20 91 14 06 lds r18, 0x0614 ; 0x800614 240d4: 30 91 15 06 lds r19, 0x0615 ; 0x800615 240d8: 3a 83 std Y+2, r19 ; 0x02 240da: 29 83 std Y+1, r18 ; 0x01 240dc: 40 90 16 06 lds r4, 0x0616 ; 0x800616 240e0: 50 90 17 06 lds r5, 0x0617 ; 0x800617 240e4: 60 90 18 06 lds r6, 0x0618 ; 0x800618 240e8: 70 90 19 06 lds r7, 0x0619 ; 0x800619 #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 240ec: b9 01 movw r22, r18 240ee: 33 0f add r19, r19 240f0: 88 0b sbc r24, r24 240f2: 99 0b sbc r25, r25 240f4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 240f8: a3 01 movw r20, r6 240fa: 92 01 movw r18, r4 240fc: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 24100: 6b 01 movw r12, r22 24102: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 24104: 20 91 e2 06 lds r18, 0x06E2 ; 0x8006e2 24108: 30 91 e3 06 lds r19, 0x06E3 ; 0x8006e3 2410c: 40 91 e4 06 lds r20, 0x06E4 ; 0x8006e4 24110: 50 91 e5 06 lds r21, 0x06E5 ; 0x8006e5 24114: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 24118: 6d 83 std Y+5, r22 ; 0x05 2411a: 7e 83 std Y+6, r23 ; 0x06 2411c: 8f 83 std Y+7, r24 ; 0x07 2411e: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 24120: 20 91 fb 05 lds r18, 0x05FB ; 0x8005fb 24124: 30 91 fc 05 lds r19, 0x05FC ; 0x8005fc 24128: 40 91 fd 05 lds r20, 0x05FD ; 0x8005fd 2412c: 50 91 fe 05 lds r21, 0x05FE ; 0x8005fe 24130: c7 01 movw r24, r14 24132: b6 01 movw r22, r12 24134: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 24138: 5b 01 movw r10, r22 2413a: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 2413c: 30 91 a5 04 lds r19, 0x04A5 ; 0x8004a5 <_ZL19temp_iState_min_bed.lto_priv.481> 24140: 3e 87 std Y+14, r19 ; 0x0e 24142: 80 91 a6 04 lds r24, 0x04A6 ; 0x8004a6 <_ZL19temp_iState_min_bed.lto_priv.481+0x1> 24146: 8d 87 std Y+13, r24 ; 0x0d 24148: 30 90 a7 04 lds r3, 0x04A7 ; 0x8004a7 <_ZL19temp_iState_min_bed.lto_priv.481+0x2> 2414c: 20 90 a8 04 lds r2, 0x04A8 ; 0x8004a8 <_ZL19temp_iState_min_bed.lto_priv.481+0x3> 24150: 23 2f mov r18, r19 24152: 38 2f mov r19, r24 24154: 43 2d mov r20, r3 24156: 52 2d mov r21, r2 24158: b5 01 movw r22, r10 2415a: c8 01 movw r24, r16 2415c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 24160: 87 fd sbrc r24, 7 24162: 18 c0 rjmp .+48 ; 0x24194 24164: 90 91 a1 04 lds r25, 0x04A1 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.482> 24168: 9e 87 std Y+14, r25 ; 0x0e 2416a: 20 91 a2 04 lds r18, 0x04A2 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.482+0x1> 2416e: 2d 87 std Y+13, r18 ; 0x0d 24170: 30 90 a3 04 lds r3, 0x04A3 ; 0x8004a3 <_ZL19temp_iState_max_bed.lto_priv.482+0x2> 24174: 20 90 a4 04 lds r2, 0x04A4 ; 0x8004a4 <_ZL19temp_iState_max_bed.lto_priv.482+0x3> 24178: 29 2f mov r18, r25 2417a: 3d 85 ldd r19, Y+13 ; 0x0d 2417c: 43 2d mov r20, r3 2417e: 52 2d mov r21, r2 24180: b5 01 movw r22, r10 24182: c8 01 movw r24, r16 24184: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 24188: 18 16 cp r1, r24 2418a: 24 f0 brlt .+8 ; 0x24194 2418c: ae 86 std Y+14, r10 ; 0x0e 2418e: bd 86 std Y+13, r11 ; 0x0d 24190: 30 2e mov r3, r16 24192: 21 2e mov r2, r17 24194: 8e 85 ldd r24, Y+14 ; 0x0e 24196: 9d 85 ldd r25, Y+13 ; 0x0d 24198: a3 2d mov r26, r3 2419a: b2 2d mov r27, r2 2419c: 80 93 fb 05 sts 0x05FB, r24 ; 0x8005fb 241a0: 90 93 fc 05 sts 0x05FC, r25 ; 0x8005fc 241a4: a0 93 fd 05 sts 0x05FD, r26 ; 0x8005fd 241a8: b0 93 fe 05 sts 0x05FE, r27 ; 0x8005fe iTerm_bed = cs.bedKi * temp_iState_bed; 241ac: 20 91 e6 06 lds r18, 0x06E6 ; 0x8006e6 241b0: 30 91 e7 06 lds r19, 0x06E7 ; 0x8006e7 241b4: 40 91 e8 06 lds r20, 0x06E8 ; 0x8006e8 241b8: 50 91 e9 06 lds r21, 0x06E9 ; 0x8006e9 241bc: bc 01 movw r22, r24 241be: 83 2d mov r24, r3 241c0: 92 2d mov r25, r2 241c2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 241c6: 69 87 std Y+9, r22 ; 0x09 241c8: 7a 87 std Y+10, r23 ; 0x0a 241ca: 8b 87 std Y+11, r24 ; 0x0b 241cc: 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); 241ce: 20 91 f7 05 lds r18, 0x05F7 ; 0x8005f7 241d2: 30 91 f8 05 lds r19, 0x05F8 ; 0x8005f8 241d6: 40 91 f9 05 lds r20, 0x05F9 ; 0x8005f9 241da: 50 91 fa 05 lds r21, 0x05FA ; 0x8005fa 241de: c3 01 movw r24, r6 241e0: b2 01 movw r22, r4 241e2: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 241e6: 20 91 ea 06 lds r18, 0x06EA ; 0x8006ea 241ea: 30 91 eb 06 lds r19, 0x06EB ; 0x8006eb 241ee: 40 91 ec 06 lds r20, 0x06EC ; 0x8006ec 241f2: 50 91 ed 06 lds r21, 0x06ED ; 0x8006ed 241f6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 241fa: 20 ed ldi r18, 0xD0 ; 208 241fc: 3c ec ldi r19, 0xCC ; 204 241fe: 4c e4 ldi r20, 0x4C ; 76 24200: 5d e3 ldi r21, 0x3D ; 61 24202: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 24206: 4b 01 movw r8, r22 24208: 5c 01 movw r10, r24 2420a: 23 e3 ldi r18, 0x33 ; 51 2420c: 33 e3 ldi r19, 0x33 ; 51 2420e: 43 e7 ldi r20, 0x73 ; 115 24210: 5f e3 ldi r21, 0x3F ; 63 24212: 60 91 f3 05 lds r22, 0x05F3 ; 0x8005f3 24216: 70 91 f4 05 lds r23, 0x05F4 ; 0x8005f4 2421a: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 2421e: 90 91 f6 05 lds r25, 0x05F6 ; 0x8005f6 24222: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 24226: 9b 01 movw r18, r22 24228: ac 01 movw r20, r24 2422a: c5 01 movw r24, r10 2422c: b4 01 movw r22, r8 2422e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 24232: 4b 01 movw r8, r22 24234: 5c 01 movw r10, r24 24236: 80 92 f3 05 sts 0x05F3, r8 ; 0x8005f3 2423a: 90 92 f4 05 sts 0x05F4, r9 ; 0x8005f4 2423e: a0 92 f5 05 sts 0x05F5, r10 ; 0x8005f5 24242: b0 92 f6 05 sts 0x05F6, r11 ; 0x8005f6 temp_dState_bed = pid_input; 24246: 40 92 f7 05 sts 0x05F7, r4 ; 0x8005f7 2424a: 50 92 f8 05 sts 0x05F8, r5 ; 0x8005f8 2424e: 60 92 f9 05 sts 0x05F9, r6 ; 0x8005f9 24252: 70 92 fa 05 sts 0x05FA, r7 ; 0x8005fa pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 24256: 29 85 ldd r18, Y+9 ; 0x09 24258: 3a 85 ldd r19, Y+10 ; 0x0a 2425a: 4b 85 ldd r20, Y+11 ; 0x0b 2425c: 5c 85 ldd r21, Y+12 ; 0x0c 2425e: 6d 81 ldd r22, Y+5 ; 0x05 24260: 7e 81 ldd r23, Y+6 ; 0x06 24262: 8f 81 ldd r24, Y+7 ; 0x07 24264: 98 85 ldd r25, Y+8 ; 0x08 24266: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2426a: a5 01 movw r20, r10 2426c: 94 01 movw r18, r8 2426e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 24272: 4b 01 movw r8, r22 24274: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 24276: 20 e0 ldi r18, 0x00 ; 0 24278: 30 e0 ldi r19, 0x00 ; 0 2427a: 4f e7 ldi r20, 0x7F ; 127 2427c: 53 e4 ldi r21, 0x43 ; 67 2427e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 24282: 20 e0 ldi r18, 0x00 ; 0 24284: 30 e0 ldi r19, 0x00 ; 0 24286: 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) { 24288: 18 16 cp r1, r24 2428a: 0c f0 brlt .+2 ; 0x2428e 2428c: 70 c0 rjmp .+224 ; 0x2436e if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2428e: c7 01 movw r24, r14 24290: b6 01 movw r22, r12 24292: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 24296: 18 16 cp r1, r24 24298: 84 f4 brge .+32 ; 0x242ba 2429a: a7 01 movw r20, r14 2429c: 96 01 movw r18, r12 2429e: 6e 85 ldd r22, Y+14 ; 0x0e 242a0: 7d 85 ldd r23, Y+13 ; 0x0d 242a2: 83 2d mov r24, r3 242a4: 92 2d mov r25, r2 242a6: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 242aa: 60 93 fb 05 sts 0x05FB, r22 ; 0x8005fb 242ae: 70 93 fc 05 sts 0x05FC, r23 ; 0x8005fc 242b2: 80 93 fd 05 sts 0x05FD, r24 ; 0x8005fd 242b6: 90 93 fe 05 sts 0x05FE, r25 ; 0x8005fe pid_output=MAX_BED_POWER; 242ba: 81 2c mov r8, r1 242bc: 91 2c mov r9, r1 242be: 9f e7 ldi r25, 0x7F ; 127 242c0: a9 2e mov r10, r25 242c2: 93 e4 ldi r25, 0x43 ; 67 242c4: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 242c6: 20 e0 ldi r18, 0x00 ; 0 242c8: 30 e0 ldi r19, 0x00 ; 0 242ca: 4a ef ldi r20, 0xFA ; 250 242cc: 52 e4 ldi r21, 0x42 ; 66 242ce: c3 01 movw r24, r6 242d0: b2 01 movw r22, r4 242d2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 242d6: 87 ff sbrs r24, 7 242d8: 6d c0 rjmp .+218 ; 0x243b4 { soft_pwm_bed = (int)pid_output >> 1; 242da: c5 01 movw r24, r10 242dc: b4 01 movw r22, r8 242de: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 242e2: 75 95 asr r23 242e4: 67 95 ror r22 242e6: 60 93 1a 06 sts 0x061A, r22 ; 0x80061a soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 242ea: 89 81 ldd r24, Y+1 ; 0x01 242ec: 9a 81 ldd r25, Y+2 ; 0x02 242ee: 89 2b or r24, r25 242f0: 11 f4 brne .+4 ; 0x242f6 { soft_pwm_bed = 0; 242f2: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a static void temp_mgr_pid() { for(uint8_t e = 0; e < EXTRUDERS; e++) pid_heater(e, current_temperature_isr[e], target_temperature_isr[e]); pid_bed(current_temperature_bed_isr, target_temperature_bed_isr); } 242f6: 2e 96 adiw r28, 0x0e ; 14 242f8: 0f b6 in r0, 0x3f ; 63 242fa: f8 94 cli 242fc: de bf out 0x3e, r29 ; 62 242fe: 0f be out 0x3f, r0 ; 63 24300: cd bf out 0x3d, r28 ; 61 24302: df 91 pop r29 24304: cf 91 pop r28 24306: 1f 91 pop r17 24308: 0f 91 pop r16 2430a: ff 90 pop r15 2430c: ef 90 pop r14 2430e: df 90 pop r13 24310: cf 90 pop r12 24312: bf 90 pop r11 24314: af 90 pop r10 24316: 9f 90 pop r9 24318: 8f 90 pop r8 2431a: 7f 90 pop r7 2431c: 6f 90 pop r6 2431e: 5f 90 pop r5 24320: 4f 90 pop r4 24322: 3f 90 pop r3 24324: 2f 90 pop r2 24326: 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) { 24328: c5 01 movw r24, r10 2432a: b4 01 movw r22, r8 2432c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 24330: 87 ff sbrs r24, 7 24332: a9 ce rjmp .-686 ; 0x24086 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 24334: 20 e0 ldi r18, 0x00 ; 0 24336: 30 e0 ldi r19, 0x00 ; 0 24338: a9 01 movw r20, r18 2433a: c7 01 movw r24, r14 2433c: b6 01 movw r22, r12 2433e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 24342: 87 ff sbrs r24, 7 24344: a3 cd rjmp .-1210 ; 0x23e8c 24346: a7 01 movw r20, r14 24348: 96 01 movw r18, r12 2434a: 6d 85 ldd r22, Y+13 ; 0x0d 2434c: 79 85 ldd r23, Y+9 ; 0x09 2434e: 81 2f mov r24, r17 24350: 90 2f mov r25, r16 24352: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 24356: 60 93 ee 05 sts 0x05EE, r22 ; 0x8005ee 2435a: 70 93 ef 05 sts 0x05EF, r23 ; 0x8005ef 2435e: 80 93 f0 05 sts 0x05F0, r24 ; 0x8005f0 24362: 90 93 f1 05 sts 0x05F1, r25 ; 0x8005f1 24366: 92 cd rjmp .-1244 ; 0x23e8c // 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; 24368: 10 92 19 05 sts 0x0519, r1 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 2436c: b1 ce rjmp .-670 ; 0x240d0 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){ 2436e: c5 01 movw r24, r10 24370: b4 01 movw r22, r8 24372: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 24376: 87 ff sbrs r24, 7 24378: a6 cf rjmp .-180 ; 0x242c6 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 2437a: 20 e0 ldi r18, 0x00 ; 0 2437c: 30 e0 ldi r19, 0x00 ; 0 2437e: a9 01 movw r20, r18 24380: c7 01 movw r24, r14 24382: b6 01 movw r22, r12 24384: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 24388: 87 ff sbrs r24, 7 2438a: 10 c0 rjmp .+32 ; 0x243ac 2438c: a7 01 movw r20, r14 2438e: 96 01 movw r18, r12 24390: 6e 85 ldd r22, Y+14 ; 0x0e 24392: 7d 85 ldd r23, Y+13 ; 0x0d 24394: 83 2d mov r24, r3 24396: 92 2d mov r25, r2 24398: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 2439c: 60 93 fb 05 sts 0x05FB, r22 ; 0x8005fb 243a0: 70 93 fc 05 sts 0x05FC, r23 ; 0x8005fc 243a4: 80 93 fd 05 sts 0x05FD, r24 ; 0x8005fd 243a8: 90 93 fe 05 sts 0x05FE, r25 ; 0x8005fe pid_output=0; 243ac: 81 2c mov r8, r1 243ae: 91 2c mov r9, r1 243b0: 54 01 movw r10, r8 243b2: 89 cf rjmp .-238 ; 0x242c6 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 243b4: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a 243b8: 98 cf rjmp .-208 ; 0x242ea 000243ba : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 243be: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 243c2: 90 93 1c 06 sts 0x061C, r25 ; 0x80061c 243c6: 80 93 1b 06 sts 0x061B, r24 ; 0x80061b target_temperature_bed_isr = target_temperature_bed; 243ca: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 243ce: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 243d2: 90 93 15 06 sts 0x0615, r25 ; 0x800615 243d6: 80 93 14 06 sts 0x0614, r24 ; 0x800614 } 243da: 08 95 ret 000243dc : { // 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) 243dc: 81 30 cpi r24, 0x01 ; 1 243de: 41 f1 breq .+80 ; 0x24430 243e0: 20 f0 brcs .+8 ; 0x243ea 243e2: 82 30 cpi r24, 0x02 ; 2 243e4: 09 f4 brne .+2 ; 0x243e8 243e6: 45 c0 rjmp .+138 ; 0x24472 243e8: 08 95 ret { case X_AXIS: { enable_x(); 243ea: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); 243ec: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 243f0: 81 70 andi r24, 0x01 ; 1 uint8_t new_x_dir_pin = (INVERT_X_DIR)^direction; 243f2: 91 e0 ldi r25, 0x01 ; 1 243f4: 69 27 eor r22, r25 //setup new step if (new_x_dir_pin != old_x_dir_pin) { 243f6: 86 17 cp r24, r22 243f8: 59 f0 breq .+22 ; 0x24410 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 243fa: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 243fe: 66 23 and r22, r22 24400: 89 f0 breq .+34 ; 0x24424 24402: 91 60 ori r25, 0x01 ; 1 24404: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 24408: eb e4 ldi r30, 0x4B ; 75 2440a: f0 e0 ldi r31, 0x00 ; 0 2440c: 31 97 sbiw r30, 0x01 ; 1 2440e: f1 f7 brne .-4 ; 0x2440c delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 24410: 91 e0 ldi r25, 0x01 ; 1 24412: 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); 24414: 88 23 and r24, r24 24416: 41 f0 breq .+16 ; 0x24428 24418: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2441c: 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); 2441e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 24422: 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); 24424: 9e 7f andi r25, 0xFE ; 254 24426: ee cf rjmp .-36 ; 0x24404 #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); 24428: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2442c: 8e 7f andi r24, 0xFE ; 254 2442e: f7 cf rjmp .-18 ; 0x2441e } break; case Y_AXIS: { enable_y(); 24430: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); 24432: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 24436: 81 e0 ldi r24, 0x01 ; 1 24438: 29 2f mov r18, r25 2443a: 22 70 andi r18, 0x02 ; 2 2443c: 91 ff sbrs r25, 1 2443e: 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) { 24440: 86 17 cp r24, r22 24442: 59 f0 breq .+22 ; 0x2445a WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 24444: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24448: 66 23 and r22, r22 2444a: 79 f0 breq .+30 ; 0x2446a 2444c: 82 60 ori r24, 0x02 ; 2 2444e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24452: 8b e4 ldi r24, 0x4B ; 75 24454: 90 e0 ldi r25, 0x00 ; 0 24456: 01 97 sbiw r24, 0x01 ; 1 24458: f1 f7 brne .-4 ; 0x24456 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 2445a: 82 e0 ldi r24, 0x02 ; 2 2445c: 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); 2445e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24462: 22 23 and r18, r18 24464: 21 f0 breq .+8 ; 0x2446e 24466: 82 60 ori r24, 0x02 ; 2 24468: da cf rjmp .-76 ; 0x2441e 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); 2446a: 8d 7f andi r24, 0xFD ; 253 2446c: f0 cf rjmp .-32 ; 0x2444e #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); 2446e: 8d 7f andi r24, 0xFD ; 253 24470: d6 cf rjmp .-84 ; 0x2441e } break; case Z_AXIS: { enable_z(); 24472: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); 24474: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 24478: 81 e0 ldi r24, 0x01 ; 1 2447a: 29 2f mov r18, r25 2447c: 24 70 andi r18, 0x04 ; 4 2447e: 92 ff sbrs r25, 2 24480: 80 e0 ldi r24, 0x00 ; 0 uint8_t new_z_dir_pin = (INVERT_Z_DIR)^direction^BABYSTEP_INVERT_Z; 24482: 91 e0 ldi r25, 0x01 ; 1 24484: 69 27 eor r22, r25 //setup new step if (new_z_dir_pin != old_z_dir_pin) { 24486: 86 17 cp r24, r22 24488: 59 f0 breq .+22 ; 0x244a0 WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 2448a: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2448e: 66 23 and r22, r22 24490: 91 f0 breq .+36 ; 0x244b6 24492: 94 60 ori r25, 0x04 ; 4 24494: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24498: eb e4 ldi r30, 0x4B ; 75 2449a: f0 e0 ldi r31, 0x00 ; 0 2449c: 31 97 sbiw r30, 0x01 ; 1 2449e: f1 f7 brne .-4 ; 0x2449c delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 244a0: 94 e0 ldi r25, 0x04 ; 4 244a2: 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) { 244a4: 86 17 cp r24, r22 244a6: 09 f4 brne .+2 ; 0x244aa 244a8: bc cf rjmp .-136 ; 0x24422 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 244aa: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 244ae: 22 23 and r18, r18 244b0: 21 f0 breq .+8 ; 0x244ba 244b2: 84 60 ori r24, 0x04 ; 4 244b4: b4 cf rjmp .-152 ; 0x2441e 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); 244b6: 9b 7f andi r25, 0xFB ; 251 244b8: ed cf rjmp .-38 ; 0x24494 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); 244ba: 8b 7f andi r24, 0xFB ; 251 244bc: b0 cf rjmp .-160 ; 0x2441e 000244be : } } static void checkRx(void) { if (selectedSerialPort == 0) { 244be: 80 91 21 05 lds r24, 0x0521 ; 0x800521 244c2: 81 11 cpse r24, r1 244c4: 25 c0 rjmp .+74 ; 0x24510 if((M_UCSRxA & (1< 244ca: 87 ff sbrs r24, 7 244cc: 3d c0 rjmp .+122 ; 0x24548 // Test for a framing error. if (M_UCSRxA & (1< 244d2: 84 ff sbrs r24, 4 244d4: 03 c0 rjmp .+6 ; 0x244dc // 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); 244d6: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 244da: 08 95 ret } else { unsigned char c = M_UDRx; 244dc: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 244e0: 20 91 93 04 lds r18, 0x0493 ; 0x800493 244e4: 30 91 94 04 lds r19, 0x0494 ; 0x800494 244e8: c9 01 movw r24, r18 244ea: 01 96 adiw r24, 0x01 ; 1 244ec: 8f 77 andi r24, 0x7F ; 127 244ee: 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) { 244f0: 60 91 95 04 lds r22, 0x0495 ; 0x800495 244f4: 70 91 96 04 lds r23, 0x0496 ; 0x800496 244f8: 86 17 cp r24, r22 244fa: 97 07 cpc r25, r23 244fc: 29 f1 breq .+74 ; 0x24548 // 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; 244fe: 2d 5e subi r18, 0xED ; 237 24500: 3b 4f sbci r19, 0xFB ; 251 24502: f9 01 movw r30, r18 24504: 40 83 st Z, r20 rx_buffer.head = i; 24506: 90 93 94 04 sts 0x0494, r25 ; 0x800494 2450a: 80 93 93 04 sts 0x0493, r24 ; 0x800493 2450e: 1c c0 rjmp .+56 ; 0x24548 UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 24514: 87 ff sbrs r24, 7 24516: 18 c0 rjmp .+48 ; 0x24548 // Test for a framing error. if (UCSR1A & (1< 2451c: 84 ff sbrs r24, 4 2451e: 03 c0 rjmp .+6 ; 0x24526 // 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); 24520: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 24524: 08 95 ret } else { unsigned char c = UDR1; 24526: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 2452a: 20 91 93 04 lds r18, 0x0493 ; 0x800493 2452e: 30 91 94 04 lds r19, 0x0494 ; 0x800494 24532: c9 01 movw r24, r18 24534: 01 96 adiw r24, 0x01 ; 1 24536: 8f 77 andi r24, 0x7F ; 127 24538: 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) { 2453a: 60 91 95 04 lds r22, 0x0495 ; 0x800495 2453e: 70 91 96 04 lds r23, 0x0496 ; 0x800496 24542: 68 17 cp r22, r24 24544: 79 07 cpc r23, r25 24546: d9 f6 brne .-74 ; 0x244fe M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 24548: 08 95 ret 0002454a : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 2454a: 23 e0 ldi r18, 0x03 ; 3 2454c: 81 11 cpse r24, r1 2454e: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 24562: 94 60 ori r25, 0x04 ; 4 24564: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24568: 3f bf out 0x3f, r19 ; 63 2456a: fb 01 movw r30, r22 2456c: 31 97 sbiw r30, 0x01 ; 1 2456e: f1 f7 brne .-4 ; 0x2456c delayMicroseconds(200); WRITE(BEEPER,LOW); 24570: 3f b7 in r19, 0x3f ; 63 24572: f8 94 cli 24574: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24578: 9b 7f andi r25, 0xFB ; 251 2457a: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2457e: 3f bf out 0x3f, r19 ; 63 24580: fa 01 movw r30, r20 24582: 31 97 sbiw r30, 0x01 ; 1 24584: f1 f7 brne .-4 ; 0x24582 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); } } 2458c: 08 95 ret 0002458e : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 2458e: 8a e0 ldi r24, 0x0A ; 10 24590: 2b e8 ldi r18, 0x8B ; 139 24592: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 24594: 4f b7 in r20, 0x3f ; 63 24596: f8 94 cli 24598: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2459c: 94 60 ori r25, 0x04 ; 4 2459e: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 245a2: 4f bf out 0x3f, r20 ; 63 245a4: f9 01 movw r30, r18 245a6: 31 97 sbiw r30, 0x01 ; 1 245a8: f1 f7 brne .-4 ; 0x245a6 delayMicroseconds(100); WRITE(BEEPER,LOW); 245aa: 4f b7 in r20, 0x3f ; 63 245ac: f8 94 cli 245ae: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 245b2: 9b 7f andi r25, 0xFB ; 251 245b4: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 245b8: 4f bf out 0x3f, r20 ; 63 245ba: f9 01 movw r30, r18 245bc: 31 97 sbiw r30, 0x01 ; 1 245be: f1 f7 brne .-4 ; 0x245bc 245c0: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 245c2: 41 f7 brne .-48 ; 0x24594 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 245c4: 08 95 ret 000245c6 : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 245c6: 87 ea ldi r24, 0xA7 ; 167 245c8: 9c e0 ldi r25, 0x0C ; 12 245ca: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (eeprom_setting != 0) 245ce: 81 11 cpse r24, r1 245d0: 05 c0 rjmp .+10 ; 0x245dc return false; switch(eFilamentAction) { 245d2: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 245d6: 81 50 subi r24, 0x01 ; 1 245d8: 88 30 cpi r24, 0x08 ; 8 245da: 10 f0 brcs .+4 ; 0x245e0 #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; 245dc: 80 e0 ldi r24, 0x00 ; 0 245de: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 245e0: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 245e2: 08 95 ret 000245e4 : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 245e4: 0f 94 10 cf call 0x39e20 ; 0x39e20 245e8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 245ec: 80 91 15 05 lds r24, 0x0515 ; 0x800515 245f0: 84 30 cpi r24, 0x04 ; 4 245f2: a8 f5 brcc .+106 ; 0x2465e 245f4: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 245f8: 87 e6 ldi r24, 0x67 ; 103 245fa: 9d e3 ldi r25, 0x3D ; 61 245fc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24600: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 24604: 8f ef ldi r24, 0xFF ; 255 24606: 9d e4 ldi r25, 0x4D ; 77 24608: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2460c: 68 ed ldi r22, 0xD8 ; 216 2460e: 7a e3 ldi r23, 0x3A ; 58 24610: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 24614: 86 ef ldi r24, 0xF6 ; 246 24616: 9d e4 ldi r25, 0x4D ; 77 24618: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2461c: 6e e5 ldi r22, 0x5E ; 94 2461e: 79 e3 ldi r23, 0x39 ; 57 24620: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 24624: 8d ee ldi r24, 0xED ; 237 24626: 9d e4 ldi r25, 0x4D ; 77 24628: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2462c: 60 e8 ldi r22, 0x80 ; 128 2462e: 79 e3 ldi r23, 0x39 ; 57 24630: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 24634: 82 ee ldi r24, 0xE2 ; 226 24636: 9d e4 ldi r25, 0x4D ; 77 24638: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2463c: 6e ec ldi r22, 0xCE ; 206 2463e: 7a e3 ldi r23, 0x3A ; 58 24640: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_END(); 24644: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 24648: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2464c: 8f 5f subi r24, 0xFF ; 255 2464e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24652: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24656: 8f 5f subi r24, 0xFF ; 255 24658: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2465c: c7 cf rjmp .-114 ; 0x245ec 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(); } 2465e: 08 95 ret 00024660 : //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 24660: 0f 94 10 cf call 0x39e20 ; 0x39e20 24664: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24668: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2466c: 84 30 cpi r24, 0x04 ; 4 2466e: 28 f5 brcc .+74 ; 0x246ba 24670: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 24674: 88 eb ldi r24, 0xB8 ; 184 24676: 9d e3 ldi r25, 0x3D ; 61 24678: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2467c: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_print); 24680: 81 e8 ldi r24, 0x81 ; 129 24682: 9a e4 ldi r25, 0x4A ; 74 24684: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24688: 66 ee ldi r22, 0xE6 ; 230 2468a: 79 e3 ldi r23, 0x39 ; 57 2468c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_total); 24690: 89 e7 ldi r24, 0x79 ; 121 24692: 9a e4 ldi r25, 0x4A ; 74 24694: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24698: 6a e0 ldi r22, 0x0A ; 10 2469a: 7b e3 ldi r23, 0x3B ; 59 2469c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_END(); 246a0: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { MENU_BEGIN(); 246a4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 246a8: 8f 5f subi r24, 0xFF ; 255 246aa: 80 93 15 05 sts 0x0515, r24 ; 0x800515 246ae: 80 91 17 05 lds r24, 0x0517 ; 0x800517 246b2: 8f 5f subi r24, 0xFF ; 255 246b4: 80 93 17 05 sts 0x0517, r24 ; 0x800517 246b8: d7 cf rjmp .-82 ; 0x24668 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(); } 246ba: 08 95 ret 000246bc : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 246bc: 0f 94 10 cf call 0x39e20 ; 0x39e20 246c0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 246c4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 246c8: 84 30 cpi r24, 0x04 ; 4 246ca: 68 f5 brcc .+90 ; 0x24726 246cc: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 246d0: 88 eb ldi r24, 0xB8 ; 184 246d2: 9d e3 ldi r25, 0x3D ; 61 246d4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 246d8: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 246dc: 81 e8 ldi r24, 0x81 ; 129 246de: 9a e4 ldi r25, 0x4A ; 74 246e0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 246e4: 6e e9 ldi r22, 0x9E ; 158 246e6: 7a e3 ldi r23, 0x3A ; 58 246e8: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 246ec: 89 e7 ldi r24, 0x79 ; 121 246ee: 9a e4 ldi r25, 0x4A ; 74 246f0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 246f4: 6a ec ldi r22, 0xCA ; 202 246f6: 7a e3 ldi r23, 0x3A ; 58 246f8: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 246fc: 87 e1 ldi r24, 0x17 ; 23 246fe: 9a e4 ldi r25, 0x4A ; 74 24700: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24704: 62 e7 ldi r22, 0x72 ; 114 24706: 7b e3 ldi r23, 0x3B ; 59 24708: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_END(); 2470c: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 24710: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24714: 8f 5f subi r24, 0xFF ; 255 24716: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2471a: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2471e: 8f 5f subi r24, 0xFF ; 255 24720: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24724: cf cf rjmp .-98 ; 0x246c4 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(); } 24726: 08 95 ret 00024728 : Sound_CycleState(); } #ifndef MMU_FORCE_STEALTH_MODE static void lcd_mmu_mode_toggle() { eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); 24728: 89 ea ldi r24, 0xA9 ; 169 2472a: 9d e0 ldi r25, 0x0D ; 13 2472c: 0c 94 bf 77 jmp 0xef7e ; 0xef7e 00024730 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 24730: 8c ea ldi r24, 0xAC ; 172 24732: 9c e0 ldi r25, 0x0C ; 12 24734: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 if (current_state) 24738: 88 23 and r24, r24 2473a: 61 f0 breq .+24 ; 0x24754 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 2473c: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 24740: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 24744: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b else { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); 24748: 8c ea ldi r24, 0xAC ; 172 2474a: 9c e0 ldi r25, 0x0C ; 12 2474c: 0e 94 bf 77 call 0xef7e ; 0xef7e MMU2::mmu2.Status(); 24750: 0d 94 07 77 jmp 0x2ee0e ; 0x2ee0e { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 24754: 0e 94 23 db call 0x1b646 ; 0x1b646 24758: f7 cf rjmp .-18 ; 0x24748 0002475a : 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) 2475a: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 2475e: 88 23 and r24, r24 24760: 21 f0 breq .+8 ; 0x2476a 24762: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 24766: 88 23 and r24, r24 24768: 51 f0 breq .+20 ; 0x2477e { _md->status = 1; 2476a: 81 e0 ldi r24, 0x01 ; 1 2476c: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 24770: 60 e0 ldi r22, 0x00 ; 0 24772: 8a e2 ldi r24, 0x2A ; 42 24774: 9d e0 ldi r25, 0x0D ; 13 24776: 0e 94 94 77 call 0xef28 ; 0xef28 2477a: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } MENU_BEGIN(); 2477e: 0f 94 10 cf call 0x39e20 ; 0x39e20 24782: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24786: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2478a: 84 30 cpi r24, 0x04 ; 4 2478c: 08 f0 brcs .+2 ; 0x24790 2478e: 81 c0 rjmp .+258 ; 0x24892 24790: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 24794: 80 91 f8 03 lds r24, 0x03F8 ; 0x8003f8 24798: 81 11 cpse r24, r1 2479a: 4a c0 rjmp .+148 ; 0x24830 2479c: 89 e1 ldi r24, 0x19 ; 25 2479e: 90 e4 ldi r25, 0x40 ; 64 247a0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 247a4: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 247a8: 8d e3 ldi r24, 0x3D ; 61 247aa: 9b e3 ldi r25, 0x3B ; 59 247ac: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 247b0: 60 ee ldi r22, 0xE0 ; 224 247b2: 79 e3 ldi r23, 0x39 ; 57 247b4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c SETTINGS_NOZZLE; 247b8: 80 91 ee 04 lds r24, 0x04EE ; 0x8004ee 247bc: 8c 33 cpi r24, 0x3C ; 60 247be: 09 f4 brne .+2 ; 0x247c2 247c0: 54 c0 rjmp .+168 ; 0x2486a 247c2: c8 f5 brcc .+114 ; 0x24836 247c4: 89 31 cpi r24, 0x19 ; 25 247c6: 09 f4 brne .+2 ; 0x247ca 247c8: 44 c0 rjmp .+136 ; 0x24852 247ca: 88 32 cpi r24, 0x28 ; 40 247cc: c1 f1 breq .+112 ; 0x2483e MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 247ce: 83 e5 ldi r24, 0x53 ; 83 247d0: 97 e5 ldi r25, 0x57 ; 87 247d2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 247d6: 68 e4 ldi r22, 0x48 ; 72 247d8: 7b e3 ldi r23, 0x3B ; 59 247da: 0f 94 8d ce call 0x39d1a ; 0x39d1a MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 247de: 8a e4 ldi r24, 0x4A ; 74 247e0: 97 e5 ldi r25, 0x57 ; 87 247e2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 247e6: 62 e3 ldi r22, 0x32 ; 50 247e8: 7b e3 ldi r23, 0x3B ; 59 247ea: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #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); 247ee: 80 91 98 13 lds r24, 0x1398 ; 0x801398 247f2: 81 30 cpi r24, 0x01 ; 1 247f4: 31 f0 breq .+12 ; 0x24802 247f6: 68 e2 ldi r22, 0x28 ; 40 247f8: 7a e3 ldi r23, 0x3A ; 58 247fa: 82 e9 ldi r24, 0x92 ; 146 247fc: 94 ea ldi r25, 0xA4 ; 164 247fe: 0f 94 8d ce call 0x39d1a ; 0x39d1a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) if (_md->experimental_menu_visibility) 24802: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 24806: 88 23 and r24, r24 24808: 31 f0 breq .+12 ; 0x24816 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 2480a: 6e e3 ldi r22, 0x3E ; 62 2480c: 7a e3 ldi r23, 0x3A ; 58 2480e: 85 e8 ldi r24, 0x85 ; 133 24810: 94 ea ldi r25, 0xA4 ; 164 24812: 0f 94 8e d1 call 0x3a31c ; 0x3a31c //! //! 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(); 24816: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 2481a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2481e: 8f 5f subi r24, 0xFF ; 255 24820: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24824: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24828: 8f 5f subi r24, 0xFF ; 255 2482a: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2482e: ab cf rjmp .-170 ; 0x24786 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 24830: 87 e6 ldi r24, 0x67 ; 103 24832: 9d e3 ldi r25, 0x3D ; 61 24834: b5 cf rjmp .-150 ; 0x247a0 MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 24836: 80 35 cpi r24, 0x50 ; 80 24838: 11 f1 breq .+68 ; 0x2487e 2483a: 8f 3f cpi r24, 0xFF ; 255 2483c: 41 f6 brne .-112 ; 0x247ce 2483e: 87 ee ldi r24, 0xE7 ; 231 24840: 9b e3 ldi r25, 0x3B ; 59 24842: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24846: 22 e0 ldi r18, 0x02 ; 2 24848: 42 e6 ldi r20, 0x62 ; 98 2484a: 5b e3 ldi r21, 0x3B ; 59 2484c: 6e ea ldi r22, 0xAE ; 174 2484e: 74 ea ldi r23, 0xA4 ; 164 24850: 09 c0 rjmp .+18 ; 0x24864 24852: 87 ee ldi r24, 0xE7 ; 231 24854: 9b e3 ldi r25, 0x3B ; 59 24856: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2485a: 22 e0 ldi r18, 0x02 ; 2 2485c: 42 e6 ldi r20, 0x62 ; 98 2485e: 5b e3 ldi r21, 0x3B ; 59 24860: 63 eb ldi r22, 0xB3 ; 179 24862: 74 ea ldi r23, 0xA4 ; 164 24864: 0f 94 9f d0 call 0x3a13e ; 0x3a13e 24868: b2 cf rjmp .-156 ; 0x247ce 2486a: 87 ee ldi r24, 0xE7 ; 231 2486c: 9b e3 ldi r25, 0x3B ; 59 2486e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24872: 22 e0 ldi r18, 0x02 ; 2 24874: 42 e6 ldi r20, 0x62 ; 98 24876: 5b e3 ldi r21, 0x3B ; 59 24878: 69 ea ldi r22, 0xA9 ; 169 2487a: 74 ea ldi r23, 0xA4 ; 164 2487c: f3 cf rjmp .-26 ; 0x24864 2487e: 87 ee ldi r24, 0xE7 ; 231 24880: 9b e3 ldi r25, 0x3B ; 59 24882: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24886: 22 e0 ldi r18, 0x02 ; 2 24888: 42 e6 ldi r20, 0x62 ; 98 2488a: 5b e3 ldi r21, 0x3B ; 59 2488c: 64 ea ldi r22, 0xA4 ; 164 2488e: 74 ea ldi r23, 0xA4 ; 164 24890: e9 cf rjmp .-46 ; 0x24864 //! 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(); } 24892: 08 95 ret 00024894 : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 24894: 80 e0 ldi r24, 0x00 ; 0 24896: 0d 94 bc 1d jmp 0x23b78 ; 0x23b78 0002489a : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 2489a: 0f 94 10 cf call 0x39e20 ; 0x39e20 2489e: 10 92 15 05 sts 0x0515, r1 ; 0x800515 248a2: 80 91 15 05 lds r24, 0x0515 ; 0x800515 248a6: 84 30 cpi r24, 0x04 ; 4 248a8: 08 f0 brcs .+2 ; 0x248ac 248aa: 45 c0 rjmp .+138 ; 0x24936 248ac: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 248b0: 8e eb ldi r24, 0xBE ; 190 248b2: 97 e5 ldi r25, 0x57 ; 87 248b4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 248b8: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 248bc: 6e e2 ldi r22, 0x2E ; 46 248be: 74 ed ldi r23, 0xD4 ; 212 248c0: 89 e4 ldi r24, 0x49 ; 73 248c2: 9d e0 ldi r25, 0x0D ; 13 248c4: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 248c8: 69 e2 ldi r22, 0x29 ; 41 248ca: 74 ed ldi r23, 0xD4 ; 212 248cc: 84 e5 ldi r24, 0x54 ; 84 248ce: 9d e0 ldi r25, 0x0D ; 13 248d0: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 248d4: 64 e2 ldi r22, 0x24 ; 36 248d6: 74 ed ldi r23, 0xD4 ; 212 248d8: 8f e5 ldi r24, 0x5F ; 95 248da: 9d e0 ldi r25, 0x0D ; 13 248dc: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 248e0: 6f e1 ldi r22, 0x1F ; 31 248e2: 74 ed ldi r23, 0xD4 ; 212 248e4: 8a e6 ldi r24, 0x6A ; 106 248e6: 9d e0 ldi r25, 0x0D ; 13 248e8: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 248ec: 6a e1 ldi r22, 0x1A ; 26 248ee: 74 ed ldi r23, 0xD4 ; 212 248f0: 85 e7 ldi r24, 0x75 ; 117 248f2: 9d e0 ldi r25, 0x0D ; 13 248f4: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 248f8: 65 e1 ldi r22, 0x15 ; 21 248fa: 74 ed ldi r23, 0xD4 ; 212 248fc: 80 e8 ldi r24, 0x80 ; 128 248fe: 9d e0 ldi r25, 0x0D ; 13 24900: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 24904: 60 e1 ldi r22, 0x10 ; 16 24906: 74 ed ldi r23, 0xD4 ; 212 24908: 8b e8 ldi r24, 0x8B ; 139 2490a: 9d e0 ldi r25, 0x0D ; 13 2490c: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 24910: 6b e0 ldi r22, 0x0B ; 11 24912: 74 ed ldi r23, 0xD4 ; 212 24914: 86 e9 ldi r24, 0x96 ; 150 24916: 9d e0 ldi r25, 0x0D ; 13 24918: 0f 94 3e d1 call 0x3a27c ; 0x3a27c MENU_END(); 2491c: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 24920: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24924: 8f 5f subi r24, 0xFF ; 255 24926: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2492a: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2492e: 8f 5f subi r24, 0xFF ; 255 24930: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24934: b6 cf rjmp .-148 ; 0x248a2 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(); } 24936: 08 95 ret 00024938 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 24938: 0f 94 10 cf call 0x39e20 ; 0x39e20 2493c: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24940: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24944: 84 30 cpi r24, 0x04 ; 4 24946: d8 f5 brcc .+118 ; 0x249be 24948: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 2494c: 8e eb ldi r24, 0xBE ; 190 2494e: 97 e5 ldi r25, 0x57 ; 87 24950: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24954: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 24958: 81 e4 ldi r24, 0x41 ; 65 2495a: 97 e5 ldi r25, 0x57 ; 87 2495c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24960: 4a e8 ldi r20, 0x8A ; 138 24962: 59 e3 ldi r21, 0x39 ; 57 24964: bc 01 movw r22, r24 24966: 80 91 ef 04 lds r24, 0x04EF ; 0x8004ef 2496a: 0e 94 b8 f9 call 0x1f370 ; 0x1f370 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 2496e: 89 e3 ldi r24, 0x39 ; 57 24970: 97 e5 ldi r25, 0x57 ; 87 24972: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24976: 48 ea ldi r20, 0xA8 ; 168 24978: 59 e3 ldi r21, 0x39 ; 57 2497a: bc 01 movw r22, r24 2497c: 80 91 ed 04 lds r24, 0x04ED ; 0x8004ed 24980: 0e 94 b8 f9 call 0x1f370 ; 0x1f370 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 24984: 44 e8 ldi r20, 0x84 ; 132 24986: 5a e3 ldi r21, 0x3A ; 58 24988: 6b e4 ldi r22, 0x4B ; 75 2498a: 70 e7 ldi r23, 0x70 ; 112 2498c: 80 91 ec 04 lds r24, 0x04EC ; 0x8004ec 24990: 0e 94 b8 f9 call 0x1f370 ; 0x1f370 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 24994: 48 e4 ldi r20, 0x48 ; 72 24996: 5a e3 ldi r21, 0x3A ; 58 24998: 6d e0 ldi r22, 0x0D ; 13 2499a: 7e e6 ldi r23, 0x6E ; 110 2499c: 80 91 ea 04 lds r24, 0x04EA ; 0x8004ea 249a0: 0e 94 b8 f9 call 0x1f370 ; 0x1f370 MENU_END(); 249a4: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 249a8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 249ac: 8f 5f subi r24, 0xFF ; 255 249ae: 80 93 15 05 sts 0x0515, r24 ; 0x800515 249b2: 80 91 17 05 lds r24, 0x0517 ; 0x800517 249b6: 8f 5f subi r24, 0xFF ; 255 249b8: 80 93 17 05 sts 0x0517, r24 ; 0x800517 249bc: c1 cf rjmp .-126 ; 0x24940 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(); } 249be: 08 95 ret 000249c0 : 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); 249c0: 8a ee ldi r24, 0xEA ; 234 249c2: 94 e0 ldi r25, 0x04 ; 4 249c4: 0f 94 59 1e call 0x23cb2 ; 0x23cb2 249c8: 60 91 ea 04 lds r22, 0x04EA ; 0x8004ea 249cc: 80 e2 ldi r24, 0x20 ; 32 249ce: 9c e0 ldi r25, 0x0C ; 12 249d0: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 000249d4 : 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); 249d4: 8c ee ldi r24, 0xEC ; 236 249d6: 94 e0 ldi r25, 0x04 ; 4 249d8: 0f 94 59 1e call 0x23cb2 ; 0x23cb2 249dc: 60 91 ec 04 lds r22, 0x04EC ; 0x8004ec 249e0: 83 ea ldi r24, 0xA3 ; 163 249e2: 9d e0 ldi r25, 0x0D ; 13 249e4: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 000249e8 : 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); 249e8: 8d ee ldi r24, 0xED ; 237 249ea: 94 e0 ldi r25, 0x04 ; 4 249ec: 0f 94 59 1e call 0x23cb2 ; 0x23cb2 249f0: 60 91 ed 04 lds r22, 0x04ED ; 0x8004ed 249f4: 84 ea ldi r24, 0xA4 ; 164 249f6: 9d e0 ldi r25, 0x0D ; 13 249f8: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 000249fc : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 249fc: 8f ee ldi r24, 0xEF ; 239 249fe: 94 e0 ldi r25, 0x04 ; 4 24a00: 0f 94 59 1e call 0x23cb2 ; 0x23cb2 24a04: 60 91 ef 04 lds r22, 0x04EF ; 0x8004ef 24a08: 88 ea ldi r24, 0xA8 ; 168 24a0a: 9d e0 ldi r25, 0x0D ; 13 24a0c: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024a10 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 24a10: 80 91 90 17 lds r24, 0x1790 ; 0x801790 case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; break; case Filament_sensor::SensorActionOnError::_Pause: act = Filament_sensor::SensorActionOnError::_Continue; 24a14: 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) { 24a16: 81 11 cpse r24, r1 24a18: 01 c0 rjmp .+2 ; 0x24a1c case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 24a1a: 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; 24a1c: 60 93 90 17 sts 0x1790, r22 ; 0x801790 24a20: 87 e4 ldi r24, 0x47 ; 71 24a22: 9d e0 ldi r25, 0x0D ; 13 24a24: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024a28 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 24a28: cf 93 push r28 24a2a: df 93 push r29 MENU_BEGIN(); 24a2c: 0f 94 10 cf call 0x39e20 ; 0x39e20 24a30: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24a34: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24a38: 84 30 cpi r24, 0x04 ; 4 24a3a: 08 f0 brcs .+2 ; 0x24a3e 24a3c: 96 c0 rjmp .+300 ; 0x24b6a 24a3e: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_BACK)); 24a42: 89 e1 ldi r24, 0x19 ; 25 24a44: 90 e4 ldi r25, 0x40 ; 64 24a46: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24a4a: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 24a4e: 80 91 88 17 lds r24, 0x1788 ; 0x801788 24a52: 88 23 and r24, r24 24a54: f1 f1 breq .+124 ; 0x24ad2 24a56: 88 e4 ldi r24, 0x48 ; 72 24a58: 9d e5 ldi r25, 0x5D ; 93 24a5a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24a5e: ec 01 movw r28, r24 24a60: 88 ec ldi r24, 0xC8 ; 200 24a62: 9c e3 ldi r25, 0x3C ; 60 24a64: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24a68: 22 e0 ldi r18, 0x02 ; 2 24a6a: 46 e3 ldi r20, 0x36 ; 54 24a6c: 5b e3 ldi r21, 0x3B ; 59 24a6e: be 01 movw r22, r28 24a70: 0f 94 9f d0 call 0x3a13e ; 0x3a13e 24a74: 80 91 88 17 lds r24, 0x1788 ; 0x801788 if (fsensor.isEnabled()) { 24a78: 88 23 and r24, r24 24a7a: 09 f4 brne .+2 ; 0x24a7e 24a7c: 66 c0 rjmp .+204 ; 0x24b4a if (fsensor.isError()) { 24a7e: 83 30 cpi r24, 0x03 ; 3 24a80: 59 f5 brne .+86 ; 0x24ad8 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 24a82: 87 e0 ldi r24, 0x07 ; 7 24a84: 9d e3 ldi r25, 0x3D ; 61 24a86: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24a8a: ec 01 movw r28, r24 24a8c: 83 ee ldi r24, 0xE3 ; 227 24a8e: 96 e5 ldi r25, 0x56 ; 86 24a90: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24a94: 22 e0 ldi r18, 0x02 ; 2 24a96: 4e eb ldi r20, 0xBE ; 190 24a98: 59 e3 ldi r21, 0x39 ; 57 24a9a: be 01 movw r22, r28 24a9c: 0f 94 9f d0 call 0x3a13e ; 0x3a13e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 24aa0: 87 e0 ldi r24, 0x07 ; 7 24aa2: 9d e3 ldi r25, 0x3D ; 61 24aa4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24aa8: ec 01 movw r28, r24 24aaa: 85 ed ldi r24, 0xD5 ; 213 24aac: 96 e5 ldi r25, 0x56 ; 86 24aae: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24ab2: 22 e0 ldi r18, 0x02 ; 2 24ab4: 4e eb ldi r20, 0xBE ; 190 24ab6: 59 e3 ldi r21, 0x39 ; 57 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } else { MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), fsensor.getRunoutEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_runout_set); MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24ab8: be 01 movw r22, r28 24aba: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #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()) { 24abe: 80 91 90 17 lds r24, 0x1790 ; 0x801790 24ac2: 88 23 and r24, r24 24ac4: 99 f1 breq .+102 ; 0x24b2c 24ac6: 81 30 cpi r24, 0x01 ; 1 24ac8: 09 f4 brne .+2 ; 0x24acc 24aca: 4c c0 rjmp .+152 ; 0x24b64 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(); 24acc: 0f 94 08 25 call 0x24a10 ; 0x24a10 24ad0: 3c c0 rjmp .+120 ; 0x24b4a 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); 24ad2: 82 e4 ldi r24, 0x42 ; 66 24ad4: 9d e5 ldi r25, 0x5D ; 93 24ad6: c1 cf rjmp .-126 ; 0x24a5a #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); 24ad8: 80 91 8a 17 lds r24, 0x178A ; 0x80178a 24adc: 88 23 and r24, r24 24ade: 01 f1 breq .+64 ; 0x24b20 24ae0: 88 e4 ldi r24, 0x48 ; 72 24ae2: 9d e5 ldi r25, 0x5D ; 93 24ae4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24ae8: ec 01 movw r28, r24 24aea: 83 ee ldi r24, 0xE3 ; 227 24aec: 96 e5 ldi r25, 0x56 ; 86 24aee: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24af2: 22 e0 ldi r18, 0x02 ; 2 24af4: 4c e4 ldi r20, 0x4C ; 76 24af6: 5b e3 ldi r21, 0x3B ; 59 24af8: be 01 movw r22, r28 24afa: 0f 94 9f d0 call 0x3a13e ; 0x3a13e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24afe: 80 91 89 17 lds r24, 0x1789 ; 0x801789 24b02: 88 23 and r24, r24 24b04: 81 f0 breq .+32 ; 0x24b26 24b06: 88 e4 ldi r24, 0x48 ; 72 24b08: 9d e5 ldi r25, 0x5D ; 93 24b0a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24b0e: ec 01 movw r28, r24 24b10: 85 ed ldi r24, 0xD5 ; 213 24b12: 96 e5 ldi r25, 0x56 ; 86 24b14: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24b18: 22 e0 ldi r18, 0x02 ; 2 24b1a: 44 e3 ldi r20, 0x34 ; 52 24b1c: 5a e3 ldi r21, 0x3A ; 58 24b1e: cc cf rjmp .-104 ; 0x24ab8 #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); 24b20: 82 e4 ldi r24, 0x42 ; 66 24b22: 9d e5 ldi r25, 0x5D ; 93 24b24: df cf rjmp .-66 ; 0x24ae4 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 24b26: 82 e4 ldi r24, 0x42 ; 66 24b28: 9d e5 ldi r25, 0x5D ; 93 24b2a: ef cf rjmp .-34 ; 0x24b0a #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); 24b2c: 8d ec ldi r24, 0xCD ; 205 24b2e: 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); 24b30: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24b34: ec 01 movw r28, r24 24b36: 81 ec ldi r24, 0xC1 ; 193 24b38: 96 e5 ldi r25, 0x56 ; 86 24b3a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24b3e: 22 e0 ldi r18, 0x02 ; 2 24b40: 48 e1 ldi r20, 0x18 ; 24 24b42: 5a e3 ldi r21, 0x3A ; 58 24b44: be 01 movw r22, r28 24b46: 0f 94 9f d0 call 0x3a13e ; 0x3a13e default: lcd_fsensor_actionNA_set(); } } MENU_END(); 24b4a: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 24b4e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24b52: 8f 5f subi r24, 0xFF ; 255 24b54: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24b58: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24b5c: 8f 5f subi r24, 0xFF ; 255 24b5e: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24b62: 68 cf rjmp .-304 ; 0x24a34 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); 24b64: 89 eb ldi r24, 0xB9 ; 185 24b66: 96 e5 ldi r25, 0x56 ; 86 24b68: e3 cf rjmp .-58 ; 0x24b30 lcd_fsensor_actionNA_set(); } } MENU_END(); } 24b6a: df 91 pop r29 24b6c: cf 91 pop r28 24b6e: 08 95 ret 00024b70 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 24b70: e8 e8 ldi r30, 0x88 ; 136 24b72: f7 e1 ldi r31, 0x17 ; 23 24b74: 61 81 ldd r22, Z+1 ; 0x01 24b76: 81 e0 ldi r24, 0x01 ; 1 24b78: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 24b7a: 61 83 std Z+1, r22 ; 0x01 24b7c: 87 e0 ldi r24, 0x07 ; 7 24b7e: 9f e0 ldi r25, 0x0F ; 15 24b80: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024b84 : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 24b84: e8 e8 ldi r30, 0x88 ; 136 24b86: f7 e1 ldi r31, 0x17 ; 23 24b88: 62 81 ldd r22, Z+2 ; 0x02 24b8a: 81 e0 ldi r24, 0x01 ; 1 24b8c: 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; 24b8e: 62 83 std Z+2, r22 ; 0x02 24b90: 85 ed ldi r24, 0xD5 ; 213 24b92: 9e e0 ldi r25, 0x0E ; 14 24b94: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024b98 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 24b98: ef ed ldi r30, 0xDF ; 223 24b9a: f6 e1 ldi r31, 0x16 ; 22 24b9c: 60 81 ld r22, Z 24b9e: 81 e0 ldi r24, 0x01 ; 1 24ba0: 68 27 eor r22, r24 24ba2: 60 83 st Z, r22 24ba4: 8b eb ldi r24, 0xBB ; 187 24ba6: 9f e0 ldi r25, 0x0F ; 15 24ba8: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024bac : 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; 24bac: 80 91 21 05 lds r24, 0x0521 ; 0x800521 24bb0: 81 30 cpi r24, 0x01 ; 1 24bb2: 51 f4 brne .+20 ; 0x24bc8 24bb4: 10 92 21 05 sts 0x0521, r1 ; 0x800521 24bb8: 60 91 21 05 lds r22, 0x0521 ; 0x800521 24bbc: 88 e0 ldi r24, 0x08 ; 8 24bbe: 9f e0 ldi r25, 0x0F ; 15 24bc0: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a else selectedSerialPort = 1; eeprom_update_byte_notify((unsigned char *)EEPROM_SECOND_SERIAL_ACTIVE, selectedSerialPort); MYSERIAL.begin(BAUDRATE); 24bc4: 0c 94 81 db jmp 0x1b702 ; 0x1b702 } #ifdef HAS_SECOND_SERIAL_PORT void lcd_second_serial_set() { if(selectedSerialPort == 1) selectedSerialPort = 0; else selectedSerialPort = 1; 24bc8: 81 e0 ldi r24, 0x01 ; 1 24bca: 80 93 21 05 sts 0x0521, r24 ; 0x800521 24bce: f4 cf rjmp .-24 ; 0x24bb8 00024bd0 : 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); 24bd0: 8f ea ldi r24, 0xAF ; 175 24bd2: 9f e0 ldi r25, 0x0F ; 15 24bd4: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 temp_cal_active = !temp_cal_active; 24bd8: 61 e0 ldi r22, 0x01 ; 1 24bda: 81 11 cpse r24, r1 24bdc: 60 e0 ldi r22, 0x00 ; 0 24bde: 8f ea ldi r24, 0xAF ; 175 24be0: 9f e0 ldi r25, 0x0F ; 15 24be2: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024be6 : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 24be6: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 24bea: 81 30 cpi r24, 0x01 ; 1 24bec: 71 f0 breq .+28 ; 0x24c0a 24bee: 20 f0 brcs .+8 ; 0x24bf8 24bf0: 82 30 cpi r24, 0x02 ; 2 24bf2: 69 f4 brne .+26 ; 0x24c0e break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 24bf4: 83 e0 ldi r24, 0x03 ; 3 24bf6: 01 c0 rjmp .+2 ; 0x24bfa void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 24bf8: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 24bfa: 80 93 e1 04 sts 0x04E1, r24 ; 0x8004e1 24bfe: 60 91 e1 04 lds r22, 0x04E1 ; 0x8004e1 24c02: 87 ed ldi r24, 0xD7 ; 215 24c04: 9e e0 ldi r25, 0x0E ; 14 24c06: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 24c0a: 82 e0 ldi r24, 0x02 ; 2 24c0c: f6 cf rjmp .-20 ; 0x24bfa break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 24c0e: 10 92 e1 04 sts 0x04E1, r1 ; 0x8004e1 24c12: f5 cf rjmp .-22 ; 0x24bfe 00024c14 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 24c14: 89 e0 ldi r24, 0x09 ; 9 24c16: 9f e0 ldi r25, 0x0F ; 15 24c18: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 24c1c: 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) { 24c1e: 88 23 and r24, r24 24c20: 21 f0 breq .+8 ; 0x24c2a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 24c22: 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) { 24c24: 81 30 cpi r24, 0x01 ; 1 24c26: 09 f0 breq .+2 ; 0x24c2a case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 24c28: 60 e0 ldi r22, 0x00 ; 0 24c2a: 89 e0 ldi r24, 0x09 ; 9 24c2c: 9f e0 ldi r25, 0x0F ; 15 24c2e: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 24c32: 81 e0 ldi r24, 0x01 ; 1 24c34: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd } 24c38: 08 95 ret 00024c3a : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 24c3a: ef 92 push r14 24c3c: ff 92 push r15 24c3e: 0f 93 push r16 24c40: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 24c42: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 24c46: 81 11 cpse r24, r1 24c48: 35 c0 rjmp .+106 ; 0x24cb4 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 24c4a: 80 ec ldi r24, 0xC0 ; 192 24c4c: 9f e0 ldi r25, 0x0F ; 15 24c4e: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 24c52: 81 30 cpi r24, 0x01 ; 1 24c54: 61 f5 brne .+88 ; 0x24cae { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 24c56: 8f eb ldi r24, 0xBF ; 191 24c58: 9f e0 ldi r25, 0x0F ; 15 24c5a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 24c5e: 08 2e mov r0, r24 24c60: 00 0c add r0, r0 24c62: 99 0b sbc r25, r25 24c64: 90 93 b8 03 sts 0x03B8, r25 ; 0x8003b8 24c68: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 24c6c: 8e eb ldi r24, 0xBE ; 190 24c6e: 9f e0 ldi r25, 0x0F ; 15 24c70: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 24c74: 08 2e mov r0, r24 24c76: 00 0c add r0, r0 24c78: 99 0b sbc r25, r25 24c7a: 90 93 ba 03 sts 0x03BA, r25 ; 0x8003ba 24c7e: 80 93 b9 03 sts 0x03B9, r24 ; 0x8003b9 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 24c82: 8d eb ldi r24, 0xBD ; 189 24c84: 9f e0 ldi r25, 0x0F ; 15 24c86: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 24c8a: 08 2e mov r0, r24 24c8c: 00 0c add r0, r0 24c8e: 99 0b sbc r25, r25 24c90: 90 93 bc 03 sts 0x03BC, r25 ; 0x8003bc 24c94: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 24c98: 8c eb ldi r24, 0xBC ; 188 24c9a: 9f e0 ldi r25, 0x0F ; 15 24c9c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 24ca0: 08 2e mov r0, r24 24ca2: 00 0c add r0, r0 24ca4: 99 0b sbc r25, r25 24ca6: 90 93 be 03 sts 0x03BE, r25 ; 0x8003be 24caa: 80 93 bd 03 sts 0x03BD, r24 ; 0x8003bd } _md->status = 1; 24cae: 81 e0 ldi r24, 0x01 ; 1 24cb0: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } MENU_BEGIN(); 24cb4: 0f 94 10 cf call 0x39e20 ; 0x39e20 24cb8: 10 92 15 05 sts 0x0515, r1 ; 0x800515 24cbc: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24cc0: 84 30 cpi r24, 0x04 ; 4 24cc2: 08 f0 brcs .+2 ; 0x24cc6 24cc4: 6e c0 rjmp .+220 ; 0x24da2 24cc6: 10 92 18 05 sts 0x0518, r1 ; 0x800518 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 24cca: 0f 94 90 cd call 0x39b20 ; 0x39b20 24cce: 88 23 and r24, r24 24cd0: e9 f0 breq .+58 ; 0x24d0c 24cd2: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 24cd6: 8f eb ldi r24, 0xBF ; 191 24cd8: 9f e0 ldi r25, 0x0F ; 15 24cda: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 24cde: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 24ce2: 8d eb ldi r24, 0xBD ; 189 24ce4: 9f e0 ldi r25, 0x0F ; 15 24ce6: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 24cea: 60 91 bd 03 lds r22, 0x03BD ; 0x8003bd 24cee: 8c eb ldi r24, 0xBC ; 188 24cf0: 9f e0 ldi r25, 0x0F ; 15 24cf2: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 24cf6: 60 91 b9 03 lds r22, 0x03B9 ; 0x8003b9 24cfa: 8e eb ldi r24, 0xBE ; 190 24cfc: 9f e0 ldi r25, 0x0F ; 15 24cfe: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 24d02: 61 e0 ldi r22, 0x01 ; 1 24d04: 80 ec ldi r24, 0xC0 ; 192 24d06: 9f e0 ldi r25, 0x0F ; 15 24d08: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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)); 24d0c: 89 e1 ldi r24, 0x19 ; 25 24d0e: 90 e4 ldi r25, 0x40 ; 64 24d10: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24d14: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d18: 87 e4 ldi r24, 0x47 ; 71 24d1a: 9d e4 ldi r25, 0x4D ; 77 24d1c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24d20: f1 2c mov r15, r1 24d22: e1 2c mov r14, r1 24d24: 04 e6 ldi r16, 0x64 ; 100 24d26: 10 e0 ldi r17, 0x00 ; 0 24d28: 2c e9 ldi r18, 0x9C ; 156 24d2a: 3f ef ldi r19, 0xFF ; 255 24d2c: 40 e1 ldi r20, 0x10 ; 16 24d2e: 67 eb ldi r22, 0xB7 ; 183 24d30: 73 e0 ldi r23, 0x03 ; 3 24d32: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d36: 86 e3 ldi r24, 0x36 ; 54 24d38: 9d e4 ldi r25, 0x4D ; 77 24d3a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24d3e: 2c e9 ldi r18, 0x9C ; 156 24d40: 3f ef ldi r19, 0xFF ; 255 24d42: 40 e1 ldi r20, 0x10 ; 16 24d44: 69 eb ldi r22, 0xB9 ; 185 24d46: 73 e0 ldi r23, 0x03 ; 3 24d48: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d4c: 85 e2 ldi r24, 0x25 ; 37 24d4e: 9d e4 ldi r25, 0x4D ; 77 24d50: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24d54: 2c e9 ldi r18, 0x9C ; 156 24d56: 3f ef ldi r19, 0xFF ; 255 24d58: 40 e1 ldi r20, 0x10 ; 16 24d5a: 6b eb ldi r22, 0xBB ; 187 24d5c: 73 e0 ldi r23, 0x03 ; 3 24d5e: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 24d62: 84 e1 ldi r24, 0x14 ; 20 24d64: 9d e4 ldi r25, 0x4D ; 77 24d66: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24d6a: 2c e9 ldi r18, 0x9C ; 156 24d6c: 3f ef ldi r19, 0xFF ; 255 24d6e: 40 e1 ldi r20, 0x10 ; 16 24d70: 6d eb ldi r22, 0xBD ; 189 24d72: 73 e0 ldi r23, 0x03 ; 3 24d74: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 24d78: 80 e1 ldi r24, 0x10 ; 16 24d7a: 9b e3 ldi r25, 0x3B ; 59 24d7c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24d80: 6e ec ldi r22, 0xCE ; 206 24d82: 79 e3 ldi r23, 0x39 ; 57 24d84: 0f 94 8d ce call 0x39d1a ; 0x39d1a MENU_END(); 24d88: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 _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(); 24d8c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 24d90: 8f 5f subi r24, 0xFF ; 255 24d92: 80 93 15 05 sts 0x0515, r24 ; 0x800515 24d96: 80 91 17 05 lds r24, 0x0517 ; 0x800517 24d9a: 8f 5f subi r24, 0xFF ; 255 24d9c: 80 93 17 05 sts 0x0517, r24 ; 0x800517 24da0: 8d cf rjmp .-230 ; 0x24cbc 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(); } 24da2: 1f 91 pop r17 24da4: 0f 91 pop r16 24da6: ff 90 pop r15 24da8: ef 90 pop r14 24daa: 08 95 ret 00024dac : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 24dac: 8e ec ldi r24, 0xCE ; 206 24dae: 9e e0 ldi r25, 0x0E ; 14 24db0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 24db4: 60 e0 ldi r22, 0x00 ; 0 24db6: 81 30 cpi r24, 0x01 ; 1 24db8: 09 f0 breq .+2 ; 0x24dbc 24dba: 61 e0 ldi r22, 0x01 ; 1 24dbc: 8e ec ldi r24, 0xCE ; 206 24dbe: 9e e0 ldi r25, 0x0E ; 14 24dc0: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024dc4 : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 24dc4: 60 91 38 02 lds r22, 0x0238 ; 0x800238 24dc8: 81 e0 ldi r24, 0x01 ; 1 24dca: 68 27 eor r22, r24 24dcc: 60 93 38 02 sts 0x0238, r22 ; 0x800238 24dd0: 87 e8 ldi r24, 0x87 ; 135 24dd2: 9f e0 ldi r25, 0x0F ; 15 24dd4: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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. 24dd8: 80 91 38 02 lds r24, 0x0238 ; 0x800238 24ddc: 81 11 cpse r24, r1 24dde: 02 c0 rjmp .+4 ; 0x24de4 24de0: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 #endif //FANCHECK } 24de4: 08 95 ret 00024de6 : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 24de6: 86 ed ldi r24, 0xD6 ; 214 24de8: 9e e0 ldi r25, 0x0E ; 14 24dea: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 24dee: 61 e0 ldi r22, 0x01 ; 1 24df0: 82 30 cpi r24, 0x02 ; 2 24df2: 09 f0 breq .+2 ; 0x24df6 24df4: 62 e0 ldi r22, 0x02 ; 2 24df6: 86 ed ldi r24, 0xD6 ; 214 24df8: 9e e0 ldi r25, 0x0E ; 14 24dfa: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 00024dfe : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 24dfe: cf 93 push r28 24e00: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 24e02: 80 91 ee 04 lds r24, 0x04EE ; 0x8004ee 24e06: 8c 33 cpi r24, 0x3C ; 60 24e08: e1 f0 breq .+56 ; 0x24e42 24e0a: 80 35 cpi r24, 0x50 ; 80 24e0c: 01 f1 breq .+64 ; 0x24e4e 24e0e: 88 32 cpi r24, 0x28 ; 40 24e10: 91 f0 breq .+36 ; 0x24e36 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 24e12: 88 e2 ldi r24, 0x28 ; 40 24e14: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=400; 24e18: c0 e9 ldi r28, 0x90 ; 144 24e1a: d1 e0 ldi r29, 0x01 ; 1 24e1c: 60 91 ee 04 lds r22, 0x04EE ; 0x8004ee 24e20: 87 ea ldi r24, 0xA7 ; 167 24e22: 9d e0 ldi r25, 0x0D ; 13 24e24: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 24e28: be 01 movw r22, r28 24e2a: 85 ea ldi r24, 0xA5 ; 165 24e2c: 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); } 24e2e: df 91 pop r29 24e30: cf 91 pop r28 24e32: 0d 94 d3 dd jmp 0x3bba6 ; 0x3bba6 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 24e36: 8c e3 ldi r24, 0x3C ; 60 24e38: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=600; 24e3c: c8 e5 ldi r28, 0x58 ; 88 24e3e: d2 e0 ldi r29, 0x02 ; 2 24e40: ed cf rjmp .-38 ; 0x24e1c break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 24e42: 80 e5 ldi r24, 0x50 ; 80 24e44: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=800; 24e48: c0 e2 ldi r28, 0x20 ; 32 24e4a: d3 e0 ldi r29, 0x03 ; 3 24e4c: e7 cf rjmp .-50 ; 0x24e1c break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 24e4e: 89 e1 ldi r24, 0x19 ; 25 24e50: 80 93 ee 04 sts 0x04EE, r24 ; 0x8004ee nDiameter=250; 24e54: ca ef ldi r28, 0xFA ; 250 24e56: d0 e0 ldi r29, 0x00 ; 0 24e58: e1 cf rjmp .-62 ; 0x24e1c 00024e5a : #endif //SDCARD_SORT_ALPHA #ifdef TMC2130 static void lcd_crash_mode_info() { lcd_home(); 24e5a: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_puts_P(_T(MSG_CRASH_DET_ONLY_IN_NORMAL)); 24e5e: 88 e0 ldi r24, 0x08 ; 8 24e60: 9e e4 ldi r25, 0x4E ; 78 24e62: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24e66: 0e 94 80 6f call 0xdf00 ; 0xdf00 menu_back_if_clicked(); 24e6a: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00024e6e : } static void lcd_crash_mode_info2() { lcd_home(); 24e6e: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_puts_P(_T(MSG_CRASH_DET_STEALTH_FORCE_OFF)); 24e72: 8f e3 ldi r24, 0x3F ; 63 24e74: 9e e4 ldi r25, 0x4E ; 78 24e76: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24e7a: 0e 94 80 6f call 0xdf00 ; 0xdf00 menu_back_if_clicked(); 24e7e: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00024e82 : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 24e82: 81 30 cpi r24, 0x01 ; 1 24e84: 21 f4 brne .+8 ; 0x24e8e case STATE_ON: lcd_puts_P(_N(" 1")); 24e86: 8b e1 ldi r24, 0x1B ; 27 24e88: 90 e7 ldi r25, 0x70 ; 112 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 24e8a: 0c 94 80 6f jmp 0xdf00 ; 0xdf00 24e8e: 87 e1 ldi r24, 0x17 ; 23 24e90: 90 e7 ldi r25, 0x70 ; 112 24e92: fb cf rjmp .-10 ; 0x24e8a 00024e94 : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 24e94: 81 e0 ldi r24, 0x01 ; 1 24e96: 90 91 88 17 lds r25, 0x1788 ; 0x801788 24e9a: 91 11 cpse r25, r1 24e9c: 80 e0 ldi r24, 0x00 ; 0 24e9e: 0c 94 b4 75 jmp 0xeb68 ; 0xeb68 00024ea2 : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 24ea2: 0d 94 74 87 jmp 0x30ee8 ; 0x30ee8 00024ea6 : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 24ea6: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_status_message_idx = 0; // Re-draw message from beginning 24eaa: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 24eae: 20 e0 ldi r18, 0x00 ; 0 24eb0: 41 e0 ldi r20, 0x01 ; 1 24eb2: 70 e0 ldi r23, 0x00 ; 0 24eb4: 60 e0 ldi r22, 0x00 ; 0 24eb6: 8c e3 ldi r24, 0x3C ; 60 24eb8: 9a e3 ldi r25, 0x3A ; 58 24eba: 0f 94 3a cf call 0x39e74 ; 0x39e74 menu_depth = 0; 24ebe: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 24ec2: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 } 24ec6: 08 95 ret 00024ec8 : } } #if (LANG_MODE != 0) void lcd_language() { 24ec8: cf 93 push r28 24eca: df 93 push r29 lcd_update_enable(true); 24ecc: 81 e0 ldi r24, 0x01 ; 1 24ece: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 menu_goto(lcd_language_menu, 0, true, true); 24ed2: 21 e0 ldi r18, 0x01 ; 1 24ed4: 41 e0 ldi r20, 0x01 ; 1 24ed6: 70 e0 ldi r23, 0x00 ; 0 24ed8: 60 e0 ldi r22, 0x00 ; 0 24eda: 88 e2 ldi r24, 0x28 ; 40 24edc: 9b e3 ldi r25, 0x3B ; 59 24ede: 0f 94 3a cf call 0x39e74 ; 0x39e74 24ee2: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 24ee6: c0 91 69 0e lds r28, 0x0E69 ; 0x800e69 24eea: d0 91 6a 0e lds r29, 0x0E6A ; 0x800e6a 24eee: 0e 94 d2 71 call 0xe3a4 ; 0xe3a4 24ef2: cc 53 subi r28, 0x3C ; 60 24ef4: da 43 sbci r29, 0x3A ; 58 24ef6: 39 f0 breq .+14 ; 0x24f06 24ef8: 81 11 cpse r24, r1 24efa: 07 c0 rjmp .+14 ; 0x24f0a { delay_keep_alive(50); 24efc: 82 e3 ldi r24, 0x32 ; 50 24efe: 90 e0 ldi r25, 0x00 ; 0 24f00: 0e 94 87 8e call 0x11d0e ; 0x11d0e 24f04: f0 cf rjmp .-32 ; 0x24ee6 } if (lang_is_selected()) 24f06: 88 23 and r24, r24 24f08: 21 f0 breq .+8 ; 0x24f12 lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 24f0a: df 91 pop r29 24f0c: 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(); 24f0e: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 else lang_select(LANG_ID_PRI); 24f12: 80 e0 ldi r24, 0x00 ; 0 } 24f14: df 91 pop r29 24f16: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 24f18: 0c 94 e9 72 jmp 0xe5d2 ; 0xe5d2 00024f1c : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 24f1c: 61 e0 ldi r22, 0x01 ; 1 24f1e: 8d e5 ldi r24, 0x5D ; 93 24f20: 94 ea ldi r25, 0xA4 ; 164 24f22: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_return_to_status(); 24f26: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00024f2a : lcd_return_to_status(); } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 24f2a: 61 e0 ldi r22, 0x01 ; 1 24f2c: 87 e5 ldi r24, 0x57 ; 87 24f2e: 94 ea ldi r25, 0xA4 ; 164 24f30: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_return_to_status(); 24f34: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00024f38 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 24f38: 61 e0 ldi r22, 0x01 ; 1 24f3a: 83 e5 ldi r24, 0x53 ; 83 24f3c: 94 ea ldi r25, 0xA4 ; 164 24f3e: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_return_to_status(); 24f42: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00024f46 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 24f46: 61 e0 ldi r22, 0x01 ; 1 24f48: 8f e4 ldi r24, 0x4F ; 79 24f4a: 94 ea ldi r25, 0xA4 ; 164 24f4c: 0e 94 4b 89 call 0x11296 ; 0x11296 lcd_return_to_status(); 24f50: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00024f54 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 24f54: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 24f58: 88 e5 ldi r24, 0x58 ; 88 24f5a: 9d e4 ldi r25, 0x4D ; 77 24f5c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 24f60: ac 01 movw r20, r24 24f62: 60 e0 ldi r22, 0x00 ; 0 24f64: 80 e0 ldi r24, 0x00 ; 0 24f66: 0e 94 a9 6f call 0xdf52 ; 0xdf52 pid_temp += lcd_encoder; 24f6a: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.457> 24f6e: 90 91 4c 02 lds r25, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 24f72: 20 91 37 05 lds r18, 0x0537 ; 0x800537 24f76: 30 91 38 05 lds r19, 0x0538 ; 0x800538 24f7a: 82 0f add r24, r18 24f7c: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 24f7e: 82 33 cpi r24, 0x32 ; 50 24f80: 21 e0 ldi r18, 0x01 ; 1 24f82: 92 07 cpc r25, r18 24f84: 50 f1 brcs .+84 ; 0x24fda 24f86: 81 e3 ldi r24, 0x31 ; 49 24f88: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 24f8a: 90 93 4c 02 sts 0x024C, r25 ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 24f8e: 80 93 4b 02 sts 0x024B, r24 ; 0x80024b <_ZL8pid_temp.lto_priv.457> lcd_encoder = 0; 24f92: 10 92 38 05 sts 0x0538, r1 ; 0x800538 24f96: 10 92 37 05 sts 0x0537, r1 ; 0x800537 lcd_set_cursor(1, 2); 24f9a: 62 e0 ldi r22, 0x02 ; 2 24f9c: 81 e0 ldi r24, 0x01 ; 1 24f9e: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%3u"), pid_temp); 24fa2: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL8pid_temp.lto_priv.457+0x1> 24fa6: 8f 93 push r24 24fa8: 80 91 4b 02 lds r24, 0x024B ; 0x80024b <_ZL8pid_temp.lto_priv.457> 24fac: 8f 93 push r24 24fae: 87 ed ldi r24, 0xD7 ; 215 24fb0: 93 ea ldi r25, 0xA3 ; 163 24fb2: 9f 93 push r25 24fb4: 8f 93 push r24 24fb6: 0e 94 6e 6f call 0xdedc ; 0xdedc if (lcd_clicked()) { 24fba: 0e 94 b2 71 call 0xe364 ; 0xe364 24fbe: 0f 90 pop r0 24fc0: 0f 90 pop r0 24fc2: 0f 90 pop r0 24fc4: 0f 90 pop r0 24fc6: 88 23 and r24, r24 24fc8: 71 f0 breq .+28 ; 0x24fe6 lcd_commands_type = LcdCommands::PidExtruder; 24fca: 83 e0 ldi r24, 0x03 ; 3 24fcc: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 lcd_return_to_status(); 24fd0: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_update(2); 24fd4: 82 e0 ldi r24, 0x02 ; 2 24fd6: 0c 94 5c 6f jmp 0xdeb8 ; 0xdeb8 { 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; 24fda: 8a 30 cpi r24, 0x0A ; 10 24fdc: 91 05 cpc r25, r1 24fde: a8 f6 brcc .-86 ; 0x24f8a 24fe0: 8a e0 ldi r24, 0x0A ; 10 24fe2: 90 e0 ldi r25, 0x00 ; 0 24fe4: d2 cf rjmp .-92 ; 0x24f8a lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 24fe6: 08 95 ret 00024fe8 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 24fe8: df 92 push r13 24fea: ef 92 push r14 24fec: ff 92 push r15 24fee: 0f 93 push r16 24ff0: 1f 93 push r17 24ff2: cf 93 push r28 24ff4: df 93 push r29 24ff6: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 24ffa: 0e 94 c1 6f call 0xdf82 ; 0xdf82 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] ); 24ffe: c1 eb ldi r28, 0xB1 ; 177 25000: d4 e0 ldi r29, 0x04 ; 4 25002: 8a 81 ldd r24, Y+2 ; 0x02 25004: 9b 81 ldd r25, Y+3 ; 0x03 25006: 2c e3 ldi r18, 0x3C ; 60 25008: f2 2e mov r15, r18 2500a: f8 9e mul r15, r24 2500c: 80 01 movw r16, r0 2500e: f9 9e mul r15, r25 25010: 10 0d add r17, r0 25012: 11 24 eor r1, r1 25014: 80 e5 ldi r24, 0x50 ; 80 25016: 9f e3 ldi r25, 0x3F ; 63 25018: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2501c: e8 2e mov r14, r24 2501e: d9 2e mov r13, r25 25020: 88 81 ld r24, Y 25022: 99 81 ldd r25, Y+1 ; 0x01 25024: f8 9e mul r15, r24 25026: e0 01 movw r28, r0 25028: f9 9e mul r15, r25 2502a: d0 0d add r29, r0 2502c: 11 24 eor r1, r1 2502e: 8d e5 ldi r24, 0x5D ; 93 25030: 9f e3 ldi r25, 0x3F ; 63 25032: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25036: 1f 93 push r17 25038: 0f 93 push r16 2503a: df 92 push r13 2503c: ef 92 push r14 2503e: df 93 push r29 25040: cf 93 push r28 25042: 9f 93 push r25 25044: 8f 93 push r24 25046: 83 ee ldi r24, 0xE3 ; 227 25048: 90 ea ldi r25, 0xA0 ; 160 2504a: 9f 93 push r25 2504c: 8f 93 push r24 2504e: 0e 94 6e 6f call 0xdedc ; 0xdedc menu_back_if_clicked(); 25052: 8d b7 in r24, 0x3d ; 61 25054: 9e b7 in r25, 0x3e ; 62 25056: 0a 96 adiw r24, 0x0a ; 10 25058: 0f b6 in r0, 0x3f ; 63 2505a: f8 94 cli 2505c: 9e bf out 0x3e, r25 ; 62 2505e: 0f be out 0x3f, r0 ; 63 25060: 8d bf out 0x3d, r24 ; 61 } 25062: df 91 pop r29 25064: cf 91 pop r28 25066: 1f 91 pop r17 25068: 0f 91 pop r16 2506a: ff 90 pop r15 2506c: ef 90 pop r14 2506e: 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(); 25070: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00025074 : //! | Y: 000 | //! | | //! ---------------------- //! @endcode static void lcd_menu_belt_status() { 25074: 0f 93 push r16 25076: 1f 93 push r17 25078: cf 93 push r28 2507a: df 93 push r29 lcd_home(); 2507c: 0e 94 c1 6f call 0xdf82 ; 0xdf82 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))); 25080: 8b e5 ldi r24, 0x5B ; 91 25082: 9f e0 ldi r25, 0x0F ; 15 25084: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 25088: 18 2f mov r17, r24 2508a: 09 2f mov r16, r25 2508c: 8d e5 ldi r24, 0x5D ; 93 2508e: 9f e0 ldi r25, 0x0F ; 15 25090: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 25094: ec 01 movw r28, r24 25096: 82 eb ldi r24, 0xB2 ; 178 25098: 9a e4 ldi r25, 0x4A ; 74 2509a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2509e: 0f 93 push r16 250a0: 1f 93 push r17 250a2: df 93 push r29 250a4: cf 93 push r28 250a6: 9f 93 push r25 250a8: 8f 93 push r24 250aa: 81 ec ldi r24, 0xC1 ; 193 250ac: 91 ea ldi r25, 0xA1 ; 161 250ae: 9f 93 push r25 250b0: 8f 93 push r24 250b2: 0e 94 6e 6f call 0xdedc ; 0xdedc menu_back_if_clicked(); 250b6: 8d b7 in r24, 0x3d ; 61 250b8: 9e b7 in r25, 0x3e ; 62 250ba: 08 96 adiw r24, 0x08 ; 8 250bc: 0f b6 in r0, 0x3f ; 63 250be: f8 94 cli 250c0: 9e bf out 0x3e, r25 ; 62 250c2: 0f be out 0x3f, r0 ; 63 250c4: 8d bf out 0x3d, r24 ; 61 } 250c6: df 91 pop r29 250c8: cf 91 pop r28 250ca: 1f 91 pop r17 250cc: 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(); 250ce: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 000250d2 : #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){ 250d2: cf 93 push r28 250d4: df 93 push r29 250d6: cd b7 in r28, 0x3d ; 61 250d8: de b7 in r29, 0x3e ; 62 250da: 2f 97 sbiw r28, 0x0f ; 15 250dc: 0f b6 in r0, 0x3f ; 63 250de: f8 94 cli 250e0: de bf out 0x3e, r29 ; 62 250e2: 0f be out 0x3f, r0 ; 63 250e4: cd bf out 0x3d, r28 ; 61 250e6: fc 01 movw r30, r24 250e8: de 01 movw r26, r28 250ea: 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; 250ec: 90 e0 ldi r25, 0x00 ; 0 250ee: 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); 250f0: 84 91 lpm r24, Z 250f2: 41 e0 ldi r20, 0x01 ; 1 250f4: 49 0f add r20, r25 if( ! b ) 250f6: 88 23 and r24, r24 250f8: 29 f0 breq .+10 ; 0x25104 break; dst[i] = b; 250fa: 8d 93 st X+, r24 250fc: 31 96 adiw r30, 0x01 ; 1 250fe: 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 25100: 4d 30 cpi r20, 0x0D ; 13 25102: b1 f7 brne .-20 ; 0x250f0 uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 25104: f9 01 movw r30, r18 25106: e9 0f add r30, r25 25108: f1 1d adc r31, r1 2510a: 8a e3 ldi r24, 0x3A ; 58 2510c: 80 83 st Z, r24 ++i; 2510e: 9f 5f subi r25, 0xFF ; 255 25110: f9 01 movw r30, r18 25112: e9 0f add r30, r25 25114: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 25116: 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 25118: 9e 30 cpi r25, 0x0E ; 14 2511a: 19 f0 breq .+6 ; 0x25122 dst[i] = ' '; 2511c: 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 2511e: 9f 5f subi r25, 0xFF ; 255 25120: fb cf rjmp .-10 ; 0x25118 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 25122: 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 25124: 7f 93 push r23 25126: 6f 93 push r22 25128: 3f 93 push r19 2512a: 2f 93 push r18 2512c: 8f e7 ldi r24, 0x7F ; 127 2512e: 91 ea ldi r25, 0xA1 ; 161 25130: 9f 93 push r25 25132: 8f 93 push r24 25134: 0e 94 6e 6f call 0xdedc ; 0xdedc 25138: 0f 90 pop r0 2513a: 0f 90 pop r0 2513c: 0f 90 pop r0 2513e: 0f 90 pop r0 25140: 0f 90 pop r0 25142: 0f 90 pop r0 } 25144: 2f 96 adiw r28, 0x0f ; 15 25146: 0f b6 in r0, 0x3f ; 63 25148: f8 94 cli 2514a: de bf out 0x3e, r29 ; 62 2514c: 0f be out 0x3f, r0 ; 63 2514e: cd bf out 0x3d, r28 ; 61 25150: df 91 pop r29 25152: cf 91 pop r28 25154: 08 95 ret 00025156 : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 25156: cf 92 push r12 25158: df 92 push r13 2515a: ef 92 push r14 2515c: ff 92 push r15 2515e: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25162: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 25166: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2516a: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2516e: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 25172: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 25176: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 2517a: 6b 01 movw r12, r22 2517c: 81 e4 ldi r24, 0x41 ; 65 2517e: 97 e5 ldi r25, 0x57 ; 87 25180: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25184: b6 01 movw r22, r12 25186: 0f 94 69 28 call 0x250d2 ; 0x250d2 lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 2518a: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 2518e: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 25192: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 25196: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 2519a: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 2519e: 6b 01 movw r12, r22 251a0: 86 e2 ldi r24, 0x26 ; 38 251a2: 97 e5 ldi r25, 0x57 ; 87 251a4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 251a8: b6 01 movw r22, r12 251aa: 0f 94 69 28 call 0x250d2 ; 0x250d2 #ifdef AMBIENT_THERMISTOR lcd_menu_temperatures_line( _T(MSG_AMBIENT), (int)current_temperature_ambient ); 251ae: 60 91 53 06 lds r22, 0x0653 ; 0x800653 251b2: 70 91 54 06 lds r23, 0x0654 ; 0x800654 251b6: 80 91 55 06 lds r24, 0x0655 ; 0x800655 251ba: 90 91 56 06 lds r25, 0x0656 ; 0x800656 251be: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 251c2: 6b 01 movw r12, r22 251c4: 8e e8 ldi r24, 0x8E ; 142 251c6: 9a e4 ldi r25, 0x4A ; 74 251c8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 251cc: b6 01 movw r22, r12 251ce: 0f 94 69 28 call 0x250d2 ; 0x250d2 #endif //AMBIENT_THERMISTOR #ifdef PINDA_THERMISTOR lcd_menu_temperatures_line(MSG_PINDA, (int)current_temperature_pinda ); ////MSG_PINDA 251d2: 60 91 99 03 lds r22, 0x0399 ; 0x800399 251d6: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 251da: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 251de: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 251e2: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 251e6: 85 e2 ldi r24, 0x25 ; 37 251e8: 90 e7 ldi r25, 0x70 ; 112 251ea: 0f 94 69 28 call 0x250d2 ; 0x250d2 #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 251ee: ff 90 pop r15 251f0: ef 90 pop r14 251f2: df 90 pop r13 251f4: 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(); 251f6: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 000251fa : //! | 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() { 251fa: af 92 push r10 251fc: bf 92 push r11 251fe: cf 92 push r12 25200: df 92 push r13 25202: ef 92 push r14 25204: ff 92 push r15 25206: 0f 93 push r16 25208: 1f 93 push r17 2520a: cf 93 push r28 2520c: df 93 push r29 2520e: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t power = eeprom_read_byte((uint8_t*)EEPROM_POWER_COUNT); 25212: 84 e6 ldi r24, 0x64 ; 100 25214: 9f e0 ldi r25, 0x0F ; 15 25216: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2521a: 18 2f mov r17, r24 uint8_t filam = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 2521c: 85 e6 ldi r24, 0x65 ; 101 2521e: 9f e0 ldi r25, 0x0F ; 15 25220: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 25224: e8 2e mov r14, r24 uint8_t crashX = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_X); 25226: 86 e6 ldi r24, 0x66 ; 102 25228: 9f e0 ldi r25, 0x0F ; 15 2522a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2522e: b8 2e mov r11, r24 uint8_t crashY = eeprom_read_byte((uint8_t*)EEPROM_CRASH_COUNT_Y); 25230: 88 e6 ldi r24, 0x68 ; 104 25232: 9f e0 ldi r25, 0x0F ; 15 25234: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 25238: a8 2e mov r10, r24 lcd_home(); 2523a: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P(failStatsFmt, 2523e: 81 e7 ldi r24, 0x71 ; 113 25240: 9a e4 ldi r25, 0x4A ; 74 25242: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25246: d8 2e mov r13, r24 25248: c9 2e mov r12, r25 2524a: 82 e6 ldi r24, 0x62 ; 98 2524c: 9a e4 ldi r25, 0x4A ; 74 2524e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25252: 08 2f mov r16, r24 25254: f9 2e mov r15, r25 25256: 81 e5 ldi r24, 0x51 ; 81 25258: 9a e4 ldi r25, 0x4A ; 74 2525a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2525e: ec 01 movw r28, r24 25260: 8b e3 ldi r24, 0x3B ; 59 25262: 9a e4 ldi r25, 0x4A ; 74 25264: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25268: 1f 92 push r1 2526a: af 92 push r10 2526c: 1f 92 push r1 2526e: bf 92 push r11 25270: cf 92 push r12 25272: df 92 push r13 25274: 1f 92 push r1 25276: ef 92 push r14 25278: ff 92 push r15 2527a: 0f 93 push r16 2527c: 1f 92 push r1 2527e: 1f 93 push r17 25280: df 93 push r29 25282: cf 93 push r28 25284: 9f 93 push r25 25286: 8f 93 push r24 25288: 8a e4 ldi r24, 0x4A ; 74 2528a: 91 ea ldi r25, 0xA1 ; 161 2528c: 9f 93 push r25 2528e: 8f 93 push r24 25290: 0e 94 6e 6f call 0xdedc ; 0xdedc _T(MSG_LAST_PRINT_FAILURES), _T(MSG_POWER_FAILURES), power, _T(MSG_FIL_RUNOUTS), filam, _T(MSG_CRASH), crashX, crashY); menu_back_if_clicked(); 25294: 8d b7 in r24, 0x3d ; 61 25296: 9e b7 in r25, 0x3e ; 62 25298: 42 96 adiw r24, 0x12 ; 18 2529a: 0f b6 in r0, 0x3f ; 63 2529c: f8 94 cli 2529e: 9e bf out 0x3e, r25 ; 62 252a0: 0f be out 0x3f, r0 ; 63 252a2: 8d bf out 0x3d, r24 ; 61 } 252a4: df 91 pop r29 252a6: cf 91 pop r28 252a8: 1f 91 pop r17 252aa: 0f 91 pop r16 252ac: ff 90 pop r15 252ae: ef 90 pop r14 252b0: df 90 pop r13 252b2: cf 90 pop r12 252b4: bf 90 pop r11 252b6: 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(); 252b8: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 000252bc : //! | 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() { 252bc: 6f 92 push r6 252be: 7f 92 push r7 252c0: 8f 92 push r8 252c2: 9f 92 push r9 252c4: af 92 push r10 252c6: bf 92 push r11 252c8: cf 92 push r12 252ca: df 92 push r13 252cc: ef 92 push r14 252ce: ff 92 push r15 252d0: 0f 93 push r16 252d2: 1f 93 push r17 252d4: cf 93 push r28 252d6: df 93 push r29 252d8: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 252dc: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P(failStatsFmt, 252e0: 83 e0 ldi r24, 0x03 ; 3 252e2: 9f e0 ldi r25, 0x0F ; 15 252e4: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 252e8: 0f 94 75 1e call 0x23cea ; 0x23cea 252ec: 78 2e mov r7, r24 252ee: 69 2e mov r6, r25 252f0: 85 e0 ldi r24, 0x05 ; 5 252f2: 9f e0 ldi r25, 0x0F ; 15 252f4: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 252f8: 0f 94 75 1e call 0x23cea ; 0x23cea 252fc: 98 2e mov r9, r24 252fe: 89 2e mov r8, r25 25300: 81 e7 ldi r24, 0x71 ; 113 25302: 9a e4 ldi r25, 0x4A ; 74 25304: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25308: b8 2e mov r11, r24 2530a: a9 2e mov r10, r25 2530c: 81 e0 ldi r24, 0x01 ; 1 2530e: 9f e0 ldi r25, 0x0F ; 15 25310: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 25314: 0f 94 75 1e call 0x23cea ; 0x23cea 25318: d8 2e mov r13, r24 2531a: c9 2e mov r12, r25 2531c: 82 e6 ldi r24, 0x62 ; 98 2531e: 9a e4 ldi r25, 0x4A ; 74 25320: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25324: f8 2e mov r15, r24 25326: e9 2e mov r14, r25 25328: 8f ef ldi r24, 0xFF ; 255 2532a: 9e e0 ldi r25, 0x0E ; 14 2532c: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 25330: 0f 94 75 1e call 0x23cea ; 0x23cea 25334: 18 2f mov r17, r24 25336: 09 2f mov r16, r25 25338: 81 e5 ldi r24, 0x51 ; 81 2533a: 9a e4 ldi r25, 0x4A ; 74 2533c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25340: ec 01 movw r28, r24 25342: 8a e2 ldi r24, 0x2A ; 42 25344: 9a e4 ldi r25, 0x4A ; 74 25346: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2534a: 6f 92 push r6 2534c: 7f 92 push r7 2534e: 8f 92 push r8 25350: 9f 92 push r9 25352: af 92 push r10 25354: bf 92 push r11 25356: cf 92 push r12 25358: df 92 push r13 2535a: ef 92 push r14 2535c: ff 92 push r15 2535e: 0f 93 push r16 25360: 1f 93 push r17 25362: df 93 push r29 25364: cf 93 push r28 25366: 9f 93 push r25 25368: 8f 93 push r24 2536a: 8a e4 ldi r24, 0x4A ; 74 2536c: 91 ea ldi r25, 0xA1 ; 161 2536e: 9f 93 push r25 25370: 8f 93 push r24 25372: 0e 94 6e 6f call 0xdedc ; 0xdedc _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(); 25376: 8d b7 in r24, 0x3d ; 61 25378: 9e b7 in r25, 0x3e ; 62 2537a: 42 96 adiw r24, 0x12 ; 18 2537c: 0f b6 in r0, 0x3f ; 63 2537e: f8 94 cli 25380: 9e bf out 0x3e, r25 ; 62 25382: 0f be out 0x3f, r0 ; 63 25384: 8d bf out 0x3d, r24 ; 61 } 25386: df 91 pop r29 25388: cf 91 pop r28 2538a: 1f 91 pop r17 2538c: 0f 91 pop r16 2538e: ff 90 pop r15 25390: ef 90 pop r14 25392: df 90 pop r13 25394: cf 90 pop r12 25396: bf 90 pop r11 25398: af 90 pop r10 2539a: 9f 90 pop r9 2539c: 8f 90 pop r8 2539e: 7f 90 pop r7 253a0: 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(); 253a2: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 000253a6 : //! | 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() { 253a6: 8f 92 push r8 253a8: 9f 92 push r9 253aa: af 92 push r10 253ac: bf 92 push r11 253ae: cf 92 push r12 253b0: df 92 push r13 253b2: ef 92 push r14 253b4: ff 92 push r15 253b6: 0f 93 push r16 253b8: 1f 93 push r17 253ba: cf 93 push r28 253bc: df 93 push r29 253be: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 253c2: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P( 253c6: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 253ca: 90 91 9f 13 lds r25, 0x139F ; 0x80139f 253ce: 0f 94 75 1e call 0x23cea ; 0x23cea 253d2: 98 2e mov r9, r24 253d4: 89 2e mov r8, r25 253d6: 85 e0 ldi r24, 0x05 ; 5 253d8: 9a e4 ldi r25, 0x4A ; 74 253da: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 253de: b8 2e mov r11, r24 253e0: a9 2e mov r10, r25 253e2: 80 ed ldi r24, 0xD0 ; 208 253e4: 9e e0 ldi r25, 0x0E ; 14 253e6: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 253ea: 0f 94 75 1e call 0x23cea ; 0x23cea 253ee: d8 2e mov r13, r24 253f0: c9 2e mov r12, r25 253f2: 84 ef ldi r24, 0xF4 ; 244 253f4: 99 e4 ldi r25, 0x49 ; 73 253f6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 253fa: f8 2e mov r15, r24 253fc: e9 2e mov r14, r25 253fe: 83 ed ldi r24, 0xD3 ; 211 25400: 9e e0 ldi r25, 0x0E ; 14 25402: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 25406: 0f 94 75 1e call 0x23cea ; 0x23cea 2540a: 18 2f mov r17, r24 2540c: 09 2f mov r16, r25 2540e: 88 ee ldi r24, 0xE8 ; 232 25410: 99 e4 ldi r25, 0x49 ; 73 25412: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25416: ec 01 movw r28, r24 25418: 8a e2 ldi r24, 0x2A ; 42 2541a: 9a e4 ldi r25, 0x4A ; 74 2541c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25420: 8f 92 push r8 25422: 9f 92 push r9 25424: af 92 push r10 25426: bf 92 push r11 25428: cf 92 push r12 2542a: df 92 push r13 2542c: ef 92 push r14 2542e: ff 92 push r15 25430: 0f 93 push r16 25432: 1f 93 push r17 25434: df 93 push r29 25436: cf 93 push r28 25438: 9f 93 push r25 2543a: 8f 93 push r24 2543c: 8d e1 ldi r24, 0x1D ; 29 2543e: 91 ea ldi r25, 0xA1 ; 161 25440: 9f 93 push r25 25442: 8f 93 push r24 25444: 0e 94 6e 6f call 0xdedc ; 0xdedc ), _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(); 25448: 8d b7 in r24, 0x3d ; 61 2544a: 9e b7 in r25, 0x3e ; 62 2544c: 40 96 adiw r24, 0x10 ; 16 2544e: 0f b6 in r0, 0x3f ; 63 25450: f8 94 cli 25452: 9e bf out 0x3e, r25 ; 62 25454: 0f be out 0x3f, r0 ; 63 25456: 8d bf out 0x3d, r24 ; 61 } 25458: df 91 pop r29 2545a: cf 91 pop r28 2545c: 1f 91 pop r17 2545e: 0f 91 pop r16 25460: ff 90 pop r15 25462: ef 90 pop r14 25464: df 90 pop r13 25466: cf 90 pop r12 25468: bf 90 pop r11 2546a: af 90 pop r10 2546c: 9f 90 pop r9 2546e: 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(); 25470: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00025474 : //! | 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() { 25474: cf 92 push r12 25476: df 92 push r13 25478: ef 92 push r14 2547a: ff 92 push r15 2547c: 0f 93 push r16 2547e: 1f 93 push r17 25480: cf 93 push r28 25482: df 93 push r29 25484: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 25488: 0e 94 c1 6f call 0xdf82 ; 0xdf82 " %-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) )); 2548c: 8f ec ldi r24, 0xCF ; 207 2548e: 9e e0 ldi r25, 0x0E ; 14 25490: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 25494: 90 e0 ldi r25, 0x00 ; 0 25496: 0f 94 75 1e call 0x23cea ; 0x23cea 2549a: d8 2e mov r13, r24 2549c: c9 2e mov r12, r25 2549e: 84 ef ldi r24, 0xF4 ; 244 254a0: 99 e4 ldi r25, 0x49 ; 73 254a2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 254a6: f8 2e mov r15, r24 254a8: 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) ), 254aa: 82 ed ldi r24, 0xD2 ; 210 254ac: 9e e0 ldi r25, 0x0E ; 14 254ae: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 254b2: 90 e0 ldi r25, 0x00 ; 0 254b4: 0f 94 75 1e call 0x23cea ; 0x23cea 254b8: 18 2f mov r17, r24 254ba: 09 2f mov r16, r25 254bc: 88 ee ldi r24, 0xE8 ; 232 254be: 99 e4 ldi r25, 0x49 ; 73 254c0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 254c4: ec 01 movw r28, r24 254c6: 8b e3 ldi r24, 0x3B ; 59 254c8: 9a e4 ldi r25, 0x4A ; 74 254ca: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 254ce: cf 92 push r12 254d0: df 92 push r13 254d2: ef 92 push r14 254d4: ff 92 push r15 254d6: 0f 93 push r16 254d8: 1f 93 push r17 254da: df 93 push r29 254dc: cf 93 push r28 254de: 9f 93 push r25 254e0: 8f 93 push r24 254e2: 8e ef ldi r24, 0xFE ; 254 254e4: 90 ea ldi r25, 0xA0 ; 160 254e6: 9f 93 push r25 254e8: 8f 93 push r24 254ea: 0e 94 6e 6f call 0xdedc ; 0xdedc " %-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(); 254ee: 8d b7 in r24, 0x3d ; 61 254f0: 9e b7 in r25, 0x3e ; 62 254f2: 0c 96 adiw r24, 0x0c ; 12 254f4: 0f b6 in r0, 0x3f ; 63 254f6: f8 94 cli 254f8: 9e bf out 0x3e, r25 ; 62 254fa: 0f be out 0x3f, r0 ; 63 254fc: 8d bf out 0x3d, r24 ; 61 } 254fe: df 91 pop r29 25500: cf 91 pop r28 25502: 1f 91 pop r17 25504: 0f 91 pop r16 25506: ff 90 pop r15 25508: ef 90 pop r14 2550a: df 90 pop r13 2550c: 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(); 2550e: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00025512 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 25512: af 92 push r10 25514: bf 92 push r11 25516: cf 92 push r12 25518: df 92 push r13 2551a: ef 92 push r14 2551c: ff 92 push r15 2551e: 0f 93 push r16 25520: 1f 93 push r17 25522: cf 93 push r28 25524: df 93 push r29 25526: 00 d0 rcall .+0 ; 0x25528 25528: 00 d0 rcall .+0 ; 0x2552a 2552a: 1f 92 push r1 2552c: cd b7 in r28, 0x3d ; 61 2552e: 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)) || 25530: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 25534: 81 11 cpse r24, r1 25536: 18 c0 rjmp .+48 ; 0x25568 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))) || 25538: 81 ea ldi r24, 0xA1 ; 161 2553a: 9d e0 ldi r25, 0x0D ; 13 2553c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 25540: 18 2f mov r17, r24 25542: 0e 94 cc 77 call 0xef98 ; 0xef98 25546: 88 23 and r24, r24 25548: 79 f0 breq .+30 ; 0x25568 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 2554a: 80 e1 ldi r24, 0x10 ; 16 2554c: 0e 94 4b f9 call 0x1f296 ; 0x1f296 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))) || 25550: 88 23 and r24, r24 25552: 51 f0 breq .+20 ; 0x25568 (!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))))) 25554: 2b e0 ldi r18, 0x0B ; 11 25556: 12 9f mul r17, r18 25558: c0 01 movw r24, r0 2555a: 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 2555c: 80 5b subi r24, 0xB0 ; 176 2555e: 92 4f sbci r25, 0xF2 ; 242 25560: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e } 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)) || 25564: 89 2b or r24, r25 25566: f1 f4 brne .+60 ; 0x255a4 (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) 25568: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 2556c: 88 23 and r24, r24 2556e: 71 f0 breq .+28 ; 0x2558c { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 25570: 81 ea ldi r24, 0xA1 ; 161 25572: 9d e0 ldi r25, 0x0D ; 13 25574: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 25578: 2b e0 ldi r18, 0x0B ; 11 2557a: 82 9f mul r24, r18 2557c: c0 01 movw r24, r0 2557e: 11 24 eor r1, r1 25580: 6f ef ldi r22, 0xFF ; 255 25582: 7f ef ldi r23, 0xFF ; 255 25584: 80 5b subi r24, 0xB0 ; 176 25586: 92 4f sbci r25, 0xF2 ; 242 25588: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 } // 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()); 2558c: 0e 94 b2 71 call 0xe364 ; 0xe364 25590: 21 e0 ldi r18, 0x01 ; 1 25592: 81 11 cpse r24, r1 25594: 20 e0 ldi r18, 0x00 ; 0 25596: 41 e0 ldi r20, 0x01 ; 1 25598: 70 e0 ldi r23, 0x00 ; 0 2559a: 60 e0 ldi r22, 0x00 ; 0 2559c: 8c e9 ldi r24, 0x9C ; 156 2559e: 99 e3 ldi r25, 0x39 ; 57 255a0: 0f 94 3a cf call 0x39e74 ; 0x39e74 } if (lcd_encoder) { 255a4: 20 91 37 05 lds r18, 0x0537 ; 0x800537 255a8: 30 91 38 05 lds r19, 0x0538 ; 0x800538 255ac: 21 15 cp r18, r1 255ae: 31 05 cpc r19, r1 255b0: 59 f0 breq .+22 ; 0x255c8 menuData->reset = lcd_encoder > 0; 255b2: 81 e0 ldi r24, 0x01 ; 1 255b4: 12 16 cp r1, r18 255b6: 13 06 cpc r1, r19 255b8: 0c f0 brlt .+2 ; 0x255bc 255ba: 80 e0 ldi r24, 0x00 ; 0 255bc: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 lcd_encoder = 0; // Reset 255c0: 10 92 38 05 sts 0x0538, r1 ; 0x800538 255c4: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } char sheet_name[sizeof(Sheet::name)]; eeprom_read_block(sheet_name, &EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].name, sizeof(Sheet::name)); 255c8: 81 ea ldi r24, 0xA1 ; 161 255ca: 9d e0 ldi r25, 0x0D ; 13 255cc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 255d0: 1b e0 ldi r17, 0x0B ; 11 255d2: 81 9f mul r24, r17 255d4: b0 01 movw r22, r0 255d6: 11 24 eor r1, r1 255d8: 67 5b subi r22, 0xB7 ; 183 255da: 72 4f sbci r23, 0xF2 ; 242 255dc: 47 e0 ldi r20, 0x07 ; 7 255de: 50 e0 ldi r21, 0x00 ; 0 255e0: ce 01 movw r24, r28 255e2: 01 96 adiw r24, 0x01 ; 1 255e4: 7c 01 movw r14, r24 255e6: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 lcd_home(); 255ea: 0e 94 c1 6f call 0xdf82 ; 0xdf82 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]; 255ee: 81 ea ldi r24, 0xA1 ; 161 255f0: 9d e0 ldi r25, 0x0D ; 13 255f2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 255f6: 81 9f mul r24, r17 255f8: c0 01 movw r24, r0 255fa: 11 24 eor r1, r1 255fc: 80 5b subi r24, 0xB0 ; 176 255fe: 92 4f sbci r25, 0xF2 ; 242 25600: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 25604: bc 01 movw r22, r24 25606: 99 0f add r25, r25 25608: 88 0b sbc r24, r24 2560a: 99 0b sbc r25, r25 2560c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 25610: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 25614: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 25618: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 2561c: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 25620: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 25624: d6 2e mov r13, r22 25626: c7 2e mov r12, r23 25628: b8 2e mov r11, r24 2562a: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 2562c: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 25630: 0e e3 ldi r16, 0x3E ; 62 25632: 10 e2 ldi r17, 0x20 ; 32 25634: 81 11 cpse r24, r1 25636: 02 c0 rjmp .+4 ; 0x2563c 25638: 00 e2 ldi r16, 0x20 ; 32 2563a: 1e e3 ldi r17, 0x3E ; 62 2563c: 8b eb ldi r24, 0xBB ; 187 2563e: 9e e4 ldi r25, 0x4E ; 78 25640: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25644: 1f 92 push r1 25646: 0f 93 push r16 25648: 1f 92 push r1 2564a: 1f 93 push r17 2564c: af 92 push r10 2564e: bf 92 push r11 25650: cf 92 push r12 25652: df 92 push r13 25654: ff 92 push r15 25656: ef 92 push r14 25658: 9f 93 push r25 2565a: 8f 93 push r24 2565c: 0e 94 6e 6f call 0xdedc ; 0xdedc 25660: 0f b6 in r0, 0x3f ; 63 25662: f8 94 cli 25664: de bf out 0x3e, r29 ; 62 25666: 0f be out 0x3f, r0 ; 63 25668: 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. } 2566a: 27 96 adiw r28, 0x07 ; 7 2566c: 0f b6 in r0, 0x3f ; 63 2566e: f8 94 cli 25670: de bf out 0x3e, r29 ; 62 25672: 0f be out 0x3f, r0 ; 63 25674: cd bf out 0x3d, r28 ; 61 25676: df 91 pop r29 25678: cf 91 pop r28 2567a: 1f 91 pop r17 2567c: 0f 91 pop r16 2567e: ff 90 pop r15 25680: ef 90 pop r14 25682: df 90 pop r13 25684: cf 90 pop r12 25686: bf 90 pop r11 25688: af 90 pop r10 2568a: 08 95 ret 0002568c : //! |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() { 2568c: 2f 92 push r2 2568e: 3f 92 push r3 25690: 4f 92 push r4 25692: 5f 92 push r5 25694: 6f 92 push r6 25696: 7f 92 push r7 25698: 8f 92 push r8 2569a: 9f 92 push r9 2569c: af 92 push r10 2569e: bf 92 push r11 256a0: cf 92 push r12 256a2: df 92 push r13 256a4: ef 92 push r14 256a6: ff 92 push r15 256a8: 0f 93 push r16 256aa: 1f 93 push r17 256ac: cf 93 push r28 256ae: df 93 push r29 256b0: cd b7 in r28, 0x3d ; 61 256b2: de b7 in r29, 0x3e ; 62 256b4: a8 97 sbiw r28, 0x28 ; 40 256b6: 0f b6 in r0, 0x3f ; 63 256b8: f8 94 cli 256ba: de bf out 0x3e, r29 ; 62 256bc: 0f be out 0x3f, r0 ; 63 256be: 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); 256c0: 48 e0 ldi r20, 0x08 ; 8 256c2: 50 e0 ldi r21, 0x00 ; 0 256c4: 65 ee ldi r22, 0xE5 ; 229 256c6: 7f e0 ldi r23, 0x0F ; 15 256c8: ce 01 movw r24, r28 256ca: 41 96 adiw r24, 0x11 ; 17 256cc: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 256d0: 48 e0 ldi r20, 0x08 ; 8 256d2: 50 e0 ldi r21, 0x00 ; 0 256d4: 6d ed ldi r22, 0xDD ; 221 256d6: 7f e0 ldi r23, 0x0F ; 15 256d8: ce 01 movw r24, r28 256da: 09 96 adiw r24, 0x09 ; 9 256dc: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 256e0: 48 e0 ldi r20, 0x08 ; 8 256e2: 50 e0 ldi r21, 0x00 ; 0 256e4: 65 ed ldi r22, 0xD5 ; 213 256e6: 7f e0 ldi r23, 0x0F ; 15 256e8: ce 01 movw r24, r28 256ea: 01 96 adiw r24, 0x01 ; 1 256ec: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 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]; 256f0: 8d 84 ldd r8, Y+13 ; 0x0d 256f2: 9e 84 ldd r9, Y+14 ; 0x0e 256f4: af 84 ldd r10, Y+15 ; 0x0f 256f6: b8 88 ldd r11, Y+16 ; 0x10 256f8: ef e1 ldi r30, 0x1F ; 31 256fa: f2 e9 ldi r31, 0x92 ; 146 256fc: 25 91 lpm r18, Z+ 256fe: 35 91 lpm r19, Z+ 25700: 45 91 lpm r20, Z+ 25702: 54 91 lpm r21, Z 25704: cd 80 ldd r12, Y+5 ; 0x05 25706: de 80 ldd r13, Y+6 ; 0x06 25708: ef 80 ldd r14, Y+7 ; 0x07 2570a: f8 84 ldd r15, Y+8 ; 0x08 2570c: e3 e2 ldi r30, 0x23 ; 35 2570e: f2 e9 ldi r31, 0x92 ; 146 25710: 85 91 lpm r24, Z+ 25712: 95 91 lpm r25, Z+ 25714: a5 91 lpm r26, Z+ 25716: b4 91 lpm r27, Z 25718: 8d a3 std Y+37, r24 ; 0x25 2571a: 9e a3 std Y+38, r25 ; 0x26 2571c: af a3 std Y+39, r26 ; 0x27 2571e: b8 a7 std Y+40, r27 ; 0x28 25720: 8d 89 ldd r24, Y+21 ; 0x15 25722: 9e 89 ldd r25, Y+22 ; 0x16 25724: af 89 ldd r26, Y+23 ; 0x17 25726: b8 8d ldd r27, Y+24 ; 0x18 25728: 89 a3 std Y+33, r24 ; 0x21 2572a: 9a a3 std Y+34, r25 ; 0x22 2572c: ab a3 std Y+35, r26 ; 0x23 2572e: bc a3 std Y+36, r27 ; 0x24 25730: c5 01 movw r24, r10 25732: b4 01 movw r22, r8 25734: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 25738: 2b 01 movw r4, r22 2573a: 3c 01 movw r6, r24 2573c: 2d a1 ldd r18, Y+37 ; 0x25 2573e: 3e a1 ldd r19, Y+38 ; 0x26 25740: 4f a1 ldd r20, Y+39 ; 0x27 25742: 58 a5 ldd r21, Y+40 ; 0x28 25744: c7 01 movw r24, r14 25746: b6 01 movw r22, r12 25748: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2574c: 9b 01 movw r18, r22 2574e: ac 01 movw r20, r24 25750: c3 01 movw r24, r6 25752: b2 01 movw r22, r4 25754: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 25758: 29 a1 ldd r18, Y+33 ; 0x21 2575a: 3a a1 ldd r19, Y+34 ; 0x22 2575c: 4b a1 ldd r20, Y+35 ; 0x23 2575e: 5c a1 ldd r21, Y+36 ; 0x24 25760: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 25764: 20 e0 ldi r18, 0x00 ; 0 25766: 30 e0 ldi r19, 0x00 ; 0 25768: 40 e9 ldi r20, 0x90 ; 144 2576a: 50 e4 ldi r21, 0x40 ; 64 2576c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 25770: 1b 01 movw r2, r22 25772: 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]; 25774: e7 e2 ldi r30, 0x27 ; 39 25776: f2 e9 ldi r31, 0x92 ; 146 25778: 25 91 lpm r18, Z+ 2577a: 35 91 lpm r19, Z+ 2577c: 45 91 lpm r20, Z+ 2577e: 54 91 lpm r21, Z 25780: eb e2 ldi r30, 0x2B ; 43 25782: f2 e9 ldi r31, 0x92 ; 146 25784: 45 90 lpm r4, Z+ 25786: 55 90 lpm r5, Z+ 25788: 65 90 lpm r6, Z+ 2578a: 74 90 lpm r7, Z 2578c: c5 01 movw r24, r10 2578e: b4 01 movw r22, r8 25790: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 25794: 4b 01 movw r8, r22 25796: 5c 01 movw r10, r24 25798: a3 01 movw r20, r6 2579a: 92 01 movw r18, r4 2579c: c7 01 movw r24, r14 2579e: b6 01 movw r22, r12 257a0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 257a4: 9b 01 movw r18, r22 257a6: ac 01 movw r20, r24 257a8: c5 01 movw r24, r10 257aa: b4 01 movw r22, r8 257ac: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 257b0: 29 a1 ldd r18, Y+33 ; 0x21 257b2: 3a a1 ldd r19, Y+34 ; 0x22 257b4: 4b a1 ldd r20, Y+35 ; 0x23 257b6: 5c a1 ldd r21, Y+36 ; 0x24 257b8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 257bc: 20 e0 ldi r18, 0x00 ; 0 257be: 30 e0 ldi r19, 0x00 ; 0 257c0: 40 e9 ldi r20, 0x90 ; 144 257c2: 50 e4 ldi r21, 0x40 ; 64 257c4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 257c8: 6d 8f std Y+29, r22 ; 0x1d 257ca: 7e 8f std Y+30, r23 ; 0x1e 257cc: 8f 8f std Y+31, r24 ; 0x1f 257ce: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 257d0: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P(_N( 257d4: 8d eb ldi r24, 0xBD ; 189 257d6: 9c e4 ldi r25, 0x4C ; 76 257d8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 257dc: d8 2e mov r13, r24 257de: c9 2e mov r12, r25 257e0: 86 eb ldi r24, 0xB6 ; 182 257e2: 9c e4 ldi r25, 0x4C ; 76 257e4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 257e8: f8 2e mov r15, r24 257ea: e9 2e mov r14, r25 257ec: 80 ea ldi r24, 0xA0 ; 160 257ee: 9c e4 ldi r25, 0x4C ; 76 257f0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 257f4: cf 92 push r12 257f6: df 92 push r13 257f8: ef 92 push r14 257fa: ff 92 push r15 257fc: 2a e1 ldi r18, 0x1A ; 26 257fe: 3c e8 ldi r19, 0x8C ; 140 25800: 3f 93 push r19 25802: 2f 93 push r18 25804: 9f 93 push r25 25806: 8f 93 push r24 25808: 85 ed ldi r24, 0xD5 ; 213 2580a: 9f e6 ldi r25, 0x6F ; 111 2580c: 9f 93 push r25 2580e: 8f 93 push r24 25810: 0e 94 6e 6f call 0xdedc ; 0xdedc _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 25814: 62 e0 ldi r22, 0x02 ; 2 25816: 8b e0 ldi r24, 0x0B ; 11 25818: 0e 94 95 6f call 0xdf2a ; 0xdf2a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 2581c: 0f b6 in r0, 0x3f ; 63 2581e: f8 94 cli 25820: de bf out 0x3e, r29 ; 62 25822: 0f be out 0x3f, r0 ; 63 25824: cd bf out 0x3d, r28 ; 61 25826: 20 e0 ldi r18, 0x00 ; 0 25828: 30 e0 ldi r19, 0x00 ; 0 2582a: 48 e4 ldi r20, 0x48 ; 72 2582c: 53 e4 ldi r21, 0x43 ; 67 2582e: 62 2d mov r22, r2 25830: 73 2d mov r23, r3 25832: 80 2f mov r24, r16 25834: 91 2f mov r25, r17 25836: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 2583a: 87 ff sbrs r24, 7 2583c: 51 c0 rjmp .+162 ; 0x258e0 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 2583e: 1f 93 push r17 25840: 0f 93 push r16 25842: 3f 92 push r3 25844: 2f 92 push r2 25846: 8d ec ldi r24, 0xCD ; 205 25848: 9f e6 ldi r25, 0x6F ; 111 2584a: 9f 93 push r25 2584c: 8f 93 push r24 2584e: 0e 94 6e 6f call 0xdedc ; 0xdedc 25852: 0f 90 pop r0 25854: 0f 90 pop r0 25856: 0f 90 pop r0 25858: 0f 90 pop r0 2585a: 0f 90 pop r0 2585c: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 2585e: 63 e0 ldi r22, 0x03 ; 3 25860: 8b e0 ldi r24, 0x0B ; 11 25862: 0e 94 95 6f call 0xdf2a ; 0xdf2a if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 25866: 1d 8d ldd r17, Y+29 ; 0x1d 25868: 0e 8d ldd r16, Y+30 ; 0x1e 2586a: ff 8c ldd r15, Y+31 ; 0x1f 2586c: e8 a0 ldd r14, Y+32 ; 0x20 2586e: 20 e0 ldi r18, 0x00 ; 0 25870: 30 e0 ldi r19, 0x00 ; 0 25872: 48 e4 ldi r20, 0x48 ; 72 25874: 53 e4 ldi r21, 0x43 ; 67 25876: d8 01 movw r26, r16 25878: f7 01 movw r30, r14 2587a: 6b 2f mov r22, r27 2587c: 7a 2f mov r23, r26 2587e: 8f 2f mov r24, r31 25880: 9e 2f mov r25, r30 25882: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 25886: 87 fd sbrc r24, 7 25888: 32 c0 rjmp .+100 ; 0x258ee 2588a: 87 e0 ldi r24, 0x07 ; 7 2588c: 9d e3 ldi r25, 0x3D ; 61 2588e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25892: 0e 94 80 6f call 0xdf00 ; 0xdf00 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 25896: 0e 94 b2 71 call 0xe364 ; 0xe364 2589a: 88 23 and r24, r24 2589c: 41 f0 breq .+16 ; 0x258ae menu_goto(lcd_menu_xyz_skew, 0, true); 2589e: 20 e0 ldi r18, 0x00 ; 0 258a0: 41 e0 ldi r20, 0x01 ; 1 258a2: 70 e0 ldi r23, 0x00 ; 0 258a4: 60 e0 ldi r22, 0x00 ; 0 258a6: 86 ef ldi r24, 0xF6 ; 246 258a8: 99 e3 ldi r25, 0x39 ; 57 258aa: 0f 94 3a cf call 0x39e74 ; 0x39e74 } 258ae: a8 96 adiw r28, 0x28 ; 40 258b0: 0f b6 in r0, 0x3f ; 63 258b2: f8 94 cli 258b4: de bf out 0x3e, r29 ; 62 258b6: 0f be out 0x3f, r0 ; 63 258b8: cd bf out 0x3d, r28 ; 61 258ba: df 91 pop r29 258bc: cf 91 pop r28 258be: 1f 91 pop r17 258c0: 0f 91 pop r16 258c2: ff 90 pop r15 258c4: ef 90 pop r14 258c6: df 90 pop r13 258c8: cf 90 pop r12 258ca: bf 90 pop r11 258cc: af 90 pop r10 258ce: 9f 90 pop r9 258d0: 8f 90 pop r8 258d2: 7f 90 pop r7 258d4: 6f 90 pop r6 258d6: 5f 90 pop r5 258d8: 4f 90 pop r4 258da: 3f 90 pop r3 258dc: 2f 90 pop r2 258de: 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)); 258e0: 87 e0 ldi r24, 0x07 ; 7 258e2: 9d e3 ldi r25, 0x3D ; 61 258e4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 258e8: 0e 94 80 6f call 0xdf00 ; 0xdf00 258ec: b8 cf rjmp .-144 ; 0x2585e else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 258ee: ef 92 push r14 258f0: ff 92 push r15 258f2: 0f 93 push r16 258f4: 1f 93 push r17 258f6: 8d ec ldi r24, 0xCD ; 205 258f8: 9f e6 ldi r25, 0x6F ; 111 258fa: 9f 93 push r25 258fc: 8f 93 push r24 258fe: 0e 94 6e 6f call 0xdedc ; 0xdedc 25902: 0f 90 pop r0 25904: 0f 90 pop r0 25906: 0f 90 pop r0 25908: 0f 90 pop r0 2590a: 0f 90 pop r0 2590c: 0f 90 pop r0 2590e: c3 cf rjmp .-122 ; 0x25896 00025910 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 25910: 86 e3 ldi r24, 0x36 ; 54 25912: 9f e6 ldi r25, 0x6F ; 111 25914: 0c 94 06 7b jmp 0xf60c ; 0xf60c 00025918 : * 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) { 25918: af 92 push r10 2591a: bf 92 push r11 2591c: cf 92 push r12 2591e: df 92 push r13 25920: ef 92 push r14 25922: ff 92 push r15 25924: 0f 93 push r16 25926: 1f 93 push r17 25928: cf 93 push r28 2592a: df 93 push r29 2592c: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 2592e: 0e 94 49 6f call 0xde92 ; 0xde92 * @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; 25932: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 25934: 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; 25936: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 25938: 6f 2d mov r22, r15 2593a: 80 e0 ldi r24, 0x00 ; 0 2593c: 0e 94 95 6f call 0xdf2a ; 0xdf2a // 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) 25940: c6 01 movw r24, r12 25942: 0f 94 66 1e call 0x23ccc ; 0x23ccc 25946: 88 23 and r24, r24 25948: 29 f0 breq .+10 ; 0x25954 2594a: 8f ef ldi r24, 0xFF ; 255 2594c: c8 1a sub r12, r24 2594e: d8 0a sbc r13, r24 25950: 09 f4 brne .+2 ; 0x25954 25952: 49 c0 rjmp .+146 ; 0x259e6 25954: c6 01 movw r24, r12 25956: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 2595a: 84 31 cpi r24, 0x14 ; 20 2595c: 91 05 cpc r25, r1 2595e: 10 f0 brcs .+4 ; 0x25964 25960: 84 e1 ldi r24, 0x14 ; 20 25962: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 25964: e6 01 movw r28, r12 25966: c8 0f add r28, r24 25968: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 2596a: e3 e0 ldi r30, 0x03 ; 3 2596c: fe 12 cpse r15, r30 2596e: 0a c0 rjmp .+20 ; 0x25984 25970: 84 31 cpi r24, 0x14 ; 20 25972: 41 f4 brne .+16 ; 0x25984 // 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; 25974: fe 01 movw r30, r28 25976: 84 91 lpm r24, Z 25978: e1 2c mov r14, r1 if (multi_screen) 2597a: 88 23 and r24, r24 2597c: 19 f0 breq .+6 ; 0x25984 msgend = (msgend2 -= 2); 2597e: 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; 25980: ee 24 eor r14, r14 25982: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 25984: fe 01 movw r30, r28 25986: 84 91 lpm r24, Z 25988: 88 23 and r24, r24 2598a: 09 f4 brne .+2 ; 0x2598e 2598c: 40 c0 rjmp .+128 ; 0x25a0e 2598e: ce 01 movw r24, r28 25990: 0f 94 66 1e call 0x23ccc ; 0x23ccc 25994: 81 11 cpse r24, r1 25996: 3b c0 rjmp .+118 ; 0x25a0e 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); 25998: fe 01 movw r30, r28 2599a: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 2599c: 92 ed ldi r25, 0xD2 ; 210 2599e: 98 0f add r25, r24 259a0: 92 30 cpi r25, 0x02 ; 2 259a2: a8 f1 brcs .+106 ; 0x25a0e 259a4: 8c 32 cpi r24, 0x2C ; 44 259a6: 99 f1 breq .+102 ; 0x25a0e 259a8: 96 ec ldi r25, 0xC6 ; 198 259aa: 98 0f add r25, r24 259ac: 92 30 cpi r25, 0x02 ; 2 259ae: 78 f1 brcs .+94 ; 0x25a0e 259b0: 8f 33 cpi r24, 0x3F ; 63 259b2: 69 f1 breq .+90 ; 0x25a0e 259b4: 81 32 cpi r24, 0x21 ; 33 259b6: 59 f1 breq .+86 ; 0x25a0e 259b8: 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)) 259ba: c0 16 cp r12, r16 259bc: d1 06 cpc r13, r17 259be: 58 f4 brcc .+22 ; 0x259d6 259c0: 58 01 movw r10, r16 259c2: f1 e0 ldi r31, 0x01 ; 1 259c4: af 1a sub r10, r31 259c6: b1 08 sbc r11, r1 259c8: c5 01 movw r24, r10 259ca: 0f 94 66 1e call 0x23ccc ; 0x23ccc 259ce: 81 11 cpse r24, r1 259d0: 1d c0 rjmp .+58 ; 0x25a0c -- msgend; 259d2: 85 01 movw r16, r10 259d4: f2 cf rjmp .-28 ; 0x259ba if (msgend == msg) 259d6: c0 16 cp r12, r16 259d8: d1 06 cpc r13, r17 259da: c9 f0 breq .+50 ; 0x25a0e 259dc: 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) { 259de: f3 94 inc r15 259e0: 84 e0 ldi r24, 0x04 ; 4 259e2: f8 12 cpse r15, r24 259e4: a9 cf rjmp .-174 ; 0x25938 } lcd_print(c); } } if (multi_screen) { 259e6: ee 20 and r14, r14 259e8: f9 f0 breq .+62 ; 0x25a28 // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 259ea: 48 e8 ldi r20, 0x88 ; 136 259ec: 63 e0 ldi r22, 0x03 ; 3 259ee: 83 e1 ldi r24, 0x13 ; 19 259f0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a } return multi_screen ? msgend : NULL; } 259f4: ce 01 movw r24, r28 259f6: df 91 pop r29 259f8: cf 91 pop r28 259fa: 1f 91 pop r17 259fc: 0f 91 pop r16 259fe: ff 90 pop r15 25a00: ef 90 pop r14 25a02: df 90 pop r13 25a04: cf 90 pop r12 25a06: bf 90 pop r11 25a08: af 90 pop r10 25a0a: 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)) 25a0c: 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) { 25a0e: cc 16 cp r12, r28 25a10: dd 06 cpc r13, r29 25a12: 28 f7 brcc .-54 ; 0x259de char c = char(pgm_read_byte(msg)); 25a14: f6 01 movw r30, r12 25a16: 84 91 lpm r24, Z if (c == '\n') { 25a18: 8a 30 cpi r24, 0x0A ; 10 25a1a: 09 f3 breq .-62 ; 0x259de 25a1c: 0e 94 44 70 call 0xe088 ; 0xe088 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 25a20: ff ef ldi r31, 0xFF ; 255 25a22: cf 1a sub r12, r31 25a24: df 0a sbc r13, r31 25a26: f3 cf rjmp .-26 ; 0x25a0e if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 25a28: d0 e0 ldi r29, 0x00 ; 0 25a2a: c0 e0 ldi r28, 0x00 ; 0 25a2c: e3 cf rjmp .-58 ; 0x259f4 00025a2e : } #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)); 25a2e: 83 ef ldi r24, 0xF3 ; 243 25a30: 9b e4 ldi r25, 0x4B ; 75 25a32: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25a36: 0f 94 8c 2c call 0x25918 ; 0x25918 menu_back_if_clicked(); 25a3a: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00025a3e : } _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(); 25a3e: 0e 94 23 78 call 0xf046 ; 0xf046 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 25a42: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 } 25a46: 08 95 ret 00025a48 : //! |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() { 25a48: cf 93 push r28 25a4a: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 25a4c: 81 ef ldi r24, 0xF1 ; 241 25a4e: 9c e4 ldi r25, 0x4C ; 76 25a50: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25a54: ac 01 movw r20, r24 25a56: 60 e0 ldi r22, 0x00 ; 0 25a58: 80 e0 ldi r24, 0x00 ; 0 25a5a: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 1, STR_SEPARATOR); 25a5e: 4a e1 ldi r20, 0x1A ; 26 25a60: 5c e8 ldi r21, 0x8C ; 140 25a62: 61 e0 ldi r22, 0x01 ; 1 25a64: 80 e0 ldi r24, 0x00 ; 0 25a66: 0e 94 a9 6f call 0xdf52 ; 0xdf52 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 25a6a: 62 e0 ldi r22, 0x02 ; 2 25a6c: 80 e0 ldi r24, 0x00 ; 0 25a6e: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25a72: 85 ee ldi r24, 0xE5 ; 229 25a74: 9f e0 ldi r25, 0x0F ; 15 25a76: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 25a7a: 9f 93 push r25 25a7c: 8f 93 push r24 25a7e: 7f 93 push r23 25a80: 6f 93 push r22 25a82: 1f 92 push r1 25a84: 88 e5 ldi r24, 0x58 ; 88 25a86: 8f 93 push r24 25a88: c2 eb ldi r28, 0xB2 ; 178 25a8a: d3 ea ldi r29, 0xA3 ; 163 25a8c: df 93 push r29 25a8e: cf 93 push r28 25a90: 0e 94 6e 6f call 0xdedc ; 0xdedc { 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); 25a94: 63 e0 ldi r22, 0x03 ; 3 25a96: 80 e0 ldi r24, 0x00 ; 0 25a98: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 25a9c: 89 ee ldi r24, 0xE9 ; 233 25a9e: 9f e0 ldi r25, 0x0F ; 15 25aa0: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 25aa4: 9f 93 push r25 25aa6: 8f 93 push r24 25aa8: 7f 93 push r23 25aaa: 6f 93 push r22 25aac: 1f 92 push r1 25aae: 89 e5 ldi r24, 0x59 ; 89 25ab0: 8f 93 push r24 25ab2: df 93 push r29 25ab4: cf 93 push r28 25ab6: 0e 94 6e 6f call 0xdedc ; 0xdedc } menu_back_if_clicked(); 25aba: 8d b7 in r24, 0x3d ; 61 25abc: 9e b7 in r25, 0x3e ; 62 25abe: 40 96 adiw r24, 0x10 ; 16 25ac0: 0f b6 in r0, 0x3f ; 63 25ac2: f8 94 cli 25ac4: 9e bf out 0x3e, r25 ; 62 25ac6: 0f be out 0x3f, r0 ; 63 25ac8: 8d bf out 0x3d, r24 ; 61 } 25aca: df 91 pop r29 25acc: 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(); 25ace: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00025ad2 : //! ---------------------- //! 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() { 25ad2: cf 92 push r12 25ad4: df 92 push r13 25ad6: ef 92 push r14 25ad8: ff 92 push r15 25ada: 0f 93 push r16 25adc: 1f 93 push r17 25ade: cf 93 push r28 25ae0: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 25ae2: 80 e6 ldi r24, 0x60 ; 96 25ae4: 9f e0 ldi r25, 0x0F ; 15 25ae6: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 25aea: 6b 01 movw r12, r22 25aec: 7c 01 movw r14, r24 lcd_home(); 25aee: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P(_N( 25af2: 83 ee ldi r24, 0xE3 ; 227 25af4: 9c e4 ldi r25, 0x4C ; 76 25af6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25afa: 18 2f mov r17, r24 25afc: 09 2f mov r16, r25 25afe: 85 ed ldi r24, 0xD5 ; 213 25b00: 9c e4 ldi r25, 0x4C ; 76 25b02: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25b06: ec 01 movw r28, r24 25b08: 85 ec ldi r24, 0xC5 ; 197 25b0a: 9c e4 ldi r25, 0x4C ; 76 25b0c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25b10: 2e e3 ldi r18, 0x3E ; 62 25b12: 2f 93 push r18 25b14: 20 e8 ldi r18, 0x80 ; 128 25b16: 2f 93 push r18 25b18: 1f 92 push r1 25b1a: 1f 92 push r1 25b1c: 0f 93 push r16 25b1e: 1f 93 push r17 25b20: 2d e3 ldi r18, 0x3D ; 61 25b22: 2f 93 push r18 25b24: 25 ef ldi r18, 0xF5 ; 245 25b26: 2f 93 push r18 25b28: 22 ec ldi r18, 0xC2 ; 194 25b2a: 2f 93 push r18 25b2c: 20 e9 ldi r18, 0x90 ; 144 25b2e: 2f 93 push r18 25b30: df 93 push r29 25b32: cf 93 push r28 25b34: 2a e1 ldi r18, 0x1A ; 26 25b36: 3c e8 ldi r19, 0x8C ; 140 25b38: 3f 93 push r19 25b3a: 2f 93 push r18 25b3c: 9f 93 push r25 25b3e: 8f 93 push r24 25b40: 8a ee ldi r24, 0xEA ; 234 25b42: 9f e6 ldi r25, 0x6F ; 111 25b44: 9f 93 push r25 25b46: 8f 93 push r24 25b48: 0e 94 6e 6f call 0xdedc ; 0xdedc _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); 25b4c: 60 e0 ldi r22, 0x00 ; 0 25b4e: 8f e0 ldi r24, 0x0F ; 15 25b50: 0e 94 95 6f call 0xdf2a ; 0xdf2a if (angleDiff < 100){ 25b54: 8d b7 in r24, 0x3d ; 61 25b56: 9e b7 in r25, 0x3e ; 62 25b58: 42 96 adiw r24, 0x12 ; 18 25b5a: 0f b6 in r0, 0x3f ; 63 25b5c: f8 94 cli 25b5e: 9e bf out 0x3e, r25 ; 62 25b60: 0f be out 0x3f, r0 ; 63 25b62: 8d bf out 0x3d, r24 ; 61 25b64: 20 e0 ldi r18, 0x00 ; 0 25b66: 30 e0 ldi r19, 0x00 ; 0 25b68: 48 ec ldi r20, 0xC8 ; 200 25b6a: 52 e4 ldi r21, 0x42 ; 66 25b6c: c7 01 movw r24, r14 25b6e: b6 01 movw r22, r12 25b70: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 25b74: 87 ff sbrs r24, 7 25b76: 32 c0 rjmp .+100 ; 0x25bdc } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 25b78: 20 e0 ldi r18, 0x00 ; 0 25b7a: 30 e0 ldi r19, 0x00 ; 0 25b7c: 44 e3 ldi r20, 0x34 ; 52 25b7e: 53 e4 ldi r21, 0x43 ; 67 25b80: c7 01 movw r24, r14 25b82: b6 01 movw r22, r12 25b84: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 25b88: 2b ed ldi r18, 0xDB ; 219 25b8a: 3f e0 ldi r19, 0x0F ; 15 25b8c: 49 e4 ldi r20, 0x49 ; 73 25b8e: 50 e4 ldi r21, 0x40 ; 64 25b90: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__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)); 25b94: 9f 93 push r25 25b96: 8f 93 push r24 25b98: 7f 93 push r23 25b9a: 6f 93 push r22 25b9c: 83 ee ldi r24, 0xE3 ; 227 25b9e: 9f e6 ldi r25, 0x6F ; 111 25ba0: 9f 93 push r25 25ba2: 8f 93 push r24 25ba4: 0e 94 6e 6f call 0xdedc ; 0xdedc 25ba8: 0f 90 pop r0 25baa: 0f 90 pop r0 25bac: 0f 90 pop r0 25bae: 0f 90 pop r0 25bb0: 0f 90 pop r0 25bb2: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 25bb4: 0e 94 b2 71 call 0xe364 ; 0xe364 25bb8: 88 23 and r24, r24 25bba: b9 f0 breq .+46 ; 0x25bea menu_goto(lcd_menu_xyz_offset, 0, true); 25bbc: 20 e0 ldi r18, 0x00 ; 0 25bbe: 41 e0 ldi r20, 0x01 ; 1 25bc0: 70 e0 ldi r23, 0x00 ; 0 25bc2: 60 e0 ldi r22, 0x00 ; 0 25bc4: 82 e9 ldi r24, 0x92 ; 146 25bc6: 9a e3 ldi r25, 0x3A ; 58 } 25bc8: df 91 pop r29 25bca: cf 91 pop r28 25bcc: 1f 91 pop r17 25bce: 0f 91 pop r16 25bd0: ff 90 pop r15 25bd2: ef 90 pop r14 25bd4: df 90 pop r13 25bd6: 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); 25bd8: 0d 94 3a cf jmp 0x39e74 ; 0x39e74 ); 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)); 25bdc: 87 e0 ldi r24, 0x07 ; 7 25bde: 9d e3 ldi r25, 0x3D ; 61 25be0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25be4: 0e 94 80 6f call 0xdf00 ; 0xdf00 25be8: e5 cf rjmp .-54 ; 0x25bb4 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 25bea: df 91 pop r29 25bec: cf 91 pop r28 25bee: 1f 91 pop r17 25bf0: 0f 91 pop r16 25bf2: ff 90 pop r15 25bf4: ef 90 pop r14 25bf6: df 90 pop r13 25bf8: cf 90 pop r12 25bfa: 08 95 ret 00025bfc <_lcd_move(char const*, unsigned char, int, int)>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 25bfc: 2f 92 push r2 25bfe: 3f 92 push r3 25c00: 4f 92 push r4 25c02: 5f 92 push r5 25c04: 6f 92 push r6 25c06: 7f 92 push r7 25c08: 9f 92 push r9 25c0a: af 92 push r10 25c0c: bf 92 push r11 25c0e: cf 92 push r12 25c10: df 92 push r13 25c12: ef 92 push r14 25c14: ff 92 push r15 25c16: 0f 93 push r16 25c18: 1f 93 push r17 25c1a: cf 93 push r28 25c1c: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 25c1e: 70 91 58 0e lds r23, 0x0E58 ; 0x800e58 25c22: 71 11 cpse r23, r1 25c24: 04 c0 rjmp .+8 ; 0x25c2e <_lcd_move(char const*, unsigned char, int, int)+0x32> 25c26: 70 91 59 0e lds r23, 0x0E59 ; 0x800e59 25c2a: 77 23 and r23, r23 25c2c: 99 f0 breq .+38 ; 0x25c54 <_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(); } 25c2e: df 91 pop r29 25c30: cf 91 pop r28 25c32: 1f 91 pop r17 25c34: 0f 91 pop r16 25c36: ff 90 pop r15 25c38: ef 90 pop r14 25c3a: df 90 pop r13 25c3c: cf 90 pop r12 25c3e: bf 90 pop r11 25c40: af 90 pop r10 25c42: 9f 90 pop r9 25c44: 7f 90 pop r7 25c46: 6f 90 pop r6 25c48: 5f 90 pop r5 25c4a: 4f 90 pop r4 25c4c: 3f 90 pop r3 25c4e: 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(); 25c50: 0d 94 d8 d1 jmp 0x3a3b0 ; 0x3a3b0 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) 25c54: 70 91 a9 03 lds r23, 0x03A9 ; 0x8003a9 25c58: 71 11 cpse r23, r1 25c5a: 09 c0 rjmp .+18 ; 0x25c6e <_lcd_move(char const*, unsigned char, int, int)+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 25c5c: 70 91 8f 02 lds r23, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> check_endstops = check; 25c60: 10 92 8f 02 sts 0x028F, r1 ; 0x80028f <_ZL14check_endstops.lto_priv.389> { _md->endstopsEnabledPrevious = enable_endstops(false); 25c64: 70 93 aa 03 sts 0x03AA, r23 ; 0x8003aa _md->initialized = true; 25c68: 71 e0 ldi r23, 0x01 ; 1 25c6a: 70 93 a9 03 sts 0x03A9, r23 ; 0x8003a9 25c6e: 19 01 movw r2, r18 25c70: 6a 01 movw r12, r20 25c72: c6 2f mov r28, r22 25c74: d9 2f mov r29, r25 25c76: 98 2e mov r9, r24 } if (lcd_encoder != 0) 25c78: 80 91 37 05 lds r24, 0x0537 ; 0x800537 25c7c: 90 91 38 05 lds r25, 0x0538 ; 0x800538 25c80: 89 2b or r24, r25 25c82: 09 f4 brne .+2 ; 0x25c86 <_lcd_move(char const*, unsigned char, int, int)+0x8a> 25c84: 71 c0 rjmp .+226 ; 0x25d68 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { refresh_cmd_timeout(); 25c86: 0e 94 78 67 call 0xcef0 ; 0xcef0 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; 25c8a: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 if (++ next_block_index == BLOCK_BUFFER_SIZE) 25c8e: 8f 5f subi r24, 0xFF ; 255 25c90: 80 31 cpi r24, 0x10 ; 16 25c92: 09 f4 brne .+2 ; 0x25c96 <_lcd_move(char const*, unsigned char, int, int)+0x9a> next_block_index = 0; 25c94: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 25c96: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 if (! planner_queue_full()) 25c9a: 98 17 cp r25, r24 25c9c: 09 f4 brne .+2 ; 0x25ca0 <_lcd_move(char const*, unsigned char, int, int)+0xa4> 25c9e: 64 c0 rjmp .+200 ; 0x25d68 <_lcd_move(char const*, unsigned char, int, int)+0x16c> { current_position[axis] += lcd_encoder; 25ca0: 84 e0 ldi r24, 0x04 ; 4 25ca2: c8 9f mul r28, r24 25ca4: 80 01 movw r16, r0 25ca6: 11 24 eor r1, r1 25ca8: f8 01 movw r30, r16 25caa: ed 5b subi r30, 0xBD ; 189 25cac: f8 4f sbci r31, 0xF8 ; 248 25cae: 5f 01 movw r10, r30 25cb0: 60 91 37 05 lds r22, 0x0537 ; 0x800537 25cb4: 70 91 38 05 lds r23, 0x0538 ; 0x800538 25cb8: 07 2e mov r0, r23 25cba: 00 0c add r0, r0 25cbc: 88 0b sbc r24, r24 25cbe: 99 0b sbc r25, r25 25cc0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 25cc4: f5 01 movw r30, r10 25cc6: 20 81 ld r18, Z 25cc8: 31 81 ldd r19, Z+1 ; 0x01 25cca: 42 81 ldd r20, Z+2 ; 0x02 25ccc: 53 81 ldd r21, Z+3 ; 0x03 25cce: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 25cd2: 2b 01 movw r4, r22 25cd4: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25cd6: b6 01 movw r22, r12 25cd8: dd 0c add r13, r13 25cda: 88 0b sbc r24, r24 25cdc: 99 0b sbc r25, r25 25cde: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 25ce2: 6b 01 movw r12, r22 25ce4: 7c 01 movw r14, r24 25ce6: ac 01 movw r20, r24 25ce8: 9b 01 movw r18, r22 25cea: c3 01 movw r24, r6 25cec: b2 01 movw r22, r4 25cee: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 25cf2: f5 01 movw r30, r10 25cf4: 87 fd sbrc r24, 7 25cf6: 7d c0 rjmp .+250 ; 0x25df2 <_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; 25cf8: 40 82 st Z, r4 25cfa: 51 82 std Z+1, r5 ; 0x01 25cfc: 62 82 std Z+2, r6 ; 0x02 25cfe: 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; 25d00: b1 01 movw r22, r2 25d02: 33 0c add r3, r3 25d04: 88 0b sbc r24, r24 25d06: 99 0b sbc r25, r25 25d08: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 25d0c: 2b 01 movw r4, r22 25d0e: 3c 01 movw r6, r24 25d10: c8 01 movw r24, r16 25d12: 8d 5b subi r24, 0xBD ; 189 25d14: 98 4f sbci r25, 0xF8 ; 248 25d16: 7c 01 movw r14, r24 25d18: a3 01 movw r20, r6 25d1a: 92 01 movw r18, r4 25d1c: fc 01 movw r30, r24 25d1e: 60 81 ld r22, Z 25d20: 71 81 ldd r23, Z+1 ; 0x01 25d22: 82 81 ldd r24, Z+2 ; 0x02 25d24: 93 81 ldd r25, Z+3 ; 0x03 25d26: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 25d2a: 18 16 cp r1, r24 25d2c: 2c f4 brge .+10 ; 0x25d38 <_lcd_move(char const*, unsigned char, int, int)+0x13c> 25d2e: f7 01 movw r30, r14 25d30: 40 82 st Z, r4 25d32: 51 82 std Z+1, r5 ; 0x01 25d34: 62 82 std Z+2, r6 ; 0x02 25d36: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 25d38: 10 92 38 05 sts 0x0538, r1 ; 0x800538 25d3c: 10 92 37 05 sts 0x0537, r1 ; 0x800537 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 25d40: 67 e4 ldi r22, 0x47 ; 71 25d42: 77 e0 ldi r23, 0x07 ; 7 25d44: 83 e4 ldi r24, 0x43 ; 67 25d46: 97 e0 ldi r25, 0x07 ; 7 25d48: 0e 94 5f 6b call 0xd6be ; 0xd6be plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 25d4c: f8 01 movw r30, r16 25d4e: e5 50 subi r30, 0x05 ; 5 25d50: fd 4f sbci r31, 0xFD ; 253 25d52: 60 81 ld r22, Z 25d54: 71 81 ldd r23, Z+1 ; 0x01 25d56: 82 81 ldd r24, Z+2 ; 0x02 25d58: 93 81 ldd r25, Z+3 ; 0x03 25d5a: 0e 94 7c 67 call 0xcef8 ; 0xcef8 25d5e: 0f 94 93 ba call 0x37526 ; 0x37526 lcd_draw_update = 1; 25d62: 81 e0 ldi r24, 0x01 ; 1 25d64: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 25d68: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 25d6c: 88 23 and r24, r24 25d6e: 11 f1 breq .+68 ; 0x25db4 <_lcd_move(char const*, unsigned char, int, int)+0x1b8> { lcd_set_cursor(0, 1); 25d70: 61 e0 ldi r22, 0x01 ; 1 25d72: 80 e0 ldi r24, 0x00 ; 0 25d74: 0e 94 95 6f call 0xdf2a ; 0xdf2a menu_draw_float31(name, current_position[axis]); 25d78: 84 e0 ldi r24, 0x04 ; 4 25d7a: c8 9f mul r28, r24 25d7c: f0 01 movw r30, r0 25d7e: 11 24 eor r1, r1 25d80: ed 5b subi r30, 0xBD ; 189 25d82: 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); 25d84: 83 81 ldd r24, Z+3 ; 0x03 25d86: 8f 93 push r24 25d88: 82 81 ldd r24, Z+2 ; 0x02 25d8a: 8f 93 push r24 25d8c: 81 81 ldd r24, Z+1 ; 0x01 25d8e: 8f 93 push r24 25d90: 80 81 ld r24, Z 25d92: 8f 93 push r24 25d94: df 93 push r29 25d96: 9f 92 push r9 25d98: 89 e9 ldi r24, 0x99 ; 153 25d9a: 93 ea ldi r25, 0xA3 ; 163 25d9c: 9f 93 push r25 25d9e: 8f 93 push r24 25da0: 0e 94 6e 6f call 0xdedc ; 0xdedc 25da4: ed b7 in r30, 0x3d ; 61 25da6: fe b7 in r31, 0x3e ; 62 25da8: 38 96 adiw r30, 0x08 ; 8 25daa: 0f b6 in r0, 0x3f ; 63 25dac: f8 94 cli 25dae: fe bf out 0x3e, r31 ; 62 25db0: 0f be out 0x3f, r0 ; 63 25db2: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 25db4: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 25db8: 81 11 cpse r24, r1 25dba: 04 c0 rjmp .+8 ; 0x25dc4 <_lcd_move(char const*, unsigned char, int, int)+0x1c8> 25dbc: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 25dc0: 88 23 and r24, r24 25dc2: 21 f0 breq .+8 ; 0x25dcc <_lcd_move(char const*, unsigned char, int, int)+0x1d0> 25dc4: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 25dc8: 80 93 8f 02 sts 0x028F, r24 ; 0x80028f <_ZL14check_endstops.lto_priv.389> menu_back_if_clicked(); } 25dcc: df 91 pop r29 25dce: cf 91 pop r28 25dd0: 1f 91 pop r17 25dd2: 0f 91 pop r16 25dd4: ff 90 pop r15 25dd6: ef 90 pop r14 25dd8: df 90 pop r13 25dda: cf 90 pop r12 25ddc: bf 90 pop r11 25dde: af 90 pop r10 25de0: 9f 90 pop r9 25de2: 7f 90 pop r7 25de4: 6f 90 pop r6 25de6: 5f 90 pop r5 25de8: 4f 90 pop r4 25dea: 3f 90 pop r3 25dec: 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(); 25dee: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 25df2: c0 82 st Z, r12 25df4: d1 82 std Z+1, r13 ; 0x01 25df6: e2 82 std Z+2, r14 ; 0x02 25df8: f3 82 std Z+3, r15 ; 0x03 25dfa: 82 cf rjmp .-252 ; 0x25d00 <_lcd_move(char const*, unsigned char, int, int)+0x104> 00025dfc : } // 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); 25dfc: 2f ef ldi r18, 0xFF ; 255 25dfe: 30 e0 ldi r19, 0x00 ; 0 25e00: 50 e0 ldi r21, 0x00 ; 0 25e02: 40 e0 ldi r20, 0x00 ; 0 25e04: 60 e0 ldi r22, 0x00 ; 0 25e06: 8d eb ldi r24, 0xBD ; 189 25e08: 93 ea ldi r25, 0xA3 ; 163 25e0a: 0d 94 fe 2d jmp 0x25bfc ; 0x25bfc <_lcd_move(char const*, unsigned char, int, int)> 00025e0e : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 25e0e: 24 ed ldi r18, 0xD4 ; 212 25e10: 30 e0 ldi r19, 0x00 ; 0 25e12: 4c ef ldi r20, 0xFC ; 252 25e14: 5f ef ldi r21, 0xFF ; 255 25e16: 61 e0 ldi r22, 0x01 ; 1 25e18: 80 ec ldi r24, 0xC0 ; 192 25e1a: 93 ea ldi r25, 0xA3 ; 163 25e1c: 0d 94 fe 2d jmp 0x25bfc ; 0x25bfc <_lcd_move(char const*, unsigned char, int, int)> 00025e20 : } static void lcd_move_z() { _lcd_move(PSTR("Z:"), Z_AXIS, Z_MIN_POS, Z_MAX_POS); 25e20: 22 ed ldi r18, 0xD2 ; 210 25e22: 30 e0 ldi r19, 0x00 ; 0 25e24: 50 e0 ldi r21, 0x00 ; 0 25e26: 40 e0 ldi r20, 0x00 ; 0 25e28: 62 e0 ldi r22, 0x02 ; 2 25e2a: 83 ec ldi r24, 0xC3 ; 195 25e2c: 93 ea ldi r25, 0xA3 ; 163 25e2e: 0d 94 fe 2d jmp 0x25bfc ; 0x25bfc <_lcd_move(char const*, unsigned char, int, int)> 00025e32 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 25e32: 80 91 60 06 lds r24, 0x0660 ; 0x800660 25e36: 81 11 cpse r24, r1 25e38: 03 c0 rjmp .+6 ; 0x25e40 25e3a: 82 e0 ldi r24, 0x02 ; 2 25e3c: 0d 94 bc d1 jmp 0x3a378 ; 0x3a378 25e40: 81 e0 ldi r24, 0x01 ; 1 25e42: fc cf rjmp .-8 ; 0x25e3c 00025e44 : } // 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); 25e44: 5f 93 push r21 25e46: 4f 93 push r20 25e48: 7f 93 push r23 25e4a: 6f 93 push r22 25e4c: 28 2f mov r18, r24 25e4e: 08 2e mov r0, r24 25e50: 00 0c add r0, r0 25e52: 33 0b sbc r19, r19 25e54: 3f 93 push r19 25e56: 8f 93 push r24 25e58: 81 ed ldi r24, 0xD1 ; 209 25e5a: 9e e6 ldi r25, 0x6E ; 110 25e5c: 9f 93 push r25 25e5e: 8f 93 push r24 25e60: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_space(9 - chars); 25e64: 2d b7 in r18, 0x3d ; 61 25e66: 3e b7 in r19, 0x3e ; 62 25e68: 28 5f subi r18, 0xF8 ; 248 25e6a: 3f 4f sbci r19, 0xFF ; 255 25e6c: 0f b6 in r0, 0x3f ; 63 25e6e: f8 94 cli 25e70: 3e bf out 0x3e, r19 ; 62 25e72: 0f be out 0x3f, r0 ; 63 25e74: 2d bf out 0x3d, r18 ; 61 25e76: 99 e0 ldi r25, 0x09 ; 9 25e78: 98 1b sub r25, r24 25e7a: 89 2f mov r24, r25 25e7c: 0c 94 8b 6f jmp 0xdf16 ; 0xdf16 00025e80 : default: return false; } } void lcd_print_target_temps_first_line() { 25e80: cf 93 push r28 25e82: df 93 push r29 lcd_home(); 25e84: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 25e88: c0 91 6d 0e lds r28, 0x0E6D ; 0x800e6d 25e8c: d0 91 6e 0e lds r29, 0x0E6E ; 0x800e6e 25e90: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 25e94: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 25e98: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 25e9c: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 25ea0: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 25ea4: ae 01 movw r20, r28 25ea6: 82 e8 ldi r24, 0x82 ; 130 25ea8: 0f 94 22 2f call 0x25e44 ; 0x25e44 lcd_set_cursor(10, 0); 25eac: 60 e0 ldi r22, 0x00 ; 0 25eae: 8a e0 ldi r24, 0x0A ; 10 25eb0: 0e 94 95 6f call 0xdf2a ; 0xdf2a FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 25eb4: c0 91 6b 0e lds r28, 0x0E6B ; 0x800e6b 25eb8: d0 91 6c 0e lds r29, 0x0E6C ; 0x800e6c int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 25ebc: 20 97 sbiw r28, 0x00 ; 0 25ebe: 81 f0 breq .+32 ; 0x25ee0 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 25ec0: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 25ec4: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 25ec8: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 25ecc: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 25ed0: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 25ed4: ae 01 movw r20, r28 25ed6: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 25ed8: df 91 pop r29 25eda: 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); 25edc: 0d 94 22 2f jmp 0x25e44 ; 0x25e44 } else { lcd_space(10); 25ee0: 8a e0 ldi r24, 0x0A ; 10 } } 25ee2: df 91 pop r29 25ee4: 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); 25ee6: 0c 94 8b 6f jmp 0xdf16 ; 0xdf16 00025eea : 25eea: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 25eee: 0f 94 40 2f call 0x25e80 ; 0x25e80 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 25ef2: 8e e4 ldi r24, 0x4E ; 78 25ef4: 9b e4 ldi r25, 0x4B ; 75 25ef6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25efa: ac 01 movw r20, r24 25efc: 61 e0 ldi r22, 0x01 ; 1 25efe: 80 e0 ldi r24, 0x00 ; 0 25f00: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(0,2); 25f04: 62 e0 ldi r22, 0x02 ; 2 25f06: 80 e0 ldi r24, 0x00 ; 0 25f08: 0e 94 95 6f call 0xdf2a ; 0xdf2a switch(eFilamentAction) { 25f0c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 25f10: 83 30 cpi r24, 0x03 ; 3 25f12: 81 f1 breq .+96 ; 0x25f74 25f14: 48 f4 brcc .+18 ; 0x25f28 25f16: 81 30 cpi r24, 0x01 ; 1 25f18: 60 f0 brcs .+24 ; 0x25f32 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 25f1a: 8b e3 ldi r24, 0x3B ; 59 25f1c: 9b e4 ldi r25, 0x4B ; 75 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 25f1e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 25f22: 0e 94 80 6f call 0xdf00 ; 0xdf00 25f26: 05 c0 rjmp .+10 ; 0x25f32 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) { 25f28: 85 30 cpi r24, 0x05 ; 5 25f2a: 21 f1 breq .+72 ; 0x25f74 25f2c: b0 f3 brcs .-20 ; 0x25f1a 25f2e: 88 30 cpi r24, 0x08 ; 8 25f30: a1 f3 breq .-24 ; 0x25f1a case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 25f32: 0e 94 b2 71 call 0xe364 ; 0xe364 #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 25f36: 81 11 cpse r24, r1 25f38: 09 c0 rjmp .+18 ; 0x25f4c 25f3a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 25f3e: 81 50 subi r24, 0x01 ; 1 25f40: 82 30 cpi r24, 0x02 ; 2 25f42: 28 f5 brcc .+74 ; 0x25f8e 25f44: 80 91 8c 17 lds r24, 0x178C ; 0x80178c 25f48: 88 23 and r24, r24 25f4a: 09 f1 breq .+66 ; 0x25f8e #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 25f4c: 80 91 60 06 lds r24, 0x0660 ; 0x800660 25f50: 81 11 cpse r24, r1 25f52: 13 c0 rjmp .+38 ; 0x25f7a 25f54: 83 e0 ldi r24, 0x03 ; 3 25f56: 0f 94 bc d1 call 0x3a378 ; 0x3a378 switch(eFilamentAction) { 25f5a: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 25f5e: 82 30 cpi r24, 0x02 ; 2 25f60: 71 f0 breq .+28 ; 0x25f7e 25f62: 83 30 cpi r24, 0x03 ; 3 25f64: 81 f0 breq .+32 ; 0x25f86 25f66: 81 30 cpi r24, 0x01 ; 1 25f68: 91 f4 brne .+36 ; 0x25f8e case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 25f6a: 61 e0 ldi r22, 0x01 ; 1 25f6c: 80 e8 ldi r24, 0x80 ; 128 25f6e: 9f e6 ldi r25, 0x6F ; 111 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25f70: 0c 94 4b 89 jmp 0x11296 ; 0x11296 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)); 25f74: 86 e2 ldi r24, 0x26 ; 38 25f76: 9b e4 ldi r25, 0x4B ; 75 25f78: d2 cf rjmp .-92 ; 0x25f1e #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); 25f7a: 82 e0 ldi r24, 0x02 ; 2 25f7c: ec cf rjmp .-40 ; 0x25f56 switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 25f7e: 81 e0 ldi r24, 0x01 ; 1 25f80: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 25f84: f2 cf rjmp .-28 ; 0x25f6a [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 25f86: 61 e0 ldi r22, 0x01 ; 1 25f88: 88 e1 ldi r24, 0x18 ; 24 25f8a: 9c e6 ldi r25, 0x6C ; 108 25f8c: f1 cf rjmp .-30 ; 0x25f70 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 25f8e: 08 95 ret 00025f90 : //! | Bed: 00.0V | c=12 //! | IR : 00.0V | c=12 optional //! ---------------------- //! @endcode static void lcd_menu_voltages() { 25f90: cf 92 push r12 25f92: df 92 push r13 25f94: ef 92 push r14 25f96: ff 92 push r15 25f98: 0f 93 push r16 25f9a: 1f 93 push r17 25f9c: cf 93 push r28 25f9e: df 93 push r29 25fa0: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout float volt_pwr = VOLT_DIV_REF * ((float)current_voltage_raw_pwr / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25fa4: 60 91 59 06 lds r22, 0x0659 ; 0x800659 25fa8: 70 91 5a 06 lds r23, 0x065A ; 0x80065a 25fac: 07 2e mov r0, r23 25fae: 00 0c add r0, r0 25fb0: 88 0b sbc r24, r24 25fb2: 99 0b sbc r25, r25 25fb4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 25fb8: 20 e0 ldi r18, 0x00 ; 0 25fba: 30 ec ldi r19, 0xC0 ; 192 25fbc: 4f e7 ldi r20, 0x7F ; 127 25fbe: 56 e4 ldi r21, 0x46 ; 70 25fc0: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 25fc4: 20 e0 ldi r18, 0x00 ; 0 25fc6: 30 e0 ldi r19, 0x00 ; 0 25fc8: 40 ea ldi r20, 0xA0 ; 160 25fca: 50 e4 ldi r21, 0x40 ; 64 25fcc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 25fd0: 27 ed ldi r18, 0xD7 ; 215 25fd2: 30 e3 ldi r19, 0x30 ; 48 25fd4: 44 e4 ldi r20, 0x44 ; 68 25fd6: 5e e3 ldi r21, 0x3E ; 62 25fd8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 25fdc: eb 01 movw r28, r22 25fde: 18 2f mov r17, r24 25fe0: 09 2f mov r16, r25 float volt_bed = VOLT_DIV_REF * ((float)current_voltage_raw_bed / (1023 * OVERSAMPLENR)) / VOLT_DIV_FAC; 25fe2: 60 91 57 06 lds r22, 0x0657 ; 0x800657 25fe6: 70 91 58 06 lds r23, 0x0658 ; 0x800658 25fea: 07 2e mov r0, r23 25fec: 00 0c add r0, r0 25fee: 88 0b sbc r24, r24 25ff0: 99 0b sbc r25, r25 25ff2: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 25ff6: 20 e0 ldi r18, 0x00 ; 0 25ff8: 30 ec ldi r19, 0xC0 ; 192 25ffa: 4f e7 ldi r20, 0x7F ; 127 25ffc: 56 e4 ldi r21, 0x46 ; 70 25ffe: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 26002: 20 e0 ldi r18, 0x00 ; 0 26004: 30 e0 ldi r19, 0x00 ; 0 26006: 40 ea ldi r20, 0xA0 ; 160 26008: 50 e4 ldi r21, 0x40 ; 64 2600a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2600e: 27 ed ldi r18, 0xD7 ; 215 26010: 30 e3 ldi r19, 0x30 ; 48 26012: 44 e4 ldi r20, 0x44 ; 68 26014: 5e e3 ldi r21, 0x3E ; 62 26016: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2601a: f6 2e mov r15, r22 2601c: e7 2e mov r14, r23 2601e: d8 2e mov r13, r24 26020: c9 2e mov r12, r25 lcd_home(); 26022: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P(PSTR(" PWR: %4.1fV\n" " BED: %4.1fV"), volt_pwr, volt_bed); 26026: cf 92 push r12 26028: df 92 push r13 2602a: ef 92 push r14 2602c: ff 92 push r15 2602e: 0f 93 push r16 26030: 1f 93 push r17 26032: df 93 push r29 26034: cf 93 push r28 26036: 8d e9 ldi r24, 0x9D ; 157 26038: 91 ea ldi r25, 0xA1 ; 161 2603a: 9f 93 push r25 2603c: 8f 93 push r24 2603e: 0e 94 6e 6f call 0xdedc ; 0xdedc #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) lcd_printf_P(PSTR("\n IR : %3.1fV"), Raw2Voltage(fsensor.getVoltRaw())); 26042: 0f 94 e7 7c call 0x2f9ce ; 0x2f9ce 26046: bc 01 movw r22, r24 26048: 90 e0 ldi r25, 0x00 ; 0 2604a: 80 e0 ldi r24, 0x00 ; 0 2604c: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 26050: 20 e0 ldi r18, 0x00 ; 0 26052: 30 ec ldi r19, 0xC0 ; 192 26054: 4f e7 ldi r20, 0x7F ; 127 26056: 56 e4 ldi r21, 0x46 ; 70 26058: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2605c: 20 e0 ldi r18, 0x00 ; 0 2605e: 30 e0 ldi r19, 0x00 ; 0 26060: 40 ea ldi r20, 0xA0 ; 160 26062: 50 e4 ldi r21, 0x40 ; 64 26064: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 26068: 9f 93 push r25 2606a: 8f 93 push r24 2606c: 7f 93 push r23 2606e: 6f 93 push r22 26070: 89 e8 ldi r24, 0x89 ; 137 26072: 91 ea ldi r25, 0xA1 ; 161 26074: 9f 93 push r25 26076: 8f 93 push r24 26078: 0e 94 6e 6f call 0xdedc ; 0xdedc #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) menu_back_if_clicked(); 2607c: 8d b7 in r24, 0x3d ; 61 2607e: 9e b7 in r25, 0x3e ; 62 26080: 40 96 adiw r24, 0x10 ; 16 26082: 0f b6 in r0, 0x3f ; 63 26084: f8 94 cli 26086: 9e bf out 0x3e, r25 ; 62 26088: 0f be out 0x3f, r0 ; 63 2608a: 8d bf out 0x3d, r24 ; 61 } 2608c: df 91 pop r29 2608e: cf 91 pop r28 26090: 1f 91 pop r17 26092: 0f 91 pop r16 26094: ff 90 pop r15 26096: ef 90 pop r14 26098: df 90 pop r13 2609a: 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(); 2609c: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 000260a0 : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 260a0: ef 92 push r14 260a2: ff 92 push r15 260a4: 0f 93 push r16 260a6: 1f 93 push r17 260a8: cf 93 push r28 260aa: 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) 260ac: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 260b0: 88 23 and r24, r24 260b2: 29 f0 breq .+10 ; 0x260be 260b4: 90 91 6d 02 lds r25, 0x026D ; 0x80026d 260b8: 92 30 cpi r25, 0x02 ; 2 260ba: 09 f0 breq .+2 ; 0x260be 260bc: 8c c1 rjmp .+792 ; 0x263d6 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 260be: 81 e0 ldi r24, 0x01 ; 1 260c0: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 260c4: 80 91 df 16 lds r24, 0x16DF ; 0x8016df _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 260c8: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa if (_md->is_flash_air) { 260cc: 88 23 and r24, r24 260ce: 21 f0 breq .+8 ; 0x260d8 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 260d0: 8b ea ldi r24, 0xAB ; 171 260d2: 93 e0 ldi r25, 0x03 ; 3 260d4: 0f 94 84 86 call 0x30d08 ; 0x30d08 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 260d8: 0f 94 10 cf call 0x39e20 ; 0x39e20 260dc: 10 92 15 05 sts 0x0515, r1 ; 0x800515 if (((menu_item - 1) == menu_line) && lcd_draw_update) { lcd_set_cursor(6, menu_row); MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 260e0: 81 e0 ldi r24, 0x01 ; 1 260e2: e8 2e mov r14, r24 260e4: 82 ea ldi r24, 0xA2 ; 162 260e6: 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]); 260e8: c0 ed ldi r28, 0xD0 ; 208 260ea: d1 ea ldi r29, 0xA1 ; 161 260ec: 0f ea ldi r16, 0xAF ; 175 260ee: 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(); 260f0: 80 91 15 05 lds r24, 0x0515 ; 0x800515 260f4: 84 30 cpi r24, 0x04 ; 4 260f6: 08 f0 brcs .+2 ; 0x260fa 260f8: 95 c1 rjmp .+810 ; 0x26424 260fa: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 260fe: 88 eb ldi r24, 0xB8 ; 184 26100: 9d e3 ldi r25, 0x3D ; 61 26102: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26106: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR("Firmware:")); 2610a: 8a e7 ldi r24, 0x7A ; 122 2610c: 92 ea ldi r25, 0xA2 ; 162 2610e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 26112: 8d e6 ldi r24, 0x6D ; 109 26114: 92 ea ldi r25, 0xA2 ; 162 26116: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 2611a: 8f e5 ldi r24, 0x5F ; 95 2611c: 92 ea ldi r25, 0xA2 ; 162 2611e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 26122: 8f e4 ldi r24, 0x4F ; 79 26124: 92 ea ldi r25, 0xA2 ; 162 26126: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 2612a: 84 e7 ldi r24, 0x74 ; 116 2612c: 9f e6 ldi r25, 0x6F ; 111 2612e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 26132: 82 e6 ldi r24, 0x62 ; 98 26134: 9f e6 ldi r25, 0x6F ; 111 26136: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 2613a: 81 e5 ldi r24, 0x51 ; 81 2613c: 9f e6 ldi r25, 0x6F ; 111 2613e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(STR_SEPARATOR); 26142: 8a e1 ldi r24, 0x1A ; 26 26144: 9c e8 ldi r25, 0x8C ; 140 26146: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 2614a: 83 e4 ldi r24, 0x43 ; 67 2614c: 92 ea ldi r25, 0xA2 ; 162 2614e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 26152: 89 e3 ldi r24, 0x39 ; 57 26154: 92 ea ldi r25, 0xA2 ; 162 26156: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 2615a: 8a e2 ldi r24, 0x2A ; 42 2615c: 92 ea ldi r25, 0xA2 ; 162 2615e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(STR_SEPARATOR); 26162: 8a e1 ldi r24, 0x1A ; 26 26164: 9c e8 ldi r25, 0x8C ; 140 26166: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(_T(MSG_DATE)); 2616a: 8e e1 ldi r24, 0x1E ; 30 2616c: 9b e4 ldi r25, 0x4B ; 75 2616e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26172: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 26176: 8f e1 ldi r24, 0x1F ; 31 26178: 92 ea ldi r25, 0xA2 ; 162 2617a: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 2617e: 8a e1 ldi r24, 0x1A ; 26 26180: 9c e8 ldi r25, 0x8C ; 140 26182: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR("Fil. sensor v.:")); 26186: 8f e0 ldi r24, 0x0F ; 15 26188: 92 ea ldi r25, 0xA2 ; 162 2618a: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(fsensor.getIRVersionText()); 2618e: 0f 94 ef 7c call 0x2f9de ; 0x2f9de 26192: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) MENU_ITEM_BACK_P(STR_SEPARATOR); 26196: 8a e1 ldi r24, 0x1A ; 26 26198: 9c e8 ldi r25, 0x8C ; 140 2619a: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 if (MMU2::mmu2.Enabled()) 2619e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 261a2: 81 30 cpi r24, 0x01 ; 1 261a4: 09 f0 breq .+2 ; 0x261a8 261a6: 39 c1 rjmp .+626 ; 0x2641a { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 261a8: 8e e0 ldi r24, 0x0E ; 14 261aa: 9b e4 ldi r25, 0x4B ; 75 261ac: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 261b0: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 261b4: 8a e0 ldi r24, 0x0A ; 10 261b6: 92 ea ldi r25, 0xA2 ; 162 261b8: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 if (((menu_item - 1) == menu_line) && lcd_draw_update) 261bc: 80 91 18 05 lds r24, 0x0518 ; 0x800518 261c0: 81 50 subi r24, 0x01 ; 1 261c2: 99 0b sbc r25, r25 261c4: 20 91 17 05 lds r18, 0x0517 ; 0x800517 261c8: 28 17 cp r18, r24 261ca: 19 06 cpc r1, r25 261cc: 49 f5 brne .+82 ; 0x26220 261ce: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 261d2: 88 23 and r24, r24 261d4: 29 f1 breq .+74 ; 0x26220 { lcd_set_cursor(6, menu_row); 261d6: 60 91 15 05 lds r22, 0x0515 ; 0x800515 261da: 86 e0 ldi r24, 0x06 ; 6 261dc: 0e 94 95 6f call 0xdf2a ; 0xdf2a 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) { 261e0: 80 91 98 13 lds r24, 0x1398 ; 0x801398 261e4: 81 30 cpi r24, 0x01 ; 1 261e6: 09 f0 breq .+2 ; 0x261ea 261e8: 11 c1 rjmp .+546 ; 0x2640c 261ea: 80 91 78 13 lds r24, 0x1378 ; 0x801378 261ee: 90 91 79 13 lds r25, 0x1379 ; 0x801379 261f2: 20 91 7a 13 lds r18, 0x137A ; 0x80137a MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 261f6: 88 23 and r24, r24 261f8: 09 f4 brne .+2 ; 0x261fc 261fa: 08 c1 rjmp .+528 ; 0x2640c lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 261fc: 1f 92 push r1 261fe: 2f 93 push r18 26200: 1f 92 push r1 26202: 9f 93 push r25 26204: 1f 92 push r1 26206: 8f 93 push r24 26208: ff 92 push r15 2620a: ef 92 push r14 2620c: 0e 94 6e 6f call 0xdedc ; 0xdedc 26210: 8d b7 in r24, 0x3d ; 61 26212: 9e b7 in r25, 0x3e ; 62 26214: 08 96 adiw r24, 0x08 ; 8 26216: 0f b6 in r0, 0x3f ; 63 26218: f8 94 cli 2621a: 9e bf out 0x3e, r25 ; 62 2621c: 0f be out 0x3f, r0 ; 63 2621e: 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) { 26220: 80 91 aa 03 lds r24, 0x03AA ; 0x8003aa 26224: 88 23 and r24, r24 26226: 09 f4 brne .+2 ; 0x2622a 26228: 40 c0 rjmp .+128 ; 0x262aa MENU_ITEM_BACK_P(STR_SEPARATOR); 2622a: 8a e1 ldi r24, 0x1A ; 26 2622c: 9c e8 ldi r25, 0x8C ; 140 2622e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 26232: 80 ee ldi r24, 0xE0 ; 224 26234: 91 ea ldi r25, 0xA1 ; 161 26236: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(" ")); 2623a: 8e ed ldi r24, 0xDE ; 222 2623c: 91 ea ldi r25, 0xA1 ; 161 2623e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 26242: 80 91 18 05 lds r24, 0x0518 ; 0x800518 26246: 81 50 subi r24, 0x01 ; 1 26248: 99 0b sbc r25, r25 2624a: 20 91 17 05 lds r18, 0x0517 ; 0x800517 2624e: 28 17 cp r18, r24 26250: 19 06 cpc r1, r25 26252: 59 f5 brne .+86 ; 0x262aa 26254: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 26258: 88 23 and r24, r24 2625a: 39 f1 breq .+78 ; 0x262aa lcd_set_cursor(2, menu_row); 2625c: 60 91 15 05 lds r22, 0x0515 ; 0x800515 26260: 82 e0 ldi r24, 0x02 ; 2 26262: 0e 94 95 6f call 0xdf2a ; 0xdf2a 26266: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 2626a: 1f 92 push r1 2626c: 8f 93 push r24 2626e: 80 91 ad 03 lds r24, 0x03AD ; 0x8003ad 26272: 1f 92 push r1 26274: 8f 93 push r24 26276: 80 91 ac 03 lds r24, 0x03AC ; 0x8003ac 2627a: 1f 92 push r1 2627c: 8f 93 push r24 2627e: 80 91 ab 03 lds r24, 0x03AB ; 0x8003ab 26282: 1f 92 push r1 26284: 8f 93 push r24 26286: df 93 push r29 26288: cf 93 push r28 2628a: 1f 93 push r17 2628c: 0f 93 push r16 2628e: 0f 94 a8 dc call 0x3b950 ; 0x3b950 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 26292: 8f ea ldi r24, 0xAF ; 175 26294: 93 e0 ldi r25, 0x03 ; 3 26296: 0e 94 9c 71 call 0xe338 ; 0xe338 2629a: 8d b7 in r24, 0x3d ; 61 2629c: 9e b7 in r25, 0x3e ; 62 2629e: 0c 96 adiw r24, 0x0c ; 12 262a0: 0f b6 in r0, 0x3f ; 63 262a2: f8 94 cli 262a4: 9e bf out 0x3e, r25 ; 62 262a6: 0f be out 0x3f, r0 ; 63 262a8: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 262aa: 80 91 5b 06 lds r24, 0x065B ; 0x80065b 262ae: 90 91 5c 06 lds r25, 0x065C ; 0x80065c 262b2: a0 91 5d 06 lds r26, 0x065D ; 0x80065d 262b6: b0 91 5e 06 lds r27, 0x065E ; 0x80065e 262ba: 89 2b or r24, r25 262bc: 8a 2b or r24, r26 262be: 8b 2b or r24, r27 262c0: 09 f4 brne .+2 ; 0x262c4 262c2: 42 c0 rjmp .+132 ; 0x26348 MENU_ITEM_BACK_P(STR_SEPARATOR); 262c4: 8a e1 ldi r24, 0x1A ; 26 262c6: 9c e8 ldi r25, 0x8C ; 140 262c8: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 262cc: 81 ef ldi r24, 0xF1 ; 241 262ce: 9a e4 ldi r25, 0x4A ; 74 262d0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 262d4: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_BACK_P(PSTR(" ")); 262d8: 8c ed ldi r24, 0xDC ; 220 262da: 91 ea ldi r25, 0xA1 ; 161 262dc: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 if (((menu_item - 1) == menu_line) && lcd_draw_update) { 262e0: 80 91 18 05 lds r24, 0x0518 ; 0x800518 262e4: 81 50 subi r24, 0x01 ; 1 262e6: 99 0b sbc r25, r25 262e8: 20 91 17 05 lds r18, 0x0517 ; 0x800517 262ec: 28 17 cp r18, r24 262ee: 19 06 cpc r1, r25 262f0: 59 f5 brne .+86 ; 0x26348 262f2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 262f6: 88 23 and r24, r24 262f8: 39 f1 breq .+78 ; 0x26348 lcd_set_cursor(2, menu_row); 262fa: 60 91 15 05 lds r22, 0x0515 ; 0x800515 262fe: 82 e0 ldi r24, 0x02 ; 2 26300: 0e 94 95 6f call 0xdf2a ; 0xdf2a 26304: 80 91 5e 06 lds r24, 0x065E ; 0x80065e 26308: 1f 92 push r1 2630a: 8f 93 push r24 2630c: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 26310: 1f 92 push r1 26312: 8f 93 push r24 26314: 80 91 5c 06 lds r24, 0x065C ; 0x80065c 26318: 1f 92 push r1 2631a: 8f 93 push r24 2631c: 80 91 5b 06 lds r24, 0x065B ; 0x80065b 26320: 1f 92 push r1 26322: 8f 93 push r24 26324: df 93 push r29 26326: cf 93 push r28 26328: 1f 93 push r17 2632a: 0f 93 push r16 2632c: 0f 94 a8 dc call 0x3b950 ; 0x3b950 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 26330: 8f ea ldi r24, 0xAF ; 175 26332: 93 e0 ldi r25, 0x03 ; 3 26334: 0e 94 9c 71 call 0xe338 ; 0xe338 26338: 8d b7 in r24, 0x3d ; 61 2633a: 9e b7 in r25, 0x3e ; 62 2633c: 0c 96 adiw r24, 0x0c ; 12 2633e: 0f b6 in r0, 0x3f ; 63 26340: f8 94 cli 26342: 9e bf out 0x3e, r25 ; 62 26344: 0f be out 0x3f, r0 ; 63 26346: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 26348: 8a e1 ldi r24, 0x1A ; 26 2634a: 9c e8 ldi r25, 0x8C ; 140 2634c: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 26350: 8e ed ldi r24, 0xDE ; 222 26352: 9a e4 ldi r25, 0x4A ; 74 26354: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26358: 6c ec ldi r22, 0xCC ; 204 2635a: 7a e3 ldi r23, 0x3A ; 58 2635c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 26360: 8e ec ldi r24, 0xCE ; 206 26362: 9a e4 ldi r25, 0x4A ; 74 26364: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26368: 6a e4 ldi r22, 0x4A ; 74 2636a: 7a e3 ldi r23, 0x3A ; 58 2636c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 26370: 80 ec ldi r24, 0xC0 ; 192 26372: 9a e4 ldi r25, 0x4A ; 74 26374: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26378: 60 e0 ldi r22, 0x00 ; 0 2637a: 7a e3 ldi r23, 0x3A ; 58 2637c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #ifdef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_BELT_STATUS), lcd_menu_belt_status); 26380: 82 eb ldi r24, 0xB2 ; 178 26382: 9a e4 ldi r25, 0x4A ; 74 26384: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26388: 62 e0 ldi r22, 0x02 ; 2 2638a: 7a e3 ldi r23, 0x3A ; 58 2638c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #endif //TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_MENU_TEMPERATURES), lcd_menu_temperatures); 26390: 83 ea ldi r24, 0xA3 ; 163 26392: 9a e4 ldi r25, 0x4A ; 74 26394: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26398: 6e e6 ldi r22, 0x6E ; 110 2639a: 79 e3 ldi r23, 0x39 ; 57 2639c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #if defined (VOLT_BED_PIN) || defined (VOLT_PWR_PIN) MENU_ITEM_SUBMENU_P(_T(MSG_MENU_VOLTAGES), lcd_menu_voltages); 263a0: 88 e9 ldi r24, 0x98 ; 152 263a2: 9a e4 ldi r25, 0x4A ; 74 263a4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 263a8: 6c e6 ldi r22, 0x6C ; 108 263aa: 7b e3 ldi r23, 0x3B ; 59 263ac: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #endif //defined VOLT_BED_PIN || defined VOLT_PWR_PIN #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); 263b0: 68 e9 ldi r22, 0x98 ; 152 263b2: 7a e3 ldi r23, 0x3A ; 58 263b4: 85 e4 ldi r24, 0x45 ; 69 263b6: 9f e6 ldi r25, 0x6F ; 111 263b8: 0f 94 8d ce call 0x39d1a ; 0x39d1a 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(); 263bc: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 263c0: 80 91 15 05 lds r24, 0x0515 ; 0x800515 263c4: 8f 5f subi r24, 0xFF ; 255 263c6: 80 93 15 05 sts 0x0515, r24 ; 0x800515 263ca: 80 91 17 05 lds r24, 0x0517 ; 0x800517 263ce: 8f 5f subi r24, 0xFF ; 255 263d0: 80 93 17 05 sts 0x0517, r24 ; 0x800517 263d4: 8d ce rjmp .-742 ; 0x260f0 _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) 263d6: 90 91 aa 03 lds r25, 0x03AA ; 0x8003aa 263da: 99 23 and r25, r25 263dc: 09 f4 brne .+2 ; 0x263e0 263de: 7c ce rjmp .-776 ; 0x260d8 263e0: 40 91 ab 03 lds r20, 0x03AB ; 0x8003ab 263e4: 50 91 ac 03 lds r21, 0x03AC ; 0x8003ac 263e8: 60 91 ad 03 lds r22, 0x03AD ; 0x8003ad 263ec: 70 91 ae 03 lds r23, 0x03AE ; 0x8003ae 263f0: 45 2b or r20, r21 263f2: 46 2b or r20, r22 263f4: 47 2b or r20, r23 263f6: 09 f0 breq .+2 ; 0x263fa 263f8: 6f ce rjmp .-802 ; 0x260d8 263fa: 8f 5f subi r24, 0xFF ; 255 263fc: 80 31 cpi r24, 0x10 ; 16 263fe: 19 f0 breq .+6 ; 0x26406 26400: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 26404: 69 ce rjmp .-814 ; 0x260d8 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 26406: 10 92 a9 03 sts 0x03A9, r1 ; 0x8003a9 2640a: 66 ce rjmp .-820 ; 0x260d8 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)); 2640c: 84 e0 ldi r24, 0x04 ; 4 2640e: 9b e4 ldi r25, 0x4B ; 75 26410: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26414: 0e 94 80 6f call 0xdf00 ; 0xdf00 26418: 03 cf rjmp .-506 ; 0x26220 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 2641a: 82 ef ldi r24, 0xF2 ; 242 2641c: 91 ea ldi r25, 0xA1 ; 161 2641e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 26422: fe ce rjmp .-516 ; 0x26220 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 26424: df 91 pop r29 26426: cf 91 pop r28 26428: 1f 91 pop r17 2642a: 0f 91 pop r16 2642c: ff 90 pop r15 2642e: ef 90 pop r14 26430: 08 95 ret 00026432 : { 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) { 26432: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 26436: 81 11 cpse r24, r1 26438: 19 c0 rjmp .+50 ; 0x2646c lcd_clear(); 2643a: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 2643e: 87 e1 ldi r24, 0x17 ; 23 26440: 9a e4 ldi r25, 0x4A ; 74 26442: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26446: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_putc(':'); 2644a: 8a e3 ldi r24, 0x3A ; 58 2644c: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_set_cursor(10, 1); 26450: 61 e0 ldi r22, 0x01 ; 1 26452: 8a e0 ldi r24, 0x0A ; 10 26454: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 26458: 88 ea ldi r24, 0xA8 ; 168 2645a: 9c e0 ldi r25, 0x0C ; 12 2645c: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); else lcd_printNumber(n, base); 26460: 4a e0 ldi r20, 0x0A ; 10 26462: 0e 94 e9 70 call 0xe1d2 ; 0xe1d2 _md->initialized = true; 26466: 81 e0 ldi r24, 0x01 ; 1 26468: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 } menu_back_if_clicked(); 2646c: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 00026470 : } 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){ 26470: 0f 93 push r16 26472: 1f 93 push r17 26474: cf 93 push r28 26476: df 93 push r29 26478: ec 01 movw r28, r24 2647a: cb 01 movw r24, r22 2647c: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 2647e: 4a 81 ldd r20, Y+2 ; 0x02 26480: 41 30 cpi r20, 0x01 ; 1 26482: 29 f0 breq .+10 ; 0x2648e 26484: 88 f0 brcs .+34 ; 0x264a8 26486: 42 30 cpi r20, 0x02 ; 2 26488: 09 f1 breq .+66 ; 0x264cc 2648a: 43 30 cpi r20, 0x03 ; 3 2648c: d1 f4 brne .+52 ; 0x264c2 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 ){ 2648e: 8b 81 ldd r24, Y+3 ; 0x03 26490: 81 11 cpse r24, r1 26492: 25 c0 rjmp .+74 ; 0x264de state = next_state; // advance to the next state 26494: 82 e0 ldi r24, 0x02 ; 2 26496: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 26498: 63 e0 ldi r22, 0x03 ; 3 2649a: 8c ed ldi r24, 0xDC ; 220 2649c: 9e e9 ldi r25, 0x9E ; 158 2649e: 0f 94 c7 06 call 0x20d8e ; 0x20d8e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 264a2: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 264a4: 8b 83 std Y+3, r24 ; 0x03 264a6: 0d c0 rjmp .+26 ; 0x264c2 //! @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 ){ 264a8: a9 01 movw r20, r18 264aa: 98 01 movw r18, r16 264ac: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 264b0: 18 16 cp r1, r24 264b2: 3c f4 brge .+14 ; 0x264c2 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 264b4: 63 e0 ldi r22, 0x03 ; 3 264b6: 88 81 ld r24, Y 264b8: 99 81 ldd r25, Y+1 ; 0x01 264ba: 0f 94 c7 06 call 0x20d8e ; 0x20d8e state = States::TempAboveMintemp; 264be: 81 e0 ldi r24, 0x01 ; 1 264c0: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 264c2: df 91 pop r29 264c4: cf 91 pop r28 264c6: 1f 91 pop r17 264c8: 0f 91 pop r16 264ca: 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 ){ 264cc: 8b 81 ldd r24, Y+3 ; 0x03 264ce: 81 11 cpse r24, r1 264d0: 06 c0 rjmp .+12 ; 0x264de 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); 264d2: 88 81 ld r24, Y 264d4: 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 264d6: 23 e0 ldi r18, 0x03 ; 3 264d8: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 264da: 63 e0 ldi r22, 0x03 ; 3 264dc: e0 cf rjmp .-64 ; 0x2649e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 264de: 81 50 subi r24, 0x01 ; 1 264e0: e1 cf rjmp .-62 ; 0x264a4 000264e2 : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 264e2: cf 93 push r28 if(IsStopped() == false) { 264e4: 90 91 14 05 lds r25, 0x0514 ; 0x800514 264e8: 91 11 cpse r25, r1 264ea: 18 c0 rjmp .+48 ; 0x2651c 264ec: c6 2f mov r28, r22 if (isPreheat) { 264ee: 88 23 and r24, r24 264f0: c9 f0 breq .+50 ; 0x26524 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 264f2: 80 e8 ldi r24, 0x80 ; 128 264f4: 9e e9 ldi r25, 0x9E ; 158 264f6: 66 23 and r22, r22 264f8: 11 f0 breq .+4 ; 0x264fe 264fa: 8e e8 ldi r24, 0x8E ; 142 264fc: 9e e9 ldi r25, 0x9E ; 158 264fe: 63 e0 ldi r22, 0x03 ; 3 26500: 0f 94 c7 06 call 0x20d8e ; 0x20d8e SERIAL_ERROR_START; 26504: 8a ec ldi r24, 0xCA ; 202 26506: 99 ea ldi r25, 0xA9 ; 169 26508: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 2650c: 8d e5 ldi r24, 0x5D ; 93 2650e: 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) { 26510: c1 11 cpse r28, r1 26512: 02 c0 rjmp .+4 ; 0x26518 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 26514: 8b e3 ldi r24, 0x3B ; 59 26516: 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"); 26518: 0e 94 06 7b call 0xf60c ; 0xf60c } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 2651c: 80 e0 ldi r24, 0x00 ; 0 } 2651e: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 26520: 0c 94 37 7b jmp 0xf66e ; 0xf66e 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); 26524: 87 e1 ldi r24, 0x17 ; 23 26526: 9e e9 ldi r25, 0x9E ; 158 26528: 66 23 and r22, r22 2652a: 11 f0 breq .+4 ; 0x26530 2652c: 87 e2 ldi r24, 0x27 ; 39 2652e: 9e e9 ldi r25, 0x9E ; 158 26530: 63 e0 ldi r22, 0x03 ; 3 26532: 0f 94 c7 06 call 0x20d8e ; 0x20d8e SERIAL_ERROR_START; 26536: 8a ec ldi r24, 0xCA ; 202 26538: 99 ea ldi r25, 0xA9 ; 169 2653a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 2653e: 8e ef ldi r24, 0xFE ; 254 26540: 9d e9 ldi r25, 0x9D ; 157 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); } } else { lcd_setalertstatuspgm(isBed? PSTR("BED THERMAL RUNAWAY") : PSTR("THERMAL RUNAWAY"), LCD_STATUS_CRITICAL); SERIAL_ERROR_START; if (isBed) { 26542: c1 11 cpse r28, r1 26544: e9 cf rjmp .-46 ; 0x26518 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 26546: 86 ee ldi r24, 0xE6 ; 230 26548: 9d e9 ldi r25, 0x9D ; 157 2654a: e6 cf rjmp .-52 ; 0x26518 0002654c : } } static void Sound_DoSound_Prompt(void) { backlight_wake(2); 2654c: 82 e0 ldi r24, 0x02 ; 2 2654e: 0e 94 a0 8b call 0x11740 ; 0x11740 WRITE(BEEPER,HIGH); 26552: 9f b7 in r25, 0x3f ; 63 26554: f8 94 cli 26556: e2 e0 ldi r30, 0x02 ; 2 26558: f1 e0 ldi r31, 0x01 ; 1 2655a: 80 81 ld r24, Z 2655c: 84 60 ori r24, 0x04 ; 4 2655e: 80 83 st Z, r24 26560: 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); 26562: 2f ef ldi r18, 0xFF ; 255 26564: 89 e6 ldi r24, 0x69 ; 105 26566: 98 e1 ldi r25, 0x18 ; 24 26568: 21 50 subi r18, 0x01 ; 1 2656a: 80 40 sbci r24, 0x00 ; 0 2656c: 90 40 sbci r25, 0x00 ; 0 2656e: e1 f7 brne .-8 ; 0x26568 26570: 00 c0 rjmp .+0 ; 0x26572 26572: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 26574: 9f b7 in r25, 0x3f ; 63 26576: f8 94 cli 26578: 80 81 ld r24, Z 2657a: 8b 7f andi r24, 0xFB ; 251 2657c: 80 83 st Z, r24 2657e: 9f bf out 0x3f, r25 ; 63 } 26580: 08 95 ret 00026582 : 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() { 26582: cf 93 push r28 26584: 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); 26586: 80 91 38 02 lds r24, 0x0238 ; 0x800238 2658a: 88 23 and r24, r24 2658c: 89 f0 breq .+34 ; 0x265b0 2658e: 88 e4 ldi r24, 0x48 ; 72 26590: 9d e5 ldi r25, 0x5D ; 93 26592: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26596: ec 01 movw r28, r24 26598: 8c e2 ldi r24, 0x2C ; 44 2659a: 97 e5 ldi r25, 0x57 ; 87 2659c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 265a0: 22 e0 ldi r18, 0x02 ; 2 265a2: 44 e9 ldi r20, 0x94 ; 148 265a4: 5a e3 ldi r21, 0x3A ; 58 265a6: be 01 movw r22, r28 } 265a8: df 91 pop r29 265aa: 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); 265ac: 0d 94 9f d0 jmp 0x3a13e ; 0x3a13e 265b0: 82 e4 ldi r24, 0x42 ; 66 265b2: 9d e5 ldi r25, 0x5D ; 93 265b4: ee cf rjmp .-36 ; 0x26592 000265b6 : } #endif // TMC2130 } } static void menuitems_temperature_common() { 265b6: ef 92 push r14 265b8: ff 92 push r15 265ba: 0f 93 push r16 265bc: 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); 265be: 81 e4 ldi r24, 0x41 ; 65 265c0: 97 e5 ldi r25, 0x57 ; 87 265c2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 265c6: 28 ec ldi r18, 0xC8 ; 200 265c8: e2 2e mov r14, r18 265ca: f1 2c mov r15, r1 265cc: 07 e2 ldi r16, 0x27 ; 39 265ce: 11 e0 ldi r17, 0x01 ; 1 265d0: 30 e0 ldi r19, 0x00 ; 0 265d2: 20 e0 ldi r18, 0x00 ; 0 265d4: 40 e1 ldi r20, 0x10 ; 16 265d6: 6d e6 ldi r22, 0x6D ; 109 265d8: 7e e0 ldi r23, 0x0E ; 14 265da: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 #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); 265de: 86 e2 ldi r24, 0x26 ; 38 265e0: 97 e5 ldi r25, 0x57 ; 87 265e2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 265e6: 32 e3 ldi r19, 0x32 ; 50 265e8: e3 2e mov r14, r19 265ea: f1 2c mov r15, r1 265ec: 08 e7 ldi r16, 0x78 ; 120 265ee: 10 e0 ldi r17, 0x00 ; 0 265f0: 30 e0 ldi r19, 0x00 ; 0 265f2: 20 e0 ldi r18, 0x00 ; 0 265f4: 40 e1 ldi r20, 0x10 ; 16 265f6: 6b e6 ldi r22, 0x6B ; 107 265f8: 7e e0 ldi r23, 0x0E ; 14 265fa: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 265fe: 8a e1 ldi r24, 0x1A ; 26 26600: 97 e5 ldi r25, 0x57 ; 87 26602: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26606: 4f e7 ldi r20, 0x7F ; 127 26608: e4 2e mov r14, r20 2660a: f1 2c mov r15, r1 2660c: 0f ef ldi r16, 0xFF ; 255 2660e: 10 e0 ldi r17, 0x00 ; 0 26610: 30 e0 ldi r19, 0x00 ; 0 26612: 20 e0 ldi r18, 0x00 ; 0 26614: 48 e0 ldi r20, 0x08 ; 8 26616: 63 ee ldi r22, 0xE3 ; 227 26618: 73 e0 ldi r23, 0x03 ; 3 2661a: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 } 2661e: 1f 91 pop r17 26620: 0f 91 pop r16 26622: ff 90 pop r15 26624: ef 90 pop r14 26626: 08 95 ret 00026628 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { 26628: cf 93 push r28 2662a: 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); 2662c: 8f ef ldi r24, 0xFF ; 255 2662e: 9f e0 ldi r25, 0x0F ; 15 26630: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 bool bDesync = tmc2130_mode ^ eeprom_mode; 26634: 90 91 6c 06 lds r25, 0x066C ; 0x80066c if (eeprom_mode == SILENT_MODE_NORMAL) 26638: 81 11 cpse r24, r1 2663a: 35 c0 rjmp .+106 ; 0x266a6 { if (bDesync) 2663c: 99 23 and r25, r25 2663e: 11 f1 breq .+68 ; 0x26684 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M915"), lcd_silent_mode_set); 26640: 8c e2 ldi r24, 0x2C ; 44 26642: 9d e3 ldi r25, 0x3D ; 61 26644: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26648: 22 e0 ldi r18, 0x02 ; 2 2664a: 44 e9 ldi r20, 0x94 ; 148 2664c: 59 e3 ldi r21, 0x39 ; 57 2664e: 60 e8 ldi r22, 0x80 ; 128 26650: 74 ea ldi r23, 0xA4 ; 164 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_NORMAL), lcd_silent_mode_set); 26652: 0f 94 9f d0 call 0x3a13e ; 0x3a13e } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 26656: 89 e6 ldi r24, 0x69 ; 105 26658: 9f e0 ldi r25, 0x0F ; 15 2665a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2665e: 88 23 and r24, r24 26660: f9 f0 breq .+62 ; 0x266a0 26662: 88 e4 ldi r24, 0x48 ; 72 26664: 9d e5 ldi r25, 0x5D ; 93 26666: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2666a: ec 01 movw r28, r24 2666c: 8d e0 ldi r24, 0x0D ; 13 2666e: 97 e5 ldi r25, 0x57 ; 87 26670: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26674: 22 e0 ldi r18, 0x02 ; 2 26676: 4a ee ldi r20, 0xEA ; 234 26678: 5a e3 ldi r21, 0x3A ; 58 2667a: 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 } } 2667c: df 91 pop r29 2667e: 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); 26680: 0d 94 9f d0 jmp 0x3a13e ; 0x3a13e { 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); 26684: 8c e7 ldi r24, 0x7C ; 124 26686: 97 e5 ldi r25, 0x57 ; 87 26688: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2668c: ec 01 movw r28, r24 2668e: 8c e2 ldi r24, 0x2C ; 44 26690: 9d e3 ldi r25, 0x3D ; 61 26692: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26696: 22 e0 ldi r18, 0x02 ; 2 26698: 44 e9 ldi r20, 0x94 ; 148 2669a: 59 e3 ldi r21, 0x39 ; 57 2669c: be 01 movw r22, r28 2669e: d9 cf rjmp .-78 ; 0x26652 } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) ? _T(MSG_ON) : _T(MSG_OFF), crash_mode_switch); 266a0: 82 e4 ldi r24, 0x42 ; 66 266a2: 9d e5 ldi r25, 0x5D ; 93 266a4: e0 cf rjmp .-64 ; 0x26666 } else { if (bDesync) 266a6: 98 17 cp r25, r24 266a8: a9 f0 breq .+42 ; 0x266d4 { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), PSTR("M914") , lcd_silent_mode_set); 266aa: 8c e2 ldi r24, 0x2C ; 44 266ac: 9d e3 ldi r25, 0x3D ; 61 266ae: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 266b2: 22 e0 ldi r18, 0x02 ; 2 266b4: 44 e9 ldi r20, 0x94 ; 148 266b6: 59 e3 ldi r21, 0x39 ; 57 266b8: 6b e7 ldi r22, 0x7B ; 123 266ba: 74 ea ldi r23, 0xA4 ; 164 } else { MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_STEALTH), lcd_silent_mode_set); 266bc: 0f 94 9f d0 call 0x3a13e ; 0x3a13e } MENU_ITEM_TOGGLE_P(_T(MSG_CRASHDETECT), NULL, lcd_crash_mode_info); 266c0: 8d e0 ldi r24, 0x0D ; 13 266c2: 97 e5 ldi r25, 0x57 ; 87 266c4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 266c8: 22 e0 ldi r18, 0x02 ; 2 266ca: 4c e6 ldi r20, 0x6C ; 108 266cc: 5a e3 ldi r21, 0x3A ; 58 266ce: 70 e0 ldi r23, 0x00 ; 0 266d0: 60 e0 ldi r22, 0x00 ; 0 266d2: d4 cf rjmp .-88 ; 0x2667c { 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); 266d4: 83 e0 ldi r24, 0x03 ; 3 266d6: 97 e5 ldi r25, 0x57 ; 87 266d8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 266dc: ec 01 movw r28, r24 266de: 8c e2 ldi r24, 0x2C ; 44 266e0: 9d e3 ldi r25, 0x3D ; 61 266e2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 266e6: 22 e0 ldi r18, 0x02 ; 2 266e8: 44 e9 ldi r20, 0x94 ; 148 266ea: 59 e3 ldi r21, 0x39 ; 57 266ec: be 01 movw r22, r28 266ee: e6 cf rjmp .-52 ; 0x266bc 000266f0 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 266f0: cf 93 push r28 266f2: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 266f4: 86 ed ldi r24, 0xD6 ; 214 266f6: 9e e0 ldi r25, 0x0E ; 14 266f8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 266fc: 81 30 cpi r24, 0x01 ; 1 266fe: c1 f5 brne .+112 ; 0x26770 MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 26700: 88 e4 ldi r24, 0x48 ; 72 26702: 9d e5 ldi r25, 0x5D ; 93 26704: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26708: 22 e0 ldi r18, 0x02 ; 2 2670a: 46 ed ldi r20, 0xD6 ; 214 2670c: 5a e3 ldi r21, 0x3A ; 58 2670e: bc 01 movw r22, r24 26710: 81 e4 ldi r24, 0x41 ; 65 26712: 90 e7 ldi r25, 0x70 ; 112 26714: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 26718: 8e ec ldi r24, 0xCE ; 206 2671a: 9e e0 ldi r25, 0x0E ; 14 2671c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 26720: 81 30 cpi r24, 0x01 ; 1 26722: 49 f5 brne .+82 ; 0x26776 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 26724: 88 e4 ldi r24, 0x48 ; 72 26726: 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); 26728: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2672c: ec 01 movw r28, r24 2672e: 8a ef ldi r24, 0xFA ; 250 26730: 96 e5 ldi r25, 0x56 ; 86 26732: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26736: 22 e0 ldi r18, 0x02 ; 2 26738: 48 e1 ldi r20, 0x18 ; 24 2673a: 5b e3 ldi r21, 0x3B ; 59 2673c: be 01 movw r22, r28 2673e: 0f 94 9f d0 call 0x3a13e ; 0x3a13e } #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); 26742: 89 ea ldi r24, 0xA9 ; 169 26744: 9d e0 ldi r25, 0x0D ; 13 26746: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2674a: 88 23 and r24, r24 2674c: b9 f0 breq .+46 ; 0x2677c 2674e: 83 e0 ldi r24, 0x03 ; 3 26750: 97 e5 ldi r25, 0x57 ; 87 26752: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26756: ec 01 movw r28, r24 26758: 8f ee ldi r24, 0xEF ; 239 2675a: 96 e5 ldi r25, 0x56 ; 86 2675c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26760: 22 e0 ldi r18, 0x02 ; 2 26762: 42 e1 ldi r20, 0x12 ; 18 26764: 5a e3 ldi r21, 0x3A ; 58 26766: be 01 movw r22, r28 #endif // MMU_FORCE_STEALTH_MODE } 26768: df 91 pop r29 2676a: 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); 2676c: 0d 94 9f d0 jmp 0x3a13e ; 0x3a13e #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); 26770: 82 e4 ldi r24, 0x42 ; 66 26772: 9d e5 ldi r25, 0x5D ; 93 26774: c7 cf rjmp .-114 ; 0x26704 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); 26776: 82 e4 ldi r24, 0x42 ; 66 26778: 9d e5 ldi r25, 0x5D ; 93 2677a: d6 cf rjmp .-84 ; 0x26728 } #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); 2677c: 8c e7 ldi r24, 0x7C ; 124 2677e: 97 e5 ldi r25, 0x57 ; 87 26780: e8 cf rjmp .-48 ; 0x26752 00026782 : MENU_END(); } static void lcd_settings_menu() { 26782: 1f 93 push r17 26784: cf 93 push r28 26786: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 26788: 8f ef ldi r24, 0xFF ; 255 2678a: 9f e0 ldi r25, 0x0F ; 15 2678c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 26790: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 MENU_BEGIN(); 26794: 0f 94 10 cf call 0x39e20 ; 0x39e20 26798: 10 92 15 05 sts 0x0515, r1 ; 0x800515 SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 2679c: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 2679e: 80 91 15 05 lds r24, 0x0515 ; 0x800515 267a2: 84 30 cpi r24, 0x04 ; 4 267a4: 08 f0 brcs .+2 ; 0x267a8 267a6: 5c c1 rjmp .+696 ; 0x26a60 267a8: 10 92 18 05 sts 0x0518, r1 ; 0x800518 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 267ac: 88 eb ldi r24, 0xB8 ; 184 267ae: 9d e3 ldi r25, 0x3D ; 61 267b0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 267b4: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 267b8: 87 ef ldi r24, 0xF7 ; 247 267ba: 97 e5 ldi r25, 0x57 ; 87 267bc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 267c0: 6b ec ldi r22, 0xCB ; 203 267c2: 74 ed ldi r23, 0xD4 ; 212 267c4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c if (!printer_active() || printingIsPaused()) 267c8: 0e 94 96 68 call 0xd12c ; 0xd12c 267cc: 88 23 and r24, r24 267ce: 21 f0 breq .+8 ; 0x267d8 267d0: 0e 94 3a 68 call 0xd074 ; 0xd074 267d4: 88 23 and r24, r24 267d6: 81 f0 breq .+32 ; 0x267f8 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 267d8: 8b ee ldi r24, 0xEB ; 235 267da: 97 e5 ldi r25, 0x57 ; 87 267dc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 267e0: 6e ea ldi r22, 0xAE ; 174 267e2: 79 e3 ldi r23, 0x39 ; 57 267e4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 267e8: 88 ed ldi r24, 0xD8 ; 216 267ea: 97 e5 ldi r25, 0x57 ; 87 267ec: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 267f0: 67 e7 ldi r22, 0x77 ; 119 267f2: 7b e6 ldi r23, 0x6B ; 107 267f4: 0f 94 06 ce call 0x39c0c ; 0x39c0c } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 267f8: 88 ec ldi r24, 0xC8 ; 200 267fa: 9c e3 ldi r25, 0x3C ; 60 267fc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26800: 6a ed ldi r22, 0xDA ; 218 26802: 7a e3 ldi r23, 0x3A ; 58 26804: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #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); 26808: 8c ea ldi r24, 0xAC ; 172 2680a: 9c e0 ldi r25, 0x0C ; 12 2680c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 26810: 88 23 and r24, r24 26812: 09 f4 brne .+2 ; 0x26816 26814: ac c0 rjmp .+344 ; 0x2696e 26816: 88 e4 ldi r24, 0x48 ; 72 26818: 9d e5 ldi r25, 0x5D ; 93 2681a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2681e: 22 e0 ldi r18, 0x02 ; 2 26820: 40 e5 ldi r20, 0x50 ; 80 26822: 5a e3 ldi r21, 0x3A ; 58 26824: bc 01 movw r22, r24 26826: 82 ec ldi r24, 0xC2 ; 194 26828: 94 ea ldi r25, 0xA4 ; 164 2682a: 0f 94 9f d0 call 0x3a13e ; 0x3a13e if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 2682e: 8c ea ldi r24, 0xAC ; 172 26830: 9c e0 ldi r25, 0x0C ; 12 26832: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 26836: 88 23 and r24, r24 26838: 31 f0 breq .+12 ; 0x26846 { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 2683a: 68 e7 ldi r22, 0x78 ; 120 2683c: 7a e3 ldi r23, 0x3A ; 58 2683e: 88 eb ldi r24, 0xB8 ; 184 26840: 94 ea ldi r25, 0xA4 ; 164 26842: 0f 94 8d ce call 0x39d1a ; 0x39d1a } if (MMU2::mmu2.Enabled()) 26846: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2684a: 81 30 cpi r24, 0x01 ; 1 2684c: 51 f4 brne .+20 ; 0x26862 { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 2684e: 0f 94 78 33 call 0x266f0 ; 0x266f0 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 26852: 89 ec ldi r24, 0xC9 ; 201 26854: 97 e5 ldi r25, 0x57 ; 87 26856: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2685a: 68 ef ldi r22, 0xF8 ; 248 2685c: 78 ed ldi r23, 0xD8 ; 216 2685e: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } SETTINGS_FANS_CHECK(); 26862: 0f 94 c1 32 call 0x26582 ; 0x26582 SETTINGS_SILENT_MODE(); 26866: 0f 94 14 33 call 0x26628 ; 0x26628 if(!farm_mode) { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 2686a: 10 93 f8 03 sts 0x03F8, r17 ; 0x8003f8 MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 2686e: 8e eb ldi r24, 0xBE ; 190 26870: 97 e5 ldi r25, 0x57 ; 87 26872: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26876: 6c e0 ldi r22, 0x0C ; 12 26878: 7b e3 ldi r23, 0x3B ; 59 2687a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } 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); 2687e: 89 e7 ldi r24, 0x79 ; 121 26880: 9a e3 ldi r25, 0x3A ; 58 26882: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26886: 64 e2 ldi r22, 0x24 ; 36 26888: 78 ed ldi r23, 0xD8 ; 216 2688a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_T(MSG_LIN_CORRECTION), lcd_settings_linearity_correction_menu); 2688e: 8c ea ldi r24, 0xAC ; 172 26890: 97 e5 ldi r25, 0x57 ; 87 26892: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26896: 6c ef ldi r22, 0xFC ; 252 26898: 7a e3 ldi r23, 0x3A ; 58 2689a: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #endif //LINEARITY_CORRECTION && TMC2130 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 2689e: 20 e0 ldi r18, 0x00 ; 0 268a0: 30 e0 ldi r19, 0x00 ; 0 268a2: 40 e2 ldi r20, 0x20 ; 32 268a4: 51 e4 ldi r21, 0x41 ; 65 268a6: 60 91 99 03 lds r22, 0x0399 ; 0x800399 268aa: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 268ae: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 268b2: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 268b6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 268ba: 87 fd sbrc r24, 7 268bc: 16 c0 rjmp .+44 ; 0x268ea 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); 268be: 8f ea ldi r24, 0xAF ; 175 268c0: 9f e0 ldi r25, 0x0F ; 15 268c2: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 268c6: 88 23 and r24, r24 268c8: 09 f4 brne .+2 ; 0x268cc 268ca: 54 c0 rjmp .+168 ; 0x26974 268cc: 88 e4 ldi r24, 0x48 ; 72 268ce: 9d e5 ldi r25, 0x5D ; 93 268d0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 268d4: ec 01 movw r28, r24 268d6: 82 e3 ldi r24, 0x32 ; 50 268d8: 9a e3 ldi r25, 0x3A ; 58 268da: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 268de: 22 e0 ldi r18, 0x02 ; 2 268e0: 4e ed ldi r20, 0xDE ; 222 268e2: 59 e3 ldi r21, 0x39 ; 57 268e4: be 01 movw r22, r28 268e6: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #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); 268ea: 80 91 21 05 lds r24, 0x0521 ; 0x800521 268ee: 81 11 cpse r24, r1 268f0: 44 c0 rjmp .+136 ; 0x2697a 268f2: 82 e4 ldi r24, 0x42 ; 66 268f4: 9d e5 ldi r25, 0x5D ; 93 268f6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 268fa: ec 01 movw r28, r24 268fc: 81 ea ldi r24, 0xA1 ; 161 268fe: 97 e5 ldi r25, 0x57 ; 87 26900: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26904: 22 e0 ldi r18, 0x02 ; 2 26906: 4e e1 ldi r20, 0x1E ; 30 26908: 5b e3 ldi r21, 0x3B ; 59 2690a: be 01 movw r22, r28 2690c: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #endif //HAS_SECOND_SERIAL if (!printingIsPaused()) MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z); 26910: 0e 94 3a 68 call 0xd074 ; 0xd074 26914: 81 11 cpse r24, r1 26916: 08 c0 rjmp .+16 ; 0x26928 26918: 8b e6 ldi r24, 0x6B ; 107 2691a: 9c e3 ldi r25, 0x3C ; 60 2691c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26920: 64 ee ldi r22, 0xE4 ; 228 26922: 79 e3 ldi r23, 0x39 ; 57 26924: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 26928: 8f e8 ldi r24, 0x8F ; 143 2692a: 97 e5 ldi r25, 0x57 ; 87 2692c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26930: 68 e2 ldi r22, 0x28 ; 40 26932: 7b e3 ldi r23, 0x3B ; 59 26934: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode if (card.ToshibaFlashAir_isEnabled()) 26938: 80 91 df 16 lds r24, 0x16DF ; 0x8016df 2693c: 88 23 and r24, r24 2693e: 01 f1 breq .+64 ; 0x26980 MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 26940: 85 e8 ldi r24, 0x85 ; 133 26942: 97 e5 ldi r25, 0x57 ; 87 26944: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26948: 22 e0 ldi r18, 0x02 ; 2 2694a: 4c e7 ldi r20, 0x7C ; 124 2694c: 5a e3 ldi r21, 0x3A ; 58 2694e: 61 e6 ldi r22, 0x61 ; 97 26950: 70 e7 ldi r23, 0x70 ; 112 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 26952: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 26956: 89 e0 ldi r24, 0x09 ; 9 26958: 9f e0 ldi r25, 0x0F ; 15 2695a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2695e: 88 23 and r24, r24 26960: e9 f0 breq .+58 ; 0x2699c 26962: 81 30 cpi r24, 0x01 ; 1 26964: 09 f4 brne .+2 ; 0x26968 26966: 6d c0 rjmp .+218 ; 0x26a42 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); 26968: 80 e3 ldi r24, 0x30 ; 48 2696a: 90 e4 ldi r25, 0x40 ; 64 2696c: 19 c0 rjmp .+50 ; 0x269a0 #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); 2696e: 82 e4 ldi r24, 0x42 ; 66 26970: 9d e5 ldi r25, 0x5D ; 93 26972: 53 cf rjmp .-346 ; 0x2681a #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); 26974: 82 e4 ldi r24, 0x42 ; 66 26976: 9d e5 ldi r25, 0x5D ; 93 26978: ab cf rjmp .-170 ; 0x268d0 #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); 2697a: 88 e4 ldi r24, 0x48 ; 72 2697c: 9d e5 ldi r25, 0x5D ; 93 2697e: bb cf rjmp .-138 ; 0x268f6 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); 26980: 8c e7 ldi r24, 0x7C ; 124 26982: 97 e5 ldi r25, 0x57 ; 87 26984: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26988: ec 01 movw r28, r24 2698a: 85 e8 ldi r24, 0x85 ; 133 2698c: 97 e5 ldi r25, 0x57 ; 87 2698e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26992: 22 e0 ldi r18, 0x02 ; 2 26994: 4c e7 ldi r20, 0x7C ; 124 26996: 5a e3 ldi r21, 0x3A ; 58 26998: be 01 movw r22, r28 2699a: db cf rjmp .-74 ; 0x26952 #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; 2699c: 85 e7 ldi r24, 0x75 ; 117 2699e: 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); 269a0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 269a4: ec 01 movw r28, r24 269a6: 8e e6 ldi r24, 0x6E ; 110 269a8: 97 e5 ldi r25, 0x57 ; 87 269aa: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 269ae: 22 e0 ldi r18, 0x02 ; 2 269b0: 44 e4 ldi r20, 0x44 ; 68 269b2: 5b e3 ldi r21, 0x3B ; 59 269b4: be 01 movw r22, r28 269b6: 0f 94 9f d0 call 0x3a13e ; 0x3a13e } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 269ba: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 269be: 82 30 cpi r24, 0x02 ; 2 269c0: 09 f4 brne .+2 ; 0x269c4 269c2: 45 c0 rjmp .+138 ; 0x26a4e 269c4: 83 30 cpi r24, 0x03 ; 3 269c6: 09 f4 brne .+2 ; 0x269ca 269c8: 45 c0 rjmp .+138 ; 0x26a54 269ca: 81 30 cpi r24, 0x01 ; 1 269cc: e9 f1 breq .+122 ; 0x26a48 269ce: 81 ec ldi r24, 0xC1 ; 193 269d0: 9c e3 ldi r25, 0x3C ; 60 269d2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 269d6: ec 01 movw r28, r24 269d8: 89 eb ldi r24, 0xB9 ; 185 269da: 9c e3 ldi r25, 0x3C ; 60 269dc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 269e0: 22 e0 ldi r18, 0x02 ; 2 269e2: 46 e6 ldi r20, 0x66 ; 102 269e4: 59 e3 ldi r21, 0x39 ; 57 269e6: be 01 movw r22, r28 269e8: 0f 94 9f d0 call 0x3a13e ; 0x3a13e #ifdef LCD_BL_PIN if (backlightSupport) 269ec: 80 91 fe 03 lds r24, 0x03FE ; 0x8003fe 269f0: 88 23 and r24, r24 269f2: 41 f0 breq .+16 ; 0x26a04 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); 269f4: 83 e9 ldi r24, 0x93 ; 147 269f6: 9c e3 ldi r25, 0x3C ; 60 269f8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 269fc: 6b e9 ldi r22, 0x9B ; 155 269fe: 77 ed ldi r23, 0xD7 ; 215 26a00: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } #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 26a04: 87 ea ldi r24, 0xA7 ; 167 26a06: 9c e0 ldi r25, 0x0C ; 12 26a08: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 26a0c: 88 23 and r24, r24 26a0e: 29 f1 breq .+74 ; 0x26a5a 26a10: 82 e7 ldi r24, 0x72 ; 114 26a12: 9d e3 ldi r25, 0x3D ; 61 26a14: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26a18: 22 e0 ldi r18, 0x02 ; 2 26a1a: 41 e6 ldi r20, 0x61 ; 97 26a1c: 52 ed ldi r21, 0xD2 ; 210 26a1e: bc 01 movw r22, r24 26a20: 84 e5 ldi r24, 0x54 ; 84 26a22: 90 e7 ldi r25, 0x70 ; 112 26a24: 0f 94 9f d0 call 0x3a13e ; 0x3a13e if (farm_mode) { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); 26a28: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 26a2c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26a30: 8f 5f subi r24, 0xFF ; 255 26a32: 80 93 15 05 sts 0x0515, r24 ; 0x800515 26a36: 80 91 17 05 lds r24, 0x0517 ; 0x800517 26a3a: 8f 5f subi r24, 0xFF ; 255 26a3c: 80 93 17 05 sts 0x0517, r24 ; 0x800517 26a40: ae ce rjmp .-676 ; 0x2679e 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; 26a42: 83 e6 ldi r24, 0x63 ; 99 26a44: 97 e5 ldi r25, 0x57 ; 87 26a46: ac cf rjmp .-168 ; 0x269a0 default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 26a48: 82 eb ldi r24, 0xB2 ; 178 26a4a: 9c e3 ldi r25, 0x3C ; 60 26a4c: c2 cf rjmp .-124 ; 0x269d2 26a4e: 89 ea ldi r24, 0xA9 ; 169 26a50: 9c e3 ldi r25, 0x3C ; 60 26a52: bf cf rjmp .-130 ; 0x269d2 26a54: 80 ea ldi r24, 0xA0 ; 160 26a56: 9c e3 ldi r25, 0x3C ; 60 26a58: bc cf rjmp .-136 ; 0x269d2 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 26a5a: 88 e7 ldi r24, 0x78 ; 120 26a5c: 9d e3 ldi r25, 0x3D ; 61 26a5e: da cf rjmp .-76 ; 0x26a14 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 26a60: df 91 pop r29 26a62: cf 91 pop r28 26a64: 1f 91 pop r17 26a66: 08 95 ret 00026a68 : //! @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) { 26a68: cf 92 push r12 26a6a: df 92 push r13 26a6c: ef 92 push r14 26a6e: ff 92 push r15 26a70: 0f 93 push r16 26a72: 1f 93 push r17 26a74: cf 93 push r28 26a76: df 93 push r29 26a78: d8 2f mov r29, r24 26a7a: 6b 01 movw r12, r22 26a7c: 7a 01 movw r14, r20 26a7e: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 26a80: 40 e2 ldi r20, 0x20 ; 32 26a82: 81 11 cpse r24, r1 26a84: 01 c0 rjmp .+2 ; 0x26a88 26a86: 4e e3 ldi r20, 0x3E ; 62 26a88: 63 e0 ldi r22, 0x03 ; 3 26a8a: 80 e0 ldi r24, 0x00 ; 0 26a8c: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_puts_P(first_choice); 26a90: c6 01 movw r24, r12 26a92: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 26a96: 40 e2 ldi r20, 0x20 ; 32 26a98: d1 30 cpi r29, 0x01 ; 1 26a9a: 09 f4 brne .+2 ; 0x26a9e 26a9c: 4e e3 ldi r20, 0x3E ; 62 26a9e: 63 e0 ldi r22, 0x03 ; 3 26aa0: 8c 2f mov r24, r28 26aa2: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_puts_P(second_choice); 26aa6: c7 01 movw r24, r14 26aa8: 0e 94 80 6f call 0xdf00 ; 0xdf00 if (third_choice) { 26aac: 01 15 cp r16, r1 26aae: 11 05 cpc r17, r1 26ab0: 19 f1 breq .+70 ; 0x26af8 26ab2: c8 01 movw r24, r16 26ab4: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> 26ab8: d8 2e mov r13, r24 26aba: c7 01 movw r24, r14 26abc: 0f 94 4f db call 0x3b69e ; 0x3b69e <__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; 26ac0: 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;} 26ac2: 93 e1 ldi r25, 0x13 ; 19 26ac4: 9d 19 sub r25, r13 26ac6: 8c 0f add r24, r28 26ac8: 89 17 cp r24, r25 26aca: 08 f4 brcc .+2 ; 0x26ace 26acc: 89 2f mov r24, r25 26ace: 83 31 cpi r24, 0x13 ; 19 26ad0: 08 f0 brcs .+2 ; 0x26ad4 26ad2: 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 ? '>': ' '); 26ad4: 40 e2 ldi r20, 0x20 ; 32 26ad6: d2 30 cpi r29, 0x02 ; 2 26ad8: 09 f4 brne .+2 ; 0x26adc 26ada: 4e e3 ldi r20, 0x3E ; 62 26adc: 63 e0 ldi r22, 0x03 ; 3 26ade: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_puts_P(third_choice); 26ae2: c8 01 movw r24, r16 } } 26ae4: df 91 pop r29 26ae6: cf 91 pop r28 26ae8: 1f 91 pop r17 26aea: 0f 91 pop r16 26aec: ff 90 pop r15 26aee: ef 90 pop r14 26af0: df 90 pop r13 26af2: 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); 26af4: 0c 94 80 6f jmp 0xdf00 ; 0xdf00 } } 26af8: df 91 pop r29 26afa: cf 91 pop r28 26afc: 1f 91 pop r17 26afe: 0f 91 pop r16 26b00: ff 90 pop r15 26b02: ef 90 pop r14 26b04: df 90 pop r13 26b06: cf 90 pop r12 26b08: 08 95 ret 00026b0a : return multi_screen ? msgend : NULL; } const char* lcd_display_message_fullscreen_P(const char *msg) { 26b0a: cf 93 push r28 26b0c: df 93 push r29 26b0e: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 26b10: 80 e0 ldi r24, 0x00 ; 0 26b12: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); 26b16: 0e 94 c8 6f call 0xdf90 ; 0xdf90 return lcd_display_message_fullscreen_nonBlocking_P(msg); 26b1a: ce 01 movw r24, r28 } 26b1c: df 91 pop r29 26b1e: 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); 26b20: 0d 94 8c 2c jmp 0x25918 ; 0x25918 00026b24 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 26b24: cf 92 push r12 26b26: df 92 push r13 26b28: ef 92 push r14 26b2a: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 26b2c: 80 e0 ldi r24, 0x00 ; 0 26b2e: 90 e0 ldi r25, 0x00 ; 0 26b30: a8 ec ldi r26, 0xC8 ; 200 26b32: b2 e4 ldi r27, 0x42 ; 66 26b34: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 26b38: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 26b3c: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 26b40: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 26b44: 65 e5 ldi r22, 0x55 ; 85 26b46: 75 e5 ldi r23, 0x55 ; 85 26b48: 85 e5 ldi r24, 0x55 ; 85 26b4a: 91 e4 ldi r25, 0x41 ; 65 26b4c: 0f 94 93 ba call 0x37526 ; 0x37526 delay_keep_alive(2000); 26b50: 80 ed ldi r24, 0xD0 ; 208 26b52: 97 e0 ldi r25, 0x07 ; 7 26b54: 0e 94 87 8e call 0x11d0e ; 0x11d0e lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26b58: 8c e6 ldi r24, 0x6C ; 108 26b5a: 9f e4 ldi r25, 0x4F ; 79 26b5c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26b60: 0f 94 85 35 call 0x26b0a ; 0x26b0a return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 26b64: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 26b68: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 26b6c: 07 2e mov r0, r23 26b6e: 00 0c add r0, r0 26b70: 88 0b sbc r24, r24 26b72: 99 0b sbc r25, r25 26b74: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 26b78: 9b 01 movw r18, r22 26b7a: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 26b7c: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 26b80: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 26b84: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 26b88: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 26b8c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 26b90: 9f 77 andi r25, 0x7F ; 127 26b92: 20 e0 ldi r18, 0x00 ; 0 26b94: 30 e0 ldi r19, 0x00 ; 0 26b96: 40 ea ldi r20, 0xA0 ; 160 26b98: 50 e4 ldi r21, 0x40 ; 64 26b9a: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 26b9e: 18 16 cp r1, r24 26ba0: b4 f5 brge .+108 ; 0x26c0e lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 26ba2: 8c e6 ldi r24, 0x6C ; 108 26ba4: 9f e4 ldi r25, 0x4F ; 79 26ba6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26baa: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_set_cursor(0, 4); 26bae: 64 e0 ldi r22, 0x04 ; 4 26bb0: 80 e0 ldi r24, 0x00 ; 0 26bb2: 0e 94 95 6f call 0xdf2a ; 0xdf2a 26bb6: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 26bba: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 26bbe: 07 2e mov r0, r23 26bc0: 00 0c add r0, r0 26bc2: 88 0b sbc r24, r24 26bc4: 99 0b sbc r25, r25 26bc6: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__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)); 26bca: 20 e0 ldi r18, 0x00 ; 0 26bcc: 30 e0 ldi r19, 0x00 ; 0 26bce: 40 e0 ldi r20, 0x00 ; 0 26bd0: 5f e3 ldi r21, 0x3F ; 63 26bd2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 26bd6: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 26bda: 6b 01 movw r12, r22 26bdc: 20 e0 ldi r18, 0x00 ; 0 26bde: 30 e0 ldi r19, 0x00 ; 0 26be0: 40 e0 ldi r20, 0x00 ; 0 26be2: 5f e3 ldi r21, 0x3F ; 63 26be4: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 26be8: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 26bec: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 26bf0: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 26bf4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 26bf8: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 26bfc: a6 01 movw r20, r12 26bfe: 82 e8 ldi r24, 0x82 ; 130 26c00: 0f 94 22 2f call 0x25e44 ; 0x25e44 delay_keep_alive(1000); 26c04: 88 ee ldi r24, 0xE8 ; 232 26c06: 93 e0 ldi r25, 0x03 ; 3 26c08: 0e 94 87 8e call 0x11d0e ; 0x11d0e 26c0c: ab cf rjmp .-170 ; 0x26b64 } } 26c0e: ff 90 pop r15 26c10: ef 90 pop r14 26c12: df 90 pop r13 26c14: cf 90 pop r12 26c16: 08 95 ret 00026c18 : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 26c18: cf 92 push r12 26c1a: df 92 push r13 26c1c: ef 92 push r14 26c1e: ff 92 push r15 26c20: 0f 93 push r16 26c22: 1f 93 push r17 26c24: cf 93 push r28 26c26: df 93 push r29 26c28: d8 2e mov r13, r24 26c2a: 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) 26c2c: 01 e0 ldi r16, 0x01 ; 1 26c2e: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 26c32: 81 11 cpse r24, r1 26c34: 01 c0 rjmp .+2 ; 0x26c38 26c36: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 26c38: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 26c3c: 8d 2d mov r24, r13 26c3e: 9c 2d mov r25, r12 26c40: 0f 94 85 35 call 0x26b0a ; 0x26b0a 26c44: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 26c46: 0e 94 ad 71 call 0xe35a ; 0xe35a KEEPALIVE_STATE(PAUSED_FOR_USER); 26c4a: 84 e0 ldi r24, 0x04 ; 4 26c4c: 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); 26c50: 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) { 26c52: 20 97 sbiw r28, 0x00 ; 0 26c54: 29 f4 brne .+10 ; 0x26c60 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 26c56: 49 e8 ldi r20, 0x89 ; 137 26c58: 63 e0 ldi r22, 0x03 ; 3 26c5a: 83 e1 ldi r24, 0x13 ; 19 26c5c: 0e 94 b5 6f call 0xdf6a ; 0xdf6a * @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); 26c60: 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); 26c62: 82 e3 ldi r24, 0x32 ; 50 26c64: 90 e0 ldi r25, 0x00 ; 0 26c66: 0e 94 87 8e call 0x11d0e ; 0x11d0e if (lcd_clicked()) { 26c6a: 0e 94 b2 71 call 0xe364 ; 0xe364 26c6e: 88 23 and r24, r24 26c70: 81 f0 breq .+32 ; 0x26c92 if (msg_next == NULL) { 26c72: 20 97 sbiw r28, 0x00 ; 0 26c74: 81 f4 brne .+32 ; 0x26c96 KEEPALIVE_STATE(IN_HANDLER); 26c76: 82 e0 ldi r24, 0x02 ; 2 26c78: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 26c7c: 00 93 6e 02 sts 0x026E, r16 ; 0x80026e if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 26c80: df 91 pop r29 26c82: cf 91 pop r28 26c84: 1f 91 pop r17 26c86: 0f 91 pop r16 26c88: ff 90 pop r15 26c8a: ef 90 pop r14 26c8c: df 90 pop r13 26c8e: cf 90 pop r12 26c90: 08 95 ret 26c92: 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) { 26c94: 31 f7 brne .-52 ; 0x26c62 else { break; } } } if (multi_screen) { 26c96: e1 14 cp r14, r1 26c98: f1 04 cpc r15, r1 26c9a: d9 f2 breq .-74 ; 0x26c52 if (msg_next == NULL) 26c9c: 20 97 sbiw r28, 0x00 ; 0 26c9e: 11 f4 brne .+4 ; 0x26ca4 msg_next = msg; 26ca0: cd 2d mov r28, r13 26ca2: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 26ca4: ce 01 movw r24, r28 26ca6: 0f 94 85 35 call 0x26b0a ; 0x26b0a 26caa: ec 01 movw r28, r24 26cac: d2 cf rjmp .-92 ; 0x26c52 00026cae : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 26cae: cf 93 push r28 26cb0: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 26cb2: 8e e5 ldi r24, 0x5E ; 94 26cb4: 91 e5 ldi r25, 0x51 ; 81 26cb6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26cba: 0f 94 0c 36 call 0x26c18 ; 0x26c18 _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 26cbe: 80 91 98 13 lds r24, 0x1398 ; 0x801398 26cc2: 81 30 cpi r24, 0x01 ; 1 26cc4: 69 f4 brne .+26 ; 0x26ce0 { lcd_show_fullscreen_message_and_wait_P( 26cc6: 85 e0 ldi r24, 0x05 ; 5 26cc8: 91 e5 ldi r25, 0x51 ; 81 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 26cca: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26cce: 0f 94 0c 36 call 0x26c18 ; 0x26c18 _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 26cd2: 83 e3 ldi r24, 0x33 ; 51 26cd4: 90 e5 ldi r25, 0x50 ; 80 26cd6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 _T(MSG_WIZARD_V2_CAL_2)); } 26cda: 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( 26cdc: 0d 94 0c 36 jmp 0x26c18 ; 0x26c18 if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 26ce0: cc 23 and r28, r28 26ce2: b9 f3 breq .-18 ; 0x26cd2 { lcd_show_fullscreen_message_and_wait_P( 26ce4: 83 ed ldi r24, 0xD3 ; 211 26ce6: 90 e5 ldi r25, 0x50 ; 80 26ce8: f0 cf rjmp .-32 ; 0x26cca 00026cea : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 26cea: 80 91 98 13 lds r24, 0x1398 ; 0x801398 26cee: 81 30 cpi r24, 0x01 ; 1 26cf0: 71 f4 brne .+28 ; 0x26d0e lcd_show_fullscreen_message_and_wait_P( 26cf2: 8a ed ldi r24, 0xDA ; 218 26cf4: 9f e4 ldi r25, 0x4F ; 79 26cf6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26cfa: 0f 94 0c 36 call 0x26c18 ; 0x26c18 _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; 26cfe: 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; 26d00: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 26d04: 61 e0 ldi r22, 0x01 ; 1 26d06: 81 e6 ldi r24, 0x61 ; 97 26d08: 94 ea ldi r25, 0xA4 ; 164 26d0a: 0c 94 4b 89 jmp 0x11296 ; 0x11296 // 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( 26d0e: 8e e8 ldi r24, 0x8E ; 142 26d10: 9f e4 ldi r25, 0x4F ; 79 26d12: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26d16: 0f 94 0c 36 call 0x26c18 ; 0x26c18 _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 26d1a: 80 e0 ldi r24, 0x00 ; 0 26d1c: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); 26d20: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 26d24: 86 e7 ldi r24, 0x76 ; 118 26d26: 9c e5 ldi r25, 0x5C ; 92 26d28: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26d2c: ac 01 movw r20, r24 26d2e: 62 e0 ldi r22, 0x02 ; 2 26d30: 80 e0 ldi r24, 0x00 ; 0 26d32: 0e 94 a9 6f call 0xdf52 ; 0xdf52 eFilamentAction = FilamentAction::Load; 26d36: 81 e0 ldi r24, 0x01 ; 1 26d38: e3 cf rjmp .-58 ; 0x26d00 00026d3a : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 26d3a: cf 93 push r28 26d3c: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 26d3e: 10 92 75 07 sts 0x0775, r1 ; 0x800775 disable_x(); 26d42: 17 9a sbi 0x02, 7 ; 2 26d44: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 26d48: 16 9a sbi 0x02, 6 ; 2 26d4a: 10 92 41 07 sts 0x0741, r1 ; 0x800741 disable_z(); disable_e0(); 26d4e: 14 9a sbi 0x02, 4 ; 2 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 26d50: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 26d54: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 26d58: 68 2f mov r22, r24 26d5a: 86 ea ldi r24, 0xA6 ; 166 26d5c: 9f e0 ldi r25, 0x0F ; 15 26d5e: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 26d62: 6c 2f mov r22, r28 26d64: 8f ea ldi r24, 0xAF ; 175 26d66: 9f e0 ldi r25, 0x0F ; 15 26d68: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a // 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) { 26d6c: cc 23 and r28, r28 26d6e: 89 f0 breq .+34 ; 0x26d92 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 26d70: 86 e1 ldi r24, 0x16 ; 22 26d72: 94 ea ldi r25, 0xA4 ; 164 26d74: 0e 94 06 7b call 0xf60c ; 0xf60c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 26d78: 86 e8 ldi r24, 0x86 ; 134 26d7a: 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)); 26d7c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26d80: 0f 94 0c 36 call 0x26c18 ; 0x26c18 } lcd_update_enable(true); 26d84: 81 e0 ldi r24, 0x01 ; 1 26d86: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_update(2); 26d8a: 82 e0 ldi r24, 0x02 ; 2 } 26d8c: 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); 26d8e: 0c 94 5c 6f jmp 0xdeb8 ; 0xdeb8 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."); 26d92: 8b ed ldi r24, 0xDB ; 219 26d94: 93 ea ldi r25, 0xA3 ; 163 26d96: 0e 94 06 7b call 0xf60c ; 0xf60c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 26d9a: 8b e6 ldi r24, 0x6B ; 107 26d9c: 9d e4 ldi r25, 0x4D ; 77 26d9e: ee cf rjmp .-36 ; 0x26d7c 00026da0 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 26da0: 1f 93 push r17 26da2: cf 93 push r28 26da4: 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); 26da6: 64 e6 ldi r22, 0x64 ; 100 26da8: 70 e0 ldi r23, 0x00 ; 0 26daa: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 26dae: 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++) { 26db0: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 26db2: 4e e2 ldi r20, 0x2E ; 46 26db4: 63 e0 ldi r22, 0x03 ; 3 26db6: 81 2f mov r24, r17 26db8: 0e 94 b5 6f call 0xdf6a ; 0xdf6a //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 26dbc: ce 01 movw r24, r28 26dbe: 0e 94 87 8e call 0x11d0e ; 0x11d0e 26dc2: ce 01 movw r24, r28 26dc4: 0e 94 87 8e call 0x11d0e ; 0x11d0e 26dc8: ce 01 movw r24, r28 26dca: 0e 94 87 8e call 0x11d0e ; 0x11d0e 26dce: ce 01 movw r24, r28 26dd0: 0e 94 87 8e call 0x11d0e ; 0x11d0e 26dd4: ce 01 movw r24, r28 26dd6: 0e 94 87 8e call 0x11d0e ; 0x11d0e } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 26dda: 1f 5f subi r17, 0xFF ; 255 26ddc: 14 31 cpi r17, 0x14 ; 20 26dde: 49 f7 brne .-46 ; 0x26db2 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 26de0: df 91 pop r29 26de2: cf 91 pop r28 26de4: 1f 91 pop r17 26de6: 08 95 ret 00026de8 : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 26de8: 10 92 a7 03 sts 0x03A7, r1 ; 0x8003a7 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 26dec: 08 95 ret 00026dee : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 26dee: cf 93 push r28 MENU_BEGIN(); 26df0: 0f 94 10 cf call 0x39e20 ; 0x39e20 26df4: 10 92 15 05 sts 0x0515, r1 ; 0x800515 26df8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26dfc: 84 30 cpi r24, 0x04 ; 4 26dfe: 08 f0 brcs .+2 ; 0x26e02 26e00: a1 c0 rjmp .+322 ; 0x26f44 26e02: 10 92 18 05 sts 0x0518, r1 ; 0x800518 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 26e06: 8f e5 ldi r24, 0x5F ; 95 26e08: 9f e0 ldi r25, 0x0F ; 15 26e0a: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 26e0e: 81 11 cpse r24, r1 26e10: 10 c0 rjmp .+32 ; 0x26e32 { ON_MENU_LEAVE( 26e12: 0f 94 90 cd call 0x39b20 ; 0x39b20 26e16: 81 11 cpse r24, r1 26e18: 0f 94 f4 36 call 0x26de8 ; 0x26de8 clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 26e1c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 26e20: 8a 30 cpi r24, 0x0A ; 10 26e22: 09 f4 brne .+2 ; 0x26e26 26e24: 8c c0 rjmp .+280 ; 0x26f3e 26e26: 88 eb ldi r24, 0xB8 ; 184 26e28: 9d e3 ldi r25, 0x3D ; 61 26e2a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26e2e: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 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(); 26e32: 0f 94 e3 22 call 0x245c6 ; 0x245c6 26e36: 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); 26e38: 8e e7 ldi r24, 0x7E ; 126 26e3a: 93 ea ldi r25, 0xA3 ; 163 26e3c: cc 23 and r28, r28 26e3e: 11 f0 breq .+4 ; 0x26e44 26e40: 8d e8 ldi r24, 0x8D ; 141 26e42: 93 ea ldi r25, 0xA3 ; 163 26e44: 64 e1 ldi r22, 0x14 ; 20 26e46: 7a e3 ldi r23, 0x3A ; 58 26e48: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26e4c: 83 e6 ldi r24, 0x63 ; 99 26e4e: 93 ea ldi r25, 0xA3 ; 163 26e50: cc 23 and r28, r28 26e52: 11 f0 breq .+4 ; 0x26e58 26e54: 82 e7 ldi r24, 0x72 ; 114 26e56: 93 ea ldi r25, 0xA3 ; 163 26e58: 6c e2 ldi r22, 0x2C ; 44 26e5a: 7b e3 ldi r23, 0x3B ; 59 26e5c: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26e60: 87 e4 ldi r24, 0x47 ; 71 26e62: 93 ea ldi r25, 0xA3 ; 163 26e64: cc 23 and r28, r28 26e66: 11 f0 breq .+4 ; 0x26e6c 26e68: 87 e5 ldi r24, 0x57 ; 87 26e6a: 93 ea ldi r25, 0xA3 ; 163 26e6c: 6e e1 ldi r22, 0x1E ; 30 26e6e: 7a e3 ldi r23, 0x3A ; 58 26e70: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26e74: 8b e2 ldi r24, 0x2B ; 43 26e76: 93 ea ldi r25, 0xA3 ; 163 26e78: cc 23 and r28, r28 26e7a: 11 f0 breq .+4 ; 0x26e80 26e7c: 8b e3 ldi r24, 0x3B ; 59 26e7e: 93 ea ldi r25, 0xA3 ; 163 26e80: 6a e3 ldi r22, 0x3A ; 58 26e82: 7b e3 ldi r23, 0x3B ; 59 26e84: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26e88: 80 e1 ldi r24, 0x10 ; 16 26e8a: 93 ea ldi r25, 0xA3 ; 163 26e8c: cc 23 and r28, r28 26e8e: 11 f0 breq .+4 ; 0x26e94 26e90: 8f e1 ldi r24, 0x1F ; 31 26e92: 93 ea ldi r25, 0xA3 ; 163 26e94: 64 e5 ldi r22, 0x54 ; 84 26e96: 7a e3 ldi r23, 0x3A ; 58 26e98: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26e9c: 85 ef ldi r24, 0xF5 ; 245 26e9e: 92 ea ldi r25, 0xA2 ; 162 26ea0: cc 23 and r28, r28 26ea2: 11 f0 breq .+4 ; 0x26ea8 26ea4: 84 e0 ldi r24, 0x04 ; 4 26ea6: 93 ea ldi r25, 0xA3 ; 163 26ea8: 6c ea ldi r22, 0xAC ; 172 26eaa: 79 e3 ldi r23, 0x39 ; 57 26eac: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26eb0: 89 ed ldi r24, 0xD9 ; 217 26eb2: 92 ea ldi r25, 0xA2 ; 162 26eb4: cc 23 and r28, r28 26eb6: 11 f0 breq .+4 ; 0x26ebc 26eb8: 89 ee ldi r24, 0xE9 ; 233 26eba: 92 ea ldi r25, 0xA2 ; 162 26ebc: 68 e6 ldi r22, 0x68 ; 104 26ebe: 7b e3 ldi r23, 0x3B ; 59 26ec0: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26ec4: 8d eb ldi r24, 0xBD ; 189 26ec6: 92 ea ldi r25, 0xA2 ; 162 26ec8: cc 23 and r28, r28 26eca: 11 f0 breq .+4 ; 0x26ed0 26ecc: 8d ec ldi r24, 0xCD ; 205 26ece: 92 ea ldi r25, 0xA2 ; 162 26ed0: 62 e6 ldi r22, 0x62 ; 98 26ed2: 79 e3 ldi r23, 0x39 ; 57 26ed4: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26ed8: 81 ea ldi r24, 0xA1 ; 161 26eda: 92 ea ldi r25, 0xA2 ; 162 26edc: cc 23 and r28, r28 26ede: 11 f0 breq .+4 ; 0x26ee4 26ee0: 81 eb ldi r24, 0xB1 ; 177 26ee2: 92 ea ldi r25, 0xA2 ; 162 26ee4: 60 ec ldi r22, 0xC0 ; 192 26ee6: 79 e3 ldi r23, 0x39 ; 57 26ee8: 0f 94 8e d1 call 0x3a31c ; 0x3a31c 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); 26eec: 86 e8 ldi r24, 0x86 ; 134 26eee: 92 ea ldi r25, 0xA2 ; 162 26ef0: cc 23 and r28, r28 26ef2: 11 f0 breq .+4 ; 0x26ef8 26ef4: 85 e9 ldi r24, 0x95 ; 149 26ef6: 92 ea ldi r25, 0xA2 ; 162 26ef8: 6a ea ldi r22, 0xAA ; 170 26efa: 7a e3 ldi r23, 0x3A ; 58 26efc: 0f 94 8e d1 call 0x3a31c ; 0x3a31c } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); 26f00: 8f e5 ldi r24, 0x5F ; 95 26f02: 9f e0 ldi r25, 0x0F ; 15 26f04: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 26f08: 81 11 cpse r24, r1 26f0a: 0c c0 rjmp .+24 ; 0x26f24 26f0c: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 26f10: 89 30 cpi r24, 0x09 ; 9 26f12: 41 f4 brne .+16 ; 0x26f24 26f14: 85 eb ldi r24, 0xB5 ; 181 26f16: 9b e4 ldi r25, 0x4B ; 75 26f18: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 26f1c: 6c eb ldi r22, 0xBC ; 188 26f1e: 7a e3 ldi r23, 0x3A ; 58 26f20: 0f 94 8d ce call 0x39d1a ; 0x39d1a MENU_END(); 26f24: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 26f28: 80 91 15 05 lds r24, 0x0515 ; 0x800515 26f2c: 8f 5f subi r24, 0xFF ; 255 26f2e: 80 93 15 05 sts 0x0515, r24 ; 0x800515 26f32: 80 91 17 05 lds r24, 0x0517 ; 0x800517 26f36: 8f 5f subi r24, 0xFF ; 255 26f38: 80 93 17 05 sts 0x0517, r24 ; 0x800517 26f3c: 5d cf rjmp .-326 ; 0x26df8 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)); 26f3e: 89 e1 ldi r24, 0x19 ; 25 26f40: 90 e4 ldi r25, 0x40 ; 64 26f42: 73 cf rjmp .-282 ; 0x26e2a 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(); } 26f44: cf 91 pop r28 26f46: 08 95 ret 00026f48 : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 26f48: 89 e0 ldi r24, 0x09 ; 9 26f4a: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 lcd_generic_preheat_menu(); 26f4e: 0d 94 f7 36 jmp 0x26dee ; 0x26dee 00026f52 : // 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); 26f52: 81 e0 ldi r24, 0x01 ; 1 26f54: 0e 94 8b 6f call 0xdf16 ; 0xdf16 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 26f58: 0f 94 dd 76 call 0x2edba ; 0x2edba 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; 26f5c: 90 91 80 13 lds r25, 0x1380 ; 0x801380 26f60: 93 36 cpi r25, 0x63 ; 99 26f62: 09 f4 brne .+2 ; 0x26f66 26f64: 9f ef ldi r25, 0xFF ; 255 26f66: 89 13 cpse r24, r25 26f68: 0e c0 rjmp .+28 ; 0x26f86 lcd_putc('F'); 26f6a: 86 e4 ldi r24, 0x46 ; 70 26f6c: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26f70: 0f 94 dd 76 call 0x2edba ; 0x2edba 26f74: 8f 3f cpi r24, 0xFF ; 255 26f76: 29 f0 breq .+10 ; 0x26f82 26f78: 8f 5c subi r24, 0xCF ; 207 26f7a: 0e 94 84 6f call 0xdf08 ; 0xdf08 26f7e: 83 e0 ldi r24, 0x03 ; 3 26f80: 08 95 ret 26f82: 8f e3 ldi r24, 0x3F ; 63 26f84: fa cf rjmp .-12 ; 0x26f7a chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 26f86: 8f 3f cpi r24, 0xFF ; 255 26f88: 89 f0 breq .+34 ; 0x26fac 26f8a: 8f 5c subi r24, 0xCF ; 207 26f8c: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_putc('>'); 26f90: 8e e3 ldi r24, 0x3E ; 62 26f92: 0e 94 84 6f call 0xdf08 ; 0xdf08 26f96: 80 91 80 13 lds r24, 0x1380 ; 0x801380 26f9a: 83 36 cpi r24, 0x63 ; 99 26f9c: 49 f0 breq .+18 ; 0x26fb0 lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26f9e: 8f 3f cpi r24, 0xFF ; 255 26fa0: 39 f0 breq .+14 ; 0x26fb0 26fa2: 8f 5c subi r24, 0xCF ; 207 26fa4: 0e 94 84 6f call 0xdf08 ; 0xdf08 chars += 3; 26fa8: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 26faa: 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'); 26fac: 8f e3 ldi r24, 0x3F ; 63 26fae: ee cf rjmp .-36 ; 0x26f8c lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 26fb0: 8f e3 ldi r24, 0x3F ; 63 26fb2: f8 cf rjmp .-16 ; 0x26fa4 00026fb4 <__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) { 26fb4: 1f 92 push r1 26fb6: 0f 92 push r0 26fb8: 0f b6 in r0, 0x3f ; 63 26fba: 0f 92 push r0 26fbc: 11 24 eor r1, r1 26fbe: 0b b6 in r0, 0x3b ; 59 26fc0: 0f 92 push r0 26fc2: 2f 93 push r18 26fc4: 3f 93 push r19 26fc6: 4f 93 push r20 26fc8: 5f 93 push r21 26fca: 6f 93 push r22 26fcc: 7f 93 push r23 26fce: 8f 93 push r24 26fd0: 9f 93 push r25 26fd2: af 93 push r26 26fd4: bf 93 push r27 26fd6: ef 93 push r30 26fd8: ff 93 push r31 if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 26fda: 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 26fde: 80 91 23 05 lds r24, 0x0523 ; 0x800523 uint8_t buf_r = ptr[2]; //get read index 26fe2: 90 91 24 05 lds r25, 0x0524 ; 0x800524 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 26fe6: e8 2f mov r30, r24 26fe8: f0 e0 ldi r31, 0x00 ; 0 26fea: ea 5d subi r30, 0xDA ; 218 26fec: fa 4f sbci r31, 0xFA ; 250 26fee: 20 83 st Z, r18 buf_w++; //incerment write index 26ff0: 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 26ff2: 20 91 22 05 lds r18, 0x0522 ; 0x800522 26ff6: 82 17 cp r24, r18 26ff8: 08 f0 brcs .+2 ; 0x26ffc <__vector_51+0x48> 26ffa: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 26ffc: 98 13 cpse r25, r24 26ffe: 17 c0 rjmp .+46 ; 0x2702e <__vector_51+0x7a> { //rx buffer full puts_P(PSTR("USART2 rx Full!!!")); 27000: 80 ea ldi r24, 0xA0 ; 160 27002: 90 ea ldi r25, 0xA0 ; 160 27004: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 } } 27008: ff 91 pop r31 2700a: ef 91 pop r30 2700c: bf 91 pop r27 2700e: af 91 pop r26 27010: 9f 91 pop r25 27012: 8f 91 pop r24 27014: 7f 91 pop r23 27016: 6f 91 pop r22 27018: 5f 91 pop r21 2701a: 4f 91 pop r20 2701c: 3f 91 pop r19 2701e: 2f 91 pop r18 27020: 0f 90 pop r0 27022: 0b be out 0x3b, r0 ; 59 27024: 0f 90 pop r0 27026: 0f be out 0x3f, r0 ; 63 27028: 0f 90 pop r0 2702a: 1f 90 pop r1 2702c: 18 95 reti ptr[1] = buf_w; //store write index 2702e: 80 93 23 05 sts 0x0523, r24 ; 0x800523 27032: ea cf rjmp .-44 ; 0x27008 <__vector_51+0x54> 00027034 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 27034: 1f 92 push r1 27036: 0f 92 push r0 27038: 0f b6 in r0, 0x3f ; 63 2703a: 0f 92 push r0 2703c: 11 24 eor r1, r1 2703e: 0b b6 in r0, 0x3b ; 59 27040: 0f 92 push r0 27042: 8f 93 push r24 27044: 9f 93 push r25 27046: ef 93 push r30 27048: ff 93 push r31 WRITE(BEEPER, 0); 2704a: 9f b7 in r25, 0x3f ; 63 2704c: f8 94 cli 2704e: e2 e0 ldi r30, 0x02 ; 2 27050: f1 e0 ldi r31, 0x01 ; 1 27052: 80 81 ld r24, Z 27054: 8b 7f andi r24, 0xFB ; 251 27056: 80 83 st Z, r24 27058: 9f bf out 0x3f, r25 ; 63 } 2705a: ff 91 pop r31 2705c: ef 91 pop r30 2705e: 9f 91 pop r25 27060: 8f 91 pop r24 27062: 0f 90 pop r0 27064: 0b be out 0x3b, r0 ; 59 27066: 0f 90 pop r0 27068: 0f be out 0x3f, r0 ; 63 2706a: 0f 90 pop r0 2706c: 1f 90 pop r1 2706e: 18 95 reti 00027070 <__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) { 27070: 1f 92 push r1 27072: 0f 92 push r0 27074: 0f b6 in r0, 0x3f ; 63 27076: 0f 92 push r0 27078: 11 24 eor r1, r1 2707a: 0b b6 in r0, 0x3b ; 59 2707c: 0f 92 push r0 2707e: 8f 93 push r24 27080: 9f 93 push r25 27082: ef 93 push r30 27084: ff 93 push r31 WRITE(BEEPER, 1); 27086: 9f b7 in r25, 0x3f ; 63 27088: f8 94 cli 2708a: e2 e0 ldi r30, 0x02 ; 2 2708c: f1 e0 ldi r31, 0x01 ; 1 2708e: 80 81 ld r24, Z 27090: 84 60 ori r24, 0x04 ; 4 27092: 80 83 st Z, r24 27094: 9f bf out 0x3f, r25 ; 63 } 27096: ff 91 pop r31 27098: ef 91 pop r30 2709a: 9f 91 pop r25 2709c: 8f 91 pop r24 2709e: 0f 90 pop r0 270a0: 0b be out 0x3b, r0 ; 59 270a2: 0f 90 pop r0 270a4: 0f be out 0x3f, r0 ; 63 270a6: 0f 90 pop r0 270a8: 1f 90 pop r1 270aa: 18 95 reti 000270ac : if (cval) cval[cl] = sum / cnt; return ++cl; } bool tmc2130_home_calibrate(uint8_t axis) { 270ac: 6f 92 push r6 270ae: 7f 92 push r7 270b0: 8f 92 push r8 270b2: 9f 92 push r9 270b4: af 92 push r10 270b6: bf 92 push r11 270b8: df 92 push r13 270ba: ef 92 push r14 270bc: ff 92 push r15 270be: 0f 93 push r16 270c0: 1f 93 push r17 270c2: cf 93 push r28 270c4: df 93 push r29 270c6: cd b7 in r28, 0x3d ; 61 270c8: de b7 in r29, 0x3e ; 62 270ca: e0 97 sbiw r28, 0x30 ; 48 270cc: 0f b6 in r0, 0x3f ; 63 270ce: f8 94 cli 270d0: de bf out 0x3e, r29 ; 62 270d2: 0f be out 0x3f, r0 ; 63 270d4: cd bf out 0x3d, r28 ; 61 270d6: d8 2e mov r13, r24 uint8_t step[16]; uint8_t cnt[16]; uint8_t val[16]; homeaxis(axis, 16, step); 270d8: ae 01 movw r20, r28 270da: 4f 5f subi r20, 0xFF ; 255 270dc: 5f 4f sbci r21, 0xFF ; 255 270de: 60 e1 ldi r22, 0x10 ; 16 270e0: 0e 94 f6 7b call 0xf7ec ; 0xf7ec bubblesort_uint8(step, 16, 0); 270e4: 50 e0 ldi r21, 0x00 ; 0 270e6: 40 e0 ldi r20, 0x00 ; 0 270e8: 60 e1 ldi r22, 0x10 ; 16 270ea: ce 01 movw r24, r28 270ec: 01 96 adiw r24, 0x01 ; 1 270ee: 0f 94 9d 1e call 0x23d3a ; 0x23d3a puts_P(PSTR("sorted samples:")); 270f2: 80 e9 ldi r24, 0x90 ; 144 270f4: 90 ea ldi r25, 0xA0 ; 160 270f6: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 270fa: 9e 01 movw r18, r28 270fc: 2f 5f subi r18, 0xFF ; 255 270fe: 3f 4f sbci r19, 0xFF ; 255 27100: 59 01 movw r10, r18 27102: 10 e0 ldi r17, 0x00 ; 0 27104: 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]); 27106: 2f e7 ldi r18, 0x7F ; 127 27108: e2 2e mov r14, r18 2710a: 20 ea ldi r18, 0xA0 ; 160 2710c: f2 2e mov r15, r18 2710e: d5 01 movw r26, r10 27110: 8d 91 ld r24, X+ 27112: 5d 01 movw r10, r26 27114: 1f 92 push r1 27116: 8f 93 push r24 27118: 1f 93 push r17 2711a: 0f 93 push r16 2711c: ff 92 push r15 2711e: ef 92 push r14 27120: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 27124: 0f 5f subi r16, 0xFF ; 255 27126: 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++) 27128: 0f 90 pop r0 2712a: 0f 90 pop r0 2712c: 0f 90 pop r0 2712e: 0f 90 pop r0 27130: 0f 90 pop r0 27132: 0f 90 pop r0 27134: 00 31 cpi r16, 0x10 ; 16 27136: 11 05 cpc r17, r1 27138: 51 f7 brne .-44 ; 0x2710e } 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]; 2713a: 09 81 ldd r16, Y+1 ; 0x01 2713c: 10 e0 ldi r17, 0x00 ; 0 2713e: 5e 01 movw r10, r28 27140: b2 e0 ldi r27, 0x02 ; 2 27142: ab 0e add r10, r27 27144: b1 1c adc r11, r1 27146: ee 24 eor r14, r14 27148: e3 94 inc r14 2714a: f1 2c mov r15, r1 2714c: ec 0e add r14, r28 2714e: fd 1e adc r15, r29 27150: e0 e1 ldi r30, 0x10 ; 16 27152: ee 0e add r14, r30 27154: f1 1c adc r15, r1 uint8_t cl = 0; 27156: 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; 27158: 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]; 2715a: d5 01 movw r26, r10 2715c: 3d 91 ld r19, X+ 2715e: 5d 01 movw r10, r26 uint8_t val = sum / cnt; 27160: 62 2f mov r22, r18 27162: 70 e0 ldi r23, 0x00 ; 0 27164: c8 01 movw r24, r16 27166: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> uint8_t dif = 0; if (val > d) dif = val - d; 2716a: 46 2f mov r20, r22 2716c: 43 1b sub r20, r19 2716e: 36 17 cp r19, r22 27170: 10 f0 brcs .+4 ; 0x27176 else dif = d - val; 27172: 43 2f mov r20, r19 27174: 46 1b sub r20, r22 27176: 83 2f mov r24, r19 27178: 90 e0 ldi r25, 0x00 ; 0 if (dif <= tol) 2717a: 42 30 cpi r20, 0x02 ; 2 2717c: 08 f0 brcs .+2 ; 0x27180 2717e: 47 c0 rjmp .+142 ; 0x2720e { cnt += 1; 27180: 2f 5f subi r18, 0xFF ; 255 sum += d; 27182: 08 0f add r16, r24 27184: 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++) 27186: ae 14 cp r10, r14 27188: bf 04 cpc r11, r15 2718a: 39 f7 brne .-50 ; 0x2715a cnt = 1; sum = d; cl += 1; } } if (ccnt) ccnt[cl] = cnt; 2718c: ae 2e mov r10, r30 2718e: b1 2c mov r11, r1 27190: a1 e1 ldi r26, 0x11 ; 17 27192: b0 e0 ldi r27, 0x00 ; 0 27194: ac 0f add r26, r28 27196: bd 1f adc r27, r29 27198: aa 0d add r26, r10 2719a: bb 1d adc r27, r11 2719c: 2c 93 st X, r18 if (cval) cval[cl] = sum / cnt; 2719e: 7e 01 movw r14, r28 271a0: b1 e2 ldi r27, 0x21 ; 33 271a2: eb 0e add r14, r27 271a4: f1 1c adc r15, r1 271a6: ae 0c add r10, r14 271a8: bf 1c adc r11, r15 271aa: 62 2f mov r22, r18 271ac: 70 e0 ldi r23, 0x00 ; 0 271ae: c8 01 movw r24, r16 271b0: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 271b4: d5 01 movw r26, r10 271b6: 6c 93 st X, r22 return ++cl; 271b8: 11 e0 ldi r17, 0x01 ; 1 271ba: 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:")); 271bc: 85 e7 ldi r24, 0x75 ; 117 271be: 90 ea ldi r25, 0xA0 ; 160 271c0: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 271c4: fe 01 movw r30, r28 271c6: 71 96 adiw r30, 0x11 ; 17 271c8: 3f 01 movw r6, r30 271ca: 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]); 271cc: 8d e5 ldi r24, 0x5D ; 93 271ce: 88 2e mov r8, r24 271d0: 80 ea ldi r24, 0xA0 ; 160 271d2: 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++) 271d4: 8a 2d mov r24, r10 271d6: 8e 19 sub r24, r14 271d8: 81 17 cp r24, r17 271da: 70 f5 brcc .+92 ; 0x27238 271dc: c5 01 movw r24, r10 271de: 8e 19 sub r24, r14 271e0: 9f 09 sbc r25, r15 printf_P(PSTR(" i=%2d cnt=%2d val=%2d\n"), i, cnt[i], val[i]); 271e2: d5 01 movw r26, r10 271e4: 3d 91 ld r19, X+ 271e6: 5d 01 movw r10, r26 271e8: f3 01 movw r30, r6 271ea: 21 91 ld r18, Z+ 271ec: 3f 01 movw r6, r30 271ee: 1f 92 push r1 271f0: 3f 93 push r19 271f2: 1f 92 push r1 271f4: 2f 93 push r18 271f6: 9f 93 push r25 271f8: 8f 93 push r24 271fa: 9f 92 push r9 271fc: 8f 92 push r8 271fe: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 27202: 0f b6 in r0, 0x3f ; 63 27204: f8 94 cli 27206: de bf out 0x3e, r29 ; 62 27208: 0f be out 0x3f, r0 ; 63 2720a: cd bf out 0x3d, r28 ; 61 2720c: e3 cf rjmp .-58 ; 0x271d4 2720e: 4e 2f mov r20, r30 27210: 50 e0 ldi r21, 0x00 ; 0 cnt += 1; sum += d; } else { if (ccnt) ccnt[cl] = cnt; 27212: a1 e1 ldi r26, 0x11 ; 17 27214: b0 e0 ldi r27, 0x00 ; 0 27216: ac 0f add r26, r28 27218: bd 1f adc r27, r29 2721a: a4 0f add r26, r20 2721c: b5 1f adc r27, r21 2721e: ef 5f subi r30, 0xFF ; 255 27220: 2c 93 st X, r18 if (cval) cval[cl] = val; 27222: 21 e2 ldi r18, 0x21 ; 33 27224: 30 e0 ldi r19, 0x00 ; 0 27226: 2c 0f add r18, r28 27228: 3d 1f adc r19, r29 2722a: 42 0f add r20, r18 2722c: 53 1f adc r21, r19 2722e: da 01 movw r26, r20 27230: 6c 93 st X, r22 cnt = 1; sum = d; 27232: 8c 01 movw r16, r24 } else { if (ccnt) ccnt[cl] = cnt; if (cval) cval[cl] = val; cnt = 1; 27234: 21 e0 ldi r18, 0x01 ; 1 27236: a7 cf rjmp .-178 ; 0x27186 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); 27238: a7 01 movw r20, r14 2723a: 61 2f mov r22, r17 2723c: ce 01 movw r24, r28 2723e: 41 96 adiw r24, 0x11 ; 17 27240: 0f 94 9d 1e call 0x23d3a ; 0x23d3a tmc2130_home_origin[axis] = val[cl-1]; 27244: fe 01 movw r30, r28 27246: e1 0f add r30, r17 27248: f1 1d adc r31, r1 2724a: 80 a1 ldd r24, Z+32 ; 0x20 2724c: ed 2d mov r30, r13 2724e: f0 e0 ldi r31, 0x00 ; 0 27250: ea 50 subi r30, 0x0A ; 10 27252: fb 4f sbci r31, 0xFB ; 251 27254: 80 83 st Z, r24 printf_P(PSTR("result value: %d\n"), tmc2130_home_origin[axis]); 27256: 1f 92 push r1 27258: 8f 93 push r24 2725a: 8b e4 ldi r24, 0x4B ; 75 2725c: 90 ea ldi r25, 0xA0 ; 160 2725e: 9f 93 push r25 27260: 8f 93 push r24 27262: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 if (axis == X_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_X_ORIGIN, tmc2130_home_origin[X_AXIS]); 27266: 0f 90 pop r0 27268: 0f 90 pop r0 2726a: 0f 90 pop r0 2726c: 0f 90 pop r0 2726e: 60 91 f6 04 lds r22, 0x04F6 ; 0x8004f6 27272: 8e ef ldi r24, 0xFE ; 254 27274: 9e e0 ldi r25, 0x0E ; 14 27276: dd 20 and r13, r13 27278: 21 f0 breq .+8 ; 0x27282 2727a: 60 91 f7 04 lds r22, 0x04F7 ; 0x8004f7 2727e: 8b ef ldi r24, 0xFB ; 251 27280: 9e e0 ldi r25, 0x0E ; 14 27282: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a else if (axis == Y_AXIS) eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_Y_ORIGIN, tmc2130_home_origin[Y_AXIS]); return true; } 27286: 81 e0 ldi r24, 0x01 ; 1 27288: e0 96 adiw r28, 0x30 ; 48 2728a: 0f b6 in r0, 0x3f ; 63 2728c: f8 94 cli 2728e: de bf out 0x3e, r29 ; 62 27290: 0f be out 0x3f, r0 ; 63 27292: cd bf out 0x3d, r28 ; 61 27294: df 91 pop r29 27296: cf 91 pop r28 27298: 1f 91 pop r17 2729a: 0f 91 pop r16 2729c: ff 90 pop r15 2729e: ef 90 pop r14 272a0: df 90 pop r13 272a2: bf 90 pop r11 272a4: af 90 pop r10 272a6: 9f 90 pop r9 272a8: 8f 90 pop r8 272aa: 7f 90 pop r7 272ac: 6f 90 pop r6 272ae: 08 95 ret 000272b0 : delayMicroseconds(TMC2130_SET_DIR_DELAY); } void tmc2130_do_step(uint8_t axis) { switch (axis) 272b0: 81 30 cpi r24, 0x01 ; 1 272b2: 49 f0 breq .+18 ; 0x272c6 272b4: 28 f0 brcs .+10 ; 0x272c0 272b6: 82 30 cpi r24, 0x02 ; 2 272b8: 41 f0 breq .+16 ; 0x272ca 272ba: 83 30 cpi r24, 0x03 ; 3 272bc: 41 f0 breq .+16 ; 0x272ce 272be: 08 95 ret { case X_AXIS: _DO_STEP_X; break; 272c0: 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; 272c2: 86 b9 out 0x06, r24 ; 6 } } 272c4: 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; 272c6: 82 e0 ldi r24, 0x02 ; 2 272c8: fc cf rjmp .-8 ; 0x272c2 case Z_AXIS: _DO_STEP_Z; break; 272ca: 84 e0 ldi r24, 0x04 ; 4 272cc: fa cf rjmp .-12 ; 0x272c2 case E_AXIS: _DO_STEP_E; break; 272ce: 88 e0 ldi r24, 0x08 ; 8 272d0: f8 cf rjmp .-16 ; 0x272c2 000272d2 : } void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 272d2: 81 30 cpi r24, 0x01 ; 1 272d4: d1 f0 breq .+52 ; 0x2730a 272d6: 48 f0 brcs .+18 ; 0x272ea 272d8: 82 30 cpi r24, 0x02 ; 2 272da: 21 f1 breq .+72 ; 0x27324 272dc: 83 30 cpi r24, 0x03 ; 3 272de: 79 f1 breq .+94 ; 0x2733e 272e0: 8b e4 ldi r24, 0x4B ; 75 272e2: 90 e0 ldi r25, 0x00 ; 0 272e4: 01 97 sbiw r24, 0x01 ; 1 272e6: f1 f7 brne .-4 ; 0x272e4 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); } 272e8: 08 95 ret void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 272ea: 9f b7 in r25, 0x3f ; 63 272ec: 66 23 and r22, r22 272ee: 41 f0 breq .+16 ; 0x27300 272f0: f8 94 cli 272f2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272f6: 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; 272f8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 272fc: 9f bf out 0x3f, r25 ; 63 272fe: f0 cf rjmp .-32 ; 0x272e0 void tmc2130_set_dir(uint8_t axis, uint8_t dir) { switch (axis) { case X_AXIS: _SET_DIR_X(dir); break; 27300: f8 94 cli 27302: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27306: 8e 7f andi r24, 0xFE ; 254 27308: f7 cf rjmp .-18 ; 0x272f8 case Y_AXIS: _SET_DIR_Y(dir); break; 2730a: 9f b7 in r25, 0x3f ; 63 2730c: 61 11 cpse r22, r1 2730e: 05 c0 rjmp .+10 ; 0x2731a 27310: f8 94 cli 27312: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27316: 82 60 ori r24, 0x02 ; 2 27318: ef cf rjmp .-34 ; 0x272f8 2731a: f8 94 cli 2731c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27320: 8d 7f andi r24, 0xFD ; 253 27322: ea cf rjmp .-44 ; 0x272f8 case Z_AXIS: _SET_DIR_Z(dir); break; 27324: 9f b7 in r25, 0x3f ; 63 27326: 66 23 and r22, r22 27328: 29 f0 breq .+10 ; 0x27334 2732a: f8 94 cli 2732c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27330: 84 60 ori r24, 0x04 ; 4 27332: e2 cf rjmp .-60 ; 0x272f8 27334: f8 94 cli 27336: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2733a: 8b 7f andi r24, 0xFB ; 251 2733c: dd cf rjmp .-70 ; 0x272f8 case E_AXIS: _SET_DIR_E(dir); break; 2733e: 9f b7 in r25, 0x3f ; 63 27340: 61 11 cpse r22, r1 27342: 05 c0 rjmp .+10 ; 0x2734e 27344: f8 94 cli 27346: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2734a: 80 64 ori r24, 0x40 ; 64 2734c: d5 cf rjmp .-86 ; 0x272f8 2734e: f8 94 cli 27350: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 27354: 8f 7b andi r24, 0xBF ; 191 27356: d0 cf rjmp .-96 ; 0x272f8 00027358 : tmc2130_cs_high(axis); TMC2130_SPI_LEAVE(); } static uint8_t tmc2130_rx(uint8_t axis, uint8_t addr, uint32_t* rval) { 27358: cf 92 push r12 2735a: df 92 push r13 2735c: ef 92 push r14 2735e: ff 92 push r15 27360: 0f 93 push r16 27362: 1f 93 push r17 27364: cf 93 push r28 27366: df 93 push r29 27368: 18 2f mov r17, r24 2736a: f6 2e mov r15, r22 2736c: ea 01 movw r28, r20 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2736e: 0c e5 ldi r16, 0x5C ; 92 27370: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 27372: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 27374: 0f 94 f9 1e call 0x23df2 ; 0x23df2 TMC2130_SPI_TXRX(addr); // address 27378: 8f 2d mov r24, r15 2737a: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX(0); // MSB 2737e: 80 e0 ldi r24, 0x00 ; 0 27380: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX(0); 27384: 80 e0 ldi r24, 0x00 ; 0 27386: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX(0); 2738a: 80 e0 ldi r24, 0x00 ; 0 2738c: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX(0); // LSB 27390: 80 e0 ldi r24, 0x00 ; 0 27392: 0f 94 14 1f call 0x23e28 ; 0x23e28 tmc2130_cs_high(axis); 27396: 81 2f mov r24, r17 27398: 0f 94 de 1e call 0x23dbc ; 0x23dbc SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 2739c: 0c bd out 0x2c, r16 ; 44 SPSR = spsr; 2739e: 1d bc out 0x2d, r1 ; 45 TMC2130_SPI_LEAVE(); //datagram2 - response TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 273a0: 81 2f mov r24, r17 273a2: 0f 94 f9 1e call 0x23df2 ; 0x23df2 uint8_t stat = TMC2130_SPI_TXRX(0); // status 273a6: 80 e0 ldi r24, 0x00 ; 0 273a8: 0f 94 14 1f call 0x23e28 ; 0x23e28 273ac: 08 2f mov r16, r24 uint32_t val32 = 0; val32 = TMC2130_SPI_TXRX(0); // MSB 273ae: 80 e0 ldi r24, 0x00 ; 0 273b0: 0f 94 14 1f call 0x23e28 ; 0x23e28 273b4: 90 e0 ldi r25, 0x00 ; 0 273b6: b0 e0 ldi r27, 0x00 ; 0 273b8: a0 e0 ldi r26, 0x00 ; 0 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 273ba: cc 24 eor r12, r12 273bc: d8 2e mov r13, r24 273be: e9 2e mov r14, r25 273c0: fa 2e mov r15, r26 273c2: 80 e0 ldi r24, 0x00 ; 0 273c4: 0f 94 14 1f call 0x23e28 ; 0x23e28 273c8: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); 273ca: fe 2c mov r15, r14 273cc: ed 2c mov r14, r13 273ce: dc 2c mov r13, r12 273d0: cc 24 eor r12, r12 273d2: 80 e0 ldi r24, 0x00 ; 0 273d4: 0f 94 14 1f call 0x23e28 ; 0x23e28 273d8: c8 2a or r12, r24 val32 = (val32 << 8) | TMC2130_SPI_TXRX(0); // LSB 273da: fe 2c mov r15, r14 273dc: ed 2c mov r14, r13 273de: dc 2c mov r13, r12 273e0: cc 24 eor r12, r12 273e2: 80 e0 ldi r24, 0x00 ; 0 273e4: 0f 94 14 1f call 0x23e28 ; 0x23e28 273e8: c8 2a or r12, r24 tmc2130_cs_high(axis); 273ea: 81 2f mov r24, r17 273ec: 0f 94 de 1e call 0x23dbc ; 0x23dbc TMC2130_SPI_LEAVE(); if (rval != 0) *rval = val32; 273f0: c8 82 st Y, r12 273f2: d9 82 std Y+1, r13 ; 0x01 273f4: ea 82 std Y+2, r14 ; 0x02 273f6: fb 82 std Y+3, r15 ; 0x03 return stat; } 273f8: 80 2f mov r24, r16 273fa: df 91 pop r29 273fc: cf 91 pop r28 273fe: 1f 91 pop r17 27400: 0f 91 pop r16 27402: ff 90 pop r15 27404: ef 90 pop r14 27406: df 90 pop r13 27408: cf 90 pop r12 2740a: 08 95 ret 0002740c : #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) { 2740c: ef 92 push r14 2740e: ff 92 push r15 27410: 0f 93 push r16 27412: 1f 93 push r17 27414: cf 93 push r28 27416: df 93 push r29 27418: c8 2f mov r28, r24 2741a: e6 2e mov r14, r22 2741c: d2 2f mov r29, r18 2741e: 13 2f mov r17, r19 27420: 04 2f mov r16, r20 27422: f5 2e mov r15, r21 SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 27424: 8c e5 ldi r24, 0x5C ; 92 27426: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 27428: 1d bc out 0x2d, r1 ; 45 //datagram1 - request TMC2130_SPI_ENTER(); tmc2130_cs_low(axis); 2742a: 8c 2f mov r24, r28 2742c: 0f 94 f9 1e call 0x23df2 ; 0x23df2 TMC2130_SPI_TXRX(addr); // address 27430: 8e 2d mov r24, r14 27432: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX((wval >> 24) & 0xff); // MSB 27436: 8f 2d mov r24, r15 27438: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX((wval >> 16) & 0xff); 2743c: 80 2f mov r24, r16 2743e: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX((wval >> 8) & 0xff); 27442: 81 2f mov r24, r17 27444: 0f 94 14 1f call 0x23e28 ; 0x23e28 TMC2130_SPI_TXRX(wval & 0xff); // LSB 27448: 8d 2f mov r24, r29 2744a: 0f 94 14 1f call 0x23e28 ; 0x23e28 tmc2130_cs_high(axis); 2744e: 8c 2f mov r24, r28 TMC2130_SPI_LEAVE(); } 27450: df 91 pop r29 27452: cf 91 pop r28 27454: 1f 91 pop r17 27456: 0f 91 pop r16 27458: ff 90 pop r15 2745a: 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); 2745c: 0d 94 de 1e jmp 0x23dbc ; 0x23dbc 00027460 : if (val32 & 0x000f0000) return 0xffff; return val32 & 0xffff; } uint16_t tmc2130_rd_MSCNT(uint8_t axis) { 27460: cf 93 push r28 27462: df 93 push r29 27464: 00 d0 rcall .+0 ; 0x27466 27466: 1f 92 push r1 27468: cd b7 in r28, 0x3d ; 61 2746a: de b7 in r29, 0x3e ; 62 uint32_t val32 = 0; 2746c: 19 82 std Y+1, r1 ; 0x01 2746e: 1a 82 std Y+2, r1 ; 0x02 27470: 1b 82 std Y+3, r1 ; 0x03 27472: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(axis, TMC2130_REG_MSCNT, &val32); 27474: ae 01 movw r20, r28 27476: 4f 5f subi r20, 0xFF ; 255 27478: 5f 4f sbci r21, 0xFF ; 255 2747a: 6a e6 ldi r22, 0x6A ; 106 2747c: 0f 94 ac 39 call 0x27358 ; 0x27358 return val32 & 0x3ff; 27480: 89 81 ldd r24, Y+1 ; 0x01 27482: 9a 81 ldd r25, Y+2 ; 0x02 } 27484: 93 70 andi r25, 0x03 ; 3 27486: 0f 90 pop r0 27488: 0f 90 pop r0 2748a: 0f 90 pop r0 2748c: 0f 90 pop r0 2748e: df 91 pop r29 27490: cf 91 pop r28 27492: 08 95 ret 00027494 : #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 */) { 27494: ff 92 push r15 27496: 0f 93 push r16 27498: 1f 93 push r17 2749a: cf 93 push r28 2749c: df 93 push r29 2749e: f8 2e mov r15, r24 274a0: ea 01 movw r28, r20 // Initialise the chopper configuration ChopConfU chopconf = ChopConfU(currents[axis].getvSense(), mres); 274a2: e8 2f mov r30, r24 274a4: f0 e0 ldi r31, 0x00 ; 0 274a6: 83 e0 ldi r24, 0x03 ; 3 274a8: f8 9e mul r15, r24 274aa: 80 01 movw r16, r0 274ac: 11 24 eor r1, r1 274ae: 03 5a subi r16, 0xA3 ; 163 274b0: 1d 4f sbci r17, 0xFD ; 253 274b2: d8 01 movw r26, r16 274b4: 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) {} 274b6: 30 e0 ldi r19, 0x00 ; 0 274b8: 37 7f andi r19, 0xF7 ; 247 274ba: 3f 7e andi r19, 0xEF ; 239 274bc: 3f 7d andi r19, 0xDF ; 223 274be: 3f 7b andi r19, 0xBF ; 191 274c0: 40 e0 ldi r20, 0x00 ; 0 274c2: 80 fb bst r24, 0 274c4: 41 f9 bld r20, 1 274c6: 43 70 andi r20, 0x03 ; 3 274c8: 56 2f mov r21, r22 274ca: 5f 70 andi r21, 0x0F ; 15 274cc: 50 62 ori r21, 0x20 ; 32 274ce: 5f 7b andi r21, 0xBF ; 191 274d0: 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 274d2: 81 e0 ldi r24, 0x01 ; 1 274d4: 61 11 cpse r22, r1 274d6: 01 c0 rjmp .+2 ; 0x274da 274d8: 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); 274da: 80 fb bst r24, 0 274dc: 54 f9 bld r21, 4 chopconf.s.toff = tmc2130_chopper_config[axis].toff; // toff = 3 (fchop = 27.778kHz) 274de: bf 01 movw r22, r30 274e0: 66 0f add r22, r22 274e2: 77 1f adc r23, r23 274e4: fb 01 movw r30, r22 274e6: e3 58 subi r30, 0x83 ; 131 274e8: fd 4f sbci r31, 0xFD ; 253 274ea: 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 274ec: 92 2f mov r25, r18 274ee: 99 1f adc r25, r25 274f0: 99 27 eor r25, r25 274f2: 99 1f adc r25, r25 274f4: 81 81 ldd r24, Z+1 ; 0x01 274f6: 87 70 andi r24, 0x07 ; 7 274f8: 88 0f add r24, r24 274fa: 89 2b or r24, r25 274fc: 80 fb bst r24, 0 274fe: 27 f9 bld r18, 7 27500: 86 95 lsr r24 27502: 87 70 andi r24, 0x07 ; 7 27504: 38 7f andi r19, 0xF8 ; 248 27506: 38 2b or r19, r24 chopconf.s.tbl = tmc2130_chopper_config[axis].tbl; //blanking time, original value = 2 27508: 62 58 subi r22, 0x82 ; 130 2750a: 7d 4f sbci r23, 0xFD ; 253 2750c: fb 01 movw r30, r22 2750e: 80 81 ld r24, Z 27510: 86 95 lsr r24 27512: 86 95 lsr r24 27514: 86 95 lsr r24 27516: 80 fb bst r24, 0 27518: 37 f9 bld r19, 7 2751a: 81 fb bst r24, 1 2751c: 40 f9 bld r20, 0 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); 2751e: 6c ee ldi r22, 0xEC ; 236 27520: 8f 2d mov r24, r15 27522: 0f 94 06 3a call 0x2740c ; 0x2740c if (curr == nullptr) { 27526: 20 97 sbiw r28, 0x00 ; 0 27528: 09 f4 brne .+2 ; 0x2752c curr = ¤ts[axis]; 2752a: e8 01 movw r28, r16 2752c: 19 81 ldd r17, Y+1 ; 0x01 2752e: 8a 81 ldd r24, Y+2 ; 0x02 27530: c1 2f mov r28, r17 27532: 81 17 cp r24, r17 27534: 08 f4 brcc .+2 ; 0x27538 27536: 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()) { 27538: 18 17 cp r17, r24 2753a: 40 f4 brcc .+16 ; 0x2754c // Let user know firmware modified the value SERIAL_ECHO_START; 2753c: 82 ef ldi r24, 0xF2 ; 242 2753e: 99 ea ldi r25, 0xA9 ; 169 27540: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n("Hold current truncated to Run current")); 27544: 8b ea ldi r24, 0xAB ; 171 27546: 9e e6 ldi r25, 0x6E ; 110 27548: 0e 94 06 7b call 0xf60c ; 0xf60c struct S { uint8_t iHold; uint8_t iRun; uint16_t iHoldDelay; constexpr S(uint8_t ih, uint8_t ir) : iHold(ih & 0x1F) 2754c: 2c 2f mov r18, r28 2754e: 2f 71 andi r18, 0x1F ; 31 , iRun(ir & 0x1F) 27550: 31 2f mov r19, r17 27552: 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); 27554: 4f e0 ldi r20, 0x0F ; 15 27556: 50 e0 ldi r21, 0x00 ; 0 27558: 60 e9 ldi r22, 0x90 ; 144 2755a: 8f 2d mov r24, r15 tmc2130_wr(axis, TMC2130_REG_CHOPCONF, chopconf.dw); if (curr == nullptr) { curr = ¤ts[axis]; } SetCurrents(axis, *curr); } 2755c: df 91 pop r29 2755e: cf 91 pop r28 27560: 1f 91 pop r17 27562: 0f 91 pop r16 27564: 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); 27566: 0d 94 06 3a jmp 0x2740c ; 0x2740c 0002756a : return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 2756a: e8 2f mov r30, r24 2756c: 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--; 2756e: 98 e0 ldi r25, 0x08 ; 8 27570: 76 95 lsr r23 27572: 67 95 ror r22 27574: 61 15 cp r22, r1 27576: 71 05 cpc r23, r1 27578: 11 f0 breq .+4 ; 0x2757e 2757a: 91 50 subi r25, 0x01 ; 1 2757c: f9 cf rjmp .-14 ; 0x27570 return tmc2130_mres2usteps(tmc2130_mres[axis]); } void tmc2130_set_res(uint8_t axis, uint16_t res) { tmc2130_mres[axis] = tmc2130_usteps2mres(res); 2757e: e8 50 subi r30, 0x08 ; 8 27580: fb 4f sbci r31, 0xFB ; 251 27582: 90 83 st Z, r25 // uint32_t u = _micros(); tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 27584: 50 e0 ldi r21, 0x00 ; 0 27586: 40 e0 ldi r20, 0x00 ; 0 27588: 69 2f mov r22, r25 2758a: 0d 94 4a 3a jmp 0x27494 ; 0x27494 0002758e : } return 0; } static void tmc2130_XYZ_reg_init(uint8_t axis) { 2758e: 0f 93 push r16 27590: 1f 93 push r17 27592: cf 93 push r28 27594: df 93 push r29 27596: c8 2f mov r28, r24 tmc2130_setup_chopper(axis, tmc2130_mres[axis]); 27598: 08 2f mov r16, r24 2759a: 10 e0 ldi r17, 0x00 ; 0 2759c: f8 01 movw r30, r16 2759e: e8 50 subi r30, 0x08 ; 8 275a0: fb 4f sbci r31, 0xFB ; 251 275a2: 50 e0 ldi r21, 0x00 ; 0 275a4: 40 e0 ldi r20, 0x00 ; 0 275a6: 60 81 ld r22, Z 275a8: 0f 94 4a 3a call 0x27494 ; 0x27494 tmc2130_wr(axis, TMC2130_REG_TPOWERDOWN, 0x00000000); 275ac: 20 e0 ldi r18, 0x00 ; 0 275ae: 30 e0 ldi r19, 0x00 ; 0 275b0: a9 01 movw r20, r18 275b2: 61 e9 ldi r22, 0x91 ; 145 275b4: 8c 2f mov r24, r28 275b6: 0f 94 06 3a call 0x2740c ; 0x2740c const bool isStealth = (tmc2130_mode == TMC2130_MODE_SILENT); 275ba: d0 91 6c 06 lds r29, 0x066C ; 0x80066c if (axis == Z_AXIS) { 275be: c2 30 cpi r28, 0x02 ; 2 275c0: e1 f5 brne .+120 ; 0x2763a #ifdef TMC2130_STEALTH_Z tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr[axis]) << 16) | ((uint32_t)1 << 24)); 275c2: 20 e0 ldi r18, 0x00 ; 0 275c4: 30 e0 ldi r19, 0x00 ; 0 275c6: 44 e0 ldi r20, 0x04 ; 4 275c8: 51 e0 ldi r21, 0x01 ; 1 275ca: 6d ee ldi r22, 0xED ; 237 275cc: 82 e0 ldi r24, 0x02 ; 2 275ce: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 275d2: 24 ef ldi r18, 0xF4 ; 244 275d4: 31 e0 ldi r19, 0x01 ; 1 275d6: 40 e0 ldi r20, 0x00 ; 0 275d8: 50 e0 ldi r21, 0x00 ; 0 275da: d1 30 cpi r29, 0x01 ; 1 275dc: 19 f4 brne .+6 ; 0x275e4 275de: 20 e0 ldi r18, 0x00 ; 0 275e0: 30 e0 ldi r19, 0x00 ; 0 275e2: a9 01 movw r20, r18 275e4: 64 e9 ldi r22, 0x94 ; 148 275e6: 82 e0 ldi r24, 0x02 ; 2 275e8: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_DYNAMIC_SGSENS); 275ec: 24 e8 ldi r18, 0x84 ; 132 275ee: 31 e0 ldi r19, 0x01 ; 1 275f0: 40 e0 ldi r20, 0x00 ; 0 275f2: 50 e0 ldi r21, 0x00 ; 0 275f4: d1 30 cpi r29, 0x01 ; 1 275f6: 21 f4 brne .+8 ; 0x27600 275f8: 24 e0 ldi r18, 0x04 ; 4 275fa: 30 e0 ldi r19, 0x00 ; 0 275fc: 40 e0 ldi r20, 0x00 ; 0 275fe: 50 e0 ldi r21, 0x00 ; 0 27600: 60 e8 ldi r22, 0x80 ; 128 27602: 82 e0 ldi r24, 0x02 ; 2 27604: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 27608: 28 ec ldi r18, 0xC8 ; 200 2760a: 34 e0 ldi r19, 0x04 ; 4 2760c: 46 e0 ldi r20, 0x06 ; 6 2760e: 50 e0 ldi r21, 0x00 ; 0 27610: 60 ef ldi r22, 0xF0 ; 240 27612: 82 e0 ldi r24, 0x02 ; 2 27614: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, isStealth ? 0 : 0xFFFF0); 27618: 20 ef ldi r18, 0xF0 ; 240 2761a: 3f ef ldi r19, 0xFF ; 255 2761c: 4f e0 ldi r20, 0x0F ; 15 2761e: 50 e0 ldi r21, 0x00 ; 0 27620: d1 30 cpi r29, 0x01 ; 1 27622: 19 f4 brne .+6 ; 0x2762a 27624: 20 e0 ldi r18, 0x00 ; 0 27626: 30 e0 ldi r19, 0x00 ; 0 27628: a9 01 movw r20, r18 2762a: 63 e9 ldi r22, 0x93 ; 147 2762c: 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); } } 2762e: df 91 pop r29 27630: cf 91 pop r28 27632: 1f 91 pop r17 27634: 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); 27636: 0d 94 06 3a jmp 0x2740c ; 0x2740c 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)); 2763a: f8 01 movw r30, r16 2763c: e5 5e subi r30, 0xE5 ; 229 2763e: fc 4f sbci r31, 0xFC ; 252 27640: 20 81 ld r18, Z 27642: 30 e0 ldi r19, 0x00 ; 0 27644: 50 e0 ldi r21, 0x00 ; 0 27646: 40 e0 ldi r20, 0x00 ; 0 27648: a9 01 movw r20, r18 2764a: 33 27 eor r19, r19 2764c: 22 27 eor r18, r18 2764e: 51 60 ori r21, 0x01 ; 1 27650: 6d ee ldi r22, 0xED ; 237 27652: 8c 2f mov r24, r28 27654: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_TCOOLTHRS, isStealth ? 0 : __tcoolthrs(axis)); 27658: 20 e0 ldi r18, 0x00 ; 0 2765a: 30 e0 ldi r19, 0x00 ; 0 2765c: a9 01 movw r20, r18 2765e: d1 30 cpi r29, 0x01 ; 1 27660: 61 f0 breq .+24 ; 0x2767a uint16_t __tcoolthrs(uint8_t axis) { switch (axis) { case X_AXIS: return TMC2130_TCOOLTHRS_X; 27662: 2e ea ldi r18, 0xAE ; 174 27664: 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) 27666: c2 30 cpi r28, 0x02 ; 2 27668: 30 f0 brcs .+12 ; 0x27676 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; 2766a: 24 ef ldi r18, 0xF4 ; 244 2766c: 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) 2766e: c2 30 cpi r28, 0x02 ; 2 27670: 11 f0 breq .+4 ; 0x27676 { case X_AXIS: return TMC2130_TCOOLTHRS_X; case Y_AXIS: return TMC2130_TCOOLTHRS_Y; case Z_AXIS: return TMC2130_TCOOLTHRS_Z; } return 0; 27672: 30 e0 ldi r19, 0x00 ; 0 27674: 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)); 27676: 50 e0 ldi r21, 0x00 ; 0 27678: 40 e0 ldi r20, 0x00 ; 0 2767a: 64 e9 ldi r22, 0x94 ; 148 2767c: 8c 2f mov r24, r28 2767e: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_GCONF, isStealth ? TMC2130_GCONF_SILENT : TMC2130_GCONF_SGSENS); 27682: 20 e8 ldi r18, 0x80 ; 128 27684: 31 e0 ldi r19, 0x01 ; 1 27686: 40 e0 ldi r20, 0x00 ; 0 27688: 50 e0 ldi r21, 0x00 ; 0 2768a: d1 30 cpi r29, 0x01 ; 1 2768c: 21 f4 brne .+8 ; 0x27696 2768e: 24 e0 ldi r18, 0x04 ; 4 27690: 30 e0 ldi r19, 0x00 ; 0 27692: 40 e0 ldi r20, 0x00 ; 0 27694: 50 e0 ldi r21, 0x00 ; 0 27696: 60 e8 ldi r22, 0x80 ; 128 27698: 8c 2f mov r24, r28 2769a: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_PWMCONF, pwmconf[axis].dw); 2769e: 00 0f add r16, r16 276a0: 11 1f adc r17, r17 276a2: 00 0f add r16, r16 276a4: 11 1f adc r17, r17 276a6: f8 01 movw r30, r16 276a8: e5 5f subi r30, 0xF5 ; 245 276aa: fc 4f sbci r31, 0xFC ; 252 276ac: 20 81 ld r18, Z 276ae: 31 81 ldd r19, Z+1 ; 0x01 276b0: 42 81 ldd r20, Z+2 ; 0x02 276b2: 53 81 ldd r21, Z+3 ; 0x03 276b4: 60 ef ldi r22, 0xF0 ; 240 276b6: 8c 2f mov r24, r28 276b8: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); 276bc: 20 e0 ldi r18, 0x00 ; 0 276be: 30 e0 ldi r19, 0x00 ; 0 276c0: a9 01 movw r20, r18 276c2: 63 e9 ldi r22, 0x93 ; 147 276c4: 8c 2f mov r24, r28 276c6: b3 cf rjmp .-154 ; 0x2762e 000276c8 : } #endif //TMC2130_SG_HOMING } void tmc2130_home_exit() { 276c8: 1f 93 push r17 276ca: cf 93 push r28 276cc: df 93 push r29 printf_P(PSTR("tmc2130_home_exit tmc2130_sg_homing_axes_mask=0x%02x\n"), tmc2130_sg_homing_axes_mask); 276ce: 80 91 40 06 lds r24, 0x0640 ; 0x800640 276d2: 1f 92 push r1 276d4: 8f 93 push r24 276d6: 85 e1 ldi r24, 0x15 ; 21 276d8: 90 ea ldi r25, 0xA0 ; 160 276da: 9f 93 push r25 276dc: 8f 93 push r24 276de: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 #ifdef TMC2130_SG_HOMING if (tmc2130_sg_homing_axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) 276e2: 80 91 40 06 lds r24, 0x0640 ; 0x800640 276e6: 83 70 andi r24, 0x03 ; 3 276e8: 0f 90 pop r0 276ea: 0f 90 pop r0 276ec: 0f 90 pop r0 276ee: 0f 90 pop r0 276f0: 11 f0 breq .+4 ; 0x276f6 tmc2130_wait_standstill_xy(1000); 276f2: 0f 94 ea 87 call 0x30fd4 ; 0x30fd4 if (tmc2130_sg_homing_axes_mask) 276f6: 10 91 40 06 lds r17, 0x0640 ; 0x800640 276fa: 11 23 and r17, r17 276fc: 71 f0 breq .+28 ; 0x2771a { for (uint8_t axis = X_AXIS, mask = X_AXIS_MASK; axis <= Z_AXIS; axis++, mask <<= 1) //X Y and Z axes 276fe: d1 e0 ldi r29, 0x01 ; 1 27700: c0 e0 ldi r28, 0x00 ; 0 { if (tmc2130_sg_homing_axes_mask & mask) { 27702: 81 2f mov r24, r17 27704: 8d 23 and r24, r29 27706: 19 f0 breq .+6 ; 0x2770e tmc2130_XYZ_reg_init(axis); 27708: 8c 2f mov r24, r28 2770a: 0f 94 c7 3a call 0x2758e ; 0x2758e #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 2770e: cf 5f subi r28, 0xFF ; 255 27710: dd 0f add r29, r29 27712: c3 30 cpi r28, 0x03 ; 3 27714: b1 f7 brne .-20 ; 0x27702 { if (tmc2130_sg_homing_axes_mask & mask) { tmc2130_XYZ_reg_init(axis); } } tmc2130_sg_homing_axes_mask = 0x00; 27716: 10 92 40 06 sts 0x0640, r1 ; 0x800640 } tmc2130_sg_crash = false; 2771a: 10 92 10 05 sts 0x0510, r1 ; 0x800510 #endif } 2771e: df 91 pop r29 27720: cf 91 pop r28 27722: 1f 91 pop r17 27724: 08 95 ret 00027726 : } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 27726: df 92 push r13 27728: ef 92 push r14 2772a: ff 92 push r15 2772c: 0f 93 push r16 2772e: 1f 93 push r17 27730: cf 93 push r28 27732: df 93 push r29 27734: 00 d0 rcall .+0 ; 0x27736 27736: cd b7 in r28, 0x3d ; 61 27738: de b7 in r29, 0x3e ; 62 2773a: d8 2e mov r13, r24 printf_P(PSTR("tmc2130_home_enter(axes_mask=0x%02x)\n"), axes_mask); 2773c: 1f 92 push r1 2773e: 8f 93 push r24 27740: 8f ee ldi r24, 0xEF ; 239 27742: 9f e9 ldi r25, 0x9F ; 159 27744: 9f 93 push r25 27746: 8f 93 push r24 27748: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 #ifdef TMC2130_SG_HOMING if (axes_mask & (X_AXIS_MASK | Y_AXIS_MASK)) //X or Y 2774c: 8d 2d mov r24, r13 2774e: 83 70 andi r24, 0x03 ; 3 27750: 0f 90 pop r0 27752: 0f 90 pop r0 27754: 0f 90 pop r0 27756: 0f 90 pop r0 27758: 11 f0 breq .+4 ; 0x2775e tmc2130_wait_standstill_xy(1000); 2775a: 0f 94 ea 87 call 0x30fd4 ; 0x30fd4 } return false; } void tmc2130_home_enter(uint8_t axes_mask) { 2775e: 10 e0 ldi r17, 0x00 ; 0 27760: 00 e0 ldi r16, 0x00 ; 0 27762: ff 24 eor r15, r15 27764: f3 94 inc r15 27766: 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) 27768: 8d 2d mov r24, r13 2776a: 8f 21 and r24, r15 2776c: 09 f4 brne .+2 ; 0x27770 2776e: 46 c0 rjmp .+140 ; 0x277fc { tmc2130_sg_homing_axes_mask |= mask; 27770: 80 91 40 06 lds r24, 0x0640 ; 0x800640 27774: 8f 29 or r24, r15 27776: 80 93 40 06 sts 0x0640, r24 ; 0x800640 //Configuration to spreadCycle tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_NORMAL); 2777a: 20 e0 ldi r18, 0x00 ; 0 2777c: 30 e0 ldi r19, 0x00 ; 0 2777e: a9 01 movw r20, r18 27780: 60 e8 ldi r22, 0x80 ; 128 27782: 80 2f mov r24, r16 27784: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(axis, TMC2130_REG_COOLCONF, (((uint32_t)tmc2130_sg_thr_home[axis]) << 16)); 27788: f8 01 movw r30, r16 2778a: e5 5e subi r30, 0xE5 ; 229 2778c: fc 4f sbci r31, 0xFC ; 252 2778e: 20 81 ld r18, Z 27790: 30 e0 ldi r19, 0x00 ; 0 27792: 50 e0 ldi r21, 0x00 ; 0 27794: 40 e0 ldi r20, 0x00 ; 0 27796: a9 01 movw r20, r18 27798: 33 27 eor r19, r19 2779a: 22 27 eor r18, r18 2779c: 6d ee ldi r22, 0xED ; 237 2779e: 80 2f mov r24, r16 277a0: 0f 94 06 3a call 0x2740c ; 0x2740c 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) 277a4: 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; 277a6: 24 ef ldi r18, 0xF4 ; 244 277a8: 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) 277aa: 08 17 cp r16, r24 277ac: 11 f0 breq .+4 ; 0x277b2 { case X_AXIS: return TMC2130_TCOOLTHRS_X; 277ae: 2e ea ldi r18, 0xAE ; 174 277b0: 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)); 277b2: 50 e0 ldi r21, 0x00 ; 0 277b4: 40 e0 ldi r20, 0x00 ; 0 277b6: 64 e9 ldi r22, 0x94 ; 148 277b8: 8e 2d mov r24, r14 277ba: 0f 94 06 3a call 0x2740c ; 0x2740c iRun >>= 1; } } // PROGMEM initializer inline __attribute__((always_inline)) MotorCurrents(const MotorCurrents &curr_P) { memcpy_P(this, &curr_P, sizeof(*this)); } 277be: b8 01 movw r22, r16 277c0: 66 0f add r22, r22 277c2: 77 1f adc r23, r23 277c4: 60 0f add r22, r16 277c6: 71 1f adc r23, r17 277c8: 6d 51 subi r22, 0x1D ; 29 277ca: 70 46 sbci r23, 0x60 ; 96 277cc: 43 e0 ldi r20, 0x03 ; 3 277ce: 50 e0 ldi r21, 0x00 ; 0 277d0: ce 01 movw r24, r28 277d2: 01 96 adiw r24, 0x01 ; 1 277d4: 0f 94 2b db call 0x3b656 ; 0x3b656 MotorCurrents curr(homing_currents_P[axis]); tmc2130_setup_chopper(axis, tmc2130_mres[axis], &curr); 277d8: ae 01 movw r20, r28 277da: 4f 5f subi r20, 0xFF ; 255 277dc: 5f 4f sbci r21, 0xFF ; 255 277de: f8 01 movw r30, r16 277e0: e8 50 subi r30, 0x08 ; 8 277e2: fb 4f sbci r31, 0xFB ; 251 277e4: 60 81 ld r22, Z 277e6: 8e 2d mov r24, r14 277e8: 0f 94 4a 3a call 0x27494 ; 0x27494 tmc2130_wr(axis, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); //stallguard output DIAG1, DIAG1 = pushpull 277ec: 20 e8 ldi r18, 0x80 ; 128 277ee: 31 e0 ldi r19, 0x01 ; 1 277f0: 40 e0 ldi r20, 0x00 ; 0 277f2: 50 e0 ldi r21, 0x00 ; 0 277f4: 60 e8 ldi r22, 0x80 ; 128 277f6: 8e 2d mov r24, r14 277f8: 0f 94 06 3a call 0x2740c ; 0x2740c { 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 277fc: ff 0c add r15, r15 277fe: 0f 5f subi r16, 0xFF ; 255 27800: 1f 4f sbci r17, 0xFF ; 255 27802: 03 30 cpi r16, 0x03 ; 3 27804: 11 05 cpc r17, r1 27806: 09 f0 breq .+2 ; 0x2780a 27808: ae cf rjmp .-164 ; 0x27766 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 } 2780a: 0f 90 pop r0 2780c: 0f 90 pop r0 2780e: 0f 90 pop r0 27810: df 91 pop r29 27812: cf 91 pop r28 27814: 1f 91 pop r17 27816: 0f 91 pop r16 27818: ff 90 pop r15 2781a: ef 90 pop r14 2781c: df 90 pop r13 2781e: 08 95 ret 00027820 : crashdet_stop_and_save_print(); } } void crashdet_use_eeprom_setting() { tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); 27820: 89 e6 ldi r24, 0x69 ; 105 27822: 9f e0 ldi r25, 0x0F ; 15 27824: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 27828: 91 e0 ldi r25, 0x01 ; 1 2782a: 81 11 cpse r24, r1 2782c: 01 c0 rjmp .+2 ; 0x27830 2782e: 90 e0 ldi r25, 0x00 ; 0 27830: 90 93 5c 02 sts 0x025C, r25 ; 0x80025c } 27834: 08 95 ret 00027836 : } #ifdef TMC2130 static void crash_mode_switch() { eeprom_toggle((uint8_t*)EEPROM_CRASH_DET); 27836: 89 e6 ldi r24, 0x69 ; 105 27838: 9f e0 ldi r25, 0x0F ; 15 2783a: 0e 94 bf 77 call 0xef7e ; 0xef7e crashdet_use_eeprom_setting(); 2783e: 0d 94 10 3c jmp 0x27820 ; 0x27820 00027842 : tmc2130_wr(axis, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS); } } void tmc2130_init(TMCInitParams params) { 27842: cf 93 push r28 27844: c8 2f mov r28, r24 // DBG(_n("tmc2130_init(), mode=%S\n"), tmc2130_mode?_n("STEALTH"):_n("NORMAL")); WRITE(X_TMC2130_CS, HIGH); 27846: a0 9a sbi 0x14, 0 ; 20 WRITE(Y_TMC2130_CS, HIGH); 27848: a2 9a sbi 0x14, 2 ; 20 WRITE(Z_TMC2130_CS, HIGH); 2784a: 9f b7 in r25, 0x3f ; 63 2784c: f8 94 cli 2784e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27852: 80 62 ori r24, 0x20 ; 32 27854: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27858: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_CS, 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 61 ori r24, 0x10 ; 16 27864: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 27868: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(X_TMC2130_CS); 2786a: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_TMC2130_CS); 2786c: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_TMC2130_CS); 2786e: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27872: 80 62 ori r24, 0x20 ; 32 27874: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_TMC2130_CS); 27878: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2787c: 80 61 ori r24, 0x10 ; 16 2787e: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(X_TMC2130_DIAG); 27882: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27886: 8b 7f andi r24, 0xFB ; 251 27888: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Y_TMC2130_DIAG); 2788c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 27890: 8f 77 andi r24, 0x7F ; 127 27892: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(Z_TMC2130_DIAG); 27896: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 2789a: 8f 7b andi r24, 0xBF ; 191 2789c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_INPUT(E0_TMC2130_DIAG); 278a0: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 278a4: 87 7f andi r24, 0xF7 ; 247 278a6: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(X_TMC2130_DIAG,HIGH); 278aa: 9f b7 in r25, 0x3f ; 63 278ac: f8 94 cli 278ae: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278b2: 84 60 ori r24, 0x04 ; 4 278b4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278b8: 9f bf out 0x3f, r25 ; 63 WRITE(Y_TMC2130_DIAG,HIGH); 278ba: 9f b7 in r25, 0x3f ; 63 278bc: f8 94 cli 278be: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278c2: 80 68 ori r24, 0x80 ; 128 278c4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278c8: 9f bf out 0x3f, r25 ; 63 WRITE(Z_TMC2130_DIAG,HIGH); 278ca: 9f b7 in r25, 0x3f ; 63 278cc: f8 94 cli 278ce: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278d2: 80 64 ori r24, 0x40 ; 64 278d4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278d8: 9f bf out 0x3f, r25 ; 63 WRITE(E0_TMC2130_DIAG,HIGH); 278da: 9f b7 in r25, 0x3f ; 63 278dc: f8 94 cli 278de: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278e2: 88 60 ori r24, 0x08 ; 8 278e4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 278e8: 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); 278ea: 80 e0 ldi r24, 0x00 ; 0 278ec: 0f 94 c7 3a call 0x2758e ; 0x2758e 278f0: 81 e0 ldi r24, 0x01 ; 1 278f2: 0f 94 c7 3a call 0x2758e ; 0x2758e 278f6: 82 e0 ldi r24, 0x02 ; 2 278f8: 0f 94 c7 3a call 0x2758e ; 0x2758e } // E axis tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 278fc: 50 e0 ldi r21, 0x00 ; 0 278fe: 40 e0 ldi r20, 0x00 ; 0 27900: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 27904: 83 e0 ldi r24, 0x03 ; 3 27906: 0f 94 4a 3a call 0x27494 ; 0x27494 tmc2130_wr(E_AXIS, TMC2130_REG_TPOWERDOWN, 0x00000000); 2790a: 20 e0 ldi r18, 0x00 ; 0 2790c: 30 e0 ldi r19, 0x00 ; 0 2790e: a9 01 movw r20, r18 27910: 61 e9 ldi r22, 0x91 ; 145 27912: 83 e0 ldi r24, 0x03 ; 3 27914: 0f 94 06 3a call 0x2740c ; 0x2740c #ifndef TMC2130_STEALTH_E if( ! params.enableECool ){ 27918: c1 fd sbrc r28, 1 2791a: 1d c0 rjmp .+58 ; 0x27956 tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SGSENS); 2791c: 20 e8 ldi r18, 0x80 ; 128 2791e: 31 e0 ldi r19, 0x01 ; 1 27920: 40 e0 ldi r20, 0x00 ; 0 27922: 50 e0 ldi r21, 0x00 ; 0 27924: 60 e8 ldi r22, 0x80 ; 128 27926: 83 e0 ldi r24, 0x03 ; 3 27928: 0f 94 06 3a call 0x2740c ; 0x2740c 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]); 2792c: 60 91 fc 04 lds r22, 0x04FC ; 0x8004fc 27930: 80 e0 ldi r24, 0x00 ; 0 27932: 0f 94 5e 88 call 0x310bc ; 0x310bc tmc2130_set_wave(Y_AXIS, 247, tmc2130_wave_fac[Y_AXIS]); 27936: 60 91 fd 04 lds r22, 0x04FD ; 0x8004fd 2793a: 81 e0 ldi r24, 0x01 ; 1 2793c: 0f 94 5e 88 call 0x310bc ; 0x310bc tmc2130_set_wave(Z_AXIS, 247, tmc2130_wave_fac[Z_AXIS]); 27940: 60 91 fe 04 lds r22, 0x04FE ; 0x8004fe 27944: 82 e0 ldi r24, 0x02 ; 2 27946: 0f 94 5e 88 call 0x310bc ; 0x310bc #endif //TMC2130_LINEARITY_CORRECTION_XYZ tmc2130_set_wave(E_AXIS, 247, tmc2130_wave_fac[E_AXIS]); 2794a: 60 91 ff 04 lds r22, 0x04FF ; 0x8004ff 2794e: 83 e0 ldi r24, 0x03 ; 3 #ifdef PSU_Delta if(!params.bSuppressFlag) check_force_z(); #endif // PSU_Delta } 27950: 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]); 27952: 0d 94 5e 88 jmp 0x310bc ; 0x310bc 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)); 27956: 20 e0 ldi r18, 0x00 ; 0 27958: 30 e0 ldi r19, 0x00 ; 0 2795a: 43 e0 ldi r20, 0x03 ; 3 2795c: 50 e0 ldi r21, 0x00 ; 0 2795e: 6d ee ldi r22, 0xED ; 237 27960: 83 e0 ldi r24, 0x03 ; 3 27962: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(E_AXIS, TMC2130_REG_TCOOLTHRS, 0); 27966: 20 e0 ldi r18, 0x00 ; 0 27968: 30 e0 ldi r19, 0x00 ; 0 2796a: a9 01 movw r20, r18 2796c: 64 e9 ldi r22, 0x94 ; 148 2796e: 83 e0 ldi r24, 0x03 ; 3 27970: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(E_AXIS, TMC2130_REG_GCONF, TMC2130_GCONF_SILENT); 27974: 24 e0 ldi r18, 0x04 ; 4 27976: 30 e0 ldi r19, 0x00 ; 0 27978: 40 e0 ldi r20, 0x00 ; 0 2797a: 50 e0 ldi r21, 0x00 ; 0 2797c: 60 e8 ldi r22, 0x80 ; 128 2797e: 83 e0 ldi r24, 0x03 ; 3 27980: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(E_AXIS, TMC2130_REG_PWMCONF, pwmconf_Ecool.dw); 27984: 2b e2 ldi r18, 0x2B ; 43 27986: 34 e5 ldi r19, 0x54 ; 84 27988: 42 e0 ldi r20, 0x02 ; 2 2798a: 50 e0 ldi r21, 0x00 ; 0 2798c: 60 ef ldi r22, 0xF0 ; 240 2798e: 83 e0 ldi r24, 0x03 ; 3 27990: 0f 94 06 3a call 0x2740c ; 0x2740c tmc2130_wr(E_AXIS, TMC2130_REG_TPWMTHRS, TMC2130_TPWMTHRS_E); 27994: 23 e9 ldi r18, 0x93 ; 147 27996: 31 e0 ldi r19, 0x01 ; 1 27998: 40 e0 ldi r20, 0x00 ; 0 2799a: 50 e0 ldi r21, 0x00 ; 0 2799c: 63 e9 ldi r22, 0x93 ; 147 2799e: 83 e0 ldi r24, 0x03 ; 3 279a0: 0f 94 06 3a call 0x2740c ; 0x2740c SERIAL_ECHOLNRPGM(eMotorCurrentScalingEnabled); 279a4: 83 ec ldi r24, 0xC3 ; 195 279a6: 9f e9 ldi r25, 0x9F ; 159 279a8: 0e 94 06 7b call 0xf60c ; 0xf60c 279ac: bf cf rjmp .-130 ; 0x2792c 000279ae : lcd_update(2); } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { 279ae: df 92 push r13 279b0: ef 92 push r14 279b2: ff 92 push r15 279b4: 0f 93 push r16 279b6: 1f 93 push r17 279b8: cf 93 push r28 279ba: df 93 push r29 MENU_BEGIN(); 279bc: 0f 94 10 cf call 0x39e20 ; 0x39e20 279c0: 10 92 15 05 sts 0x0515, r1 ; 0x800515 279c4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 279c8: 84 30 cpi r24, 0x04 ; 4 279ca: 08 f0 brcs .+2 ; 0x279ce 279cc: 66 c0 rjmp .+204 ; 0x27a9a 279ce: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 279d2: 0f 94 90 cd call 0x39b20 ; 0x39b20 279d6: 88 23 and r24, r24 279d8: e9 f0 breq .+58 ; 0x27a14 279da: 0c ef ldi r16, 0xFC ; 252 279dc: 14 e0 ldi r17, 0x04 ; 4 279de: c7 ef ldi r28, 0xF7 ; 247 279e0: 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) { 279e2: f8 01 movw r30, r16 279e4: 80 81 ld r24, Z 279e6: 8e 31 cpi r24, 0x1E ; 30 279e8: 08 f4 brcc .+2 ; 0x279ec tmc2130_wave_fac[axis] = 0; 279ea: 10 82 st Z, r1 279ec: f8 01 movw r30, r16 279ee: 61 91 ld r22, Z+ 279f0: 8f 01 movw r16, r30 279f2: ce 01 movw r24, r28 279f4: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 279f8: 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++) { 279fa: c3 3f cpi r28, 0xF3 ; 243 279fc: fe e0 ldi r31, 0x0E ; 14 279fe: df 07 cpc r29, r31 27a00: 81 f7 brne .-32 ; 0x279e2 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(); 27a02: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 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) { } 27a06: e8 94 clt 27a08: d0 f8 bld r13, 0 27a0a: 80 fb bst r24, 0 27a0c: 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())); 27a0e: 8d 2d mov r24, r13 27a10: 0f 94 21 3c call 0x27842 ; 0x27842 { MENU_BEGIN(); ON_MENU_LEAVE( lcd_settings_linearity_correction_menu_save(); ); MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 27a14: 87 e6 ldi r24, 0x67 ; 103 27a16: 9d e3 ldi r25, 0x3D ; 61 27a18: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 27a1c: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 #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); 27a20: 8d ea ldi r24, 0xAD ; 173 27a22: 96 e5 ldi r25, 0x56 ; 86 27a24: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 27a28: f1 2c mov r15, r1 27a2a: e1 2c mov r14, r1 27a2c: 08 ec ldi r16, 0xC8 ; 200 27a2e: 10 e0 ldi r17, 0x00 ; 0 27a30: 2d e1 ldi r18, 0x1D ; 29 27a32: 30 e0 ldi r19, 0x00 ; 0 27a34: 48 e0 ldi r20, 0x08 ; 8 27a36: 6c ef ldi r22, 0xFC ; 252 27a38: 74 e0 ldi r23, 0x04 ; 4 27a3a: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 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); 27a3e: 81 ea ldi r24, 0xA1 ; 161 27a40: 96 e5 ldi r25, 0x56 ; 86 27a42: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 27a46: 2d e1 ldi r18, 0x1D ; 29 27a48: 30 e0 ldi r19, 0x00 ; 0 27a4a: 48 e0 ldi r20, 0x08 ; 8 27a4c: 6d ef ldi r22, 0xFD ; 253 27a4e: 74 e0 ldi r23, 0x04 ; 4 27a50: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 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); 27a54: 85 e9 ldi r24, 0x95 ; 149 27a56: 96 e5 ldi r25, 0x56 ; 86 27a58: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 27a5c: 2d e1 ldi r18, 0x1D ; 29 27a5e: 30 e0 ldi r19, 0x00 ; 0 27a60: 48 e0 ldi r20, 0x08 ; 8 27a62: 6e ef ldi r22, 0xFE ; 254 27a64: 74 e0 ldi r23, 0x04 ; 4 27a66: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 #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); 27a6a: 89 e8 ldi r24, 0x89 ; 137 27a6c: 96 e5 ldi r25, 0x56 ; 86 27a6e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 27a72: 2d e1 ldi r18, 0x1D ; 29 27a74: 30 e0 ldi r19, 0x00 ; 0 27a76: 48 e0 ldi r20, 0x08 ; 8 27a78: 6f ef ldi r22, 0xFF ; 255 27a7a: 74 e0 ldi r23, 0x04 ; 4 27a7c: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 MENU_END(); 27a80: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 } #ifdef TMC2130 void lcd_settings_linearity_correction_menu(void) { MENU_BEGIN(); 27a84: 80 91 15 05 lds r24, 0x0515 ; 0x800515 27a88: 8f 5f subi r24, 0xFF ; 255 27a8a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 27a8e: 80 91 17 05 lds r24, 0x0517 ; 0x800517 27a92: 8f 5f subi r24, 0xFF ; 255 27a94: 80 93 17 05 sts 0x0517, r24 ; 0x800517 27a98: 95 cf rjmp .-214 ; 0x279c4 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(); } 27a9a: df 91 pop r29 27a9c: cf 91 pop r28 27a9e: 1f 91 pop r17 27aa0: 0f 91 pop r16 27aa2: ff 90 pop r15 27aa4: ef 90 pop r14 27aa6: df 90 pop r13 27aa8: 08 95 ret 00027aaa : , 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()); } 27aaa: fc 01 movw r30, r24 27aac: 20 81 ld r18, Z 27aae: 92 81 ldd r25, Z+2 ; 0x02 27ab0: 49 2f mov r20, r25 27ab2: 50 e0 ldi r21, 0x00 ; 0 27ab4: 21 11 cpse r18, r1 27ab6: 02 c0 rjmp .+4 ; 0x27abc 27ab8: 44 0f add r20, r20 27aba: 55 1f adc r21, r21 27abc: 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; } 27abe: 21 11 cpse r18, r1 27ac0: 01 c0 rjmp .+2 ; 0x27ac4 27ac2: 88 0f add r24, r24 inline uint8_t getOriginaliHold() const { return min(vSense ? iHold : iHold << 1, getOriginaliRun()); } 27ac4: 84 17 cp r24, r20 27ac6: 15 06 cpc r1, r21 27ac8: 31 f0 breq .+12 ; 0x27ad6 27aca: 2c f0 brlt .+10 ; 0x27ad6 27acc: 89 2f mov r24, r25 27ace: 21 11 cpse r18, r1 27ad0: 02 c0 rjmp .+4 ; 0x27ad6 27ad2: 88 0f add r24, r24 27ad4: 08 95 ret 27ad6: 08 95 ret 00027ad8 : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 27ad8: 3f b7 in r19, 0x3f ; 63 cli(); 27ada: f8 94 cli m = timer2_overflow_count; 27adc: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 27ae0: 90 91 3d 06 lds r25, 0x063D ; 0x80063d 27ae4: a0 91 3e 06 lds r26, 0x063E ; 0x80063e 27ae8: b0 91 3f 06 lds r27, 0x063F ; 0x80063f #if defined(TCNT2) t = TCNT2; 27aec: 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)) 27af0: b8 9b sbis 0x17, 0 ; 23 27af2: 05 c0 rjmp .+10 ; 0x27afe 27af4: 2f 3f cpi r18, 0xFF ; 255 27af6: 19 f0 breq .+6 ; 0x27afe m++; 27af8: 01 96 adiw r24, 0x01 ; 1 27afa: a1 1d adc r26, r1 27afc: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 27afe: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 27b00: ba 2f mov r27, r26 27b02: a9 2f mov r26, r25 27b04: 98 2f mov r25, r24 27b06: 88 27 eor r24, r24 27b08: bc 01 movw r22, r24 27b0a: cd 01 movw r24, r26 27b0c: 62 0f add r22, r18 27b0e: 71 1d adc r23, r1 27b10: 81 1d adc r24, r1 27b12: 91 1d adc r25, r1 27b14: 42 e0 ldi r20, 0x02 ; 2 27b16: 66 0f add r22, r22 27b18: 77 1f adc r23, r23 27b1a: 88 1f adc r24, r24 27b1c: 99 1f adc r25, r25 27b1e: 4a 95 dec r20 27b20: d1 f7 brne .-12 ; 0x27b16 } 27b22: 08 95 ret 00027b24 : void delay2(unsigned long ms) { 27b24: 8f 92 push r8 27b26: 9f 92 push r9 27b28: af 92 push r10 27b2a: bf 92 push r11 27b2c: cf 92 push r12 27b2e: df 92 push r13 27b30: ef 92 push r14 27b32: ff 92 push r15 27b34: 6b 01 movw r12, r22 27b36: 7c 01 movw r14, r24 uint32_t start = micros2(); 27b38: 0f 94 6c 3d call 0x27ad8 ; 0x27ad8 27b3c: 4b 01 movw r8, r22 27b3e: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 27b40: c1 14 cp r12, r1 27b42: d1 04 cpc r13, r1 27b44: e1 04 cpc r14, r1 27b46: f1 04 cpc r15, r1 27b48: b9 f0 breq .+46 ; 0x27b78 27b4a: 0f 94 6c 3d call 0x27ad8 ; 0x27ad8 27b4e: 68 19 sub r22, r8 27b50: 79 09 sbc r23, r9 27b52: 8a 09 sbc r24, r10 27b54: 9b 09 sbc r25, r11 27b56: 68 3e cpi r22, 0xE8 ; 232 27b58: 73 40 sbci r23, 0x03 ; 3 27b5a: 81 05 cpc r24, r1 27b5c: 91 05 cpc r25, r1 27b5e: 80 f3 brcs .-32 ; 0x27b40 { ms--; 27b60: 21 e0 ldi r18, 0x01 ; 1 27b62: c2 1a sub r12, r18 27b64: d1 08 sbc r13, r1 27b66: e1 08 sbc r14, r1 27b68: f1 08 sbc r15, r1 start += 1000; 27b6a: 88 ee ldi r24, 0xE8 ; 232 27b6c: 88 0e add r8, r24 27b6e: 83 e0 ldi r24, 0x03 ; 3 27b70: 98 1e adc r9, r24 27b72: a1 1c adc r10, r1 27b74: b1 1c adc r11, r1 27b76: e4 cf rjmp .-56 ; 0x27b40 } } } 27b78: ff 90 pop r15 27b7a: ef 90 pop r14 27b7c: df 90 pop r13 27b7e: cf 90 pop r12 27b80: bf 90 pop r11 27b82: af 90 pop r10 27b84: 9f 90 pop r9 27b86: 8f 90 pop r8 27b88: 08 95 ret 00027b8a : * @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() { 27b8a: ef 92 push r14 27b8c: ff 92 push r15 27b8e: 0f 93 push r16 27b90: 1f 93 push r17 27b92: cf 93 push r28 27b94: df 93 push r29 27b96: cd b7 in r28, 0x3d ; 61 27b98: de b7 in r29, 0x3e ; 62 27b9a: 63 97 sbiw r28, 0x13 ; 19 27b9c: 0f b6 in r0, 0x3f ; 63 27b9e: f8 94 cli 27ba0: de bf out 0x3e, r29 ; 62 27ba2: 0f be out 0x3f, r0 ; 63 27ba4: 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) 27ba6: 80 91 a9 03 lds r24, 0x03A9 ; 0x8003a9 27baa: 81 11 cpse r24, r1 27bac: 3a c0 rjmp .+116 ; 0x27c22 { // Menu was entered. // Initialize its status. _md->status = 1; 27bae: 81 e0 ldi r24, 0x01 ; 1 27bb0: 80 93 a9 03 sts 0x03A9, r24 ; 0x8003a9 check_babystep(); 27bb4: 0e 94 0a 7b call 0xf614 ; 0xf614 if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 27bb8: 81 ea ldi r24, 0xA1 ; 161 27bba: 9d e0 ldi r25, 0x0D ; 13 27bbc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 27bc0: 18 2f mov r17, r24 27bc2: 0e 94 cc 77 call 0xef98 ; 0xef98 27bc6: 81 11 cpse r24, r1 27bc8: ee c0 rjmp .+476 ; 0x27da6 _md->babystepMemZ = 0; 27bca: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 27bce: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->babystepMemZ = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); } // same logic as in babystep_load if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 27bd2: 80 e1 ldi r24, 0x10 ; 16 27bd4: 0e 94 4b f9 call 0x1f296 ; 0x1f296 27bd8: 81 11 cpse r24, r1 27bda: 04 c0 rjmp .+8 ; 0x27be4 _md->babystepMemZ = 0; 27bdc: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 27be0: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 27be4: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 27be8: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 27bec: 07 2e mov r0, r23 27bee: 00 0c add r0, r0 27bf0: 88 0b sbc r24, r24 27bf2: 99 0b sbc r25, r25 27bf4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 27bf8: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 27bfc: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 27c00: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 27c04: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 27c08: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 27c0c: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 27c10: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 27c14: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 27c18: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af lcd_draw_update = 1; 27c1c: 81 e0 ldi r24, 0x01 ; 1 27c1e: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 27c22: 80 91 37 05 lds r24, 0x0537 ; 0x800537 27c26: 90 91 38 05 lds r25, 0x0538 ; 0x800538 27c2a: 00 97 sbiw r24, 0x00 ; 0 27c2c: f1 f1 breq .+124 ; 0x27caa { _md->babystepMemZ += lcd_encoder; 27c2e: 20 91 aa 03 lds r18, 0x03AA ; 0x8003aa 27c32: 30 91 ab 03 lds r19, 0x03AB ; 0x8003ab 27c36: 28 0f add r18, r24 27c38: 39 1f adc r19, r25 27c3a: 30 93 ab 03 sts 0x03AB, r19 ; 0x8003ab 27c3e: 20 93 aa 03 sts 0x03AA, r18 ; 0x8003aa if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 27c42: 21 36 cpi r18, 0x61 ; 97 27c44: 40 ef ldi r20, 0xF0 ; 240 27c46: 34 07 cpc r19, r20 27c48: 0c f0 brlt .+2 ; 0x27c4c 27c4a: ba c0 rjmp .+372 ; 0x27dc0 27c4c: 81 e6 ldi r24, 0x61 ; 97 27c4e: 90 ef ldi r25, 0xF0 ; 240 27c50: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 27c54: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa else if (_md->babystepMemZ > Z_BABYSTEP_MAX) _md->babystepMemZ = Z_BABYSTEP_MAX; //0 else babystepsTodoZadd(lcd_encoder); _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 27c58: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 27c5c: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 27c60: 07 2e mov r0, r23 27c62: 00 0c add r0, r0 27c64: 88 0b sbc r24, r24 27c66: 99 0b sbc r25, r25 27c68: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 27c6c: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 27c70: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 27c74: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 27c78: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 27c7c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 27c80: 60 93 ac 03 sts 0x03AC, r22 ; 0x8003ac 27c84: 70 93 ad 03 sts 0x03AD, r23 ; 0x8003ad 27c88: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae 27c8c: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af _delay(50); 27c90: 62 e3 ldi r22, 0x32 ; 50 27c92: 70 e0 ldi r23, 0x00 ; 0 27c94: 80 e0 ldi r24, 0x00 ; 0 27c96: 90 e0 ldi r25, 0x00 ; 0 27c98: 0f 94 92 3d call 0x27b24 ; 0x27b24 lcd_encoder = 0; 27c9c: 10 92 38 05 sts 0x0538, r1 ; 0x800538 27ca0: 10 92 37 05 sts 0x0537, r1 ; 0x800537 lcd_draw_update = 1; 27ca4: 81 e0 ldi r24, 0x01 ; 1 27ca6: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } if (lcd_draw_update) 27caa: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27cae: 88 23 and r24, r24 27cb0: c9 f1 breq .+114 ; 0x27d24 { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 27cb2: 81 ea ldi r24, 0xA1 ; 161 27cb4: 9d e0 ldi r25, 0x0D ; 13 27cb6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 27cba: 2b e0 ldi r18, 0x0B ; 11 27cbc: 82 9f mul r24, r18 27cbe: c0 01 movw r24, r0 27cc0: 11 24 eor r1, r1 27cc2: be 01 movw r22, r28 27cc4: 6f 5f subi r22, 0xFF ; 255 27cc6: 7f 4f sbci r23, 0xFF ; 255 27cc8: 87 5b subi r24, 0xB7 ; 183 27cca: 92 4f sbci r25, 0xF2 ; 242 27ccc: 0f 94 aa cd call 0x39b54 ; 0x39b54 lcd_home(); 27cd0: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_print(buffer.c); 27cd4: ce 01 movw r24, r28 27cd6: 01 96 adiw r24, 0x01 ; 1 27cd8: 0e 94 9c 71 call 0xe338 ; 0xe338 lcd_set_cursor(0, 1); 27cdc: 61 e0 ldi r22, 0x01 ; 1 27cde: 80 e0 ldi r24, 0x00 ; 0 27ce0: 0e 94 95 6f call 0xdf2a ; 0xdf2a menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 27ce4: 10 91 ac 03 lds r17, 0x03AC ; 0x8003ac 27ce8: 00 91 ad 03 lds r16, 0x03AD ; 0x8003ad 27cec: f0 90 ae 03 lds r15, 0x03AE ; 0x8003ae 27cf0: e0 90 af 03 lds r14, 0x03AF ; 0x8003af 27cf4: 86 e0 ldi r24, 0x06 ; 6 27cf6: 9d e4 ldi r25, 0x4D ; 77 27cf8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 //! (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); 27cfc: ef 92 push r14 27cfe: ff 92 push r15 27d00: 0f 93 push r16 27d02: 1f 93 push r17 27d04: 9f 93 push r25 27d06: 8f 93 push r24 27d08: 1f 92 push r1 27d0a: 80 e2 ldi r24, 0x20 ; 32 27d0c: 8f 93 push r24 27d0e: 86 ec ldi r24, 0xC6 ; 198 27d10: 93 ea ldi r25, 0xA3 ; 163 27d12: 9f 93 push r25 27d14: 8f 93 push r24 27d16: 0e 94 6e 6f call 0xdedc ; 0xdedc 27d1a: 0f b6 in r0, 0x3f ; 63 27d1c: f8 94 cli 27d1e: de bf out 0x3e, r29 ; 62 27d20: 0f be out 0x3f, r0 ; 63 27d22: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 27d24: 80 91 a8 03 lds r24, 0x03A8 ; 0x8003a8 27d28: 81 11 cpse r24, r1 27d2a: 04 c0 rjmp .+8 ; 0x27d34 27d2c: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 27d30: 88 23 and r24, r24 27d32: 51 f1 breq .+84 ; 0x27d88 { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 27d34: 81 ea ldi r24, 0xA1 ; 161 27d36: 9d e0 ldi r25, 0x0D ; 13 27d38: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 27d3c: 9b e0 ldi r25, 0x0B ; 11 27d3e: 89 9f mul r24, r25 27d40: 80 01 movw r16, r0 27d42: 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); 27d44: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 27d48: 70 91 ab 03 lds r23, 0x03AB ; 0x8003ab 27d4c: c8 01 movw r24, r16 27d4e: 80 5b subi r24, 0xB0 ; 176 27d50: 92 4f sbci r25, 0xF2 ; 242 27d52: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 27d56: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 27d5a: c8 01 movw r24, r16 27d5c: 8e 5a subi r24, 0xAE ; 174 27d5e: 92 4f sbci r25, 0xF2 ; 242 27d60: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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); 27d64: 60 91 99 03 lds r22, 0x0399 ; 0x800399 27d68: 70 91 9a 03 lds r23, 0x039A ; 0x80039a 27d6c: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 27d70: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 27d74: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 27d78: c8 01 movw r24, r16 27d7a: 8d 5a subi r24, 0xAD ; 173 27d7c: 92 4f sbci r25, 0xF2 ; 242 27d7e: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 27d82: 80 e1 ldi r24, 0x10 ; 16 27d84: 0e 94 66 e7 call 0x1cecc ; 0x1cecc } menu_back_if_clicked(); 27d88: 0f 94 7a d2 call 0x3a4f4 ; 0x3a4f4 } 27d8c: 63 96 adiw r28, 0x13 ; 19 27d8e: 0f b6 in r0, 0x3f ; 63 27d90: f8 94 cli 27d92: de bf out 0x3e, r29 ; 62 27d94: 0f be out 0x3f, r0 ; 63 27d96: cd bf out 0x3d, r28 ; 61 27d98: df 91 pop r29 27d9a: cf 91 pop r28 27d9c: 1f 91 pop r17 27d9e: 0f 91 pop r16 27da0: ff 90 pop r15 27da2: ef 90 pop r14 27da4: 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-> 27da6: 2b e0 ldi r18, 0x0B ; 11 27da8: 12 9f mul r17, r18 27daa: c0 01 movw r24, r0 27dac: 11 24 eor r1, r1 27dae: 80 5b subi r24, 0xB0 ; 176 27db0: 92 4f sbci r25, 0xF2 ; 242 27db2: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 27db6: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 27dba: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa 27dbe: 09 cf rjmp .-494 ; 0x27bd2 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 27dc0: 12 16 cp r1, r18 27dc2: 13 06 cpc r1, r19 27dc4: 2c f4 brge .+10 ; 0x27dd0 27dc6: 10 92 ab 03 sts 0x03AB, r1 ; 0x8003ab 27dca: 10 92 aa 03 sts 0x03AA, r1 ; 0x8003aa 27dce: 44 cf rjmp .-376 ; 0x27c58 extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 27dd0: 2f b7 in r18, 0x3f ; 63 27dd2: f8 94 cli babystepsTodo[Z_AXIS] += n; 27dd4: 40 91 6a 06 lds r20, 0x066A ; 0x80066a 27dd8: 50 91 6b 06 lds r21, 0x066B ; 0x80066b 27ddc: 84 0f add r24, r20 27dde: 95 1f adc r25, r21 27de0: 90 93 6b 06 sts 0x066B, r25 ; 0x80066b 27de4: 80 93 6a 06 sts 0x066A, r24 ; 0x80066a CRITICAL_SECTION_END 27de8: 2f bf out 0x3f, r18 ; 63 27dea: 36 cf rjmp .-404 ; 0x27c58 00027dec : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 27dec: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 27df0: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 27df4: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 27df8: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 27dfc: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 27e00: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 27e04: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 27e08: 26 17 cp r18, r22 27e0a: 37 07 cpc r19, r23 27e0c: 0c f0 brlt .+2 ; 0x27e10 27e0e: 65 c0 rjmp .+202 ; 0x27eda { if (lcd_encoder != 0) 27e10: 80 91 37 05 lds r24, 0x0537 ; 0x800537 27e14: 90 91 38 05 lds r25, 0x0538 ; 0x800538 27e18: 89 2b or r24, r25 27e1a: b9 f1 breq .+110 ; 0x27e8a { refresh_cmd_timeout(); 27e1c: 0e 94 78 67 call 0xcef0 ; 0xcef0 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; 27e20: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 if (++ next_block_index == BLOCK_BUFFER_SIZE) 27e24: 8f 5f subi r24, 0xFF ; 255 27e26: 80 31 cpi r24, 0x10 ; 16 27e28: 09 f4 brne .+2 ; 0x27e2c next_block_index = 0; 27e2a: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 27e2c: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 if (! planner_queue_full()) 27e30: 98 17 cp r25, r24 27e32: 59 f1 breq .+86 ; 0x27e8a { current_position[E_AXIS] += lcd_encoder; 27e34: 60 91 37 05 lds r22, 0x0537 ; 0x800537 27e38: 70 91 38 05 lds r23, 0x0538 ; 0x800538 27e3c: 07 2e mov r0, r23 27e3e: 00 0c add r0, r0 27e40: 88 0b sbc r24, r24 27e42: 99 0b sbc r25, r25 27e44: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 27e48: 9b 01 movw r18, r22 27e4a: ac 01 movw r20, r24 27e4c: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 27e50: 70 91 50 07 lds r23, 0x0750 ; 0x800750 27e54: 80 91 51 07 lds r24, 0x0751 ; 0x800751 27e58: 90 91 52 07 lds r25, 0x0752 ; 0x800752 27e5c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 27e60: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 27e64: 70 93 50 07 sts 0x0750, r23 ; 0x800750 27e68: 80 93 51 07 sts 0x0751, r24 ; 0x800751 27e6c: 90 93 52 07 sts 0x0752, r25 ; 0x800752 lcd_encoder = 0; 27e70: 10 92 38 05 sts 0x0538, r1 ; 0x800538 27e74: 10 92 37 05 sts 0x0537, r1 ; 0x800537 plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 27e78: 65 e5 ldi r22, 0x55 ; 85 27e7a: 75 e5 ldi r23, 0x55 ; 85 27e7c: 85 ed ldi r24, 0xD5 ; 213 27e7e: 9f e3 ldi r25, 0x3F ; 63 27e80: 0f 94 93 ba call 0x37526 ; 0x37526 lcd_draw_update = 1; 27e84: 81 e0 ldi r24, 0x01 ; 1 27e86: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d } } if (lcd_draw_update) 27e8a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 27e8e: 88 23 and r24, r24 27e90: 11 f1 breq .+68 ; 0x27ed6 { lcd_set_cursor(0, 1); 27e92: 61 e0 ldi r22, 0x01 ; 1 27e94: 80 e0 ldi r24, 0x00 ; 0 27e96: 0e 94 95 6f call 0xdf2a ; 0xdf2a //! 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); 27e9a: 80 91 52 07 lds r24, 0x0752 ; 0x800752 27e9e: 8f 93 push r24 27ea0: 80 91 51 07 lds r24, 0x0751 ; 0x800751 27ea4: 8f 93 push r24 27ea6: 80 91 50 07 lds r24, 0x0750 ; 0x800750 27eaa: 8f 93 push r24 27eac: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 27eb0: 8f 93 push r24 27eb2: 88 ea ldi r24, 0xA8 ; 168 27eb4: 93 ea ldi r25, 0xA3 ; 163 27eb6: 9f 93 push r25 27eb8: 8f 93 push r24 27eba: 89 e9 ldi r24, 0x99 ; 153 27ebc: 93 ea ldi r25, 0xA3 ; 163 27ebe: 9f 93 push r25 27ec0: 8f 93 push r24 27ec2: 0e 94 6e 6f call 0xdedc ; 0xdedc 27ec6: 8d b7 in r24, 0x3d ; 61 27ec8: 9e b7 in r25, 0x3e ; 62 27eca: 08 96 adiw r24, 0x08 ; 8 27ecc: 0f b6 in r0, 0x3f ; 63 27ece: f8 94 cli 27ed0: 9e bf out 0x3e, r25 ; 62 27ed2: 0f be out 0x3f, r0 ; 63 27ed4: 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(); 27ed6: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 }; } void show_preheat_nozzle_warning() { lcd_clear(); 27eda: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 27ede: 87 e9 ldi r24, 0x97 ; 151 27ee0: 9c e4 ldi r25, 0x4C ; 76 27ee2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 27ee6: ac 01 movw r20, r24 27ee8: 60 e0 ldi r22, 0x00 ; 0 27eea: 80 e0 ldi r24, 0x00 ; 0 27eec: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 27ef0: 81 e8 ldi r24, 0x81 ; 129 27ef2: 9c e4 ldi r25, 0x4C ; 76 27ef4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 27ef8: ac 01 movw r20, r24 27efa: 62 e0 ldi r22, 0x02 ; 2 27efc: 80 e0 ldi r24, 0x00 ; 0 27efe: 0e 94 a9 6f call 0xdf52 ; 0xdf52 _delay(2000); 27f02: 60 ed ldi r22, 0xD0 ; 208 27f04: 77 e0 ldi r23, 0x07 ; 7 27f06: 80 e0 ldi r24, 0x00 ; 0 27f08: 90 e0 ldi r25, 0x00 ; 0 27f0a: 0f 94 92 3d call 0x27b24 ; 0x27b24 lcd_clear(); 27f0e: 0e 94 c8 6f call 0xdf90 ; 0xdf90 menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 27f12: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00027f16 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 27f16: 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(); 27f18: f8 94 cli m = timer2_millis; 27f1a: 60 91 38 06 lds r22, 0x0638 ; 0x800638 27f1e: 70 91 39 06 lds r23, 0x0639 ; 0x800639 27f22: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 27f26: 90 91 3b 06 lds r25, 0x063B ; 0x80063b SREG = oldSREG; 27f2a: 2f bf out 0x3f, r18 ; 63 return m; } 27f2c: 08 95 ret 00027f2e : } //! @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); 27f2e: 20 e0 ldi r18, 0x00 ; 0 27f30: 30 e0 ldi r19, 0x00 ; 0 27f32: 40 e8 ldi r20, 0x80 ; 128 27f34: 5f eb ldi r21, 0xBF ; 191 27f36: 60 e0 ldi r22, 0x00 ; 0 27f38: 70 e0 ldi r23, 0x00 ; 0 27f3a: cb 01 movw r24, r22 27f3c: 0e 94 6a 8a call 0x114d4 ; 0x114d4 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 27f40: 86 e2 ldi r24, 0x26 ; 38 27f42: 9f e6 ldi r25, 0x6F ; 111 27f44: 0e 94 06 7b call 0xf60c ; 0xf60c // Indicate that the printer is paused did_pause_print = true; 27f48: 81 e0 ldi r24, 0x01 ; 1 27f4a: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 27f4e: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 27f52: 81 30 cpi r24, 0x01 ; 1 27f54: 69 f4 brne .+26 ; 0x27f70 state = PAUSED; 27f56: 82 e0 ldi r24, 0x02 ; 2 27f58: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d stopTimestamp = _millis(); 27f5c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 27f60: 60 93 4f 06 sts 0x064F, r22 ; 0x80064f 27f64: 70 93 50 06 sts 0x0650, r23 ; 0x800650 27f68: 80 93 51 06 sts 0x0651, r24 ; 0x800651 27f6c: 90 93 52 06 sts 0x0652, r25 ; 0x800652 print_job_timer.pause(); // return to status is required to continue processing in the main loop! lcd_commands_type = LcdCommands::LongPause; 27f70: 82 e0 ldi r24, 0x02 ; 2 27f72: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 lcd_return_to_status(); 27f76: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00027f7a ::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) 27f7a: ff 92 push r15 27f7c: 0f 93 push r16 27f7e: 1f 93 push r17 27f80: cf 93 push r28 27f82: df 93 push r29 { if (!m_isRunning) return false; 27f84: fc 01 movw r30, r24 27f86: f0 80 ld r15, Z 27f88: f1 10 cpse r15, r1 27f8a: 08 c0 rjmp .+16 ; 0x27f9c ::expired(unsigned short)+0x22> 27f8c: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 27f8e: 8f 2d mov r24, r15 27f90: df 91 pop r29 27f92: cf 91 pop r28 27f94: 1f 91 pop r17 27f96: 0f 91 pop r16 27f98: ff 90 pop r15 27f9a: 08 95 ret 27f9c: 8b 01 movw r16, r22 27f9e: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 27fa0: 0f 94 8b 3f call 0x27f16 ; 0x27f16 if (m_started <= m_started + msPeriod) 27fa4: 89 81 ldd r24, Y+1 ; 0x01 27fa6: 9a 81 ldd r25, Y+2 ; 0x02 27fa8: 08 0f add r16, r24 27faa: 19 1f adc r17, r25 27fac: 08 17 cp r16, r24 27fae: 19 07 cpc r17, r25 27fb0: 40 f0 brcs .+16 ; 0x27fc2 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 27fb2: 60 17 cp r22, r16 27fb4: 71 07 cpc r23, r17 27fb6: 18 f4 brcc .+6 ; 0x27fbe ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27fb8: 68 17 cp r22, r24 27fba: 79 07 cpc r23, r25 27fbc: 38 f7 brcc .-50 ; 0x27f8c ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 27fbe: 18 82 st Y, r1 27fc0: e6 cf rjmp .-52 ; 0x27f8e ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 27fc2: 60 17 cp r22, r16 27fc4: 71 07 cpc r23, r17 27fc6: c0 f7 brcc .-16 ; 0x27fb8 ::expired(unsigned short)+0x3e> 27fc8: e1 cf rjmp .-62 ; 0x27f8c ::expired(unsigned short)+0x12> 00027fca ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 27fca: fc 01 movw r30, r24 27fcc: 20 81 ld r18, Z 27fce: 21 11 cpse r18, r1 27fd0: 0d 94 bd 3f jmp 0x27f7a ; 0x27f7a ::expired(unsigned short)> } 27fd4: 81 e0 ldi r24, 0x01 ; 1 27fd6: 08 95 ret 00027fd8 ::start()>: /** * @brief Start timer */ template void Timer::start() 27fd8: cf 93 push r28 27fda: df 93 push r29 27fdc: ec 01 movw r28, r24 { m_started = _millis(); 27fde: 0f 94 8b 3f call 0x27f16 ; 0x27f16 27fe2: 7a 83 std Y+2, r23 ; 0x02 27fe4: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 27fe6: 81 e0 ldi r24, 0x01 ; 1 27fe8: 88 83 st Y, r24 } 27fea: df 91 pop r29 27fec: cf 91 pop r28 27fee: 08 95 ret 00027ff0 : } static uint8_t twi_wait(uint8_t status) { 27ff0: 1f 93 push r17 27ff2: cf 93 push r28 27ff4: df 93 push r29 27ff6: 00 d0 rcall .+0 ; 0x27ff8 27ff8: cd b7 in r28, 0x3d ; 61 27ffa: de b7 in r29, 0x3e ; 62 27ffc: 18 2f mov r17, r24 ShortTimer timmy; 27ffe: 19 82 std Y+1, r1 ; 0x01 28000: 1b 82 std Y+3, r1 ; 0x03 28002: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 28004: ce 01 movw r24, r28 28006: 01 96 adiw r24, 0x01 ; 1 28008: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> while(!(TWCR & _BV(TWINT))) { 2800c: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 28010: 87 fd sbrc r24, 7 28012: 0a c0 rjmp .+20 ; 0x28028 if (timmy.expired(TWI_TIMEOUT_MS)) { 28014: 6a e0 ldi r22, 0x0A ; 10 28016: 70 e0 ldi r23, 0x00 ; 0 28018: ce 01 movw r24, r28 2801a: 01 96 adiw r24, 0x01 ; 1 2801c: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 28020: 88 23 and r24, r24 28022: a1 f3 breq .-24 ; 0x2800c return 2; 28024: 82 e0 ldi r24, 0x02 ; 2 28026: 09 c0 rjmp .+18 ; 0x2803a } } if(TW_STATUS != status) 28028: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2802c: 88 7f andi r24, 0xF8 ; 248 2802e: 18 17 cp r17, r24 28030: 59 f0 breq .+22 ; 0x28048 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 28032: 84 e9 ldi r24, 0x94 ; 148 28034: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 28038: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 2803a: 0f 90 pop r0 2803c: 0f 90 pop r0 2803e: 0f 90 pop r0 28040: df 91 pop r29 28042: cf 91 pop r28 28044: 1f 91 pop r17 28046: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 28048: 80 e0 ldi r24, 0x00 ; 0 2804a: f7 cf rjmp .-18 ; 0x2803a 0002804c : } return standstill; } void tmc2130_check_overtemp() { 2804c: 1f 93 push r17 2804e: cf 93 push r28 28050: df 93 push r29 28052: 00 d0 rcall .+0 ; 0x28054 28054: 1f 92 push r1 28056: cd b7 in r28, 0x3d ; 61 28058: de b7 in r29, 0x3e ; 62 if (tmc2130_overtemp_timer.expired_cont(1000)) 2805a: 68 ee ldi r22, 0xE8 ; 232 2805c: 73 e0 ldi r23, 0x03 ; 3 2805e: 81 e4 ldi r24, 0x41 ; 65 28060: 96 e0 ldi r25, 0x06 ; 6 28062: 0f 94 e5 3f call 0x27fca ; 0x27fca ::expired_cont(unsigned short)> 28066: 88 23 and r24, r24 28068: 91 f1 breq .+100 ; 0x280ce { for (uint_least8_t i = 0; i < 4; i++) 2806a: 10 e0 ldi r17, 0x00 ; 0 { uint32_t drv_status = 0; 2806c: 19 82 std Y+1, r1 ; 0x01 2806e: 1a 82 std Y+2, r1 ; 0x02 28070: 1b 82 std Y+3, r1 ; 0x03 28072: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(i, TMC2130_REG_DRV_STATUS, &drv_status); 28074: ae 01 movw r20, r28 28076: 4f 5f subi r20, 0xFF ; 255 28078: 5f 4f sbci r21, 0xFF ; 255 2807a: 6f e6 ldi r22, 0x6F ; 111 2807c: 81 2f mov r24, r17 2807e: 0f 94 ac 39 call 0x27358 ; 0x27358 if (drv_status & ((uint32_t)1 << 26)) 28082: 89 81 ldd r24, Y+1 ; 0x01 28084: 9a 81 ldd r25, Y+2 ; 0x02 28086: ab 81 ldd r26, Y+3 ; 0x03 28088: bc 81 ldd r27, Y+4 ; 0x04 2808a: b2 ff sbrs r27, 2 2808c: 19 c0 rjmp .+50 ; 0x280c0 { // BIT 26 - over temp prewarning ~120C (+-20C) SERIAL_ERRORRPGM(MSG_TMC_OVERTEMP); 2808e: 87 e9 ldi r24, 0x97 ; 151 28090: 9e e6 ldi r25, 0x6E ; 110 28092: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 28096: 81 2f mov r24, r17 28098: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 2809c: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 SERIAL_ECHOLN(i); for (uint_least8_t j = 0; j < 4; j++) 280a0: 10 e0 ldi r17, 0x00 ; 0 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); 280a2: 20 e0 ldi r18, 0x00 ; 0 280a4: 30 e0 ldi r19, 0x00 ; 0 280a6: 41 e0 ldi r20, 0x01 ; 1 280a8: 50 e0 ldi r21, 0x00 ; 0 280aa: 6c ee ldi r22, 0xEC ; 236 280ac: 81 2f mov r24, r17 280ae: 0f 94 06 3a call 0x2740c ; 0x2740c 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++) 280b2: 1f 5f subi r17, 0xFF ; 255 280b4: 14 30 cpi r17, 0x04 ; 4 280b6: a9 f7 brne .-22 ; 0x280a2 tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); 280b8: 87 e9 ldi r24, 0x97 ; 151 280ba: 9e e6 ldi r25, 0x6E ; 110 280bc: 0e 94 95 7b call 0xf72a ; 0xf72a void tmc2130_check_overtemp() { if (tmc2130_overtemp_timer.expired_cont(1000)) { for (uint_least8_t i = 0; i < 4; i++) 280c0: 1f 5f subi r17, 0xFF ; 255 280c2: 14 30 cpi r17, 0x04 ; 4 280c4: 99 f6 brne .-90 ; 0x2806c tmc2130_wr(j, TMC2130_REG_CHOPCONF, 0x00010000); kill(MSG_TMC_OVERTEMP); } } tmc2130_overtemp_timer.start(); 280c6: 81 e4 ldi r24, 0x41 ; 65 280c8: 96 e0 ldi r25, 0x06 ; 6 280ca: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> } } 280ce: 0f 90 pop r0 280d0: 0f 90 pop r0 280d2: 0f 90 pop r0 280d4: 0f 90 pop r0 280d6: df 91 pop r29 280d8: cf 91 pop r28 280da: 1f 91 pop r17 280dc: 08 95 ret 000280de ::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) 280de: 8f 92 push r8 280e0: 9f 92 push r9 280e2: af 92 push r10 280e4: bf 92 push r11 280e6: cf 92 push r12 280e8: df 92 push r13 280ea: ef 92 push r14 280ec: ff 92 push r15 280ee: 1f 93 push r17 280f0: cf 93 push r28 280f2: df 93 push r29 { if (!m_isRunning) return false; 280f4: fc 01 movw r30, r24 280f6: 10 81 ld r17, Z 280f8: 11 11 cpse r17, r1 280fa: 0e c0 rjmp .+28 ; 0x28118 ::expired(unsigned long)+0x3a> 280fc: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 280fe: 81 2f mov r24, r17 28100: df 91 pop r29 28102: cf 91 pop r28 28104: 1f 91 pop r17 28106: ff 90 pop r15 28108: ef 90 pop r14 2810a: df 90 pop r13 2810c: cf 90 pop r12 2810e: bf 90 pop r11 28110: af 90 pop r10 28112: 9f 90 pop r9 28114: 8f 90 pop r8 28116: 08 95 ret 28118: 6a 01 movw r12, r20 2811a: 7b 01 movw r14, r22 2811c: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 2811e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 28122: 4b 01 movw r8, r22 28124: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 28126: 89 81 ldd r24, Y+1 ; 0x01 28128: 9a 81 ldd r25, Y+2 ; 0x02 2812a: ab 81 ldd r26, Y+3 ; 0x03 2812c: bc 81 ldd r27, Y+4 ; 0x04 2812e: c8 0e add r12, r24 28130: d9 1e adc r13, r25 28132: ea 1e adc r14, r26 28134: fb 1e adc r15, r27 28136: c8 16 cp r12, r24 28138: d9 06 cpc r13, r25 2813a: ea 06 cpc r14, r26 2813c: fb 06 cpc r15, r27 2813e: 60 f0 brcs .+24 ; 0x28158 ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 28140: 8c 14 cp r8, r12 28142: 9d 04 cpc r9, r13 28144: ae 04 cpc r10, r14 28146: bf 04 cpc r11, r15 28148: 28 f4 brcc .+10 ; 0x28154 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 2814a: 88 16 cp r8, r24 2814c: 99 06 cpc r9, r25 2814e: aa 06 cpc r10, r26 28150: bb 06 cpc r11, r27 28152: a0 f6 brcc .-88 ; 0x280fc ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 28154: 18 82 st Y, r1 28156: d3 cf rjmp .-90 ; 0x280fe ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 28158: 8c 14 cp r8, r12 2815a: 9d 04 cpc r9, r13 2815c: ae 04 cpc r10, r14 2815e: bf 04 cpc r11, r15 28160: a0 f7 brcc .-24 ; 0x2814a ::expired(unsigned long)+0x6c> 28162: cc cf rjmp .-104 ; 0x280fc ::expired(unsigned long)+0x1e> 00028164 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 28164: 0f 93 push r16 28166: 1f 93 push r17 28168: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 2816a: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 2816e: 88 23 and r24, r24 28170: 09 f4 brne .+2 ; 0x28174 28172: 4d c0 rjmp .+154 ; 0x2820e heating_status_counter++; 28174: 80 91 48 06 lds r24, 0x0648 ; 0x800648 28178: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 2817a: 8e 30 cpi r24, 0x0E ; 14 2817c: b0 f4 brcc .+44 ; 0x281aa //! @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++; 2817e: 80 93 48 06 sts 0x0648, r24 ; 0x800648 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 28182: 63 e0 ldi r22, 0x03 ; 3 28184: 87 e0 ldi r24, 0x07 ; 7 28186: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_space(13); 2818a: 8d e0 ldi r24, 0x0D ; 13 2818c: 0e 94 8b 6f call 0xdf16 ; 0xdf16 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 28190: c0 e0 ldi r28, 0x00 ; 0 28192: 80 91 48 06 lds r24, 0x0648 ; 0x800648 28196: c8 17 cp r28, r24 28198: 58 f4 brcc .+22 ; 0x281b0 lcd_putc_at(7 + dots, 3, '.'); 2819a: 4e e2 ldi r20, 0x2E ; 46 2819c: 63 e0 ldi r22, 0x03 ; 3 2819e: 87 e0 ldi r24, 0x07 ; 7 281a0: 8c 0f add r24, r28 281a2: 0e 94 b5 6f call 0xdf6a ; 0xdf6a heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 281a6: cf 5f subi r28, 0xFF ; 255 281a8: f4 cf rjmp .-24 ; 0x28192 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; 281aa: 10 92 48 06 sts 0x0648, r1 ; 0x800648 281ae: e9 cf rjmp .-46 ; 0x28182 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 281b0: 80 91 df 03 lds r24, 0x03DF ; 0x8003df 281b4: 82 30 cpi r24, 0x02 ; 2 281b6: d1 f0 breq .+52 ; 0x281ec 281b8: 30 f4 brcc .+12 ; 0x281c6 281ba: 81 30 cpi r24, 0x01 ; 1 281bc: 59 f0 breq .+22 ; 0x281d4 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 281be: cf 91 pop r28 281c0: 1f 91 pop r17 281c2: 0f 91 pop r16 281c4: 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) { 281c6: 83 30 cpi r24, 0x03 ; 3 281c8: f9 f0 breq .+62 ; 0x28208 281ca: 84 30 cpi r24, 0x04 ; 4 281cc: c1 f7 brne .-16 ; 0x281be 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)); 281ce: 85 eb ldi r24, 0xB5 ; 181 281d0: 99 e4 ldi r25, 0x49 ; 73 281d2: 0e c0 rjmp .+28 ; 0x281f0 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)); 281d4: 8e ed ldi r24, 0xDE ; 222 281d6: 99 e4 ldi r25, 0x49 ; 73 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 281d8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 281dc: ac 01 movw r20, r24 281de: 63 e0 ldi r22, 0x03 ; 3 281e0: 80 e0 ldi r24, 0x00 ; 0 break; } } } 281e2: cf 91 pop r28 281e4: 1f 91 pop r17 281e6: 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)); 281e8: 0c 94 a9 6f jmp 0xdf52 ; 0xdf52 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)); 281ec: 8e ec ldi r24, 0xCE ; 206 281ee: 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)); 281f0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 281f4: ac 01 movw r20, r24 281f6: 63 e0 ldi r22, 0x03 ; 3 281f8: 80 e0 ldi r24, 0x00 ; 0 281fa: 0e 94 a9 6f call 0xdf52 ; 0xdf52 heating_status = HeatingStatus::NO_HEATING; 281fe: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df heating_status_counter = 0; 28202: 10 92 48 06 sts 0x0648, r1 ; 0x800648 28206: db cf rjmp .-74 ; 0x281be 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)); 28208: 80 ec ldi r24, 0xC0 ; 192 2820a: 99 e4 ldi r25, 0x49 ; 73 2820c: e5 cf rjmp .-54 ; 0x281d8 #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) && 2820e: 80 91 6e 14 lds r24, 0x146E ; 0x80146e 28212: 88 23 and r24, r24 28214: 61 f1 breq .+88 ; 0x2826e } else if (((IS_SD_PRINTING) #ifdef SHOW_FILENAME_AFTER_FINISH || (GetPrinterState() == PrinterState::SDPrintingFinished) #endif //SHOW_FILENAME_AFTER_FINISH ) && 28216: 80 91 75 07 lds r24, 0x0775 ; 0x800775 2821a: 81 11 cpse r24, r1 2821c: 28 c0 rjmp .+80 ; 0x2826e (custom_message_type == CustomMsg::Status) && 2821e: 80 91 d1 03 lds r24, 0x03D1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> 28222: 82 30 cpi r24, 0x02 ; 2 28224: 20 f5 brcc .+72 ; 0x2826e } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 28226: 80 91 4f 05 lds r24, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.467> 2822a: 81 11 cpse r24, r1 2822c: 16 c0 rjmp .+44 ; 0x2825a (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); 2822e: 80 91 85 14 lds r24, 0x1485 ; 0x801485 28232: 88 23 and r24, r24 28234: 09 f4 brne .+2 ; 0x28238 28236: 35 c0 rjmp .+106 ; 0x282a2 28238: 85 e8 ldi r24, 0x85 ; 133 2823a: 94 e1 ldi r25, 0x14 ; 20 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 2823c: 20 91 68 0e lds r18, 0x0E68 ; 0x800e68 28240: 64 e1 ldi r22, 0x14 ; 20 28242: 82 0f add r24, r18 28244: 91 1d adc r25, r1 28246: 0e 94 84 71 call 0xe308 ; 0xe308 2824a: 81 11 cpse r24, r1 2824c: 2d c0 rjmp .+90 ; 0x282a8 { scrollstuff++; 2824e: 80 91 68 0e lds r24, 0x0E68 ; 0x800e68 28252: 8f 5f subi r24, 0xFF ; 255 28254: 80 93 68 0e sts 0x0E68, r24 ; 0x800e68 28258: b2 cf rjmp .-156 ; 0x281be 2825a: 40 e2 ldi r20, 0x20 ; 32 2825c: 5e e4 ldi r21, 0x4E ; 78 2825e: 60 e0 ldi r22, 0x00 ; 0 28260: 70 e0 ldi r23, 0x00 ; 0 28262: 8f e4 ldi r24, 0x4F ; 79 28264: 95 e0 ldi r25, 0x05 ; 5 28266: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 2826a: 81 11 cpse r24, r1 2826c: e0 cf rjmp .-64 ; 0x2822e 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) 2826e: 80 91 75 07 lds r24, 0x0775 ; 0x800775 28272: 81 11 cpse r24, r1 28274: 1c c0 rjmp .+56 ; 0x282ae { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 28276: e0 91 75 07 lds r30, 0x0775 ; 0x800775 2827a: ea 30 cpi r30, 0x0A ; 10 2827c: 08 f0 brcs .+2 ; 0x28280 2827e: 9f cf rjmp .-194 ; 0x281be 28280: f0 e0 ldi r31, 0x00 ; 0 28282: 88 27 eor r24, r24 28284: e9 5b subi r30, 0xB9 ; 185 28286: fe 4b sbci r31, 0xBE ; 190 28288: 8e 4f sbci r24, 0xFE ; 254 2828a: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 2828e: 74 39 cpi r23, 0x94 ; 148 28290: 90 3a cpi r25, 0xA0 ; 160 28292: 74 39 cpi r23, 0x94 ; 148 28294: ec 39 cpi r30, 0x9C ; 156 28296: b8 39 cpi r27, 0x98 ; 152 28298: 64 3b cpi r22, 0xB4 ; 180 2829a: 74 39 cpi r23, 0x94 ; 148 2829c: 74 39 cpi r23, 0x94 ; 148 2829e: f2 3a cpi r31, 0xA2 ; 162 282a0: 74 39 cpi r23, 0x94 ; 148 (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); 282a2: 80 e7 ldi r24, 0x70 ; 112 282a4: 94 e1 ldi r25, 0x14 ; 20 282a6: ca cf rjmp .-108 ; 0x2823c if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 282a8: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 282ac: 88 cf rjmp .-240 ; 0x281be } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 282ae: 80 91 4f 05 lds r24, 0x054F ; 0x80054f <_ZL26lcd_status_message_timeout.lto_priv.467> 282b2: 88 23 and r24, r24 282b4: 01 f3 breq .-64 ; 0x28276 * 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; 282b6: 0f 94 8b 3f call 0x27f16 ; 0x27f16 282ba: 00 91 50 05 lds r16, 0x0550 ; 0x800550 <_ZL26lcd_status_message_timeout.lto_priv.467+0x1> 282be: 10 91 51 05 lds r17, 0x0551 ; 0x800551 <_ZL26lcd_status_message_timeout.lto_priv.467+0x2> 282c2: 20 91 52 05 lds r18, 0x0552 ; 0x800552 <_ZL26lcd_status_message_timeout.lto_priv.467+0x3> 282c6: 30 91 53 05 lds r19, 0x0553 ; 0x800553 <_ZL26lcd_status_message_timeout.lto_priv.467+0x4> 282ca: 60 1b sub r22, r16 282cc: 71 0b sbc r23, r17 282ce: 82 0b sbc r24, r18 282d0: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 282d2: 60 3a cpi r22, 0xA0 ; 160 282d4: 7f 40 sbci r23, 0x0F ; 15 282d6: 81 05 cpc r24, r1 282d8: 91 05 cpc r25, r1 282da: 68 f6 brcc .-102 ; 0x28276 282dc: 70 cf rjmp .-288 ; 0x281be 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); 282de: 63 e0 ldi r22, 0x03 ; 3 282e0: 80 91 39 05 lds r24, 0x0539 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> 282e4: 0e 94 95 6f call 0xdf2a ; 0xdf2a const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 282e8: 80 91 39 05 lds r24, 0x0539 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> 282ec: c4 e1 ldi r28, 0x14 ; 20 282ee: 6c 2f mov r22, r28 282f0: 68 1b sub r22, r24 282f2: 90 e0 ldi r25, 0x00 ; 0 282f4: 86 5c subi r24, 0xC6 ; 198 282f6: 9a 4f sbci r25, 0xFA ; 250 282f8: 0e 94 84 71 call 0xe308 ; 0xe308 lcd_status_message_idx = LCD_WIDTH - padding; 282fc: c8 1b sub r28, r24 282fe: c0 93 39 05 sts 0x0539, r28 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> 28302: 5d cf rjmp .-326 ; 0x281be } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 28304: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 28308: 8b 30 cpi r24, 0x0B ; 11 2830a: 08 f1 brcs .+66 ; 0x2834e lcd_set_cursor(0, 3); 2830c: 63 e0 ldi r22, 0x03 ; 3 2830e: 80 e0 ldi r24, 0x00 ; 0 28310: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_space(LCD_WIDTH); 28314: 84 e1 ldi r24, 0x14 ; 20 28316: 0e 94 8b 6f call 0xdf16 ; 0xdf16 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 2831a: 85 ea ldi r24, 0xA5 ; 165 2831c: 99 e4 ldi r25, 0x49 ; 73 2831e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 28322: ac 01 movw r20, r24 28324: 63 e0 ldi r22, 0x03 ; 3 28326: 80 e0 ldi r24, 0x00 ; 0 28328: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_P(PSTR(" : ")); 2832c: 8c ec ldi r24, 0xCC ; 204 2832e: 90 ea ldi r25, 0xA0 ; 160 28330: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_print(custom_message_state - 10); 28334: 60 91 f3 03 lds r22, 0x03F3 ; 0x8003f3 28338: 6a 50 subi r22, 0x0A ; 10 2833a: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 2833c: 07 2e mov r0, r23 2833e: 00 0c add r0, r0 28340: 88 0b sbc r24, r24 28342: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 28344: cf 91 pop r28 28346: 1f 91 pop r17 28348: 0f 91 pop r16 2834a: 0c 94 4e 71 jmp 0xe29c ; 0xe29c 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) { 2834e: 83 30 cpi r24, 0x03 ; 3 28350: 31 f4 brne .+12 ; 0x2835e lcd_setstatuspgm(MSG_WELCOME); 28352: 8a e6 ldi r24, 0x6A ; 106 28354: 90 e7 ldi r25, 0x70 ; 112 28356: 0f 94 ea 0b call 0x217d4 ; 0x217d4 custom_message_type = CustomMsg::Status; 2835a: 10 92 75 07 sts 0x0775, r1 ; 0x800775 } if (custom_message_state > 3 && custom_message_state <= 10) { 2835e: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 28362: 84 50 subi r24, 0x04 ; 4 28364: 87 30 cpi r24, 0x07 ; 7 28366: 08 f0 brcs .+2 ; 0x2836a 28368: 2a cf rjmp .-428 ; 0x281be lcd_set_cursor(0, 3); 2836a: 63 e0 ldi r22, 0x03 ; 3 2836c: 80 e0 ldi r24, 0x00 ; 0 2836e: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_space(19); 28372: 83 e1 ldi r24, 0x13 ; 19 28374: 0e 94 8b 6f call 0xdf16 ; 0xdf16 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 28378: 82 e9 ldi r24, 0x92 ; 146 2837a: 99 e4 ldi r25, 0x49 ; 73 2837c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 28380: ac 01 movw r20, r24 28382: 63 e0 ldi r22, 0x03 ; 3 28384: 80 e0 ldi r24, 0x00 ; 0 28386: 0e 94 a9 6f call 0xdf52 ; 0xdf52 custom_message_state--; 2838a: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 2838e: 81 50 subi r24, 0x01 ; 1 28390: 80 93 f3 03 sts 0x03F3, r24 ; 0x8003f3 28394: 14 cf rjmp .-472 ; 0x281be } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 28396: 64 e1 ldi r22, 0x14 ; 20 28398: 8a e3 ldi r24, 0x3A ; 58 2839a: 95 e0 ldi r25, 0x05 ; 5 2839c: 0e 94 84 71 call 0xe308 ; 0xe308 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 283a0: 20 91 46 06 lds r18, 0x0646 ; 0x800646 283a4: 30 91 47 06 lds r19, 0x0647 ; 0x800647 283a8: 80 91 44 06 lds r24, 0x0644 ; 0x800644 283ac: 90 91 45 06 lds r25, 0x0645 ; 0x800645 283b0: 82 17 cp r24, r18 283b2: 93 07 cpc r25, r19 283b4: 0c f4 brge .+2 ; 0x283b8 283b6: 03 cf rjmp .-506 ; 0x281be 283b8: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 283bc: 88 23 and r24, r24 283be: 09 f4 brne .+2 ; 0x283c2 283c0: fe ce rjmp .-516 ; 0x281be lcd_set_cursor(10, 3); 283c2: 63 e0 ldi r22, 0x03 ; 3 283c4: 8a e0 ldi r24, 0x0A ; 10 283c6: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 283ca: 80 91 45 06 lds r24, 0x0645 ; 0x800645 283ce: 8f 93 push r24 283d0: 80 91 44 06 lds r24, 0x0644 ; 0x800644 283d4: 8f 93 push r24 283d6: 80 91 47 06 lds r24, 0x0647 ; 0x800647 283da: 8f 93 push r24 283dc: 80 91 46 06 lds r24, 0x0646 ; 0x800646 283e0: 8f 93 push r24 283e2: 83 ec ldi r24, 0xC3 ; 195 283e4: 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); 283e6: 9f 93 push r25 283e8: 8f 93 push r24 283ea: 0e 94 6e 6f call 0xdedc ; 0xdedc 283ee: 0f 90 pop r0 283f0: 0f 90 pop r0 283f2: 0f 90 pop r0 283f4: 0f 90 pop r0 283f6: 0f 90 pop r0 283f8: 0f 90 pop r0 283fa: e1 ce rjmp .-574 ; 0x281be 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); 283fc: 63 e0 ldi r22, 0x03 ; 3 283fe: 80 e0 ldi r24, 0x00 ; 0 28400: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 28404: c0 91 f3 03 lds r28, 0x03F3 ; 0x8003f3 28408: 82 e3 ldi r24, 0x32 ; 50 2840a: 9a e3 ldi r25, 0x3A ; 58 2840c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 28410: 1f 92 push r1 28412: cf 93 push r28 28414: 9f 93 push r25 28416: 8f 93 push r24 28418: 85 eb ldi r24, 0xB5 ; 181 2841a: 90 ea ldi r25, 0xA0 ; 160 2841c: e4 cf rjmp .-56 ; 0x283e6 break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 2841e: 82 e8 ldi r24, 0x82 ; 130 28420: 99 e4 ldi r25, 0x49 ; 73 28422: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 28426: ac 01 movw r20, r24 28428: 63 e0 ldi r22, 0x03 ; 3 2842a: 80 e0 ldi r24, 0x00 ; 0 2842c: 0e 94 a9 6f call 0xdf52 ; 0xdf52 if (custom_message_state <= PINDA_HEAT_T) { 28430: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 28434: 89 37 cpi r24, 0x79 ; 121 28436: 08 f0 brcs .+2 ; 0x2843a 28438: c2 ce rjmp .-636 ; 0x281be lcd_puts_P(PSTR(": ")); 2843a: 82 eb ldi r24, 0xB2 ; 178 2843c: 90 ea ldi r25, 0xA0 ; 160 2843e: 0e 94 80 6f call 0xdf00 ; 0xdf00 } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 28442: 80 91 f3 03 lds r24, 0x03F3 ; 0x8003f3 28446: 0e 94 44 70 call 0xe088 ; 0xe088 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 2844a: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 2844c: cf 91 pop r28 2844e: 1f 91 pop r17 28450: 0f 91 pop r16 28452: 0c 94 44 70 jmp 0xe088 ; 0xe088 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 28456: 81 e7 ldi r24, 0x71 ; 113 28458: 99 e4 ldi r25, 0x49 ; 73 2845a: be ce rjmp .-644 ; 0x281d8 0002845c ::start()>: /** * @brief Start timer */ template void Timer::start() 2845c: cf 93 push r28 2845e: df 93 push r29 28460: ec 01 movw r28, r24 { m_started = _millis(); 28462: 0f 94 8b 3f call 0x27f16 ; 0x27f16 28466: 69 83 std Y+1, r22 ; 0x01 28468: 7a 83 std Y+2, r23 ; 0x02 2846a: 8b 83 std Y+3, r24 ; 0x03 2846c: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 2846e: 81 e0 ldi r24, 0x01 ; 1 28470: 88 83 st Y, r24 } 28472: df 91 pop r29 28474: cf 91 pop r28 28476: 08 95 ret 00028478 : //! 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) { 28478: cf 92 push r12 2847a: df 92 push r13 2847c: ff 92 push r15 2847e: 0f 93 push r16 28480: 1f 93 push r17 28482: cf 93 push r28 28484: df 93 push r29 28486: cd b7 in r28, 0x3d ; 61 28488: de b7 in r29, 0x3e ; 62 2848a: 64 97 sbiw r28, 0x14 ; 20 2848c: 0f b6 in r0, 0x3f ; 63 2848e: f8 94 cli 28490: de bf out 0x3e, r29 ; 62 28492: 0f be out 0x3f, r0 ; 63 28494: cd bf out 0x3d, r28 ; 61 28496: 8c 01 movw r16, r24 28498: f6 2e mov r15, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 2849a: 66 ec ldi r22, 0xC6 ; 198 2849c: 7e e9 ldi r23, 0x9E ; 158 2849e: ce 01 movw r24, r28 284a0: 01 96 adiw r24, 0x01 ; 1 284a2: 0f 94 48 db call 0x3b690 ; 0x3b690 strcat_P(msg, type); 284a6: b8 01 movw r22, r16 284a8: ce 01 movw r24, r28 284aa: 01 96 adiw r24, 0x01 ; 1 284ac: 0f 94 34 db call 0x3b668 ; 0x3b668 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 284b0: 83 e0 ldi r24, 0x03 ; 3 284b2: 0f 94 b1 06 call 0x20d62 ; 0x20d62 284b6: 88 23 and r24, r24 284b8: e1 f0 breq .+56 ; 0x284f2 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 284ba: be 01 movw r22, r28 284bc: 6f 5f subi r22, 0xFF ; 255 284be: 7f 4f sbci r23, 0xFF ; 255 284c0: 8a e3 ldi r24, 0x3A ; 58 284c2: 95 e0 ldi r25, 0x05 ; 5 284c4: 0f 94 f3 e3 call 0x3c7e6 ; 0x3c7e6 284c8: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 284ca: 8f e4 ldi r24, 0x4F ; 79 284cc: 95 e0 ldi r25, 0x05 ; 5 284ce: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> lcd_status_message_level = severity; 284d2: 83 e0 ldi r24, 0x03 ; 3 284d4: 80 93 d1 03 sts 0x03D1, r24 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> custom_message_type = CustomMsg::Status; 284d8: 10 92 75 07 sts 0x0775, r1 ; 0x800775 custom_message_state = 0; 284dc: 10 92 f3 03 sts 0x03F3, r1 ; 0x8003f3 if (!same) { 284e0: cd 28 or r12, r13 284e2: 39 f0 breq .+14 ; 0x284f2 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 284e4: 60 e0 ldi r22, 0x00 ; 0 284e6: ce 01 movw r24, r28 284e8: 01 96 adiw r24, 0x01 ; 1 284ea: 0f 94 96 06 call 0x20d2c ; 0x20d2c lcd_return_to_status(); 284ee: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 284f2: 8a ec ldi r24, 0xCA ; 202 284f4: 99 ea ldi r25, 0xA9 ; 169 284f6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if(e != EXTRUDERS) { 284fa: 81 e0 ldi r24, 0x01 ; 1 284fc: f8 16 cp r15, r24 284fe: 49 f0 breq .+18 ; 0x28512 28500: 60 e0 ldi r22, 0x00 ; 0 28502: 70 e0 ldi r23, 0x00 ; 0 28504: cb 01 movw r24, r22 28506: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 2850a: 83 ec ldi r24, 0xC3 ; 195 2850c: 9e e9 ldi r25, 0x9E ; 158 2850e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } SERIAL_ERRORPGM("Heaters switched off. "); 28512: 8c ea ldi r24, 0xAC ; 172 28514: 9e e9 ldi r25, 0x9E ; 158 28516: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORRPGM(type); 2851a: c8 01 movw r24, r16 2851c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORLNPGM(" triggered!"); 28520: 80 ea ldi r24, 0xA0 ; 160 28522: 9e e9 ldi r25, 0x9E ; 158 28524: 0e 94 06 7b call 0xf60c ; 0xf60c } 28528: 64 96 adiw r28, 0x14 ; 20 2852a: 0f b6 in r0, 0x3f ; 63 2852c: f8 94 cli 2852e: de bf out 0x3e, r29 ; 62 28530: 0f be out 0x3f, r0 ; 63 28532: cd bf out 0x3d, r28 ; 61 28534: df 91 pop r29 28536: cf 91 pop r28 28538: 1f 91 pop r17 2853a: 0f 91 pop r16 2853c: ff 90 pop r15 2853e: df 90 pop r13 28540: cf 90 pop r12 28542: 08 95 ret 00028544 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 28544: 1f 92 push r1 28546: 0f 92 push r0 28548: 0f b6 in r0, 0x3f ; 63 2854a: 0f 92 push r0 2854c: 11 24 eor r1, r1 2854e: 2f 93 push r18 28550: 3f 93 push r19 28552: 8f 93 push r24 28554: 9f 93 push r25 28556: af 93 push r26 28558: 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; 2855a: 80 91 38 06 lds r24, 0x0638 ; 0x800638 2855e: 90 91 39 06 lds r25, 0x0639 ; 0x800639 28562: a0 91 3a 06 lds r26, 0x063A ; 0x80063a 28566: b0 91 3b 06 lds r27, 0x063B ; 0x80063b unsigned char f = timer2_fract; 2856a: 30 91 37 06 lds r19, 0x0637 ; 0x800637 m += MILLIS_INC; f += FRACT_INC; 2856e: 23 e0 ldi r18, 0x03 ; 3 28570: 23 0f add r18, r19 if (f >= FRACT_MAX) 28572: 2d 37 cpi r18, 0x7D ; 125 28574: 58 f5 brcc .+86 ; 0x285cc <__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; 28576: 01 96 adiw r24, 0x01 ; 1 28578: a1 1d adc r26, r1 2857a: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 2857c: 20 93 37 06 sts 0x0637, r18 ; 0x800637 timer2_millis = m; 28580: 80 93 38 06 sts 0x0638, r24 ; 0x800638 28584: 90 93 39 06 sts 0x0639, r25 ; 0x800639 28588: a0 93 3a 06 sts 0x063A, r26 ; 0x80063a 2858c: b0 93 3b 06 sts 0x063B, r27 ; 0x80063b timer2_overflow_count++; 28590: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 28594: 90 91 3d 06 lds r25, 0x063D ; 0x80063d 28598: a0 91 3e 06 lds r26, 0x063E ; 0x80063e 2859c: b0 91 3f 06 lds r27, 0x063F ; 0x80063f 285a0: 01 96 adiw r24, 0x01 ; 1 285a2: a1 1d adc r26, r1 285a4: b1 1d adc r27, r1 285a6: 80 93 3c 06 sts 0x063C, r24 ; 0x80063c 285aa: 90 93 3d 06 sts 0x063D, r25 ; 0x80063d 285ae: a0 93 3e 06 sts 0x063E, r26 ; 0x80063e 285b2: b0 93 3f 06 sts 0x063F, r27 ; 0x80063f } 285b6: bf 91 pop r27 285b8: af 91 pop r26 285ba: 9f 91 pop r25 285bc: 8f 91 pop r24 285be: 3f 91 pop r19 285c0: 2f 91 pop r18 285c2: 0f 90 pop r0 285c4: 0f be out 0x3f, r0 ; 63 285c6: 0f 90 pop r0 285c8: 1f 90 pop r1 285ca: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 285cc: 26 e8 ldi r18, 0x86 ; 134 285ce: 23 0f add r18, r19 m += 1; 285d0: 02 96 adiw r24, 0x02 ; 2 285d2: a1 1d adc r26, r1 285d4: b1 1d adc r27, r1 285d6: d2 cf rjmp .-92 ; 0x2857c <__vector_15+0x38> 000285d8 : return pos; } static float cost_fn(uint16_t samples, float* const var, float v, uint8_t fan_pwm, float ambient) { 285d8: 2f 92 push r2 285da: 3f 92 push r3 285dc: 4f 92 push r4 285de: 5f 92 push r5 285e0: 6f 92 push r6 285e2: 7f 92 push r7 285e4: 8f 92 push r8 285e6: 9f 92 push r9 285e8: af 92 push r10 285ea: bf 92 push r11 285ec: cf 92 push r12 285ee: df 92 push r13 285f0: ef 92 push r14 285f2: ff 92 push r15 285f4: 0f 93 push r16 285f6: 1f 93 push r17 285f8: cf 93 push r28 285fa: df 93 push r29 285fc: 00 d0 rcall .+0 ; 0x285fe 285fe: 00 d0 rcall .+0 ; 0x28600 28600: 1f 92 push r1 28602: cd b7 in r28, 0x3d ; 61 28604: de b7 in r29, 0x3e ; 62 28606: 9c 83 std Y+4, r25 ; 0x04 28608: 8b 83 std Y+3, r24 ; 0x03 2860a: 0d 83 std Y+5, r16 ; 0x05 2860c: 26 01 movw r4, r12 2860e: 37 01 movw r6, r14 *var = v; 28610: fb 01 movw r30, r22 28612: 20 83 st Z, r18 28614: 31 83 std Z+1, r19 ; 0x01 28616: 42 83 std Z+2, r20 ; 0x02 28618: 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); 2861a: 20 91 c4 12 lds r18, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 2861e: 30 91 c5 12 lds r19, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 28622: 40 91 c6 12 lds r20, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 28626: 50 91 c7 12 lds r21, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 2862a: 61 e7 ldi r22, 0x71 ; 113 2862c: 7d e3 ldi r23, 0x3D ; 61 2862e: 8a e8 ldi r24, 0x8A ; 138 28630: 9e e3 ldi r25, 0x3E ; 62 28632: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 28636: 60 93 1b 13 sts 0x131B, r22 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 2863a: 70 93 1c 13 sts 0x131C, r23 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 2863e: 80 93 1d 13 sts 0x131D, r24 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 28642: 90 93 1e 13 sts 0x131E, r25 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> warn_s = warn * TEMP_MGR_INTV; 28646: 21 e7 ldi r18, 0x71 ; 113 28648: 3d e3 ldi r19, 0x3D ; 61 2864a: 4a e8 ldi r20, 0x8A ; 138 2864c: 5e e3 ldi r21, 0x3E ; 62 2864e: 60 91 12 13 lds r22, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 28652: 70 91 13 13 lds r23, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 28656: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 2865a: 90 91 15 13 lds r25, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 2865e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 28662: 60 93 1f 13 sts 0x131F, r22 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 28666: 70 93 20 13 sts 0x1320, r23 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 2866a: 80 93 21 13 sts 0x1321, r24 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 2866e: 90 93 22 13 sts 0x1322, r25 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> err_s = err * TEMP_MGR_INTV; 28672: 21 e7 ldi r18, 0x71 ; 113 28674: 3d e3 ldi r19, 0x3D ; 61 28676: 4a e8 ldi r20, 0x8A ; 138 28678: 5e e3 ldi r21, 0x3E ; 62 2867a: 60 91 16 13 lds r22, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 2867e: 70 91 17 13 lds r23, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 28682: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 28686: 90 91 19 13 lds r25, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 2868a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2868e: 60 93 23 13 sts 0x1323, r22 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 28692: 70 93 24 13 sts 0x1324, r23 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 28696: 80 93 25 13 sts 0x1325, r24 ; 0x801325 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 2869a: 90 93 26 13 sts 0x1326, r25 ; 0x801326 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 2869e: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 286a2: 90 91 cd 12 lds r25, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 286a6: 6e e0 ldi r22, 0x0E ; 14 286a8: 71 e0 ldi r23, 0x01 ; 1 286aa: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 286ae: 60 93 ae 12 sts 0x12AE, r22 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 286b2: ee e8 ldi r30, 0x8E ; 142 286b4: 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; 286b6: 80 e0 ldi r24, 0x00 ; 0 286b8: 90 e0 ldi r25, 0x00 ; 0 286ba: a0 ec ldi r26, 0xC0 ; 192 286bc: bf e7 ldi r27, 0x7F ; 127 286be: 81 93 st Z+, r24 286c0: 91 93 st Z+, r25 286c2: a1 93 st Z+, r26 286c4: 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) 286c6: 22 e1 ldi r18, 0x12 ; 18 286c8: ee 3a cpi r30, 0xAE ; 174 286ca: f2 07 cpc r31, r18 286cc: c1 f7 brne .-16 ; 0x286be dT_lag_buf[i] = NAN; dT_lag_idx = 0; 286ce: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> dT_err_prev = 0; 286d2: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 286d6: 10 92 b1 12 sts 0x12B1, r1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 286da: 10 92 b2 12 sts 0x12B2, r1 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 286de: 10 92 b3 12 sts 0x12B3, r1 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> T_prev = NAN; 286e2: 80 93 b4 12 sts 0x12B4, r24 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 286e6: 90 93 b5 12 sts 0x12B5, r25 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 286ea: a0 93 b6 12 sts 0x12B6, r26 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 286ee: b0 93 b7 12 sts 0x12B7, r27 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> // clear the initialization flag flag_bits.uninitialized = false; 286f2: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 286f6: 8e 7f andi r24, 0xFE ; 254 286f8: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 286fc: 86 e7 ldi r24, 0x76 ; 118 286fe: 97 e0 ldi r25, 0x07 ; 7 28700: 9f 83 std Y+7, r25 ; 0x07 28702: 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) { 28704: e1 e0 ldi r30, 0x01 ; 1 28706: f0 e0 ldi r31, 0x00 ; 0 28708: fa 83 std Y+2, r31 ; 0x02 2870a: 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; 2870c: 31 2c mov r3, r1 2870e: 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; 28710: 81 2c mov r8, r1 28712: 91 2c mov r9, r1 28714: 54 01 movw r10, r8 uint16_t cnt = 0; for(uint16_t i = 1; i < samples; ++i) { 28716: 29 81 ldd r18, Y+1 ; 0x01 28718: 3a 81 ldd r19, Y+2 ; 0x02 2871a: 8b 81 ldd r24, Y+3 ; 0x03 2871c: 9c 81 ldd r25, Y+4 ; 0x04 2871e: 28 17 cp r18, r24 28720: 39 07 cpc r19, r25 28722: c8 f5 brcc .+114 ; 0x28796 thermal_model::data.step(rec_buffer[i].pwm, fan_pwm, rec_buffer[i].temp, ambient); 28724: ee 81 ldd r30, Y+6 ; 0x06 28726: ff 81 ldd r31, Y+7 ; 0x07 28728: 25 81 ldd r18, Z+5 ; 0x05 2872a: 36 81 ldd r19, Z+6 ; 0x06 2872c: 47 81 ldd r20, Z+7 ; 0x07 2872e: 50 85 ldd r21, Z+8 ; 0x08 28730: 83 01 movw r16, r6 28732: 72 01 movw r14, r4 28734: 6d 81 ldd r22, Y+5 ; 0x05 28736: 81 85 ldd r24, Z+9 ; 0x09 28738: 0e 94 b2 db call 0x1b764 ; 0x1b764 float err_v = thermal_model::data.dT_err_prev; 2873c: c0 90 b0 12 lds r12, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 28740: d0 90 b1 12 lds r13, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 28744: e0 90 b2 12 lds r14, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 28748: f0 90 b3 12 lds r15, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> if(!isnan(err_v)) { 2874c: a7 01 movw r20, r14 2874e: 96 01 movw r18, r12 28750: c7 01 movw r24, r14 28752: b6 01 movw r22, r12 28754: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 28758: 81 11 cpse r24, r1 2875a: 11 c0 rjmp .+34 ; 0x2877e err += err_v * err_v; 2875c: a7 01 movw r20, r14 2875e: 96 01 movw r18, r12 28760: c7 01 movw r24, r14 28762: b6 01 movw r22, r12 28764: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 28768: 9b 01 movw r18, r22 2876a: ac 01 movw r20, r24 2876c: c5 01 movw r24, r10 2876e: b4 01 movw r22, r8 28770: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 28774: 4b 01 movw r8, r22 28776: 5c 01 movw r10, r24 ++cnt; 28778: ff ef ldi r31, 0xFF ; 255 2877a: 2f 1a sub r2, r31 2877c: 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) { 2877e: 29 81 ldd r18, Y+1 ; 0x01 28780: 3a 81 ldd r19, Y+2 ; 0x02 28782: 2f 5f subi r18, 0xFF ; 255 28784: 3f 4f sbci r19, 0xFF ; 255 28786: 3a 83 std Y+2, r19 ; 0x02 28788: 29 83 std Y+1, r18 ; 0x01 2878a: 8e 81 ldd r24, Y+6 ; 0x06 2878c: 9f 81 ldd r25, Y+7 ; 0x07 2878e: 05 96 adiw r24, 0x05 ; 5 28790: 9f 83 std Y+7, r25 ; 0x07 28792: 8e 83 std Y+6, r24 ; 0x06 28794: c0 cf rjmp .-128 ; 0x28716 if(!isnan(err_v)) { err += err_v * err_v; ++cnt; } } return cnt ? (err / cnt) : NAN; 28796: 60 e0 ldi r22, 0x00 ; 0 28798: 70 e0 ldi r23, 0x00 ; 0 2879a: 80 ec ldi r24, 0xC0 ; 192 2879c: 9f e7 ldi r25, 0x7F ; 127 2879e: 21 14 cp r2, r1 287a0: 31 04 cpc r3, r1 287a2: 59 f0 breq .+22 ; 0x287ba 287a4: b1 01 movw r22, r2 287a6: 90 e0 ldi r25, 0x00 ; 0 287a8: 80 e0 ldi r24, 0x00 ; 0 287aa: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 287ae: 9b 01 movw r18, r22 287b0: ac 01 movw r20, r24 287b2: c5 01 movw r24, r10 287b4: b4 01 movw r22, r8 287b6: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> } 287ba: 27 96 adiw r28, 0x07 ; 7 287bc: 0f b6 in r0, 0x3f ; 63 287be: f8 94 cli 287c0: de bf out 0x3e, r29 ; 62 287c2: 0f be out 0x3f, r0 ; 63 287c4: cd bf out 0x3d, r28 ; 61 287c6: df 91 pop r29 287c8: cf 91 pop r28 287ca: 1f 91 pop r17 287cc: 0f 91 pop r16 287ce: ff 90 pop r15 287d0: ef 90 pop r14 287d2: df 90 pop r13 287d4: cf 90 pop r12 287d6: bf 90 pop r11 287d8: af 90 pop r10 287da: 9f 90 pop r9 287dc: 8f 90 pop r8 287de: 7f 90 pop r7 287e0: 6f 90 pop r6 287e2: 5f 90 pop r5 287e4: 4f 90 pop r4 287e6: 3f 90 pop r3 287e8: 2f 90 pop r2 287ea: 08 95 ret 000287ec : namespace thermal_model_cal { // set current fan speed for both front/backend static __attribute__((noinline)) void set_fan_speed(uint8_t fan_speed) { 287ec: cf 93 push r28 287ee: c8 2f mov r28, r24 // reset the fan measuring state due to missing hysteresis handling on the checking side resetFanCheck(); 287f0: 0e 94 c3 75 call 0xeb86 ; 0xeb86 fanSpeed = fan_speed; 287f4: c0 93 e3 03 sts 0x03E3, r28 ; 0x8003e3 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = fan_speed; 287f8: c0 93 a0 04 sts 0x04A0, r28 ; 0x8004a0 #endif } 287fc: cf 91 pop r28 287fe: 08 95 ret 00028800 : thermal_model::data.R[index] = R; thermal_model::setup(); } void thermal_model_report_settings() { 28800: cf 92 push r12 28802: df 92 push r13 28804: ef 92 push r14 28806: ff 92 push r15 28808: 0f 93 push r16 2880a: 1f 93 push r17 2880c: cf 93 push r28 2880e: df 93 push r29 SERIAL_ECHO_START; 28810: 82 ef ldi r24, 0xF2 ; 242 28812: 99 ea ldi r25, 0xA9 ; 169 28814: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNPGM("Thermal Model settings:"); 28818: 8b e6 ldi r24, 0x6B ; 107 2881a: 9f e9 ldi r25, 0x9F ; 159 2881c: 0e 94 06 7b call 0xf60c ; 0xf60c 28820: ce ec ldi r28, 0xCE ; 206 28822: d2 e1 ldi r29, 0x12 ; 18 28824: 10 e0 ldi r17, 0x00 ; 0 28826: 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]); 28828: 82 ef ldi r24, 0xF2 ; 242 2882a: e8 2e mov r14, r24 2882c: 89 ea ldi r24, 0xA9 ; 169 2882e: f8 2e mov r15, r24 28830: 97 e5 ldi r25, 0x57 ; 87 28832: c9 2e mov r12, r25 28834: 9f e9 ldi r25, 0x9F ; 159 28836: d9 2e mov r13, r25 28838: 88 81 ld r24, Y 2883a: 99 81 ldd r25, Y+1 ; 0x01 2883c: 2a 81 ldd r18, Y+2 ; 0x02 2883e: 3b 81 ldd r19, Y+3 ; 0x03 28840: 24 96 adiw r28, 0x04 ; 4 28842: 3f 93 push r19 28844: 2f 93 push r18 28846: 9f 93 push r25 28848: 8f 93 push r24 2884a: 1f 93 push r17 2884c: 0f 93 push r16 2884e: ff 92 push r15 28850: ef 92 push r14 28852: df 92 push r13 28854: cf 92 push r12 28856: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 2885a: 0f 5f subi r16, 0xFF ; 255 2885c: 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) 2885e: 8d b7 in r24, 0x3d ; 61 28860: 9e b7 in r25, 0x3e ; 62 28862: 0a 96 adiw r24, 0x0a ; 10 28864: 0f b6 in r0, 0x3f ; 63 28866: f8 94 cli 28868: 9e bf out 0x3e, r25 ; 62 2886a: 0f be out 0x3f, r0 ; 63 2886c: 8d bf out 0x3d, r24 ; 61 2886e: 00 31 cpi r16, 0x10 ; 16 28870: 11 05 cpc r17, r1 28872: 11 f7 brne .-60 ; 0x28838 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"), 28874: 80 91 11 13 lds r24, 0x1311 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> 28878: 8f 93 push r24 2887a: 80 91 10 13 lds r24, 0x1310 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 2887e: 8f 93 push r24 28880: 80 91 0f 13 lds r24, 0x130F ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 28884: 8f 93 push r24 28886: 80 91 0e 13 lds r24, 0x130E ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 2888a: 8f 93 push r24 2888c: 80 91 15 13 lds r24, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 28890: 8f 93 push r24 28892: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 28896: 8f 93 push r24 28898: 80 91 13 13 lds r24, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 2889c: 8f 93 push r24 2889e: 80 91 12 13 lds r24, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 288a2: 8f 93 push r24 288a4: 80 91 19 13 lds r24, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 288a8: 8f 93 push r24 288aa: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 288ae: 8f 93 push r24 288b0: 80 91 17 13 lds r24, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 288b4: 8f 93 push r24 288b6: 80 91 16 13 lds r24, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 288ba: 8f 93 push r24 288bc: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> 288c0: 1f 92 push r1 288c2: 8f 93 push r24 288c4: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> 288c8: 1f 92 push r1 288ca: 8f 93 push r24 288cc: 80 91 cd 12 lds r24, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 288d0: 8f 93 push r24 288d2: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 288d6: 8f 93 push r24 288d8: 80 91 cb 12 lds r24, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> 288dc: 8f 93 push r24 288de: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 288e2: 8f 93 push r24 288e4: 80 91 c9 12 lds r24, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 288e8: 8f 93 push r24 288ea: 80 91 c8 12 lds r24, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 288ee: 8f 93 push r24 288f0: 80 91 c7 12 lds r24, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 288f4: 8f 93 push r24 288f6: 80 91 c6 12 lds r24, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 288fa: 8f 93 push r24 288fc: 80 91 c5 12 lds r24, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 28900: 8f 93 push r24 28902: 80 91 c4 12 lds r24, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 28906: 8f 93 push r24 28908: 80 91 c3 12 lds r24, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 2890c: 8f 93 push r24 2890e: 80 91 c2 12 lds r24, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 28912: 8f 93 push r24 28914: 80 91 c1 12 lds r24, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 28918: 8f 93 push r24 2891a: 80 91 c0 12 lds r24, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 2891e: 8f 93 push r24 28920: 80 91 bf 12 lds r24, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 28924: 8f 93 push r24 28926: 80 91 be 12 lds r24, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 2892a: 8f 93 push r24 2892c: 80 91 bd 12 lds r24, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 28930: 8f 93 push r24 28932: 80 91 bc 12 lds r24, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 28936: 8f 93 push r24 28938: 80 91 bb 12 lds r24, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 2893c: 8f 93 push r24 2893e: 80 91 ba 12 lds r24, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 28942: 8f 93 push r24 28944: 80 91 b9 12 lds r24, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 28948: 8f 93 push r24 2894a: 80 91 b8 12 lds r24, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 2894e: 8f 93 push r24 28950: ff 92 push r15 28952: ef 92 push r14 28954: 81 e1 ldi r24, 0x11 ; 17 28956: 9f e9 ldi r25, 0x9F ; 159 28958: 9f 93 push r25 2895a: 8f 93 push r24 2895c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 28960: 8d b7 in r24, 0x3d ; 61 28962: 9e b7 in r25, 0x3e ; 62 28964: 8a 96 adiw r24, 0x2a ; 42 28966: 0f b6 in r0, 0x3f ; 63 28968: f8 94 cli 2896a: 9e bf out 0x3e, r25 ; 62 2896c: 0f be out 0x3f, r0 ; 63 2896e: 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); } 28970: df 91 pop r29 28972: cf 91 pop r28 28974: 1f 91 pop r17 28976: 0f 91 pop r16 28978: ff 90 pop r15 2897a: ef 90 pop r14 2897c: df 90 pop r13 2897e: cf 90 pop r12 28980: 08 95 ret 00028982 : // 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); 28982: 89 57 subi r24, 0x79 ; 121 28984: 9f 4f sbci r25, 0xFF ; 255 28986: 6e e0 ldi r22, 0x0E ; 14 28988: 71 e0 ldi r23, 0x01 ; 1 2898a: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> // ensure we do not exceed the maximum lag buffer and have at least one lag sample for filtering if(samples < 1) 2898e: 61 15 cp r22, r1 28990: 71 05 cpc r23, r1 28992: 99 f0 breq .+38 ; 0x289ba 28994: 69 30 cpi r22, 0x09 ; 9 28996: 71 05 cpc r23, r1 28998: 10 f0 brcs .+4 ; 0x2899e 2899a: 68 e0 ldi r22, 0x08 ; 8 2899c: 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; 2899e: 2e e0 ldi r18, 0x0E ; 14 289a0: 31 e0 ldi r19, 0x01 ; 1 289a2: 62 9f mul r22, r18 289a4: c0 01 movw r24, r0 289a6: 63 9f mul r22, r19 289a8: 90 0d add r25, r0 289aa: 72 9f mul r23, r18 289ac: 90 0d add r25, r0 289ae: 11 24 eor r1, r1 289b0: 90 93 cd 12 sts 0x12CD, r25 ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 289b4: 80 93 cc 12 sts 0x12CC, r24 ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> } 289b8: 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; 289ba: 61 e0 ldi r22, 0x01 ; 1 289bc: 70 e0 ldi r23, 0x00 ; 0 289be: ef cf rjmp .-34 ; 0x2899e 000289c0 : if(!calibrated()) enabled = false; reinitialize(); } static bool calibrated() { 289c0: cf 93 push r28 289c2: df 93 push r29 if(!(data.P > 0)) return false; 289c4: 20 e0 ldi r18, 0x00 ; 0 289c6: 30 e0 ldi r19, 0x00 ; 0 289c8: a9 01 movw r20, r18 289ca: 60 91 b8 12 lds r22, 0x12B8 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 289ce: 70 91 b9 12 lds r23, 0x12B9 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 289d2: 80 91 ba 12 lds r24, 0x12BA ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 289d6: 90 91 bb 12 lds r25, 0x12BB ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> 289da: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 289de: 18 16 cp r1, r24 289e0: 0c f0 brlt .+2 ; 0x289e4 289e2: 54 c0 rjmp .+168 ; 0x28a8c if(isnan(data.U)) return false; 289e4: 60 91 bc 12 lds r22, 0x12BC ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 289e8: 70 91 bd 12 lds r23, 0x12BD ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 289ec: 80 91 be 12 lds r24, 0x12BE ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 289f0: 90 91 bf 12 lds r25, 0x12BF ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> 289f4: 9b 01 movw r18, r22 289f6: ac 01 movw r20, r24 289f8: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 289fc: 81 11 cpse r24, r1 289fe: 46 c0 rjmp .+140 ; 0x28a8c if(isnan(data.V)) return false; 28a00: 60 91 c0 12 lds r22, 0x12C0 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 28a04: 70 91 c1 12 lds r23, 0x12C1 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 28a08: 80 91 c2 12 lds r24, 0x12C2 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 28a0c: 90 91 c3 12 lds r25, 0x12C3 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> 28a10: 9b 01 movw r18, r22 28a12: ac 01 movw r20, r24 28a14: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 28a18: 81 11 cpse r24, r1 28a1a: 38 c0 rjmp .+112 ; 0x28a8c if(!(data.C > 0)) return false; 28a1c: 20 e0 ldi r18, 0x00 ; 0 28a1e: 30 e0 ldi r19, 0x00 ; 0 28a20: a9 01 movw r20, r18 28a22: 60 91 c4 12 lds r22, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 28a26: 70 91 c5 12 lds r23, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 28a2a: 80 91 c6 12 lds r24, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 28a2e: 90 91 c7 12 lds r25, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 28a32: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28a36: 18 16 cp r1, r24 28a38: 4c f5 brge .+82 ; 0x28a8c if(isnan(data.fS)) return false; 28a3a: 60 91 c8 12 lds r22, 0x12C8 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 28a3e: 70 91 c9 12 lds r23, 0x12C9 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 28a42: 80 91 ca 12 lds r24, 0x12CA ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 28a46: 90 91 cb 12 lds r25, 0x12CB ; 0x8012cb <_ZN13thermal_modelL4dataE.lto_priv.396+0x3d> 28a4a: 9b 01 movw r18, r22 28a4c: ac 01 movw r20, r24 28a4e: 0f 94 c7 e2 call 0x3c58e ; 0x3c58e <__unordsf2> 28a52: 81 11 cpse r24, r1 28a54: 1b c0 rjmp .+54 ; 0x28a8c if(!(data.L > 0)) return false; 28a56: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 28a5a: 90 91 cd 12 lds r25, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 28a5e: 89 2b or r24, r25 28a60: a9 f0 breq .+42 ; 0x28a8c 28a62: ce ec ldi r28, 0xCE ; 206 28a64: 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)) 28a66: 69 91 ld r22, Y+ 28a68: 79 91 ld r23, Y+ 28a6a: 89 91 ld r24, Y+ 28a6c: 99 91 ld r25, Y+ 28a6e: 20 e0 ldi r18, 0x00 ; 0 28a70: 30 e0 ldi r19, 0x00 ; 0 28a72: a9 01 movw r20, r18 28a74: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28a78: 87 fd sbrc r24, 7 28a7a: 08 c0 rjmp .+16 ; 0x28a8c 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) { 28a7c: 83 e1 ldi r24, 0x13 ; 19 28a7e: ce 30 cpi r28, 0x0E ; 14 28a80: d8 07 cpc r29, r24 28a82: 89 f7 brne .-30 ; 0x28a66 if(!(thermal_model::data.R[i] >= 0)) return false; } if(!(data.warn != NAN)) return false; if(!(data.err != NAN)) return false; return true; 28a84: 81 e0 ldi r24, 0x01 ; 1 } 28a86: df 91 pop r29 28a88: cf 91 pop r28 28a8a: 08 95 ret reinitialize(); } static bool calibrated() { if(!(data.P > 0)) return false; 28a8c: 80 e0 ldi r24, 0x00 ; 0 28a8e: fb cf rjmp .-10 ; 0x28a86 00028a90 : } // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; 28a90: 0f 94 e0 44 call 0x289c0 ; 0x289c0 28a94: 81 11 cpse r24, r1 28a96: 02 c0 rjmp .+4 ; 0x28a9c 28a98: 10 92 20 05 sts 0x0520, r1 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 28a9c: 81 e0 ldi r24, 0x01 ; 1 28a9e: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 28aa2: 80 91 36 06 lds r24, 0x0636 ; 0x800636 28aa6: 8d 7f andi r24, 0xFD ; 253 28aa8: 80 93 36 06 sts 0x0636, r24 ; 0x800636 // verify calibration status and trigger a model reset if valid static void setup() { if(!calibrated()) enabled = false; reinitialize(); } 28aac: 08 95 ret 00028aae : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 28aae: 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; 28ab0: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 28ab4: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 28ab8: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 28abc: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28ac0: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28ac2: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 28ac4: 0f 94 dd 21 call 0x243ba ; 0x243ba temp_mgr_pid(); 28ac8: 0f 94 1a 1f call 0x23e34 ; 0x23e34 // 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); 28acc: 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; 28ace: 10 92 6d 06 sts 0x066D, r1 ; 0x80066d (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28ad2: cf bf out 0x3f, r28 ; 63 #endif } } 28ad4: cf 91 pop r28 28ad6: 08 95 ret 00028ad8 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 28ad8: 0f 94 57 45 call 0x28aae ; 0x28aae fanSpeed = 0; 28adc: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_return_to_status(); 28ae0: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 00028ae4 : // 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) { 28ae4: 1f 93 push r17 28ae6: cf 93 push r28 28ae8: df 93 push r29 28aea: c8 2f mov r28, r24 28aec: 16 2f mov r17, r22 28aee: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 28af0: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28af4: 80 fd sbrc r24, 0 28af6: 18 c0 rjmp .+48 ; 0x28b28 28af8: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 28afc: 81 11 cpse r24, r1 28afe: 14 c0 rjmp .+40 ; 0x28b28 saved_bed_temperature = target_temperature_bed; 28b00: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 28b04: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_temperature = target_temperature[index]; 28b08: e6 2f mov r30, r22 28b0a: f0 e0 ldi r31, 0x00 ; 0 28b0c: ee 0f add r30, r30 28b0e: ff 1f adc r31, r31 28b10: e3 59 subi r30, 0x93 ; 147 28b12: f1 4f sbci r31, 0xF1 ; 241 28b14: 80 81 ld r24, Z 28b16: 91 81 ldd r25, Z+1 ; 0x01 28b18: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae 28b1c: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_fan_speed = fanSpeed; 28b20: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 28b24: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 28b28: 0f 94 57 45 call 0x28aae ; 0x28aae void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed 28b2c: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> 28b30: 82 60 ori r24, 0x02 ; 2 28b32: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 <_ZL12altfanStatus.lto_priv.488> #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 28b36: 0e 94 c3 75 call 0xeb86 ; 0xeb86 setExtruderAutoFanState(3); 28b3a: 83 e0 ldi r24, 0x03 ; 3 28b3c: 0e 94 d1 76 call 0xeda2 ; 0xeda2 SET_OUTPUT(FAN_PIN); 28b40: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 28b44: 88 60 ori r24, 0x08 ; 8 28b46: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 28b4a: 8f ef ldi r24, 0xFF ; 255 28b4c: 80 93 a0 04 sts 0x04A0, r24 ; 0x8004a0 #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 28b50: 80 93 e3 03 sts 0x03E3, r24 ; 0x8003e3 hotendFanSetFullSpeed(); // set the initial error source to the highest priority error if(!temp_error_state.error || (uint8_t)type < temp_error_state.type) { 28b54: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28b58: 80 ff sbrs r24, 0 28b5a: 07 c0 rjmp .+14 ; 0x28b6a 28b5c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28b60: 82 95 swap r24 28b62: 86 95 lsr r24 28b64: 87 70 andi r24, 0x07 ; 7 28b66: d8 17 cp r29, r24 28b68: c0 f4 brcc .+48 ; 0x28b9a temp_error_state.source = (uint8_t)source; 28b6a: c3 70 andi r28, 0x03 ; 3 28b6c: cc 0f add r28, r28 28b6e: cc 0f add r28, r28 28b70: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28b74: 83 7f andi r24, 0xF3 ; 243 28b76: 8c 2b or r24, r28 28b78: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.469> temp_error_state.index = index; 28b7c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28b80: 10 fb bst r17, 0 28b82: 84 f9 bld r24, 4 28b84: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.469> temp_error_state.type = (uint8_t)type; 28b88: d2 95 swap r29 28b8a: dd 0f add r29, r29 28b8c: d0 7e andi r29, 0xE0 ; 224 28b8e: 40 91 1e 05 lds r20, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28b92: 4f 71 andi r20, 0x1F ; 31 28b94: 4d 2b or r20, r29 28b96: 40 93 1e 05 sts 0x051E, r20 ; 0x80051e <_ZL16temp_error_state.lto_priv.469> } // always set the error state temp_error_state.error = true; 28b9a: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28b9e: 81 60 ori r24, 0x01 ; 1 28ba0: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.469> temp_error_state.assert = true; 28ba4: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 28ba8: 82 60 ori r24, 0x02 ; 2 28baa: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.469> } 28bae: df 91 pop r29 28bb0: cf 91 pop r28 28bb2: 1f 91 pop r17 28bb4: 08 95 ret 00028bb6 : } void check_min_temp_bed() { #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP if (current_temperature_bed_raw >= bed_minttemp_raw) { 28bb6: 20 91 06 06 lds r18, 0x0606 ; 0x800606 28bba: 30 91 07 06 lds r19, 0x0607 ; 0x800607 28bbe: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL16bed_minttemp_raw.lto_priv.486> 28bc2: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL16bed_minttemp_raw.lto_priv.486+0x1> 28bc6: 28 17 cp r18, r24 28bc8: 39 07 cpc r19, r25 28bca: 2c f0 brlt .+10 ; 0x28bd6 #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 28bcc: 41 e0 ldi r20, 0x01 ; 1 28bce: 60 e0 ldi r22, 0x00 ; 0 28bd0: 81 e0 ldi r24, 0x01 ; 1 28bd2: 0d 94 72 45 jmp 0x28ae4 ; 0x28ae4 } } 28bd6: 08 95 ret 00028bd8 : 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]) { 28bd8: 20 91 08 06 lds r18, 0x0608 ; 0x800608 28bdc: 30 91 09 06 lds r19, 0x0609 ; 0x800609 28be0: 80 91 54 02 lds r24, 0x0254 ; 0x800254 <_ZL12minttemp_raw.lto_priv.487> 28be4: 90 91 55 02 lds r25, 0x0255 ; 0x800255 <_ZL12minttemp_raw.lto_priv.487+0x1> 28be8: 28 17 cp r18, r24 28bea: 39 07 cpc r19, r25 28bec: 2c f0 brlt .+10 ; 0x28bf8 #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 28bee: 41 e0 ldi r20, 0x01 ; 1 28bf0: 60 e0 ldi r22, 0x00 ; 0 28bf2: 80 e0 ldi r24, 0x00 ; 0 28bf4: 0d 94 72 45 jmp 0x28ae4 ; 0x28ae4 } } 28bf8: 08 95 ret 00028bfa : 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) { 28bfa: 2f 92 push r2 28bfc: 3f 92 push r3 28bfe: 4f 92 push r4 28c00: 5f 92 push r5 28c02: 6f 92 push r6 28c04: 7f 92 push r7 28c06: 8f 92 push r8 28c08: 9f 92 push r9 28c0a: af 92 push r10 28c0c: bf 92 push r11 28c0e: cf 92 push r12 28c10: df 92 push r13 28c12: ef 92 push r14 28c14: ff 92 push r15 28c16: 0f 93 push r16 28c18: 1f 93 push r17 28c1a: cf 93 push r28 28c1c: df 93 push r29 28c1e: cd b7 in r28, 0x3d ; 61 28c20: de b7 in r29, 0x3e ; 62 28c22: 2c 97 sbiw r28, 0x0c ; 12 28c24: 0f b6 in r0, 0x3f ; 63 28c26: f8 94 cli 28c28: de bf out 0x3e, r29 ; 62 28c2a: 0f be out 0x3f, r0 ; 63 28c2c: cd bf out 0x3d, r28 ; 61 28c2e: 28 2e mov r2, r24 28c30: 49 83 std Y+1, r20 ; 0x01 28c32: 5a 83 std Y+2, r21 ; 0x02 28c34: 6b 83 std Y+3, r22 ; 0x03 28c36: 7c 83 std Y+4, r23 ; 0x04 28c38: 28 01 movw r4, r16 28c3a: 39 01 movw r6, r18 28c3c: 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) 28c3e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 28c42: 02 2d mov r16, r2 28c44: 10 e0 ldi r17, 0x00 ; 0 28c46: 98 01 movw r18, r16 28c48: 22 0f add r18, r18 28c4a: 33 1f adc r19, r19 28c4c: 22 0f add r18, r18 28c4e: 33 1f adc r19, r19 28c50: 3c 87 std Y+12, r19 ; 0x0c 28c52: 2b 87 std Y+11, r18 ; 0x0b 28c54: f9 01 movw r30, r18 28c56: e6 53 subi r30, 0x36 ; 54 28c58: fa 4f sbci r31, 0xFA ; 250 28c5a: 80 80 ld r8, Z 28c5c: 91 80 ldd r9, Z+1 ; 0x01 28c5e: a2 80 ldd r10, Z+2 ; 0x02 28c60: b3 80 ldd r11, Z+3 ; 0x03 28c62: 68 19 sub r22, r8 28c64: 79 09 sbc r23, r9 28c66: 8a 09 sbc r24, r10 28c68: 9b 09 sbc r25, r11 28c6a: 61 3d cpi r22, 0xD1 ; 209 28c6c: 77 40 sbci r23, 0x07 ; 7 28c6e: 81 05 cpc r24, r1 28c70: 91 05 cpc r25, r1 28c72: 08 f4 brcc .+2 ; 0x28c76 28c74: ea c0 rjmp .+468 ; 0x28e4a { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 28c76: 33 20 and r3, r3 28c78: 09 f4 brne .+2 ; 0x28c7c 28c7a: 75 c0 rjmp .+234 ; 0x28d66 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 28c7c: 88 e6 ldi r24, 0x68 ; 104 28c7e: 91 e0 ldi r25, 0x01 ; 1 28c80: 9a 87 std Y+10, r25 ; 0x0a 28c82: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 28c84: 80 e0 ldi r24, 0x00 ; 0 28c86: 90 e0 ldi r25, 0x00 ; 0 28c88: a0 ea ldi r26, 0xA0 ; 160 28c8a: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28c8c: 8d 83 std Y+5, r24 ; 0x05 28c8e: 9e 83 std Y+6, r25 ; 0x06 28c90: af 83 std Y+7, r26 ; 0x07 28c92: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 28c94: 0f 94 8b 3f call 0x27f16 ; 0x27f16 28c98: eb 85 ldd r30, Y+11 ; 0x0b 28c9a: fc 85 ldd r31, Y+12 ; 0x0c 28c9c: e6 53 subi r30, 0x36 ; 54 28c9e: fa 4f sbci r31, 0xFA ; 250 28ca0: 60 83 st Z, r22 28ca2: 71 83 std Z+1, r23 ; 0x01 28ca4: 82 83 std Z+2, r24 ; 0x02 28ca6: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 28ca8: 20 e0 ldi r18, 0x00 ; 0 28caa: 30 e0 ldi r19, 0x00 ; 0 28cac: a9 01 movw r20, r18 28cae: c7 01 movw r24, r14 28cb0: b6 01 movw r22, r12 28cb2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 28cb6: 81 11 cpse r24, r1 28cb8: 07 c0 rjmp .+14 ; 0x28cc8 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28cba: f8 01 movw r30, r16 28cbc: ee 0f add r30, r30 28cbe: ff 1f adc r31, r31 28cc0: ea 53 subi r30, 0x3A ; 58 28cc2: fa 4f sbci r31, 0xFA ; 250 28cc4: 11 82 std Z+1, r1 ; 0x01 28cc6: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 28cc8: ab 85 ldd r26, Y+11 ; 0x0b 28cca: bc 85 ldd r27, Y+12 ; 0x0c 28ccc: a2 54 subi r26, 0x42 ; 66 28cce: ba 4f sbci r27, 0xFA ; 250 28cd0: 5d 01 movw r10, r26 28cd2: 29 81 ldd r18, Y+1 ; 0x01 28cd4: 3a 81 ldd r19, Y+2 ; 0x02 28cd6: 4b 81 ldd r20, Y+3 ; 0x03 28cd8: 5c 81 ldd r21, Y+4 ; 0x04 28cda: 6d 91 ld r22, X+ 28cdc: 7d 91 ld r23, X+ 28cde: 8d 91 ld r24, X+ 28ce0: 9c 91 ld r25, X 28ce2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 28ce6: 88 23 and r24, r24 28ce8: 09 f4 brne .+2 ; 0x28cec 28cea: 91 c0 rjmp .+290 ; 0x28e0e { if (_target_temperature > 0) 28cec: 20 e0 ldi r18, 0x00 ; 0 28cee: 30 e0 ldi r19, 0x00 ; 0 28cf0: a9 01 movw r20, r18 28cf2: 69 81 ldd r22, Y+1 ; 0x01 28cf4: 7a 81 ldd r23, Y+2 ; 0x02 28cf6: 8b 81 ldd r24, Y+3 ; 0x03 28cf8: 9c 81 ldd r25, Y+4 ; 0x04 28cfa: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28cfe: f8 01 movw r30, r16 28d00: e4 54 subi r30, 0x44 ; 68 28d02: fa 4f sbci r31, 0xFA ; 250 28d04: 18 16 cp r1, r24 28d06: c4 f5 brge .+112 ; 0x28d78 { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 28d08: 81 e0 ldi r24, 0x01 ; 1 28d0a: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 28d0c: 89 81 ldd r24, Y+1 ; 0x01 28d0e: 9a 81 ldd r25, Y+2 ; 0x02 28d10: ab 81 ldd r26, Y+3 ; 0x03 28d12: bc 81 ldd r27, Y+4 ; 0x04 28d14: f5 01 movw r30, r10 28d16: 80 83 st Z, r24 28d18: 91 83 std Z+1, r25 ; 0x01 28d1a: a2 83 std Z+2, r26 ; 0x02 28d1c: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 28d1e: eb 85 ldd r30, Y+11 ; 0x0b 28d20: fc 85 ldd r31, Y+12 ; 0x0c 28d22: ec 54 subi r30, 0x4C ; 76 28d24: fa 4f sbci r31, 0xFA ; 250 28d26: 40 82 st Z, r4 28d28: 51 82 std Z+1, r5 ; 0x01 28d2a: 62 82 std Z+2, r6 ; 0x02 28d2c: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 28d2e: f8 01 movw r30, r16 28d30: ee 54 subi r30, 0x4E ; 78 28d32: fa 4f sbci r31, 0xFA ; 250 28d34: 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)) 28d36: a3 01 movw r20, r6 28d38: 92 01 movw r18, r4 28d3a: bc 01 movw r22, r24 28d3c: cd 01 movw r24, r26 28d3e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28d42: 18 16 cp r1, r24 28d44: 1c f5 brge .+70 ; 0x28d8c { __preheat_counter[_heater_id]++; 28d46: f8 01 movw r30, r16 28d48: ee 54 subi r30, 0x4E ; 78 28d4a: fa 4f sbci r31, 0xFA ; 250 28d4c: 80 81 ld r24, Z 28d4e: 8f 5f subi r24, 0xFF ; 255 28d50: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 28d52: 31 10 cpse r3, r1 28d54: c7 c0 rjmp .+398 ; 0x28ee4 28d56: 89 30 cpi r24, 0x09 ; 9 28d58: c8 f0 brcs .+50 ; 0x28d8c { __delta=2.0; 28d5a: 81 2c mov r8, r1 28d5c: 91 2c mov r9, r1 28d5e: a1 2c mov r10, r1 28d60: 50 e4 ldi r21, 0x40 ; 64 28d62: b5 2e mov r11, r21 28d64: e8 c0 rjmp .+464 ; 0x28f36 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 28d66: ad e2 ldi r26, 0x2D ; 45 28d68: b0 e0 ldi r27, 0x00 ; 0 28d6a: ba 87 std Y+10, r27 ; 0x0a 28d6c: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 28d6e: 80 e0 ldi r24, 0x00 ; 0 28d70: 90 e0 ldi r25, 0x00 ; 0 28d72: a0 e7 ldi r26, 0x70 ; 112 28d74: b1 e4 ldi r27, 0x41 ; 65 28d76: 8a cf rjmp .-236 ; 0x28c8c __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 28d78: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 28d7a: 89 81 ldd r24, Y+1 ; 0x01 28d7c: 9a 81 ldd r25, Y+2 ; 0x02 28d7e: ab 81 ldd r26, Y+3 ; 0x03 28d80: bc 81 ldd r27, Y+4 ; 0x04 28d82: f5 01 movw r30, r10 28d84: 80 83 st Z, r24 28d86: 91 83 std Z+1, r25 ; 0x01 28d88: a2 83 std Z+2, r26 ; 0x02 28d8a: 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) 28d8c: 2d 81 ldd r18, Y+5 ; 0x05 28d8e: 3e 81 ldd r19, Y+6 ; 0x06 28d90: 4f 81 ldd r20, Y+7 ; 0x07 28d92: 58 85 ldd r21, Y+8 ; 0x08 28d94: 69 81 ldd r22, Y+1 ; 0x01 28d96: 7a 81 ldd r23, Y+2 ; 0x02 28d98: 8b 81 ldd r24, Y+3 ; 0x03 28d9a: 9c 81 ldd r25, Y+4 ; 0x04 28d9c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 28da0: a3 01 movw r20, r6 28da2: 92 01 movw r18, r4 28da4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 28da8: 87 ff sbrs r24, 7 28daa: 46 c0 rjmp .+140 ; 0x28e38 28dac: f8 01 movw r30, r16 28dae: e4 54 subi r30, 0x44 ; 68 28db0: fa 4f sbci r31, 0xFA ; 250 28db2: 80 81 ld r24, Z 28db4: 81 30 cpi r24, 0x01 ; 1 28db6: 49 f4 brne .+18 ; 0x28dca { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 28db8: 82 e0 ldi r24, 0x02 ; 2 28dba: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28dbc: f8 01 movw r30, r16 28dbe: ee 0f add r30, r30 28dc0: ff 1f adc r31, r31 28dc2: ea 53 subi r30, 0x3A ; 58 28dc4: fa 4f sbci r31, 0xFA ; 250 28dc6: 11 82 std Z+1, r1 ; 0x01 28dc8: 10 82 st Z, r1 } if (_output > 0) 28dca: 20 e0 ldi r18, 0x00 ; 0 28dcc: 30 e0 ldi r19, 0x00 ; 0 28dce: a9 01 movw r20, r18 28dd0: c7 01 movw r24, r14 28dd2: b6 01 movw r22, r12 28dd4: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28dd8: 18 16 cp r1, r24 28dda: bc f5 brge .+110 ; 0x28e4a if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 28ddc: 29 81 ldd r18, Y+1 ; 0x01 28dde: 3a 81 ldd r19, Y+2 ; 0x02 28de0: 4b 81 ldd r20, Y+3 ; 0x03 28de2: 5c 81 ldd r21, Y+4 ; 0x04 28de4: 6d 81 ldd r22, Y+5 ; 0x05 28de6: 7e 81 ldd r23, Y+6 ; 0x06 28de8: 8f 81 ldd r24, Y+7 ; 0x07 28dea: 98 85 ldd r25, Y+8 ; 0x08 28dec: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 28df0: a3 01 movw r20, r6 28df2: 92 01 movw r18, r4 28df4: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28df8: 18 16 cp r1, r24 28dfa: 0c f0 brlt .+2 ; 0x28dfe 28dfc: 3f c0 rjmp .+126 ; 0x28e7c { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 28dfe: 00 0f add r16, r16 28e00: 11 1f adc r17, r17 28e02: f8 01 movw r30, r16 28e04: ea 53 subi r30, 0x3A ; 58 28e06: fa 4f sbci r31, 0xFA ; 250 28e08: 11 82 std Z+1, r1 ; 0x01 28e0a: 10 82 st Z, r1 28e0c: 1e c0 rjmp .+60 ; 0x28e4a 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)) 28e0e: a3 01 movw r20, r6 28e10: 92 01 movw r18, r4 28e12: 69 81 ldd r22, Y+1 ; 0x01 28e14: 7a 81 ldd r23, Y+2 ; 0x02 28e16: 8b 81 ldd r24, Y+3 ; 0x03 28e18: 9c 81 ldd r25, Y+4 ; 0x04 28e1a: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28e1e: 18 16 cp r1, r24 28e20: 0c f0 brlt .+2 ; 0x28e24 28e22: b4 cf rjmp .-152 ; 0x28d8c 28e24: f8 01 movw r30, r16 28e26: e4 54 subi r30, 0x44 ; 68 28e28: fa 4f sbci r31, 0xFA ; 250 28e2a: 80 81 ld r24, Z 28e2c: 81 30 cpi r24, 0x01 ; 1 28e2e: 09 f0 breq .+2 ; 0x28e32 28e30: ad cf rjmp .-166 ; 0x28d8c 28e32: 89 cf rjmp .-238 ; 0x28d46 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; 28e34: 10 82 st Z, r1 28e36: 97 c0 rjmp .+302 ; 0x28f66 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 28e38: 20 e0 ldi r18, 0x00 ; 0 28e3a: 30 e0 ldi r19, 0x00 ; 0 28e3c: a9 01 movw r20, r18 28e3e: c7 01 movw r24, r14 28e40: b6 01 movw r22, r12 28e42: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28e46: 18 16 cp r1, r24 28e48: cc f0 brlt .+50 ; 0x28e7c } } } } } 28e4a: 2c 96 adiw r28, 0x0c ; 12 28e4c: 0f b6 in r0, 0x3f ; 63 28e4e: f8 94 cli 28e50: de bf out 0x3e, r29 ; 62 28e52: 0f be out 0x3f, r0 ; 63 28e54: cd bf out 0x3d, r28 ; 61 28e56: df 91 pop r29 28e58: cf 91 pop r28 28e5a: 1f 91 pop r17 28e5c: 0f 91 pop r16 28e5e: ff 90 pop r15 28e60: ef 90 pop r14 28e62: df 90 pop r13 28e64: cf 90 pop r12 28e66: bf 90 pop r11 28e68: af 90 pop r10 28e6a: 9f 90 pop r9 28e6c: 8f 90 pop r8 28e6e: 7f 90 pop r7 28e70: 6f 90 pop r6 28e72: 5f 90 pop r5 28e74: 4f 90 pop r4 28e76: 3f 90 pop r3 28e78: 2f 90 pop r2 28e7a: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 28e7c: f8 01 movw r30, r16 28e7e: e4 54 subi r30, 0x44 ; 68 28e80: fa 4f sbci r31, 0xFA ; 250 28e82: 80 81 ld r24, Z 28e84: 82 30 cpi r24, 0x02 ; 2 28e86: 08 f3 brcs .-62 ; 0x28e4a { temp_runaway_error_counter[_heater_id]++; 28e88: 00 0f add r16, r16 28e8a: 11 1f adc r17, r17 28e8c: f8 01 movw r30, r16 28e8e: ea 53 subi r30, 0x3A ; 58 28e90: fa 4f sbci r31, 0xFA ; 250 28e92: 80 81 ld r24, Z 28e94: 91 81 ldd r25, Z+1 ; 0x01 28e96: 01 96 adiw r24, 0x01 ; 1 28e98: 91 83 std Z+1, r25 ; 0x01 28e9a: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 28e9c: 88 0f add r24, r24 28e9e: 99 1f adc r25, r25 28ea0: e9 85 ldd r30, Y+9 ; 0x09 28ea2: fa 85 ldd r31, Y+10 ; 0x0a 28ea4: e8 17 cp r30, r24 28ea6: f9 07 cpc r31, r25 28ea8: 80 f6 brcc .-96 ; 0x28e4a set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 28eaa: 43 e0 ldi r20, 0x03 ; 3 28eac: 62 2d mov r22, r2 28eae: 83 2d mov r24, r3 } } } } } 28eb0: 2c 96 adiw r28, 0x0c ; 12 28eb2: 0f b6 in r0, 0x3f ; 63 28eb4: f8 94 cli 28eb6: de bf out 0x3e, r29 ; 62 28eb8: 0f be out 0x3f, r0 ; 63 28eba: cd bf out 0x3d, r28 ; 61 28ebc: df 91 pop r29 28ebe: cf 91 pop r28 28ec0: 1f 91 pop r17 28ec2: 0f 91 pop r16 28ec4: ff 90 pop r15 28ec6: ef 90 pop r14 28ec8: df 90 pop r13 28eca: cf 90 pop r12 28ecc: bf 90 pop r11 28ece: af 90 pop r10 28ed0: 9f 90 pop r9 28ed2: 8f 90 pop r8 28ed4: 7f 90 pop r7 28ed6: 6f 90 pop r6 28ed8: 5f 90 pop r5 28eda: 4f 90 pop r4 28edc: 3f 90 pop r3 28ede: 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); 28ee0: 0d 94 72 45 jmp 0x28ae4 ; 0x28ae4 } 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 28ee4: 81 31 cpi r24, 0x11 ; 17 28ee6: 08 f4 brcc .+2 ; 0x28eea 28ee8: 51 cf rjmp .-350 ; 0x28d8c { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 28eea: 20 e0 ldi r18, 0x00 ; 0 28eec: 30 e0 ldi r19, 0x00 ; 0 28eee: 44 eb ldi r20, 0xB4 ; 180 28ef0: 52 e4 ldi r21, 0x42 ; 66 28ef2: c3 01 movw r24, r6 28ef4: b2 01 movw r22, r4 28ef6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 28efa: 81 2c mov r8, r1 28efc: 91 2c mov r9, r1 28efe: e0 e4 ldi r30, 0x40 ; 64 28f00: ae 2e mov r10, r30 28f02: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 28f04: 18 16 cp r1, r24 28f06: 2c f4 brge .+10 ; 0x28f12 28f08: 81 2c mov r8, r1 28f0a: 91 2c mov r9, r1 28f0c: a1 2c mov r10, r1 28f0e: 70 e4 ldi r23, 0x40 ; 64 28f10: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 28f12: 20 e0 ldi r18, 0x00 ; 0 28f14: 30 e0 ldi r19, 0x00 ; 0 28f16: 42 ed ldi r20, 0xD2 ; 210 28f18: 52 e4 ldi r21, 0x42 ; 66 28f1a: c3 01 movw r24, r6 28f1c: b2 01 movw r22, r4 28f1e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 28f22: 18 16 cp r1, r24 28f24: 44 f4 brge .+16 ; 0x28f36 28f26: 6a e9 ldi r22, 0x9A ; 154 28f28: 86 2e mov r8, r22 28f2a: 69 e9 ldi r22, 0x99 ; 153 28f2c: 96 2e mov r9, r22 28f2e: 69 e1 ldi r22, 0x19 ; 25 28f30: a6 2e mov r10, r22 28f32: 6f e3 ldi r22, 0x3F ; 63 28f34: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 28f36: eb 85 ldd r30, Y+11 ; 0x0b 28f38: fc 85 ldd r31, Y+12 ; 0x0c 28f3a: ec 54 subi r30, 0x4C ; 76 28f3c: fa 4f sbci r31, 0xFA ; 250 28f3e: 20 81 ld r18, Z 28f40: 31 81 ldd r19, Z+1 ; 0x01 28f42: 42 81 ldd r20, Z+2 ; 0x02 28f44: 53 81 ldd r21, Z+3 ; 0x03 28f46: c3 01 movw r24, r6 28f48: b2 01 movw r22, r4 28f4a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 28f4e: a5 01 movw r20, r10 28f50: 94 01 movw r18, r8 28f52: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 28f56: f8 01 movw r30, r16 28f58: e0 55 subi r30, 0x50 ; 80 28f5a: fa 4f sbci r31, 0xFA ; 250 28f5c: 87 ff sbrs r24, 7 28f5e: 6a cf rjmp .-300 ; 0x28e34 __preheat_errors[_heater_id]++; 28f60: 80 81 ld r24, Z 28f62: 8f 5f subi r24, 0xFF ; 255 28f64: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28f66: 80 81 ld r24, Z 28f68: 90 e0 ldi r25, 0x00 ; 0 28f6a: 31 10 cpse r3, r1 28f6c: 04 c0 rjmp .+8 ; 0x28f76 28f6e: 06 97 sbiw r24, 0x06 ; 6 28f70: 4c f0 brlt .+18 ; 0x28f84 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28f72: 80 e0 ldi r24, 0x00 ; 0 28f74: 03 c0 rjmp .+6 ; 0x28f7c __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 28f76: 04 97 sbiw r24, 0x04 ; 4 28f78: 2c f0 brlt .+10 ; 0x28f84 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 28f7a: 81 e0 ldi r24, 0x01 ; 1 28f7c: 42 e0 ldi r20, 0x02 ; 2 28f7e: 62 2d mov r22, r2 28f80: 0f 94 72 45 call 0x28ae4 ; 0x28ae4 __preheat_start[_heater_id] = _current_temperature; 28f84: 2b 85 ldd r18, Y+11 ; 0x0b 28f86: 3c 85 ldd r19, Y+12 ; 0x0c 28f88: 2c 54 subi r18, 0x4C ; 76 28f8a: 3a 4f sbci r19, 0xFA ; 250 28f8c: d9 01 movw r26, r18 28f8e: 4d 92 st X+, r4 28f90: 5d 92 st X+, r5 28f92: 6d 92 st X+, r6 28f94: 7c 92 st X, r7 28f96: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 28f98: f8 01 movw r30, r16 28f9a: ee 54 subi r30, 0x4E ; 78 28f9c: fa 4f sbci r31, 0xFA ; 250 28f9e: 10 82 st Z, r1 28fa0: f5 ce rjmp .-534 ; 0x28d8c 00028fa2 : temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { 28fa2: fc 01 movw r30, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28fa4: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28fa6: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 28fa8: 80 81 ld r24, Z 28faa: 88 23 and r24, r24 28fac: 29 f0 breq .+10 ; 0x28fb8 28fae: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 28fb2: 82 60 ori r24, 0x02 ; 2 28fb4: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28fb8: 9f bf out 0x3f, r25 ; 63 } } 28fba: 08 95 ret 00028fbc : class TempMgrGuard { bool temp_mgr_state; public: TempMgrGuard() { 28fbc: dc 01 movw r26, r24 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28fbe: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28fc0: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 28fc2: e3 e7 ldi r30, 0x73 ; 115 28fc4: f0 e0 ldi r31, 0x00 ; 0 28fc6: 90 81 ld r25, Z 28fc8: 96 95 lsr r25 28fca: 91 70 andi r25, 0x01 ; 1 28fcc: 9c 93 st X, r25 DISABLE_TEMP_MGR_INTERRUPT(); 28fce: 80 81 ld r24, Z 28fd0: 8d 7f andi r24, 0xFD ; 253 28fd2: 80 83 st Z, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28fd4: 2f bf out 0x3f, r18 ; 63 } } 28fd6: 08 95 ret 00028fd8 : (double)thermal_model::data.err, (double)thermal_model::data.warn, (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { 28fd8: cf 93 push r28 28fda: df 93 push r29 28fdc: 1f 92 push r1 28fde: cd b7 in r28, 0x3d ; 61 28fe0: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 28fe2: ce 01 movw r24, r28 28fe4: 01 96 adiw r24, 0x01 ; 1 28fe6: 0f 94 de 47 call 0x28fbc ; 0x28fbc thermal_model::data.P = THERMAL_MODEL_DEF(P); 28fea: 80 e0 ldi r24, 0x00 ; 0 28fec: 90 e0 ldi r25, 0x00 ; 0 28fee: a0 e7 ldi r26, 0x70 ; 112 28ff0: b2 e4 ldi r27, 0x42 ; 66 28ff2: 80 93 b8 12 sts 0x12B8, r24 ; 0x8012b8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2a> 28ff6: 90 93 b9 12 sts 0x12B9, r25 ; 0x8012b9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x2b> 28ffa: a0 93 ba 12 sts 0x12BA, r26 ; 0x8012ba <_ZN13thermal_modelL4dataE.lto_priv.396+0x2c> 28ffe: b0 93 bb 12 sts 0x12BB, r27 ; 0x8012bb <_ZN13thermal_modelL4dataE.lto_priv.396+0x2d> thermal_model::data.U = THERMAL_MODEL_DEF(U); 29002: 84 e3 ldi r24, 0x34 ; 52 29004: 90 e8 ldi r25, 0x80 ; 128 29006: a7 eb ldi r26, 0xB7 ; 183 29008: ba eb ldi r27, 0xBA ; 186 2900a: 80 93 bc 12 sts 0x12BC, r24 ; 0x8012bc <_ZN13thermal_modelL4dataE.lto_priv.396+0x2e> 2900e: 90 93 bd 12 sts 0x12BD, r25 ; 0x8012bd <_ZN13thermal_modelL4dataE.lto_priv.396+0x2f> 29012: a0 93 be 12 sts 0x12BE, r26 ; 0x8012be <_ZN13thermal_modelL4dataE.lto_priv.396+0x30> 29016: b0 93 bf 12 sts 0x12BF, r27 ; 0x8012bf <_ZN13thermal_modelL4dataE.lto_priv.396+0x31> thermal_model::data.V = THERMAL_MODEL_DEF(V); 2901a: 86 e6 ldi r24, 0x66 ; 102 2901c: 96 e6 ldi r25, 0x66 ; 102 2901e: a6 e8 ldi r26, 0x86 ; 134 29020: bf e3 ldi r27, 0x3F ; 63 29022: 80 93 c0 12 sts 0x12C0, r24 ; 0x8012c0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x32> 29026: 90 93 c1 12 sts 0x12C1, r25 ; 0x8012c1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x33> 2902a: a0 93 c2 12 sts 0x12C2, r26 ; 0x8012c2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x34> 2902e: b0 93 c3 12 sts 0x12C3, r27 ; 0x8012c3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x35> thermal_model::data.C = THERMAL_MODEL_DEF(C); 29032: 8a e9 ldi r24, 0x9A ; 154 29034: 99 e9 ldi r25, 0x99 ; 153 29036: a1 e1 ldi r26, 0x11 ; 17 29038: b1 e4 ldi r27, 0x41 ; 65 2903a: 80 93 c4 12 sts 0x12C4, r24 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 2903e: 90 93 c5 12 sts 0x12C5, r25 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 29042: a0 93 c6 12 sts 0x12C6, r26 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 29046: b0 93 c7 12 sts 0x12C7, r27 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> thermal_model::data.fS = THERMAL_MODEL_DEF(fS); 2904a: 8a e9 ldi r24, 0x9A ; 154 2904c: 99 e9 ldi r25, 0x99 ; 153 2904e: a9 e1 ldi r26, 0x19 ; 25 29050: be e3 ldi r27, 0x3E ; 62 29052: 80 93 c8 12 sts 0x12C8, r24 ; 0x8012c8 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3a> 29056: 90 93 c9 12 sts 0x12C9, r25 ; 0x8012c9 <_ZN13thermal_modelL4dataE.lto_priv.396+0x3b> 2905a: a0 93 ca 12 sts 0x12CA, r26 ; 0x8012ca <_ZN13thermal_modelL4dataE.lto_priv.396+0x3c> 2905e: b0 93 cb 12 sts 0x12CB, r27 ; 0x8012cb <_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); 29062: 8e e0 ldi r24, 0x0E ; 14 29064: 91 e0 ldi r25, 0x01 ; 1 29066: 90 93 cd 12 sts 0x12CD, r25 ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 2906a: 80 93 cc 12 sts 0x12CC, r24 ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 2906e: 83 e8 ldi r24, 0x83 ; 131 29070: 9f e9 ldi r25, 0x9F ; 159 29072: ae ec ldi r26, 0xCE ; 206 29074: 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); 29076: fc 01 movw r30, r24 29078: 45 91 lpm r20, Z+ 2907a: 55 91 lpm r21, Z+ 2907c: 65 91 lpm r22, Z+ 2907e: 74 91 lpm r23, Z 29080: 4d 93 st X+, r20 29082: 5d 93 st X+, r21 29084: 6d 93 st X+, r22 29086: 7d 93 st X+, r23 29088: 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) 2908a: 23 e1 ldi r18, 0x13 ; 19 2908c: ae 30 cpi r26, 0x0E ; 14 2908e: b2 07 cpc r27, r18 29090: 91 f7 brne .-28 ; 0x29076 thermal_model::data.R[i] = pgm_read_float(THERMAL_MODEL_R_DEFAULT + i); thermal_model::data.Ta_corr = THERMAL_MODEL_Ta_corr; 29092: 80 e0 ldi r24, 0x00 ; 0 29094: 90 e0 ldi r25, 0x00 ; 0 29096: a0 ee ldi r26, 0xE0 ; 224 29098: b0 ec ldi r27, 0xC0 ; 192 2909a: 80 93 0e 13 sts 0x130E, r24 ; 0x80130e <_ZN13thermal_modelL4dataE.lto_priv.396+0x80> 2909e: 90 93 0f 13 sts 0x130F, r25 ; 0x80130f <_ZN13thermal_modelL4dataE.lto_priv.396+0x81> 290a2: a0 93 10 13 sts 0x1310, r26 ; 0x801310 <_ZN13thermal_modelL4dataE.lto_priv.396+0x82> 290a6: b0 93 11 13 sts 0x1311, r27 ; 0x801311 <_ZN13thermal_modelL4dataE.lto_priv.396+0x83> thermal_model::data.warn = THERMAL_MODEL_DEF(W); 290aa: 8a e9 ldi r24, 0x9A ; 154 290ac: 99 e9 ldi r25, 0x99 ; 153 290ae: a9 e5 ldi r26, 0x59 ; 89 290b0: bf e3 ldi r27, 0x3F ; 63 290b2: 80 93 12 13 sts 0x1312, r24 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 290b6: 90 93 13 13 sts 0x1313, r25 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 290ba: a0 93 14 13 sts 0x1314, r26 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 290be: b0 93 15 13 sts 0x1315, r27 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> thermal_model::data.err = THERMAL_MODEL_DEF(E); 290c2: 84 ea ldi r24, 0xA4 ; 164 290c4: 90 e7 ldi r25, 0x70 ; 112 290c6: ad e9 ldi r26, 0x9D ; 157 290c8: bf e3 ldi r27, 0x3F ; 63 290ca: 80 93 16 13 sts 0x1316, r24 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 290ce: 90 93 17 13 sts 0x1317, r25 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 290d2: a0 93 18 13 sts 0x1318, r26 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 290d6: b0 93 19 13 sts 0x1319, r27 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> thermal_model::warn_beep = true; 290da: 81 e0 ldi r24, 0x01 ; 1 290dc: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> thermal_model::enabled = true; 290e0: 80 93 20 05 sts 0x0520, r24 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 290e4: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 290e8: 80 91 36 06 lds r24, 0x0636 ; 0x800636 290ec: 8d 7f andi r24, 0xFD ; 253 290ee: 80 93 36 06 sts 0x0636, r24 ; 0x800636 (double)thermal_model::data.Ta_corr); } void thermal_model_reset_settings() { TempMgrGuard temp_mgr_guard; 290f2: ce 01 movw r24, r28 290f4: 01 96 adiw r24, 0x01 ; 1 290f6: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 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(); } 290fa: 0f 90 pop r0 290fc: df 91 pop r29 290fe: cf 91 pop r28 29100: 08 95 ret 00029102 : { return thermal_model::enabled; } void thermal_model_set_enabled(bool enabled) { 29102: 1f 93 push r17 29104: cf 93 push r28 29106: df 93 push r29 29108: 1f 92 push r1 2910a: cd b7 in r28, 0x3d ; 61 2910c: de b7 in r29, 0x3e ; 62 2910e: 18 2f mov r17, r24 // set the enabled flag { TempMgrGuard temp_mgr_guard; 29110: ce 01 movw r24, r28 29112: 01 96 adiw r24, 0x01 ; 1 29114: 0f 94 de 47 call 0x28fbc ; 0x28fbc thermal_model::enabled = enabled; 29118: 10 93 20 05 sts 0x0520, r17 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> thermal_model::setup(); 2911c: 0f 94 48 45 call 0x28a90 ; 0x28a90 void thermal_model_set_enabled(bool enabled) { // set the enabled flag { TempMgrGuard temp_mgr_guard; 29120: ce 01 movw r24, r28 29122: 01 96 adiw r24, 0x01 ; 1 29124: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 thermal_model::enabled = enabled; thermal_model::setup(); } // verify that the model has been enabled if(enabled && !thermal_model::enabled) 29128: 11 23 and r17, r17 2912a: 41 f0 breq .+16 ; 0x2913c 2912c: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> 29130: 81 11 cpse r24, r1 29132: 04 c0 rjmp .+8 ; 0x2913c SERIAL_ECHOLNPGM("TM: invalid parameters, cannot enable"); 29134: 8b ee ldi r24, 0xEB ; 235 29136: 9e e9 ldi r25, 0x9E ; 158 29138: 0e 94 06 7b call 0xf60c ; 0xf60c } 2913c: 0f 90 pop r0 2913e: df 91 pop r29 29140: cf 91 pop r28 29142: 1f 91 pop r17 29144: 08 95 ret 00029146 : #endif } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { 29146: 1f 93 push r17 29148: cf 93 push r28 2914a: df 93 push r29 2914c: 1f 92 push r1 2914e: cd b7 in r28, 0x3d ; 61 29150: de b7 in r29, 0x3e ; 62 29152: 18 2f mov r17, r24 TempMgrGuard temp_mgr_guard; 29154: ce 01 movw r24, r28 29156: 01 96 adiw r24, 0x01 ; 1 29158: 0f 94 de 47 call 0x28fbc ; 0x28fbc thermal_model::enabled = enabled; 2915c: 10 93 20 05 sts 0x0520, r17 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> } // clear error flags and mark as uninitialized static void reinitialize() { data.flags = 1; // shorcut to reset all error flags 29160: 81 e0 ldi r24, 0x01 ; 1 29162: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> warning_state.assert = false; // explicitly clear assertions 29166: e6 e3 ldi r30, 0x36 ; 54 29168: f6 e0 ldi r31, 0x06 ; 6 2916a: 80 81 ld r24, Z 2916c: 8d 7f andi r24, 0xFD ; 253 2916e: 80 83 st Z, r24 } // namespace thermal_model static void thermal_model_reset_enabled(bool enabled) { TempMgrGuard temp_mgr_guard; 29170: ce 01 movw r24, r28 29172: 01 96 adiw r24, 0x01 ; 1 29174: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 thermal_model::enabled = enabled; thermal_model::reinitialize(); } 29178: 0f 90 pop r0 2917a: df 91 pop r29 2917c: cf 91 pop r28 2917e: 1f 91 pop r17 29180: 08 95 ret 00029182 : /* 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() { 29182: cf 93 push r28 29184: df 93 push r29 29186: 1f 92 push r1 29188: cd b7 in r28, 0x3d ; 61 2918a: de b7 in r29, 0x3e ; 62 TempMgrGuard temp_mgr_guard; 2918c: ce 01 movw r24, r28 2918e: 01 96 adiw r24, 0x01 ; 1 29190: 0f 94 de 47 call 0x28fbc ; 0x28fbc } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 29198: 90 91 1b 05 lds r25, 0x051B ; 0x80051b 2919c: a0 91 1c 05 lds r26, 0x051C ; 0x80051c 291a0: b0 91 1d 05 lds r27, 0x051D ; 0x80051d 291a4: 80 93 61 0e sts 0x0E61, r24 ; 0x800e61 291a8: 90 93 62 0e sts 0x0E62, r25 ; 0x800e62 291ac: a0 93 63 0e sts 0x0E63, r26 ; 0x800e63 291b0: b0 93 64 0e sts 0x0E64, r27 ; 0x800e64 current_temperature_bed = current_temperature_bed_isr; 291b4: 80 91 16 06 lds r24, 0x0616 ; 0x800616 291b8: 90 91 17 06 lds r25, 0x0617 ; 0x800617 291bc: a0 91 18 06 lds r26, 0x0618 ; 0x800618 291c0: b0 91 19 06 lds r27, 0x0619 ; 0x800619 291c4: 80 93 f1 04 sts 0x04F1, r24 ; 0x8004f1 291c8: 90 93 f2 04 sts 0x04F2, r25 ; 0x8004f2 291cc: a0 93 f3 04 sts 0x04F3, r26 ; 0x8004f3 291d0: b0 93 f4 04 sts 0x04F4, r27 ; 0x8004f4 #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 291d4: 80 91 00 06 lds r24, 0x0600 ; 0x800600 291d8: 90 91 01 06 lds r25, 0x0601 ; 0x800601 291dc: a0 91 02 06 lds r26, 0x0602 ; 0x800602 291e0: b0 91 03 06 lds r27, 0x0603 ; 0x800603 291e4: 80 93 99 03 sts 0x0399, r24 ; 0x800399 291e8: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 291ec: a0 93 9b 03 sts 0x039B, r26 ; 0x80039b 291f0: b0 93 9c 03 sts 0x039C, r27 ; 0x80039c #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient = current_temperature_ambient_isr; 291f4: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 291f8: 90 91 1e 06 lds r25, 0x061E ; 0x80061e 291fc: a0 91 1f 06 lds r26, 0x061F ; 0x80061f 29200: b0 91 20 06 lds r27, 0x0620 ; 0x800620 29204: 80 93 53 06 sts 0x0653, r24 ; 0x800653 29208: 90 93 54 06 sts 0x0654, r25 ; 0x800654 2920c: a0 93 55 06 sts 0x0655, r26 ; 0x800655 29210: b0 93 56 06 sts 0x0656, r27 ; 0x800656 This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; setCurrentTemperaturesFromIsr(); if(!temp_error_state.v) { 29214: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29218: 81 11 cpse r24, r1 2921a: 02 c0 rjmp .+4 ; 0x29220 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 2921c: 0f 94 dd 21 call 0x243ba ; 0x243ba } temp_meas_ready = false; 29220: 10 92 ff 05 sts 0x05FF, r1 ; 0x8005ff - fetch updated values from temp_mgr_isr to current values - update target temperatures for temp_mgr_isr regulation *if* no temperature error is set This function is blocking: check temp_meas_ready before calling! */ static void updateTemperatures() { TempMgrGuard temp_mgr_guard; 29224: ce 01 movw r24, r28 29226: 01 96 adiw r24, 0x01 ; 1 29228: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 if(!temp_error_state.v) { // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); } temp_meas_ready = false; } 2922c: 0f 90 pop r0 2922e: df 91 pop r29 29230: cf 91 pop r28 29232: 08 95 ret 00029234 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 29234: 1f 92 push r1 29236: 0f 92 push r0 29238: 0f b6 in r0, 0x3f ; 63 2923a: 0f 92 push r0 2923c: 11 24 eor r1, r1 2923e: 0b b6 in r0, 0x3b ; 59 29240: 0f 92 push r0 29242: ff 92 push r15 29244: 0f 93 push r16 29246: 1f 93 push r17 29248: 2f 93 push r18 2924a: 3f 93 push r19 2924c: 4f 93 push r20 2924e: 5f 93 push r21 29250: 6f 93 push r22 29252: 7f 93 push r23 29254: 8f 93 push r24 29256: 9f 93 push r25 29258: af 93 push r26 2925a: bf 93 push r27 2925c: cf 93 push r28 2925e: df 93 push r29 29260: ef 93 push r30 29262: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 29264: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 29268: 8b 7f andi r24, 0xFB ; 251 2926a: 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(); 2926e: 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) 29270: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29274: 86 fd sbrc r24, 6 29276: c8 c0 rjmp .+400 ; 0x29408 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 29278: 68 ec ldi r22, 0xC8 ; 200 2927a: 70 e0 ldi r23, 0x00 ; 0 2927c: 80 ee ldi r24, 0xE0 ; 224 2927e: 95 e0 ldi r25, 0x05 ; 5 29280: 0f 94 e5 3f call 0x27fca ; 0x27fca ::expired_cont(unsigned short)> 29284: 88 23 and r24, r24 29286: b9 f0 breq .+46 ; 0x292b6 <__vector_14+0x82> buttonBlanking.start(); 29288: 80 ee ldi r24, 0xE0 ; 224 2928a: 95 e0 ldi r25, 0x05 ; 5 2928c: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> safetyTimer.start(); 29290: 8b ed ldi r24, 0xDB ; 219 29292: 95 e0 ldi r25, 0x05 ; 5 29294: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 29298: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 2929c: 81 11 cpse r24, r1 2929e: a5 c0 rjmp .+330 ; 0x293ea <__vector_14+0x1b6> 292a0: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 292a4: 81 11 cpse r24, r1 292a6: a1 c0 rjmp .+322 ; 0x293ea <__vector_14+0x1b6> { longPressTimer.start(); 292a8: 86 ed ldi r24, 0xD6 ; 214 292aa: 95 e0 ldi r25, 0x05 ; 5 292ac: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> lcd_button_pressed = 1; 292b0: 81 e0 ldi r24, 0x01 ; 1 292b2: 80 93 da 05 sts 0x05DA, r24 ; 0x8005da -2, 1, -1, 0, }; static uint8_t enc_bits_old = 0; uint8_t enc_bits = 0; if (!READ(BTN_EN1)) enc_bits |= _BV(0); 292b6: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 292ba: 82 fb bst r24, 2 292bc: 88 27 eor r24, r24 292be: 80 f9 bld r24, 0 292c0: 91 e0 ldi r25, 0x01 ; 1 292c2: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 292c4: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 292c8: 91 ff sbrs r25, 1 292ca: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 292cc: e0 91 d3 05 lds r30, 0x05D3 ; 0x8005d3 292d0: e8 17 cp r30, r24 292d2: e1 f0 breq .+56 ; 0x2930c <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 292d4: 24 e0 ldi r18, 0x04 ; 4 292d6: e2 9f mul r30, r18 292d8: f0 01 movw r30, r0 292da: 11 24 eor r1, r1 292dc: e8 2b or r30, r24 292de: e4 53 subi r30, 0x34 ; 52 292e0: f1 46 sbci r31, 0x61 ; 97 292e2: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 292e4: 90 91 d2 05 lds r25, 0x05D2 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.560> 292e8: e9 0f add r30, r25 292ea: e0 93 d2 05 sts 0x05D2, r30 ; 0x8005d2 <_ZL16lcd_encoder_diff.lto_priv.560> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 292ee: 0e 2e mov r0, r30 292f0: 00 0c add r0, r0 292f2: ff 0b sbc r31, r31 292f4: f7 ff sbrs r31, 7 292f6: 03 c0 rjmp .+6 ; 0x292fe <__vector_14+0xca> 292f8: f1 95 neg r31 292fa: e1 95 neg r30 292fc: f1 09 sbc r31, r1 292fe: 34 97 sbiw r30, 0x04 ; 4 29300: 1c f0 brlt .+6 ; 0x29308 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 29302: 91 e0 ldi r25, 0x01 ; 1 29304: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> } enc_bits_old = enc_bits; 29308: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 2930c: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29310: 81 11 cpse r24, r1 29312: 08 c0 rjmp .+16 ; 0x29324 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 29314: 80 91 19 05 lds r24, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 29318: 80 93 e5 05 sts 0x05E5, r24 ; 0x8005e5 if(soft_pwm_0 > 0) 2931c: 88 23 and r24, r24 2931e: 09 f4 brne .+2 ; 0x29322 <__vector_14+0xee> 29320: 87 c0 rjmp .+270 ; 0x29430 <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 29322: 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) 29324: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29328: 8f 70 andi r24, 0x0F ; 15 2932a: a9 f4 brne .+42 ; 0x29356 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 2932c: 80 91 a0 04 lds r24, 0x04A0 ; 0x8004a0 29330: 90 e0 ldi r25, 0x00 ; 0 29332: 24 e0 ldi r18, 0x04 ; 4 29334: 95 95 asr r25 29336: 87 95 ror r24 29338: 2a 95 dec r18 2933a: e1 f7 brne .-8 ; 0x29334 <__vector_14+0x100> 2933c: 80 93 9f 04 sts 0x049F, r24 ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.475> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 29340: 89 2b or r24, r25 29342: 09 f4 brne .+2 ; 0x29346 <__vector_14+0x112> 29344: 77 c0 rjmp .+238 ; 0x29434 <__vector_14+0x200> 29346: 9f b7 in r25, 0x3f ; 63 29348: f8 94 cli 2934a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2934e: 88 60 ori r24, 0x08 ; 8 29350: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29354: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 29356: 90 91 e5 05 lds r25, 0x05E5 ; 0x8005e5 2935a: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2935e: 98 17 cp r25, r24 29360: 08 f4 brcc .+2 ; 0x29364 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 29362: 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); 29364: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29368: 8f 70 andi r24, 0x0F ; 15 2936a: 90 91 9f 04 lds r25, 0x049F ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.475> 2936e: 98 17 cp r25, r24 29370: 40 f4 brcc .+16 ; 0x29382 <__vector_14+0x14e> 29372: 9f b7 in r25, 0x3f ; 63 29374: f8 94 cli 29376: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2937a: 87 7f andi r24, 0xF7 ; 247 2937c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29380: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 29382: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 29386: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 29388: 8f 77 andi r24, 0x7F ; 127 2938a: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2938e: 10 e0 ldi r17, 0x00 ; 0 29390: 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 29392: e8 01 movw r28, r16 29394: cc 0f add r28, r28 29396: dd 1f adc r29, r29 29398: ca 59 subi r28, 0x9A ; 154 2939a: d9 4f sbci r29, 0xF9 ; 249 2939c: 88 81 ld r24, Y 2939e: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 293a0: 18 16 cp r1, r24 293a2: 19 06 cpc r1, r25 293a4: 0c f0 brlt .+2 ; 0x293a8 <__vector_14+0x174> 293a6: 4c c0 rjmp .+152 ; 0x29440 <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 293a8: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 293aa: f8 94 cli babystep(axis,/*fwd*/true); 293ac: 61 e0 ldi r22, 0x01 ; 1 293ae: 80 2f mov r24, r16 293b0: 0f 94 ee 21 call 0x243dc ; 0x243dc babystepsTodo[axis]--; //less to do next time 293b4: 88 81 ld r24, Y 293b6: 99 81 ldd r25, Y+1 ; 0x01 293b8: 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 293ba: 99 83 std Y+1, r25 ; 0x01 293bc: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 293be: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 293c0: 0f 5f subi r16, 0xFF ; 255 293c2: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 293c4: 03 30 cpi r16, 0x03 ; 3 293c6: 11 05 cpc r17, r1 293c8: 21 f7 brne .-56 ; 0x29392 <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 293ca: 80 91 39 18 lds r24, 0x1839 ; 0x801839 <__bss_end+0x20> 293ce: 90 91 3a 18 lds r25, 0x183A ; 0x80183a <__bss_end+0x21> 293d2: a0 91 3b 18 lds r26, 0x183B ; 0x80183b <__bss_end+0x22> 293d6: b0 91 3c 18 lds r27, 0x183C ; 0x80183c <__bss_end+0x23> 293da: 82 3a cpi r24, 0xA2 ; 162 293dc: 92 4a sbci r25, 0xA2 ; 162 293de: a1 05 cpc r26, r1 293e0: b1 05 cpc r27, r1 293e2: d9 f1 breq .+118 ; 0x2945a <__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); 293e4: 81 e0 ldi r24, 0x01 ; 1 293e6: 0e 94 0d 68 call 0xd01a ; 0xd01a if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 293ea: 68 ee ldi r22, 0xE8 ; 232 293ec: 73 e0 ldi r23, 0x03 ; 3 293ee: 86 ed ldi r24, 0xD6 ; 214 293f0: 95 e0 ldi r25, 0x05 ; 5 293f2: 0f 94 bd 3f call 0x27f7a ; 0x27f7a ::expired(unsigned short)> 293f6: 88 23 and r24, r24 293f8: 09 f4 brne .+2 ; 0x293fc <__vector_14+0x1c8> 293fa: 5d cf rjmp .-326 ; 0x292b6 <__vector_14+0x82> { lcd_long_press_active = 1; 293fc: 81 e0 ldi r24, 0x01 ; 1 293fe: 80 93 d9 05 sts 0x05D9, r24 ; 0x8005d9 lcd_longpress_trigger = 1; 29402: 80 93 d5 05 sts 0x05D5, r24 ; 0x8005d5 29406: 57 cf rjmp .-338 ; 0x292b6 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 29408: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 2940c: 88 23 and r24, r24 2940e: 09 f4 brne .+2 ; 0x29412 <__vector_14+0x1de> 29410: 52 cf rjmp .-348 ; 0x292b6 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 29412: 10 92 da 05 sts 0x05DA, r1 ; 0x8005da if (!lcd_long_press_active) 29416: 80 91 d9 05 lds r24, 0x05D9 ; 0x8005d9 2941a: 81 11 cpse r24, r1 2941c: 03 c0 rjmp .+6 ; 0x29424 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 2941e: 81 e0 ldi r24, 0x01 ; 1 29420: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 29424: 81 e0 ldi r24, 0x01 ; 1 29426: 80 93 d4 05 sts 0x05D4, r24 ; 0x8005d4 <_ZL26lcd_backlight_wake_trigger.lto_priv.559> lcd_long_press_active = 0; 2942a: 10 92 d9 05 sts 0x05D9, r1 ; 0x8005d9 2942e: 43 cf rjmp .-378 ; 0x292b6 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 29430: 75 98 cbi 0x0e, 5 ; 14 29432: 78 cf rjmp .-272 ; 0x29324 <__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); 29434: 9f b7 in r25, 0x3f ; 63 29436: f8 94 cli 29438: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2943c: 87 7f andi r24, 0xF7 ; 247 2943e: 88 cf rjmp .-240 ; 0x29350 <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 29440: 89 2b or r24, r25 29442: 09 f4 brne .+2 ; 0x29446 <__vector_14+0x212> 29444: bd cf rjmp .-134 ; 0x293c0 <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 29446: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 29448: f8 94 cli babystep(axis,/*fwd*/false); 2944a: 60 e0 ldi r22, 0x00 ; 0 2944c: 80 2f mov r24, r16 2944e: 0f 94 ee 21 call 0x243dc ; 0x243dc babystepsTodo[axis]++; //less to do next time 29452: 88 81 ld r24, Y 29454: 99 81 ldd r25, Y+1 ; 0x01 29456: 01 96 adiw r24, 0x01 ; 1 29458: b0 cf rjmp .-160 ; 0x293ba <__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]) { 2945a: 9c b1 in r25, 0x0c ; 12 2945c: 80 91 e3 05 lds r24, 0x05E3 ; 0x8005e3 29460: 96 fb bst r25, 6 29462: 99 27 eor r25, r25 29464: 90 f9 bld r25, 0 29466: 98 17 cp r25, r24 29468: 91 f0 breq .+36 ; 0x2948e <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 2946a: 90 91 36 05 lds r25, 0x0536 ; 0x800536 2946e: 99 23 and r25, r25 29470: 51 f0 breq .+20 ; 0x29486 <__vector_14+0x252> 29472: 20 91 b5 04 lds r18, 0x04B5 ; 0x8004b5 29476: 30 91 b6 04 lds r19, 0x04B6 ; 0x8004b6 2947a: 2f 5f subi r18, 0xFF ; 255 2947c: 3f 4f sbci r19, 0xFF ; 255 2947e: 30 93 b6 04 sts 0x04B6, r19 ; 0x8004b6 29482: 20 93 b5 04 sts 0x04B5, r18 ; 0x8004b5 fan_state[0] = !fan_state[0]; 29486: 91 e0 ldi r25, 0x01 ; 1 29488: 89 27 eor r24, r25 2948a: 80 93 e3 05 sts 0x05E3, r24 ; 0x8005e3 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 2948e: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 29490: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 29494: 84 60 ori r24, 0x04 ; 4 29496: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 2949a: ff 91 pop r31 2949c: ef 91 pop r30 2949e: df 91 pop r29 294a0: cf 91 pop r28 294a2: bf 91 pop r27 294a4: af 91 pop r26 294a6: 9f 91 pop r25 294a8: 8f 91 pop r24 294aa: 7f 91 pop r23 294ac: 6f 91 pop r22 294ae: 5f 91 pop r21 294b0: 4f 91 pop r20 294b2: 3f 91 pop r19 294b4: 2f 91 pop r18 294b6: 1f 91 pop r17 294b8: 0f 91 pop r16 294ba: ff 90 pop r15 294bc: 0f 90 pop r0 294be: 0b be out 0x3b, r0 ; 59 294c0: 0f 90 pop r0 294c2: 0f be out 0x3f, r0 ; 63 294c4: 0f 90 pop r0 294c6: 1f 90 pop r1 294c8: 18 95 reti 000294ca : #endif } #ifdef AMBIENT_THERMISTOR static float analog2tempAmbient(int raw) { 294ca: 4f 92 push r4 294cc: 5f 92 push r5 294ce: 6f 92 push r6 294d0: 7f 92 push r7 294d2: af 92 push r10 294d4: bf 92 push r11 294d6: cf 92 push r12 294d8: df 92 push r13 294da: ef 92 push r14 294dc: ff 92 push r15 294de: 0f 93 push r16 294e0: 1f 93 push r17 294e2: cf 93 push r28 294e4: df 93 push r29 294e6: 24 e0 ldi r18, 0x04 ; 4 294e8: 30 e0 ldi r19, 0x00 ; 0 294ea: 41 e0 ldi r20, 0x01 ; 1 294ec: 50 e0 ldi r21, 0x00 ; 0 294ee: d9 01 movw r26, r18 294f0: a2 5a subi r26, 0xA2 ; 162 294f2: b2 46 sbci r27, 0x62 ; 98 float celsius = 0; byte i; for (i=1; i raw) 294f4: fd 01 movw r30, r26 294f6: 65 91 lpm r22, Z+ 294f8: 74 91 lpm r23, Z 294fa: 86 17 cp r24, r22 294fc: 97 07 cpc r25, r23 294fe: 0c f0 brlt .+2 ; 0x29502 29500: 66 c0 rjmp .+204 ; 0x295ce { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 29502: 41 50 subi r20, 0x01 ; 1 29504: 51 09 sbc r21, r1 29506: 44 0f add r20, r20 29508: 55 1f adc r21, r21 2950a: 44 0f add r20, r20 2950c: 55 1f adc r21, r21 2950e: ea 01 movw r28, r20 29510: c0 5a subi r28, 0xA0 ; 160 29512: d2 46 sbci r29, 0x62 ; 98 29514: fe 01 movw r30, r28 29516: 05 91 lpm r16, Z+ 29518: 14 91 lpm r17, Z (raw - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])) * 2951a: 42 5a subi r20, 0xA2 ; 162 2951c: 52 46 sbci r21, 0x62 ; 98 2951e: fa 01 movw r30, r20 29520: 65 91 lpm r22, Z+ 29522: 74 91 lpm r23, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 29524: f9 01 movw r30, r18 29526: e0 5a subi r30, 0xA0 ; 160 29528: f2 46 sbci r31, 0x62 ; 98 2952a: e5 90 lpm r14, Z+ 2952c: f4 90 lpm r15, Z 2952e: fe 01 movw r30, r28 29530: c5 90 lpm r12, Z+ 29532: d4 90 lpm r13, Z (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][0]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][0])); 29534: fd 01 movw r30, r26 29536: c5 91 lpm r28, Z+ 29538: d4 91 lpm r29, Z 2953a: fa 01 movw r30, r20 2953c: a5 90 lpm r10, Z+ 2953e: 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])) * 29540: 86 1b sub r24, r22 29542: 97 0b sbc r25, r23 29544: bc 01 movw r22, r24 29546: 99 0f add r25, r25 29548: 88 0b sbc r24, r24 2954a: 99 0b sbc r25, r25 2954c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29550: 2b 01 movw r4, r22 29552: 3c 01 movw r6, r24 (float)(PGM_RD_W(AMBIENTTEMPTABLE[i][1]) - PGM_RD_W(AMBIENTTEMPTABLE[i-1][1])) / 29554: b7 01 movw r22, r14 29556: 6c 19 sub r22, r12 29558: 7d 09 sbc r23, r13 2955a: 07 2e mov r0, r23 2955c: 00 0c add r0, r0 2955e: 88 0b sbc r24, r24 29560: 99 0b sbc r25, r25 29562: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29566: 9b 01 movw r18, r22 29568: 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])) * 2956a: c3 01 movw r24, r6 2956c: b2 01 movw r22, r4 2956e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 29572: 6b 01 movw r12, r22 29574: 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])); 29576: be 01 movw r22, r28 29578: 6a 19 sub r22, r10 2957a: 7b 09 sbc r23, r11 2957c: 07 2e mov r0, r23 2957e: 00 0c add r0, r0 29580: 88 0b sbc r24, r24 29582: 99 0b sbc r25, r25 29584: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29588: 9b 01 movw r18, r22 2958a: 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])) / 2958c: c7 01 movw r24, r14 2958e: b6 01 movw r22, r12 29590: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 29594: 6b 01 movw r12, r22 29596: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]) + 29598: b8 01 movw r22, r16 2959a: 11 0f add r17, r17 2959c: 88 0b sbc r24, r24 2959e: 99 0b sbc r25, r25 295a0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 295a4: 9b 01 movw r18, r22 295a6: ac 01 movw r20, r24 295a8: c7 01 movw r24, r14 295aa: b6 01 movw r22, r12 295ac: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> } } // Overflow: Set to last value in the table if (i == AMBIENTTEMPTABLE_LEN) celsius = PGM_RD_W(AMBIENTTEMPTABLE[i-1][1]); return celsius; } 295b0: df 91 pop r29 295b2: cf 91 pop r28 295b4: 1f 91 pop r17 295b6: 0f 91 pop r16 295b8: ff 90 pop r15 295ba: ef 90 pop r14 295bc: df 90 pop r13 295be: cf 90 pop r12 295c0: bf 90 pop r11 295c2: af 90 pop r10 295c4: 7f 90 pop r7 295c6: 6f 90 pop r6 295c8: 5f 90 pop r5 295ca: 4f 90 pop r4 295cc: 08 95 ret 295ce: 4f 5f subi r20, 0xFF ; 255 295d0: 5f 4f sbci r21, 0xFF ; 255 295d2: 2c 5f subi r18, 0xFC ; 252 295d4: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempAmbient(int raw) { float celsius = 0; byte i; for (i=1; i 295dc: 88 cf rjmp .-240 ; 0x294ee (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]); 295de: e4 ee ldi r30, 0xE4 ; 228 295e0: fd e9 ldi r31, 0x9D ; 157 295e2: 65 91 lpm r22, Z+ 295e4: 74 91 lpm r23, Z 295e6: 07 2e mov r0, r23 295e8: 00 0c add r0, r0 295ea: 88 0b sbc r24, r24 295ec: 99 0b sbc r25, r25 295ee: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 295f2: de cf rjmp .-68 ; 0x295b0 000295f4 : 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) { 295f4: 4f 92 push r4 295f6: 5f 92 push r5 295f8: 6f 92 push r6 295fa: 7f 92 push r7 295fc: af 92 push r10 295fe: bf 92 push r11 29600: cf 92 push r12 29602: df 92 push r13 29604: ef 92 push r14 29606: ff 92 push r15 29608: 0f 93 push r16 2960a: 1f 93 push r17 2960c: cf 93 push r28 2960e: df 93 push r29 29610: 24 e0 ldi r18, 0x04 ; 4 29612: 30 e0 ldi r19, 0x00 ; 0 29614: 41 e0 ldi r20, 0x01 ; 1 29616: 50 e0 ldi r21, 0x00 ; 0 29618: d9 01 movw r26, r18 2961a: a6 59 subi r26, 0x96 ; 150 2961c: b3 46 sbci r27, 0x63 ; 99 float celsius = 0; byte i; for (i=1; i raw) 2961e: fd 01 movw r30, r26 29620: 65 91 lpm r22, Z+ 29622: 74 91 lpm r23, Z 29624: 86 17 cp r24, r22 29626: 97 07 cpc r25, r23 29628: 0c f0 brlt .+2 ; 0x2962c 2962a: 80 c0 rjmp .+256 ; 0x2972c { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 2962c: 41 50 subi r20, 0x01 ; 1 2962e: 51 09 sbc r21, r1 29630: 44 0f add r20, r20 29632: 55 1f adc r21, r21 29634: 44 0f add r20, r20 29636: 55 1f adc r21, r21 29638: 8a 01 movw r16, r20 2963a: 04 59 subi r16, 0x94 ; 148 2963c: 13 46 sbci r17, 0x63 ; 99 2963e: f8 01 movw r30, r16 29640: c5 90 lpm r12, Z+ 29642: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 29644: 46 59 subi r20, 0x96 ; 150 29646: 53 46 sbci r21, 0x63 ; 99 29648: fa 01 movw r30, r20 2964a: 65 91 lpm r22, Z+ 2964c: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2964e: f9 01 movw r30, r18 29650: e4 59 subi r30, 0x94 ; 148 29652: f3 46 sbci r31, 0x63 ; 99 29654: c5 91 lpm r28, Z+ 29656: d4 91 lpm r29, Z 29658: f8 01 movw r30, r16 2965a: 05 91 lpm r16, Z+ 2965c: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 2965e: fd 01 movw r30, r26 29660: e5 90 lpm r14, Z+ 29662: f4 90 lpm r15, Z 29664: fa 01 movw r30, r20 29666: a5 90 lpm r10, Z+ 29668: 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])) * 2966a: 86 1b sub r24, r22 2966c: 97 0b sbc r25, r23 2966e: bc 01 movw r22, r24 29670: 99 0f add r25, r25 29672: 88 0b sbc r24, r24 29674: 99 0b sbc r25, r25 29676: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 2967a: 2b 01 movw r4, r22 2967c: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 2967e: be 01 movw r22, r28 29680: 60 1b sub r22, r16 29682: 71 0b sbc r23, r17 29684: 07 2e mov r0, r23 29686: 00 0c add r0, r0 29688: 88 0b sbc r24, r24 2968a: 99 0b sbc r25, r25 2968c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29690: 9b 01 movw r18, r22 29692: 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])) * 29694: c3 01 movw r24, r6 29696: b2 01 movw r22, r4 29698: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2969c: 2b 01 movw r4, r22 2969e: 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])); 296a0: b7 01 movw r22, r14 296a2: 6a 19 sub r22, r10 296a4: 7b 09 sbc r23, r11 296a6: 07 2e mov r0, r23 296a8: 00 0c add r0, r0 296aa: 88 0b sbc r24, r24 296ac: 99 0b sbc r25, r25 296ae: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 296b2: 9b 01 movw r18, r22 296b4: 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])) / 296b6: c3 01 movw r24, r6 296b8: b2 01 movw r22, r4 296ba: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 296be: 2b 01 movw r4, r22 296c0: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 296c2: b6 01 movw r22, r12 296c4: dd 0c add r13, r13 296c6: 88 0b sbc r24, r24 296c8: 99 0b sbc r25, r25 296ca: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 296ce: 9b 01 movw r18, r22 296d0: ac 01 movw r20, r24 296d2: c3 01 movw r24, r6 296d4: b2 01 movw r22, r4 296d6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 296da: 6b 01 movw r12, r22 296dc: 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) 296de: 20 e0 ldi r18, 0x00 ; 0 296e0: 30 e0 ldi r19, 0x00 ; 0 296e2: 40 e2 ldi r20, 0x20 ; 32 296e4: 52 e4 ldi r21, 0x42 ; 66 296e6: c7 01 movw r24, r14 296e8: b6 01 movw r22, r12 296ea: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 296ee: 87 fd sbrc r24, 7 296f0: 30 c0 rjmp .+96 ; 0x29752 296f2: 20 e0 ldi r18, 0x00 ; 0 296f4: 30 e0 ldi r19, 0x00 ; 0 296f6: 48 e4 ldi r20, 0x48 ; 72 296f8: 52 e4 ldi r21, 0x42 ; 66 296fa: c7 01 movw r24, r14 296fc: b6 01 movw r22, r12 296fe: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 29702: 18 16 cp r1, r24 29704: 34 f1 brlt .+76 ; 0x29752 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 29706: 20 e0 ldi r18, 0x00 ; 0 29708: 30 e0 ldi r19, 0x00 ; 0 2970a: 40 e2 ldi r20, 0x20 ; 32 2970c: 52 e4 ldi r21, 0x42 ; 66 2970e: c7 01 movw r24, r14 29710: b6 01 movw r22, r12 29712: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 29716: 20 e0 ldi r18, 0x00 ; 0 29718: 30 e0 ldi r19, 0x00 ; 0 2971a: 40 e0 ldi r20, 0x00 ; 0 2971c: 5f e3 ldi r21, 0x3F ; 63 2971e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 29722: 9b 01 movw r18, r22 29724: 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; 29726: c7 01 movw r24, r14 29728: b6 01 movw r22, r12 2972a: 43 c0 rjmp .+134 ; 0x297b2 2972c: 4f 5f subi r20, 0xFF ; 255 2972e: 5f 4f sbci r21, 0xFF ; 255 29730: 2c 5f subi r18, 0xFC ; 252 29732: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 2973a: 6e cf rjmp .-292 ; 0x29618 break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 2973c: ec e5 ldi r30, 0x5C ; 92 2973e: fd e9 ldi r31, 0x9D ; 157 29740: 65 91 lpm r22, Z+ 29742: 74 91 lpm r23, Z 29744: 07 2e mov r0, r23 29746: 00 0c add r0, r0 29748: 88 0b sbc r24, r24 2974a: 99 0b sbc r25, r25 2974c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29750: c4 cf rjmp .-120 ; 0x296da if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 29752: 20 e0 ldi r18, 0x00 ; 0 29754: 30 e0 ldi r19, 0x00 ; 0 29756: 48 e4 ldi r20, 0x48 ; 72 29758: 52 e4 ldi r21, 0x42 ; 66 2975a: c7 01 movw r24, r14 2975c: b6 01 movw r22, r12 2975e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 29762: 18 16 cp r1, r24 29764: dc f5 brge .+118 ; 0x297dc 29766: 20 e0 ldi r18, 0x00 ; 0 29768: 30 e0 ldi r19, 0x00 ; 0 2976a: 48 ec ldi r20, 0xC8 ; 200 2976c: 52 e4 ldi r21, 0x42 ; 66 2976e: c7 01 movw r24, r14 29770: b6 01 movw r22, r12 29772: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 29776: 18 16 cp r1, r24 29778: 8c f1 brlt .+98 ; 0x297dc { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 2977a: 20 e0 ldi r18, 0x00 ; 0 2977c: 30 e0 ldi r19, 0x00 ; 0 2977e: 40 ea ldi r20, 0xA0 ; 160 29780: 50 e4 ldi r21, 0x40 ; 64 29782: c7 01 movw r24, r14 29784: b6 01 movw r22, r12 29786: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2978a: 2b 01 movw r4, r22 2978c: 3c 01 movw r6, r24 2978e: 20 e0 ldi r18, 0x00 ; 0 29790: 30 e0 ldi r19, 0x00 ; 0 29792: 48 e4 ldi r20, 0x48 ; 72 29794: 52 e4 ldi r21, 0x42 ; 66 29796: c7 01 movw r24, r14 29798: b6 01 movw r22, r12 2979a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 2979e: 2d ec ldi r18, 0xCD ; 205 297a0: 3c ec ldi r19, 0xCC ; 204 297a2: 4c ec ldi r20, 0xCC ; 204 297a4: 5d e3 ldi r21, 0x3D ; 61 297a6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 297aa: 9b 01 movw r18, r22 297ac: ac 01 movw r20, r24 297ae: c3 01 movw r24, r6 297b0: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 297b2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 297b6: 6b 01 movw r12, r22 297b8: 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 } 297ba: c7 01 movw r24, r14 297bc: b6 01 movw r22, r12 297be: df 91 pop r29 297c0: cf 91 pop r28 297c2: 1f 91 pop r17 297c4: 0f 91 pop r16 297c6: ff 90 pop r15 297c8: ef 90 pop r14 297ca: df 90 pop r13 297cc: cf 90 pop r12 297ce: bf 90 pop r11 297d0: af 90 pop r10 297d2: 7f 90 pop r7 297d4: 6f 90 pop r6 297d6: 5f 90 pop r5 297d8: 4f 90 pop r4 297da: 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) 297dc: 20 e0 ldi r18, 0x00 ; 0 297de: 30 e0 ldi r19, 0x00 ; 0 297e0: 48 ec ldi r20, 0xC8 ; 200 297e2: 52 e4 ldi r21, 0x42 ; 66 297e4: c7 01 movw r24, r14 297e6: b6 01 movw r22, r12 297e8: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 297ec: 18 16 cp r1, r24 297ee: 2c f7 brge .-54 ; 0x297ba { celsius = celsius + _offset; 297f0: 20 e0 ldi r18, 0x00 ; 0 297f2: 30 e0 ldi r19, 0x00 ; 0 297f4: 40 e2 ldi r20, 0x20 ; 32 297f6: 51 e4 ldi r21, 0x41 ; 65 297f8: 96 cf rjmp .-212 ; 0x29726 000297fa : } static void check_temp_raw(); static void temp_mgr_isr() { 297fa: 4f 92 push r4 297fc: 5f 92 push r5 297fe: 6f 92 push r6 29800: 7f 92 push r7 29802: af 92 push r10 29804: cf 92 push r12 29806: df 92 push r13 29808: ef 92 push r14 2980a: ff 92 push r15 2980c: 0f 93 push r16 2980e: 1f 93 push r17 29810: cf 93 push r28 29812: 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 29818: 90 91 09 06 lds r25, 0x0609 ; 0x800609 2981c: 0e 94 8e da call 0x1b51c ; 0x1b51c 29820: 60 93 1a 05 sts 0x051A, r22 ; 0x80051a 29824: 70 93 1b 05 sts 0x051B, r23 ; 0x80051b 29828: 80 93 1c 05 sts 0x051C, r24 ; 0x80051c 2982c: 90 93 1d 05 sts 0x051D, r25 ; 0x80051d current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 29830: 60 90 06 06 lds r6, 0x0606 ; 0x800606 29834: 70 90 07 06 lds r7, 0x0607 ; 0x800607 29838: c3 01 movw r24, r6 2983a: 0f 94 fa 4a call 0x295f4 ; 0x295f4 2983e: 6b 01 movw r12, r22 29840: 7c 01 movw r14, r24 29842: c0 92 16 06 sts 0x0616, r12 ; 0x800616 29846: d0 92 17 06 sts 0x0617, r13 ; 0x800617 2984a: e0 92 18 06 sts 0x0618, r14 ; 0x800618 2984e: f0 92 19 06 sts 0x0619, r15 ; 0x800619 #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 29852: 80 91 04 06 lds r24, 0x0604 ; 0x800604 29856: 90 91 05 06 lds r25, 0x0605 ; 0x800605 2985a: 0f 94 fa 4a call 0x295f4 ; 0x295f4 2985e: 60 93 00 06 sts 0x0600, r22 ; 0x800600 29862: 70 93 01 06 sts 0x0601, r23 ; 0x800601 29866: 80 93 02 06 sts 0x0602, r24 ; 0x800602 2986a: 90 93 03 06 sts 0x0603, r25 ; 0x800603 #endif #ifdef AMBIENT_THERMISTOR current_temperature_ambient_isr = analog2tempAmbient(current_temperature_raw_ambient); //thermistor for ambient is NTCG104LH104JT1 (2000) 2986e: c0 91 12 06 lds r28, 0x0612 ; 0x800612 29872: d0 91 13 06 lds r29, 0x0613 ; 0x800613 29876: ce 01 movw r24, r28 29878: 0f 94 65 4a call 0x294ca ; 0x294ca 2987c: 60 93 1d 06 sts 0x061D, r22 ; 0x80061d 29880: 70 93 1e 06 sts 0x061E, r23 ; 0x80061e 29884: 80 93 1f 06 sts 0x061F, r24 ; 0x80061f 29888: 90 93 20 06 sts 0x0620, r25 ; 0x800620 #endif temp_meas_ready = true; 2988c: 81 e0 ldi r24, 0x01 ; 1 2988e: 80 93 ff 05 sts 0x05FF, r24 ; 0x8005ff { // update *_isr temperatures from raw values for PID regulation setIsrTemperaturesFromRawValues(); // clear the error assertion flag before checking again temp_error_state.assert = false; 29892: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29896: 8d 7f andi r24, 0xFD ; 253 29898: 80 93 1e 05 sts 0x051E, r24 ; 0x80051e <_ZL16temp_error_state.lto_priv.469> void check_max_temp_raw() { //heater #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP if (current_temperature_raw[0] <= maxttemp_raw[0]) { 2989c: 20 91 08 06 lds r18, 0x0608 ; 0x800608 298a0: 30 91 09 06 lds r19, 0x0609 ; 0x800609 298a4: 80 91 9b 04 lds r24, 0x049B ; 0x80049b <_ZL12maxttemp_raw.lto_priv.478> 298a8: 90 91 9c 04 lds r25, 0x049C ; 0x80049c <_ZL12maxttemp_raw.lto_priv.478+0x1> 298ac: 82 17 cp r24, r18 298ae: 93 07 cpc r25, r19 298b0: 2c f0 brlt .+10 ; 0x298bc #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 298b2: 40 e0 ldi r20, 0x00 ; 0 298b4: 60 e0 ldi r22, 0x00 ; 0 298b6: 80 e0 ldi r24, 0x00 ; 0 298b8: 0f 94 72 45 call 0x28ae4 ; 0x28ae4 } //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) { 298bc: 80 91 99 04 lds r24, 0x0499 ; 0x800499 <_ZL16bed_maxttemp_raw.lto_priv.479> 298c0: 90 91 9a 04 lds r25, 0x049A ; 0x80049a <_ZL16bed_maxttemp_raw.lto_priv.479+0x1> 298c4: 86 15 cp r24, r6 298c6: 97 05 cpc r25, r7 298c8: 2c f0 brlt .+10 ; 0x298d4 #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 298ca: 40 e0 ldi r20, 0x00 ; 0 298cc: 60 e0 ldi r22, 0x00 ; 0 298ce: 81 e0 ldi r24, 0x01 ; 1 298d0: 0f 94 72 45 call 0x28ae4 ; 0x28ae4 } #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) { 298d4: 80 91 97 04 lds r24, 0x0497 ; 0x800497 <_ZL20ambient_maxttemp_raw.lto_priv.480> 298d8: 90 91 98 04 lds r25, 0x0498 ; 0x800498 <_ZL20ambient_maxttemp_raw.lto_priv.480+0x1> 298dc: 8c 17 cp r24, r28 298de: 9d 07 cpc r25, r29 298e0: 2c f0 brlt .+10 ; 0x298ec #else if (current_temperature_raw_ambient >= ambient_maxttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::max); 298e2: 40 e0 ldi r20, 0x00 ; 0 298e4: 60 e0 ldi r22, 0x00 ; 0 298e6: 82 e0 ldi r24, 0x02 ; 2 298e8: 0f 94 72 45 call 0x28ae4 ; 0x28ae4 #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) { 298ec: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL20ambient_minttemp_raw.lto_priv.477> 298f0: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL20ambient_minttemp_raw.lto_priv.477+0x1> 298f4: c8 17 cp r28, r24 298f6: d9 07 cpc r29, r25 298f8: 2c f0 brlt .+10 ; 0x29904 #else if (current_temperature_raw_ambient <= ambient_minttemp_raw) { #endif set_temp_error(TempErrorSource::ambient, 0, TempErrorType::min); 298fa: 41 e0 ldi r20, 0x01 ; 1 298fc: 60 e0 ldi r22, 0x00 ; 0 298fe: 82 e0 ldi r24, 0x02 ; 2 29900: 0f 94 72 45 call 0x28ae4 ; 0x28ae4 #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 29904: c1 3a cpi r28, 0xA1 ; 161 29906: de 43 sbci r29, 0x3E ; 62 29908: 0c f4 brge .+2 ; 0x2990c 2990a: cd c1 rjmp .+922 ; 0x29ca6 { // 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]) { 2990c: 60 91 9d 04 lds r22, 0x049D ; 0x80049d <_ZL8minttemp.lto_priv.476> 29910: 70 91 9e 04 lds r23, 0x049E ; 0x80049e <_ZL8minttemp.lto_priv.476+0x1> 29914: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 29918: 90 91 1c 06 lds r25, 0x061C ; 0x80061c 2991c: 68 17 cp r22, r24 2991e: 79 07 cpc r23, r25 29920: 0c f0 brlt .+2 ; 0x29924 29922: 55 c0 rjmp .+170 ; 0x299ce // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 29924: c0 91 11 06 lds r28, 0x0611 ; 0x800611 29928: c1 11 cpse r28, r1 2992a: 18 c0 rjmp .+48 ; 0x2995c 2992c: 6b 5f subi r22, 0xFB ; 251 2992e: 7f 4f sbci r23, 0xFF ; 255 29930: 07 2e mov r0, r23 29932: 00 0c add r0, r0 29934: 88 0b sbc r24, r24 29936: 99 0b sbc r25, r25 29938: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 2993c: 9b 01 movw r18, r22 2993e: ac 01 movw r20, r24 29940: c1 e0 ldi r28, 0x01 ; 1 29942: 60 91 1a 05 lds r22, 0x051A ; 0x80051a 29946: 70 91 1b 05 lds r23, 0x051B ; 0x80051b 2994a: 80 91 1c 05 lds r24, 0x051C ; 0x80051c 2994e: 90 91 1d 05 lds r25, 0x051D ; 0x80051d 29952: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 29956: 18 16 cp r1, r24 29958: 0c f0 brlt .+2 ; 0x2995c 2995a: c0 e0 ldi r28, 0x00 ; 0 2995c: c0 93 11 06 sts 0x0611, r28 ; 0x800611 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 29960: 68 e9 ldi r22, 0x98 ; 152 29962: 7a e3 ldi r23, 0x3A ; 58 29964: 8e e0 ldi r24, 0x0E ; 14 29966: 96 e0 ldi r25, 0x06 ; 6 29968: 0f 94 e5 3f call 0x27fca ; 0x27fca ::expired_cont(unsigned short)> 2996c: 81 11 cpse r24, r1 2996e: 02 c0 rjmp .+4 ; 0x29974 29970: cc 23 and r28, r28 29972: 29 f0 breq .+10 ; 0x2997e bCheckingOnHeater=true; // not necessary 29974: 81 e0 ldi r24, 0x01 ; 1 29976: 80 93 11 06 sts 0x0611, r24 ; 0x800611 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active 2997a: 0f 94 ec 45 call 0x28bd8 ; 0x28bd8 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 2997e: 80 91 14 06 lds r24, 0x0614 ; 0x800614 29982: 90 91 15 06 lds r25, 0x0615 ; 0x800615 29986: 0b 97 sbiw r24, 0x0b ; 11 29988: 4c f1 brlt .+82 ; 0x299dc // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 2998a: c0 91 0d 06 lds r28, 0x060D ; 0x80060d 2998e: c1 11 cpse r28, r1 29990: 0c c0 rjmp .+24 ; 0x299aa 29992: c1 e0 ldi r28, 0x01 ; 1 29994: 20 e0 ldi r18, 0x00 ; 0 29996: 30 e0 ldi r19, 0x00 ; 0 29998: 40 e7 ldi r20, 0x70 ; 112 2999a: 51 e4 ldi r21, 0x41 ; 65 2999c: c7 01 movw r24, r14 2999e: b6 01 movw r22, r12 299a0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 299a4: 18 16 cp r1, r24 299a6: 0c f0 brlt .+2 ; 0x299aa 299a8: c0 e0 ldi r28, 0x00 ; 0 299aa: c0 93 0d 06 sts 0x060D, r28 ; 0x80060d if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 299ae: 60 e5 ldi r22, 0x50 ; 80 299b0: 73 ec ldi r23, 0xC3 ; 195 299b2: 8a e0 ldi r24, 0x0A ; 10 299b4: 96 e0 ldi r25, 0x06 ; 6 299b6: 0f 94 e5 3f call 0x27fca ; 0x27fca ::expired_cont(unsigned short)> 299ba: 81 11 cpse r24, r1 299bc: 02 c0 rjmp .+4 ; 0x299c2 299be: cc 23 and r28, r28 299c0: 99 f0 breq .+38 ; 0x299e8 bCheckingOnBed=true; // not necessary 299c2: 81 e0 ldi r24, 0x01 ; 1 299c4: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); check_min_temp_bed(); 299c8: 0f 94 db 45 call 0x28bb6 ; 0x28bb6 299cc: 0d c0 rjmp .+26 ; 0x299e8 check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ nozzle heating is off oTimer4minTempHeater.start(); 299ce: 8e e0 ldi r24, 0x0E ; 14 299d0: 96 e0 ldi r25, 0x06 ; 6 299d2: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> bCheckingOnHeater=false; 299d6: 10 92 11 06 sts 0x0611, r1 ; 0x800611 299da: d1 cf rjmp .-94 ; 0x2997e check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active } } else { // ~ bed heating is off oTimer4minTempBed.start(); 299dc: 8a e0 ldi r24, 0x0A ; 10 299de: 96 e0 ldi r25, 0x06 ; 6 299e0: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> bCheckingOnBed=false; 299e4: 10 92 0d 06 sts 0x060D, r1 ; 0x80060d static void check_temp_runaway() { #ifdef TEMP_RUNAWAY_EXTRUDER_HYSTERESIS for(uint8_t e = 0; e < EXTRUDERS; e++) temp_runaway_check(e+1, target_temperature_isr[e], current_temperature_isr[e], soft_pwm[e], false); 299e8: 60 91 19 05 lds r22, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 299ec: 70 e0 ldi r23, 0x00 ; 0 299ee: 90 e0 ldi r25, 0x00 ; 0 299f0: 80 e0 ldi r24, 0x00 ; 0 299f2: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 299f6: 6b 01 movw r12, r22 299f8: 7c 01 movw r14, r24 299fa: 40 90 1a 05 lds r4, 0x051A ; 0x80051a 299fe: 50 90 1b 05 lds r5, 0x051B ; 0x80051b 29a02: 60 90 1c 05 lds r6, 0x051C ; 0x80051c 29a06: 70 90 1d 05 lds r7, 0x051D ; 0x80051d 29a0a: 60 91 1b 06 lds r22, 0x061B ; 0x80061b 29a0e: 70 91 1c 06 lds r23, 0x061C ; 0x80061c 29a12: 07 2e mov r0, r23 29a14: 00 0c add r0, r0 29a16: 88 0b sbc r24, r24 29a18: 99 0b sbc r25, r25 29a1a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29a1e: ab 01 movw r20, r22 29a20: bc 01 movw r22, r24 29a22: a1 2c mov r10, r1 29a24: 93 01 movw r18, r6 29a26: 82 01 movw r16, r4 29a28: 81 e0 ldi r24, 0x01 ; 1 29a2a: 0f 94 fd 45 call 0x28bfa ; 0x28bfa #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 29a2e: 60 91 1a 06 lds r22, 0x061A ; 0x80061a 29a32: 70 e0 ldi r23, 0x00 ; 0 29a34: 90 e0 ldi r25, 0x00 ; 0 29a36: 80 e0 ldi r24, 0x00 ; 0 29a38: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 29a3c: 6b 01 movw r12, r22 29a3e: 7c 01 movw r14, r24 29a40: 40 90 16 06 lds r4, 0x0616 ; 0x800616 29a44: 50 90 17 06 lds r5, 0x0617 ; 0x800617 29a48: 60 90 18 06 lds r6, 0x0618 ; 0x800618 29a4c: 70 90 19 06 lds r7, 0x0619 ; 0x800619 29a50: 60 91 14 06 lds r22, 0x0614 ; 0x800614 29a54: 70 91 15 06 lds r23, 0x0615 ; 0x800615 29a58: 07 2e mov r0, r23 29a5a: 00 0c add r0, r0 29a5c: 88 0b sbc r24, r24 29a5e: 99 0b sbc r25, r25 29a60: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29a64: ab 01 movw r20, r22 29a66: bc 01 movw r22, r24 29a68: aa 24 eor r10, r10 29a6a: a3 94 inc r10 29a6c: 93 01 movw r18, r6 29a6e: 82 01 movw r16, r4 29a70: 80 e0 ldi r24, 0x00 ; 0 29a72: 0f 94 fd 45 call 0x28bfa ; 0x28bfa return true; } static void check() { if(!enabled) return; 29a76: 80 91 20 05 lds r24, 0x0520 ; 0x800520 <_ZN13thermal_modelL7enabledE.lto_priv.471> 29a7a: 88 23 and r24, r24 29a7c: 09 f4 brne .+2 ; 0x29a80 29a7e: bc c0 rjmp .+376 ; 0x29bf8 uint8_t heater_pwm = soft_pwm[0]; 29a80: c0 91 19 05 lds r28, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> uint8_t fan_pwm = soft_pwm_fan; 29a84: d0 91 9f 04 lds r29, 0x049F ; 0x80049f <_ZL12soft_pwm_fan.lto_priv.475> float heater_temp = current_temperature_isr[0]; 29a88: 40 90 1a 05 lds r4, 0x051A ; 0x80051a 29a8c: 50 90 1b 05 lds r5, 0x051B ; 0x80051b 29a90: 60 90 1c 05 lds r6, 0x051C ; 0x80051c 29a94: 70 90 1d 05 lds r7, 0x051D ; 0x80051d float ambient_temp = current_temperature_ambient_isr; 29a98: c0 90 1d 06 lds r12, 0x061D ; 0x80061d 29a9c: d0 90 1e 06 lds r13, 0x061E ; 0x80061e 29aa0: e0 90 1f 06 lds r14, 0x061F ; 0x80061f 29aa4: f0 90 20 06 lds r15, 0x0620 ; 0x800620 // check if a reset is required to seed the model: this needs to be done with valid // ADC values, so we can't do that directly in init() if(data.flag_bits.uninitialized) 29aa8: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29aac: 80 ff sbrs r24, 0 29aae: 72 c0 rjmp .+228 ; 0x29b94 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); 29ab0: 20 91 c4 12 lds r18, 0x12C4 ; 0x8012c4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x36> 29ab4: 30 91 c5 12 lds r19, 0x12C5 ; 0x8012c5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x37> 29ab8: 40 91 c6 12 lds r20, 0x12C6 ; 0x8012c6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x38> 29abc: 50 91 c7 12 lds r21, 0x12C7 ; 0x8012c7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x39> 29ac0: 61 e7 ldi r22, 0x71 ; 113 29ac2: 7d e3 ldi r23, 0x3D ; 61 29ac4: 8a e8 ldi r24, 0x8A ; 138 29ac6: 9e e3 ldi r25, 0x3E ; 62 29ac8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 29acc: 60 93 1b 13 sts 0x131B, r22 ; 0x80131b <_ZN13thermal_modelL4dataE.lto_priv.396+0x8d> 29ad0: 70 93 1c 13 sts 0x131C, r23 ; 0x80131c <_ZN13thermal_modelL4dataE.lto_priv.396+0x8e> 29ad4: 80 93 1d 13 sts 0x131D, r24 ; 0x80131d <_ZN13thermal_modelL4dataE.lto_priv.396+0x8f> 29ad8: 90 93 1e 13 sts 0x131E, r25 ; 0x80131e <_ZN13thermal_modelL4dataE.lto_priv.396+0x90> warn_s = warn * TEMP_MGR_INTV; 29adc: 21 e7 ldi r18, 0x71 ; 113 29ade: 3d e3 ldi r19, 0x3D ; 61 29ae0: 4a e8 ldi r20, 0x8A ; 138 29ae2: 5e e3 ldi r21, 0x3E ; 62 29ae4: 60 91 12 13 lds r22, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 29ae8: 70 91 13 13 lds r23, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 29aec: 80 91 14 13 lds r24, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 29af0: 90 91 15 13 lds r25, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> 29af4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 29af8: 60 93 1f 13 sts 0x131F, r22 ; 0x80131f <_ZN13thermal_modelL4dataE.lto_priv.396+0x91> 29afc: 70 93 20 13 sts 0x1320, r23 ; 0x801320 <_ZN13thermal_modelL4dataE.lto_priv.396+0x92> 29b00: 80 93 21 13 sts 0x1321, r24 ; 0x801321 <_ZN13thermal_modelL4dataE.lto_priv.396+0x93> 29b04: 90 93 22 13 sts 0x1322, r25 ; 0x801322 <_ZN13thermal_modelL4dataE.lto_priv.396+0x94> err_s = err * TEMP_MGR_INTV; 29b08: 21 e7 ldi r18, 0x71 ; 113 29b0a: 3d e3 ldi r19, 0x3D ; 61 29b0c: 4a e8 ldi r20, 0x8A ; 138 29b0e: 5e e3 ldi r21, 0x3E ; 62 29b10: 60 91 16 13 lds r22, 0x1316 ; 0x801316 <_ZN13thermal_modelL4dataE.lto_priv.396+0x88> 29b14: 70 91 17 13 lds r23, 0x1317 ; 0x801317 <_ZN13thermal_modelL4dataE.lto_priv.396+0x89> 29b18: 80 91 18 13 lds r24, 0x1318 ; 0x801318 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8a> 29b1c: 90 91 19 13 lds r25, 0x1319 ; 0x801319 <_ZN13thermal_modelL4dataE.lto_priv.396+0x8b> 29b20: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 29b24: 60 93 23 13 sts 0x1323, r22 ; 0x801323 <_ZN13thermal_modelL4dataE.lto_priv.396+0x95> 29b28: 70 93 24 13 sts 0x1324, r23 ; 0x801324 <_ZN13thermal_modelL4dataE.lto_priv.396+0x96> 29b2c: 80 93 25 13 sts 0x1325, r24 ; 0x801325 <_ZN13thermal_modelL4dataE.lto_priv.396+0x97> 29b30: 90 93 26 13 sts 0x1326, r25 ; 0x801326 <_ZN13thermal_modelL4dataE.lto_priv.396+0x98> dT_lag_size = L / (uint16_t)(TEMP_MGR_INTV * 1000); 29b34: 80 91 cc 12 lds r24, 0x12CC ; 0x8012cc <_ZN13thermal_modelL4dataE.lto_priv.396+0x3e> 29b38: 90 91 cd 12 lds r25, 0x12CD ; 0x8012cd <_ZN13thermal_modelL4dataE.lto_priv.396+0x3f> 29b3c: 6e e0 ldi r22, 0x0E ; 14 29b3e: 71 e0 ldi r23, 0x01 ; 1 29b40: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 29b44: 60 93 ae 12 sts 0x12AE, r22 ; 0x8012ae <_ZN13thermal_modelL4dataE.lto_priv.396+0x20> 29b48: ee e8 ldi r30, 0x8E ; 142 29b4a: f2 e1 ldi r31, 0x12 ; 18 29b4c: 8e ea ldi r24, 0xAE ; 174 29b4e: 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; 29b50: 40 e0 ldi r20, 0x00 ; 0 29b52: 50 e0 ldi r21, 0x00 ; 0 29b54: 60 ec ldi r22, 0xC0 ; 192 29b56: 7f e7 ldi r23, 0x7F ; 127 29b58: 41 93 st Z+, r20 29b5a: 51 93 st Z+, r21 29b5c: 61 93 st Z+, r22 29b5e: 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) 29b60: 8e 17 cp r24, r30 29b62: 9f 07 cpc r25, r31 29b64: c9 f7 brne .-14 ; 0x29b58 dT_lag_buf[i] = NAN; dT_lag_idx = 0; 29b66: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af <_ZN13thermal_modelL4dataE.lto_priv.396+0x21> dT_err_prev = 0; 29b6a: 10 92 b0 12 sts 0x12B0, r1 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 29b6e: 10 92 b1 12 sts 0x12B1, r1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 29b72: 10 92 b2 12 sts 0x12B2, r1 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 29b76: 10 92 b3 12 sts 0x12B3, r1 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> T_prev = NAN; 29b7a: 40 93 b4 12 sts 0x12B4, r20 ; 0x8012b4 <_ZN13thermal_modelL4dataE.lto_priv.396+0x26> 29b7e: 50 93 b5 12 sts 0x12B5, r21 ; 0x8012b5 <_ZN13thermal_modelL4dataE.lto_priv.396+0x27> 29b82: 60 93 b6 12 sts 0x12B6, r22 ; 0x8012b6 <_ZN13thermal_modelL4dataE.lto_priv.396+0x28> 29b86: 70 93 b7 12 sts 0x12B7, r23 ; 0x8012b7 <_ZN13thermal_modelL4dataE.lto_priv.396+0x29> // clear the initialization flag flag_bits.uninitialized = false; 29b8a: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29b8e: 8e 7f andi r24, 0xFE ; 254 29b90: 80 93 1a 13 sts 0x131A, r24 ; 0x80131a <_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); 29b94: 87 01 movw r16, r14 29b96: 76 01 movw r14, r12 29b98: a3 01 movw r20, r6 29b9a: 92 01 movw r18, r4 29b9c: 6d 2f mov r22, r29 29b9e: 8c 2f mov r24, r28 29ba0: 0e 94 b2 db call 0x1b764 ; 0x1b764 // handle errors if(data.flag_bits.error) 29ba4: 80 91 1a 13 lds r24, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29ba8: 81 ff sbrs r24, 1 29baa: 05 c0 rjmp .+10 ; 0x29bb6 set_temp_error(TempErrorSource::hotend, 0, TempErrorType::model); 29bac: 44 e0 ldi r20, 0x04 ; 4 29bae: 60 e0 ldi r22, 0x00 ; 0 29bb0: 80 e0 ldi r24, 0x00 ; 0 29bb2: 0f 94 72 45 call 0x28ae4 ; 0x28ae4 // handle warning conditions as lower-priority but with greater feedback warning_state.assert = data.flag_bits.warning; 29bb6: 90 91 1a 13 lds r25, 0x131A ; 0x80131a <_ZN13thermal_modelL4dataE.lto_priv.396+0x8c> 29bba: 80 91 36 06 lds r24, 0x0636 ; 0x800636 29bbe: 92 fb bst r25, 2 29bc0: 81 f9 bld r24, 1 29bc2: 80 93 36 06 sts 0x0636, r24 ; 0x800636 if(warning_state.assert) { 29bc6: 80 91 36 06 lds r24, 0x0636 ; 0x800636 29bca: 81 ff sbrs r24, 1 29bcc: 15 c0 rjmp .+42 ; 0x29bf8 warning_state.warning = true; 29bce: 80 91 36 06 lds r24, 0x0636 ; 0x800636 29bd2: 81 60 ori r24, 0x01 ; 1 29bd4: 80 93 36 06 sts 0x0636, r24 ; 0x800636 warning_state.dT_err = thermal_model::data.dT_err_prev; 29bd8: 80 91 b0 12 lds r24, 0x12B0 ; 0x8012b0 <_ZN13thermal_modelL4dataE.lto_priv.396+0x22> 29bdc: 90 91 b1 12 lds r25, 0x12B1 ; 0x8012b1 <_ZN13thermal_modelL4dataE.lto_priv.396+0x23> 29be0: a0 91 b2 12 lds r26, 0x12B2 ; 0x8012b2 <_ZN13thermal_modelL4dataE.lto_priv.396+0x24> 29be4: b0 91 b3 12 lds r27, 0x12B3 ; 0x8012b3 <_ZN13thermal_modelL4dataE.lto_priv.396+0x25> 29be8: 80 93 32 06 sts 0x0632, r24 ; 0x800632 29bec: 90 93 33 06 sts 0x0633, r25 ; 0x800633 29bf0: a0 93 34 06 sts 0x0634, r26 ; 0x800634 29bf4: b0 93 35 06 sts 0x0635, r27 ; 0x800635 (int)cur_pwm, (unsigned long)cur_temp_b, (unsigned long)cur_amb_b); } static void log_isr() { if(!log_buf.enabled) return; 29bf8: 80 91 31 06 lds r24, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x10> 29bfc: 88 23 and r24, r24 29bfe: 09 f4 brne .+2 ; 0x29c02 29c00: 3f c0 rjmp .+126 ; 0x29c80 uint32_t stamp = _millis(); 29c02: 0f 94 8b 3f call 0x27f16 ; 0x27f16 uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 29c06: c0 90 21 06 lds r12, 0x0621 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.558> 29c0a: d0 90 22 06 lds r13, 0x0622 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x1> 29c0e: e0 90 23 06 lds r14, 0x0623 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x2> 29c12: f0 90 24 06 lds r15, 0x0624 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x3> log_buf.entry.stamp = stamp; 29c16: 60 93 21 06 sts 0x0621, r22 ; 0x800621 <_ZN13thermal_modelL7log_bufE.lto_priv.558> 29c1a: 70 93 22 06 sts 0x0622, r23 ; 0x800622 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x1> 29c1e: 80 93 23 06 sts 0x0623, r24 ; 0x800623 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x2> 29c22: 90 93 24 06 sts 0x0624, r25 ; 0x800624 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x3> ++log_buf.entry.counter; 29c26: 20 91 26 06 lds r18, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x5> 29c2a: 2f 5f subi r18, 0xFF ; 255 29c2c: 20 93 26 06 sts 0x0626, r18 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x5> static void log_isr() { if(!log_buf.enabled) return; uint32_t stamp = _millis(); uint8_t delta_ms = stamp - log_buf.entry.stamp - (uint32_t)(TEMP_MGR_INTV * 1000); 29c30: 6c 19 sub r22, r12 29c32: 6e 50 subi r22, 0x0E ; 14 log_buf.entry.stamp = stamp; ++log_buf.entry.counter; log_buf.entry.delta_ms = delta_ms; 29c34: 60 93 25 06 sts 0x0625, r22 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x4> log_buf.entry.cur_pwm = soft_pwm[0]; 29c38: 80 91 19 05 lds r24, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 29c3c: 80 93 27 06 sts 0x0627, r24 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x6> log_buf.entry.cur_temp = current_temperature_isr[0]; 29c40: 80 91 1a 05 lds r24, 0x051A ; 0x80051a 29c44: 90 91 1b 05 lds r25, 0x051B ; 0x80051b 29c48: a0 91 1c 05 lds r26, 0x051C ; 0x80051c 29c4c: b0 91 1d 05 lds r27, 0x051D ; 0x80051d 29c50: 80 93 28 06 sts 0x0628, r24 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x7> 29c54: 90 93 29 06 sts 0x0629, r25 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x8> 29c58: a0 93 2a 06 sts 0x062A, r26 ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x9> 29c5c: b0 93 2b 06 sts 0x062B, r27 ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xa> log_buf.entry.cur_amb = current_temperature_ambient_isr; 29c60: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 29c64: 90 91 1e 06 lds r25, 0x061E ; 0x80061e 29c68: a0 91 1f 06 lds r26, 0x061F ; 0x80061f 29c6c: b0 91 20 06 lds r27, 0x0620 ; 0x800620 29c70: 80 93 2c 06 sts 0x062C, r24 ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xb> 29c74: 90 93 2d 06 sts 0x062D, r25 ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xc> 29c78: a0 93 2e 06 sts 0x062E, r26 ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xd> 29c7c: b0 93 2f 06 sts 0x062F, r27 ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xe> thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 29c80: 80 91 3e 02 lds r24, 0x023E ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> 29c84: 88 23 and r24, r24 29c86: 91 f0 breq .+36 ; 0x29cac temp_mgr_pid(); } 29c88: df 91 pop r29 29c8a: cf 91 pop r28 29c8c: 1f 91 pop r17 29c8e: 0f 91 pop r16 29c90: ff 90 pop r15 29c92: ef 90 pop r14 29c94: df 90 pop r13 29c96: cf 90 pop r12 29c98: af 90 pop r10 29c9a: 7f 90 pop r7 29c9c: 6f 90 pop r6 29c9e: 5f 90 pop r5 29ca0: 4f 90 pop r4 #endif #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); 29ca2: 0d 94 1a 1f jmp 0x23e34 ; 0x23e34 // *** end of 'common' part #ifdef AMBIENT_THERMISTOR } else { // ambient temperature is standard check_min_temp_heater0(); 29ca6: 0f 94 ec 45 call 0x28bd8 ; 0x28bd8 29caa: 8e ce rjmp .-740 ; 0x299c8 #endif // PID regulation if (pid_tuning_finished) temp_mgr_pid(); } 29cac: df 91 pop r29 29cae: cf 91 pop r28 29cb0: 1f 91 pop r17 29cb2: 0f 91 pop r16 29cb4: ff 90 pop r15 29cb6: ef 90 pop r14 29cb8: df 90 pop r13 29cba: cf 90 pop r12 29cbc: af 90 pop r10 29cbe: 7f 90 pop r7 29cc0: 6f 90 pop r6 29cc2: 5f 90 pop r5 29cc4: 4f 90 pop r4 29cc6: 08 95 ret 00029cc8 <__vector_47>: ISR(TIMERx_COMPA_vect) { 29cc8: 1f 92 push r1 29cca: 0f 92 push r0 29ccc: 0f b6 in r0, 0x3f ; 63 29cce: 0f 92 push r0 29cd0: 11 24 eor r1, r1 29cd2: 0b b6 in r0, 0x3b ; 59 29cd4: 0f 92 push r0 29cd6: 2f 93 push r18 29cd8: 3f 93 push r19 29cda: 4f 93 push r20 29cdc: 5f 93 push r21 29cde: 6f 93 push r22 29ce0: 7f 93 push r23 29ce2: 8f 93 push r24 29ce4: 9f 93 push r25 29ce6: af 93 push r26 29ce8: bf 93 push r27 29cea: ef 93 push r30 29cec: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 29cee: 80 91 1f 05 lds r24, 0x051F ; 0x80051f <_ZL16adc_values_ready.lto_priv.472> 29cf2: 88 23 and r24, r24 29cf4: 91 f0 breq .+36 ; 0x29d1a <__vector_47+0x52> adc_values_ready = false; 29cf6: 10 92 1f 05 sts 0x051F, r1 ; 0x80051f <_ZL16adc_values_ready.lto_priv.472> adc_start_cycle(); 29cfa: 0e 94 84 8f call 0x11f08 ; 0x11f08 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 29cfe: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29d02: 8d 7f andi r24, 0xFD ; 253 29d04: 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(); 29d08: 78 94 sei NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { temp_mgr_isr(); 29d0a: 0f 94 fd 4b call 0x297fa ; 0x297fa (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 29d0e: f8 94 cli } ENABLE_TEMP_MGR_INTERRUPT(); 29d10: 80 91 73 00 lds r24, 0x0073 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> 29d14: 82 60 ori r24, 0x02 ; 2 29d16: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7c2073> } 29d1a: ff 91 pop r31 29d1c: ef 91 pop r30 29d1e: bf 91 pop r27 29d20: af 91 pop r26 29d22: 9f 91 pop r25 29d24: 8f 91 pop r24 29d26: 7f 91 pop r23 29d28: 6f 91 pop r22 29d2a: 5f 91 pop r21 29d2c: 4f 91 pop r20 29d2e: 3f 91 pop r19 29d30: 2f 91 pop r18 29d32: 0f 90 pop r0 29d34: 0b be out 0x3b, r0 ; 59 29d36: 0f 90 pop r0 29d38: 0f be out 0x3f, r0 ; 63 29d3a: 0f 90 pop r0 29d3c: 1f 90 pop r1 29d3e: 18 95 reti 00029d40 : } void handle_temp_error(); void manage_heater() { 29d40: 6f 92 push r6 29d42: 7f 92 push r7 29d44: 8f 92 push r8 29d46: 9f 92 push r9 29d48: af 92 push r10 29d4a: bf 92 push r11 29d4c: cf 92 push r12 29d4e: df 92 push r13 29d50: ef 92 push r14 29d52: ff 92 push r15 29d54: 0f 93 push r16 29d56: 1f 93 push r17 29d58: cf 93 push r28 29d5a: df 93 push r29 29d5c: 1f 92 push r1 29d5e: cd b7 in r28, 0x3d ; 61 29d60: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 29d62: 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) 29d64: 80 91 ff 05 lds r24, 0x05FF ; 0x8005ff 29d68: 88 23 and r24, r24 29d6a: 09 f4 brne .+2 ; 0x29d6e 29d6c: bb c0 rjmp .+374 ; 0x29ee4 return; // syncronize temperatures with isr updateTemperatures(); 29d6e: 0f 94 c1 48 call 0x29182 ; 0x29182 #ifdef THERMAL_MODEL // handle model warnings first, so not to override the error handler if(thermal_model::warning_state.warning) 29d72: 80 91 36 06 lds r24, 0x0636 ; 0x800636 29d76: 80 ff sbrs r24, 0 29d78: 51 c0 rjmp .+162 ; 0x29e1c } static void handle_warning() { // update values float warn = data.warn; 29d7a: 10 91 12 13 lds r17, 0x1312 ; 0x801312 <_ZN13thermal_modelL4dataE.lto_priv.396+0x84> 29d7e: 00 91 13 13 lds r16, 0x1313 ; 0x801313 <_ZN13thermal_modelL4dataE.lto_priv.396+0x85> 29d82: b0 90 14 13 lds r11, 0x1314 ; 0x801314 <_ZN13thermal_modelL4dataE.lto_priv.396+0x86> 29d86: a0 90 15 13 lds r10, 0x1315 ; 0x801315 <_ZN13thermal_modelL4dataE.lto_priv.396+0x87> float dT_err; { TempMgrGuard temp_mgr_guard; 29d8a: ce 01 movw r24, r28 29d8c: 01 96 adiw r24, 0x01 ; 1 29d8e: 0f 94 de 47 call 0x28fbc ; 0x28fbc dT_err = warning_state.dT_err; 29d92: c0 90 32 06 lds r12, 0x0632 ; 0x800632 29d96: d0 90 33 06 lds r13, 0x0633 ; 0x800633 29d9a: e0 90 34 06 lds r14, 0x0634 ; 0x800634 29d9e: f0 90 35 06 lds r15, 0x0635 ; 0x800635 { // update values float warn = data.warn; float dT_err; { TempMgrGuard temp_mgr_guard; 29da2: ce 01 movw r24, r28 29da4: 01 96 adiw r24, 0x01 ; 1 29da6: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 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); 29daa: af 92 push r10 29dac: bf 92 push r11 29dae: 0f 93 push r16 29db0: 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 29db2: 21 e7 ldi r18, 0x71 ; 113 29db4: 3d e3 ldi r19, 0x3D ; 61 29db6: 4a e8 ldi r20, 0x8A ; 138 29db8: 5e e3 ldi r21, 0x3E ; 62 29dba: c7 01 movw r24, r14 29dbc: b6 01 movw r22, r12 29dbe: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> printf_P(PSTR("TM: error |%f|>%f\n"), (double)dT_err, (double)warn); 29dc2: 9f 93 push r25 29dc4: 8f 93 push r24 29dc6: 7f 93 push r23 29dc8: 6f 93 push r22 29dca: 87 e5 ldi r24, 0x57 ; 87 29dcc: 9c e9 ldi r25, 0x9C ; 156 29dce: 9f 93 push r25 29dd0: 8f 93 push r24 29dd2: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 static bool first = true; if(warning_state.assert) { 29dd6: 90 91 36 06 lds r25, 0x0636 ; 0x800636 29dda: 0f b6 in r0, 0x3f ; 63 29ddc: f8 94 cli 29dde: de bf out 0x3e, r29 ; 62 29de0: 0f be out 0x3f, r0 ; 63 29de2: cd bf out 0x3d, r28 ; 61 29de4: 80 91 3d 02 lds r24, 0x023D ; 0x80023d <_ZN13thermal_modelL9warn_beepE.lto_priv.470> 29de8: 91 ff sbrs r25, 1 29dea: 93 c0 rjmp .+294 ; 0x29f12 if (first) { 29dec: 90 91 7b 02 lds r25, 0x027B ; 0x80027b 29df0: 99 23 and r25, r25 29df2: 09 f4 brne .+2 ; 0x29df6 29df4: 87 c0 rjmp .+270 ; 0x29f04 if(warn_beep) { 29df6: 88 23 and r24, r24 29df8: 79 f0 breq .+30 ; 0x29e18 lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); 29dfa: 8f e5 ldi r24, 0x5F ; 95 29dfc: 99 e4 ldi r25, 0x49 ; 73 29dfe: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 29e02: 61 e0 ldi r22, 0x01 ; 1 29e04: 0f 94 c7 06 call 0x20d8e ; 0x20d8e WRITE(BEEPER, HIGH); 29e08: 9f b7 in r25, 0x3f ; 63 29e0a: f8 94 cli 29e0c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e10: 84 60 ori r24, 0x04 ; 4 29e12: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29e16: 9f bf out 0x3f, r25 ; 63 } first = false; 29e18: 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) 29e1c: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29e20: 88 23 and r24, r24 29e22: 89 f0 breq .+34 ; 0x29e46 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29e24: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29e28: 82 95 swap r24 29e2a: 86 95 lsr r24 29e2c: 87 70 andi r24, 0x07 ; 7 29e2e: 84 30 cpi r24, 0x04 ; 4 29e30: 08 f0 brcs .+2 ; 0x29e34 29e32: 82 c0 rjmp .+260 ; 0x29f38 29e34: 82 30 cpi r24, 0x02 ; 2 29e36: 08 f0 brcs .+2 ; 0x29e3a 29e38: 1d c1 rjmp .+570 ; 0x2a074 29e3a: 88 23 and r24, r24 29e3c: 09 f4 brne .+2 ; 0x29e40 29e3e: f4 c0 rjmp .+488 ; 0x2a028 29e40: 81 30 cpi r24, 0x01 ; 1 29e42: 09 f4 brne .+2 ; 0x29e46 29e44: 94 c0 rjmp .+296 ; 0x29f6e // handle temperature errors if(temp_error_state.v) handle_temp_error(); // periodically check fans checkFans(); 29e46: 0e 94 8d 81 call 0x1031a ; 0x1031a } #ifdef THERMAL_MODEL_DEBUG static void log_usr() { if(!log_buf.enabled) return; 29e4a: 80 91 31 06 lds r24, 0x0631 ; 0x800631 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x10> 29e4e: 88 23 and r24, r24 29e50: 09 f4 brne .+2 ; 0x29e54 29e52: 48 c0 rjmp .+144 ; 0x29ee4 uint8_t counter = log_buf.entry.counter; 29e54: 80 91 26 06 lds r24, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x5> if (counter == log_buf.serial) return; 29e58: 70 90 30 06 lds r7, 0x0630 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xf> 29e5c: 87 15 cp r24, r7 29e5e: 09 f4 brne .+2 ; 0x29e62 29e60: 41 c0 rjmp .+130 ; 0x29ee4 // 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; 29e62: ce 01 movw r24, r28 29e64: 01 96 adiw r24, 0x01 ; 1 29e66: 0f 94 de 47 call 0x28fbc ; 0x28fbc delta_ms = log_buf.entry.delta_ms; 29e6a: 00 91 25 06 lds r16, 0x0625 ; 0x800625 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x4> counter = log_buf.entry.counter; 29e6e: 10 91 26 06 lds r17, 0x0626 ; 0x800626 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x5> cur_pwm = log_buf.entry.cur_pwm; 29e72: 60 90 27 06 lds r6, 0x0627 ; 0x800627 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x6> cur_temp = log_buf.entry.cur_temp; 29e76: c0 90 28 06 lds r12, 0x0628 ; 0x800628 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x7> 29e7a: d0 90 29 06 lds r13, 0x0629 ; 0x800629 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x8> 29e7e: e0 90 2a 06 lds r14, 0x062A ; 0x80062a <_ZN13thermal_modelL7log_bufE.lto_priv.558+0x9> 29e82: f0 90 2b 06 lds r15, 0x062B ; 0x80062b <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xa> cur_amb = log_buf.entry.cur_amb; 29e86: 80 90 2c 06 lds r8, 0x062C ; 0x80062c <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xb> 29e8a: 90 90 2d 06 lds r9, 0x062D ; 0x80062d <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xc> 29e8e: a0 90 2e 06 lds r10, 0x062E ; 0x80062e <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xd> 29e92: b0 90 2f 06 lds r11, 0x062F ; 0x80062f <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xe> // avoid strict-aliasing warnings union { float cur_temp; uint32_t cur_temp_b; }; union { float cur_amb; uint32_t cur_amb_b; }; { TempMgrGuard temp_mgr_guard; 29e96: ce 01 movw r24, r28 29e98: 01 96 adiw r24, 0x01 ; 1 29e9a: 0f 94 d1 47 call 0x28fa2 ; 0x28fa2 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; 29e9e: 10 93 30 06 sts 0x0630, r17 ; 0x800630 <_ZN13thermal_modelL7log_bufE.lto_priv.558+0xf> printf_P(PSTR("TML %d %d %x %lx %lx\n"), (unsigned)d - 1, (int)delta_ms + 1, 29ea2: bf 92 push r11 29ea4: af 92 push r10 29ea6: 9f 92 push r9 29ea8: 8f 92 push r8 29eaa: ff 92 push r15 29eac: ef 92 push r14 29eae: df 92 push r13 29eb0: cf 92 push r12 29eb2: 1f 92 push r1 29eb4: 6f 92 push r6 29eb6: 80 2f mov r24, r16 29eb8: 00 0f add r16, r16 29eba: 99 0b sbc r25, r25 29ebc: 01 96 adiw r24, 0x01 ; 1 29ebe: 9f 93 push r25 29ec0: 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; 29ec2: 81 2f mov r24, r17 29ec4: 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, 29ec6: 81 50 subi r24, 0x01 ; 1 29ec8: 99 0b sbc r25, r25 29eca: 9f 93 push r25 29ecc: 8f 93 push r24 29ece: 8a ed ldi r24, 0xDA ; 218 29ed0: 9b e9 ldi r25, 0x9B ; 155 29ed2: 9f 93 push r25 29ed4: 8f 93 push r24 29ed6: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 29eda: 0f b6 in r0, 0x3f ; 63 29edc: f8 94 cli 29ede: de bf out 0x3e, r29 ; 62 29ee0: 0f be out 0x3f, r0 ; 63 29ee2: cd bf out 0x3d, r28 ; 61 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 29ee4: 0f 90 pop r0 29ee6: df 91 pop r29 29ee8: cf 91 pop r28 29eea: 1f 91 pop r17 29eec: 0f 91 pop r16 29eee: ff 90 pop r15 29ef0: ef 90 pop r14 29ef2: df 90 pop r13 29ef4: cf 90 pop r12 29ef6: bf 90 pop r11 29ef8: af 90 pop r10 29efa: 9f 90 pop r9 29efc: 8f 90 pop r8 29efe: 7f 90 pop r7 29f00: 6f 90 pop r6 29f02: 08 95 ret lcd_setalertstatuspgm(_T(MSG_THERMAL_ANOMALY), LCD_STATUS_INFO); WRITE(BEEPER, HIGH); } first = false; } else { if(warn_beep) TOGGLE(BEEPER); 29f04: 88 23 and r24, r24 29f06: 09 f4 brne .+2 ; 0x29f0a 29f08: 89 cf rjmp .-238 ; 0x29e1c 29f0a: 84 e0 ldi r24, 0x04 ; 4 29f0c: 80 93 00 01 sts 0x0100, r24 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 29f10: 85 cf rjmp .-246 ; 0x29e1c } } else { // warning cleared, reset state warning_state.warning = false; 29f12: 90 91 36 06 lds r25, 0x0636 ; 0x800636 29f16: 9e 7f andi r25, 0xFE ; 254 29f18: 90 93 36 06 sts 0x0636, r25 ; 0x800636 if(warn_beep) WRITE(BEEPER, LOW); 29f1c: 88 23 and r24, r24 29f1e: 41 f0 breq .+16 ; 0x29f30 29f20: 9f b7 in r25, 0x3f ; 63 29f22: f8 94 cli 29f24: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f28: 8b 7f andi r24, 0xFB ; 251 29f2a: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f2e: 9f bf out 0x3f, r25 ; 63 first = true; 29f30: 81 e0 ldi r24, 0x01 ; 1 29f32: 80 93 7b 02 sts 0x027B, r24 ; 0x80027b 29f36: 72 cf rjmp .-284 ; 0x29e1c #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 29f38: 84 30 cpi r24, 0x04 ; 4 29f3a: 09 f0 breq .+2 ; 0x29f3e 29f3c: 84 cf rjmp .-248 ; 0x29e46 #endif } break; #ifdef THERMAL_MODEL case TempErrorType::model: if(temp_error_state.assert) { 29f3e: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29f42: 81 ff sbrs r24, 1 29f44: b4 c0 rjmp .+360 ; 0x2a0ae if(IsStopped() == false) { 29f46: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29f4a: 81 11 cpse r24, r1 29f4c: 04 c0 rjmp .+8 ; 0x29f56 SERIAL_ECHOLNPGM("TM: error triggered!"); 29f4e: 82 e4 ldi r24, 0x42 ; 66 29f50: 9c e9 ldi r25, 0x9C ; 156 29f52: 0e 94 06 7b call 0xf60c ; 0xf60c } ThermalStop(true); 29f56: 81 e0 ldi r24, 0x01 ; 1 29f58: 0e 94 37 7b call 0xf66e ; 0xf66e WRITE(BEEPER, HIGH); 29f5c: 9f b7 in r25, 0x3f ; 63 29f5e: f8 94 cli 29f60: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f64: 84 60 ori r24, 0x04 ; 4 29f66: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 29f6a: 9f bf out 0x3f, r25 ; 63 29f6c: 6c cf rjmp .-296 ; 0x29e46 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 29f6e: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29f72: 86 95 lsr r24 29f74: 86 95 lsr r24 29f76: 83 70 andi r24, 0x03 ; 3 29f78: 81 30 cpi r24, 0x01 ; 1 29f7a: d9 f1 breq .+118 ; 0x29ff2 29f7c: 58 f0 brcs .+22 ; 0x29f94 29f7e: 82 30 cpi r24, 0x02 ; 2 29f80: 09 f0 breq .+2 ; 0x29f84 29f82: 61 cf rjmp .-318 ; 0x29e46 } ThermalStop(); } static void ambient_min_temp_error(void) { if(IsStopped() == false) { 29f84: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29f88: 81 11 cpse r24, r1 29f8a: 14 c0 rjmp .+40 ; 0x29fb4 temp_error_messagepgm(PSTR("MINTEMP AMB")); 29f8c: 61 e0 ldi r22, 0x01 ; 1 29f8e: 84 e0 ldi r24, 0x04 ; 4 29f90: 9c e9 ldi r25, 0x9C ; 156 29f92: 0e c0 rjmp .+28 ; 0x29fb0 // 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) { 29f94: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29f98: 81 ff sbrs r24, 1 29f9a: 10 c0 rjmp .+32 ; 0x29fbc min_temp_error(temp_error_state.index); 29f9c: 60 91 1e 05 lds r22, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29fa0: 62 95 swap r22 29fa2: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 29fa4: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29fa8: 81 11 cpse r24, r1 29faa: 04 c0 rjmp .+8 ; 0x29fb4 temp_error_messagepgm(err, e); 29fac: 80 ef ldi r24, 0xF0 ; 240 29fae: 9b e9 ldi r25, 0x9B ; 155 29fb0: 0f 94 3c 42 call 0x28478 ; 0x28478 prusa_statistics(92); } ThermalStop(); 29fb4: 80 e0 ldi r24, 0x00 ; 0 29fb6: 0e 94 37 7b call 0xf66e ; 0xf66e 29fba: 45 cf rjmp .-374 ; 0x29e46 // 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); 29fbc: 60 91 9d 04 lds r22, 0x049D ; 0x80049d <_ZL8minttemp.lto_priv.476> 29fc0: 70 91 9e 04 lds r23, 0x049E ; 0x80049e <_ZL8minttemp.lto_priv.476+0x1> 29fc4: 6b 5f subi r22, 0xFB ; 251 29fc6: 7f 4f sbci r23, 0xFF ; 255 29fc8: 07 2e mov r0, r23 29fca: 00 0c add r0, r0 29fcc: 88 0b sbc r24, r24 29fce: 99 0b sbc r25, r25 29fd0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 29fd4: 8b 01 movw r16, r22 29fd6: 9c 01 movw r18, r24 29fd8: 40 91 61 0e lds r20, 0x0E61 ; 0x800e61 29fdc: 50 91 62 0e lds r21, 0x0E62 ; 0x800e62 29fe0: 60 91 63 0e lds r22, 0x0E63 ; 0x800e63 29fe4: 70 91 64 0e lds r23, 0x0E64 ; 0x800e64 29fe8: 87 e7 ldi r24, 0x77 ; 119 29fea: 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); 29fec: 0f 94 38 32 call 0x26470 ; 0x26470 29ff0: 2a cf rjmp .-428 ; 0x29e46 // 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) { 29ff2: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 29ff6: 81 ff sbrs r24, 1 29ff8: 08 c0 rjmp .+16 ; 0x2a00a ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 29ffa: 80 91 14 05 lds r24, 0x0514 ; 0x800514 29ffe: 81 11 cpse r24, r1 2a000: d9 cf rjmp .-78 ; 0x29fb4 temp_error_messagepgm(err); 2a002: 61 e0 ldi r22, 0x01 ; 1 2a004: 88 ef ldi r24, 0xF8 ; 248 2a006: 9b e9 ldi r25, 0x9B ; 155 2a008: d3 cf rjmp .-90 ; 0x29fb0 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); 2a00a: 40 91 f1 04 lds r20, 0x04F1 ; 0x8004f1 2a00e: 50 91 f2 04 lds r21, 0x04F2 ; 0x8004f2 2a012: 60 91 f3 04 lds r22, 0x04F3 ; 0x8004f3 2a016: 70 91 f4 04 lds r23, 0x04F4 ; 0x8004f4 2a01a: 00 e0 ldi r16, 0x00 ; 0 2a01c: 10 e0 ldi r17, 0x00 ; 0 2a01e: 20 e7 ldi r18, 0x70 ; 112 2a020: 31 e4 ldi r19, 0x41 ; 65 2a022: 83 e7 ldi r24, 0x73 ; 115 2a024: 92 e0 ldi r25, 0x02 ; 2 2a026: e2 cf rjmp .-60 ; 0x29fec break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 2a028: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 2a02c: 86 95 lsr r24 2a02e: 86 95 lsr r24 2a030: 83 70 andi r24, 0x03 ; 3 2a032: 81 30 cpi r24, 0x01 ; 1 2a034: b9 f0 breq .+46 ; 0x2a064 2a036: 58 f0 brcs .+22 ; 0x2a04e 2a038: 82 30 cpi r24, 0x02 ; 2 2a03a: 09 f0 breq .+2 ; 0x2a03e 2a03c: 04 cf rjmp .-504 ; 0x29e46 } #ifdef AMBIENT_THERMISTOR static void ambient_max_temp_error(void) { if(IsStopped() == false) { 2a03e: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2a042: 81 11 cpse r24, r1 2a044: b7 cf rjmp .-146 ; 0x29fb4 temp_error_messagepgm(PSTR("MAXTEMP AMB")); 2a046: 61 e0 ldi r22, 0x01 ; 1 2a048: 84 e2 ldi r24, 0x24 ; 36 2a04a: 9c e9 ldi r25, 0x9C ; 156 2a04c: b1 cf rjmp .-158 ; 0x29fb0 } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 2a04e: 60 91 1e 05 lds r22, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 2a052: 62 95 swap r22 2a054: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 2a056: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2a05a: 81 11 cpse r24, r1 2a05c: ab cf rjmp .-170 ; 0x29fb4 temp_error_messagepgm(PSTR("MAXTEMP"), e); 2a05e: 80 e1 ldi r24, 0x10 ; 16 2a060: 9c e9 ldi r25, 0x9C ; 156 2a062: a6 cf rjmp .-180 ; 0x29fb0 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 2a064: 80 91 14 05 lds r24, 0x0514 ; 0x800514 2a068: 81 11 cpse r24, r1 2a06a: a4 cf rjmp .-184 ; 0x29fb4 temp_error_messagepgm(PSTR("MAXTEMP BED")); 2a06c: 61 e0 ldi r22, 0x01 ; 1 2a06e: 88 e1 ldi r24, 0x18 ; 24 2a070: 9c e9 ldi r25, 0x9C ; 156 2a072: 9e cf rjmp .-196 ; 0x29fb0 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 2a074: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 2a078: 86 95 lsr r24 2a07a: 86 95 lsr r24 2a07c: 83 70 andi r24, 0x03 ; 3 2a07e: 82 30 cpi r24, 0x02 ; 2 2a080: 08 f0 brcs .+2 ; 0x2a084 2a082: e1 ce rjmp .-574 ; 0x29e46 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 2a084: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 2a088: 86 95 lsr r24 2a08a: 86 95 lsr r24 2a08c: 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), 2a08e: 90 91 1e 05 lds r25, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 2a092: 92 95 swap r25 2a094: 96 95 lsr r25 2a096: 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( 2a098: 61 e0 ldi r22, 0x01 ; 1 2a09a: 81 30 cpi r24, 0x01 ; 1 2a09c: 09 f0 breq .+2 ; 0x2a0a0 2a09e: 60 e0 ldi r22, 0x00 ; 0 2a0a0: 81 e0 ldi r24, 0x01 ; 1 2a0a2: 92 30 cpi r25, 0x02 ; 2 2a0a4: 09 f0 breq .+2 ; 0x2a0a8 2a0a6: 80 e0 ldi r24, 0x00 ; 0 2a0a8: 0f 94 71 32 call 0x264e2 ; 0x264e2 2a0ac: cc ce rjmp .-616 ; 0x29e46 SERIAL_ECHOLNPGM("TM: error triggered!"); } ThermalStop(true); WRITE(BEEPER, HIGH); } else { temp_error_state.v = 0; 2a0ae: 10 92 1e 05 sts 0x051E, r1 ; 0x80051e <_ZL16temp_error_state.lto_priv.469> WRITE(BEEPER, LOW); 2a0b2: 9f b7 in r25, 0x3f ; 63 2a0b4: f8 94 cli 2a0b6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a0ba: 8b 7f andi r24, 0xFB ; 251 2a0bc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2a0c0: 9f bf out 0x3f, r25 ; 63 // hotend error was transitory and disappeared, re-enable bed if (!target_temperature_bed) 2a0c2: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 2a0c6: 90 91 6c 0e lds r25, 0x0E6C ; 0x800e6c 2a0ca: 89 2b or r24, r25 2a0cc: 39 f4 brne .+14 ; 0x2a0dc target_temperature_bed = saved_bed_temperature; 2a0ce: 80 91 af 05 lds r24, 0x05AF ; 0x8005af 2a0d2: 90 e0 ldi r25, 0x00 ; 0 2a0d4: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 2a0d8: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b SERIAL_ECHOLNPGM("TM: error cleared"); 2a0dc: 80 e3 ldi r24, 0x30 ; 48 2a0de: 9c e9 ldi r25, 0x9C ; 156 2a0e0: 0e 94 06 7b call 0xf60c ; 0xf60c 2a0e4: b0 ce rjmp .-672 ; 0x29e46 0002a0e6 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 2a0e6: 4f 92 push r4 2a0e8: 5f 92 push r5 2a0ea: 6f 92 push r6 2a0ec: 7f 92 push r7 2a0ee: 8f 92 push r8 2a0f0: 9f 92 push r9 2a0f2: af 92 push r10 2a0f4: bf 92 push r11 2a0f6: cf 92 push r12 2a0f8: df 92 push r13 2a0fa: ef 92 push r14 2a0fc: ff 92 push r15 2a0fe: 6c 01 movw r12, r24 bool bDelayed; long nTime0 = _millis()/1000; 2a100: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a104: 28 ee ldi r18, 0xE8 ; 232 2a106: 33 e0 ldi r19, 0x03 ; 3 2a108: 40 e0 ldi r20, 0x00 ; 0 2a10a: 50 e0 ldi r21, 0x00 ; 0 2a10c: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 2a110: 29 01 movw r4, r18 2a112: 3a 01 movw r6, r20 lcd_consume_click(); 2a114: 0e 94 ad 71 call 0xe35a ; 0xe35a KEEPALIVE_STATE(PAUSED_FOR_USER); 2a118: 84 e0 ldi r24, 0x04 ; 4 2a11a: 80 93 96 02 sts 0x0296, r24 ; 0x800296 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 2a11e: f1 2c mov r15, r1 2a120: e1 2c mov r14, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 2a122: 0f 94 a0 4e call 0x29d40 ; 0x29d40 manage_inactivity(true); 2a126: 81 e0 ldi r24, 0x01 ; 1 2a128: 0e 94 e2 8b call 0x117c4 ; 0x117c4 bDelayed = ((_millis()/1000-nTime0) > nDelay); 2a12c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a130: 28 ee ldi r18, 0xE8 ; 232 2a132: 33 e0 ldi r19, 0x03 ; 3 2a134: 40 e0 ldi r20, 0x00 ; 0 2a136: 50 e0 ldi r21, 0x00 ; 0 2a138: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 2a13c: 49 01 movw r8, r18 2a13e: 5a 01 movw r10, r20 2a140: 84 18 sub r8, r4 2a142: 95 08 sbc r9, r5 2a144: a6 08 sbc r10, r6 2a146: b7 08 sbc r11, r7 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click if (lcd_clicked() || bDelayed) { 2a148: 0e 94 b2 71 call 0xe364 ; 0xe364 2a14c: 81 11 cpse r24, r1 2a14e: 07 c0 rjmp .+14 ; 0x2a15e 2a150: c8 14 cp r12, r8 2a152: d9 04 cpc r13, r9 2a154: ea 04 cpc r14, r10 2a156: fb 04 cpc r15, r11 2a158: 20 f7 brcc .-56 ; 0x2a122 2a15a: 81 e0 ldi r24, 0x01 ; 1 2a15c: 07 c0 rjmp .+14 ; 0x2a16c 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 2a15e: 81 e0 ldi r24, 0x01 ; 1 2a160: c8 14 cp r12, r8 2a162: d9 04 cpc r13, r9 2a164: ea 04 cpc r14, r10 2a166: fb 04 cpc r15, r11 2a168: 08 f0 brcs .+2 ; 0x2a16c 2a16a: 80 e0 ldi r24, 0x00 ; 0 if (lcd_clicked() || bDelayed) { KEEPALIVE_STATE(IN_HANDLER); 2a16c: 92 e0 ldi r25, 0x02 ; 2 2a16e: 90 93 96 02 sts 0x0296, r25 ; 0x800296 return(!bDelayed); } } } 2a172: 91 e0 ldi r25, 0x01 ; 1 2a174: 89 27 eor r24, r25 2a176: ff 90 pop r15 2a178: ef 90 pop r14 2a17a: df 90 pop r13 2a17c: cf 90 pop r12 2a17e: bf 90 pop r11 2a180: af 90 pop r10 2a182: 9f 90 pop r9 2a184: 8f 90 pop r8 2a186: 7f 90 pop r7 2a188: 6f 90 pop r6 2a18a: 5f 90 pop r5 2a18c: 4f 90 pop r4 2a18e: 08 95 ret 0002a190 : #endif } static void waiting_handler() { manage_heater(); 2a190: 0f 94 a0 4e call 0x29d40 ; 0x29d40 host_keepalive(); 2a194: 0e 94 32 81 call 0x10264 ; 0x10264 host_autoreport(); 2a198: 0e 94 e3 7a call 0xf5c6 ; 0xf5c6 checkFans(); 2a19c: 0e 94 8d 81 call 0x1031a ; 0x1031a lcd_update(0); 2a1a0: 80 e0 ldi r24, 0x00 ; 0 2a1a2: 0c 94 5c 6f jmp 0xdeb8 ; 0xdeb8 0002a1a6 : } } static void __attribute__((noinline)) wait_temp() { while(current_temperature[0] < (target_temperature[0] - TEMP_HYSTERESIS)) { 2a1a6: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 2a1aa: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 2a1ae: 65 50 subi r22, 0x05 ; 5 2a1b0: 71 09 sbc r23, r1 2a1b2: 07 2e mov r0, r23 2a1b4: 00 0c add r0, r0 2a1b6: 88 0b sbc r24, r24 2a1b8: 99 0b sbc r25, r25 2a1ba: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 2a1be: 9b 01 movw r18, r22 2a1c0: ac 01 movw r20, r24 2a1c2: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2a1c6: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2a1ca: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2a1ce: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2a1d2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 2a1d6: 87 ff sbrs r24, 7 2a1d8: 07 c0 rjmp .+14 ; 0x2a1e8 if(temp_error_state.v) break; 2a1da: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 2a1de: 81 11 cpse r24, r1 2a1e0: 03 c0 rjmp .+6 ; 0x2a1e8 waiting_handler(); 2a1e2: 0f 94 c8 50 call 0x2a190 ; 0x2a190 2a1e6: df cf rjmp .-66 ; 0x2a1a6 } } 2a1e8: 08 95 ret 0002a1ea : checkFans(); lcd_update(0); } static void wait(unsigned ms) { 2a1ea: cf 92 push r12 2a1ec: df 92 push r13 2a1ee: ef 92 push r14 2a1f0: ff 92 push r15 2a1f2: 7c 01 movw r14, r24 unsigned long mark = _millis() + ms; 2a1f4: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a1f8: 9b 01 movw r18, r22 2a1fa: ac 01 movw r20, r24 2a1fc: 2e 0d add r18, r14 2a1fe: 3f 1d adc r19, r15 2a200: 41 1d adc r20, r1 2a202: 51 1d adc r21, r1 2a204: 69 01 movw r12, r18 2a206: 7a 01 movw r14, r20 while(_millis() < mark) { 2a208: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a20c: 6c 15 cp r22, r12 2a20e: 7d 05 cpc r23, r13 2a210: 8e 05 cpc r24, r14 2a212: 9f 05 cpc r25, r15 2a214: 38 f4 brcc .+14 ; 0x2a224 if(temp_error_state.v) break; 2a216: 80 91 1e 05 lds r24, 0x051E ; 0x80051e <_ZL16temp_error_state.lto_priv.469> 2a21a: 81 11 cpse r24, r1 2a21c: 03 c0 rjmp .+6 ; 0x2a224 waiting_handler(); 2a21e: 0f 94 c8 50 call 0x2a190 ; 0x2a190 2a222: f2 cf rjmp .-28 ; 0x2a208 } } 2a224: ff 90 pop r15 2a226: ef 90 pop r14 2a228: df 90 pop r13 2a22a: cf 90 pop r12 2a22c: 08 95 ret 0002a22e : 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; 2a22e: 20 91 da 06 lds r18, 0x06DA ; 0x8006da 2a232: 30 91 db 06 lds r19, 0x06DB ; 0x8006db 2a236: 40 91 dc 06 lds r20, 0x06DC ; 0x8006dc 2a23a: 50 91 dd 06 lds r21, 0x06DD ; 0x8006dd 2a23e: 60 e0 ldi r22, 0x00 ; 0 2a240: 70 e0 ldi r23, 0x00 ; 0 2a242: 8f e7 ldi r24, 0x7F ; 127 2a244: 93 e4 ldi r25, 0x43 ; 67 2a246: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2a24a: 60 93 a9 04 sts 0x04A9, r22 ; 0x8004a9 <_ZL14iState_sum_max.lto_priv.484> 2a24e: 70 93 aa 04 sts 0x04AA, r23 ; 0x8004aa <_ZL14iState_sum_max.lto_priv.484+0x1> 2a252: 80 93 ab 04 sts 0x04AB, r24 ; 0x8004ab <_ZL14iState_sum_max.lto_priv.484+0x2> 2a256: 90 93 ac 04 sts 0x04AC, r25 ; 0x8004ac <_ZL14iState_sum_max.lto_priv.484+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 2a25a: 20 91 e6 06 lds r18, 0x06E6 ; 0x8006e6 2a25e: 30 91 e7 06 lds r19, 0x06E7 ; 0x8006e7 2a262: 40 91 e8 06 lds r20, 0x06E8 ; 0x8006e8 2a266: 50 91 e9 06 lds r21, 0x06E9 ; 0x8006e9 2a26a: 60 e0 ldi r22, 0x00 ; 0 2a26c: 70 e0 ldi r23, 0x00 ; 0 2a26e: 8f e7 ldi r24, 0x7F ; 127 2a270: 93 e4 ldi r25, 0x43 ; 67 2a272: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2a276: 60 93 a1 04 sts 0x04A1, r22 ; 0x8004a1 <_ZL19temp_iState_max_bed.lto_priv.482> 2a27a: 70 93 a2 04 sts 0x04A2, r23 ; 0x8004a2 <_ZL19temp_iState_max_bed.lto_priv.482+0x1> 2a27e: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 <_ZL19temp_iState_max_bed.lto_priv.482+0x2> 2a282: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 <_ZL19temp_iState_max_bed.lto_priv.482+0x3> #endif } 2a286: 08 95 ret 0002a288 : #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) { 2a288: 2f 92 push r2 2a28a: 3f 92 push r3 2a28c: 4f 92 push r4 2a28e: 5f 92 push r5 2a290: 6f 92 push r6 2a292: 7f 92 push r7 2a294: 8f 92 push r8 2a296: 9f 92 push r9 2a298: af 92 push r10 2a29a: bf 92 push r11 2a29c: cf 92 push r12 2a29e: df 92 push r13 2a2a0: ef 92 push r14 2a2a2: ff 92 push r15 2a2a4: 0f 93 push r16 2a2a6: 1f 93 push r17 2a2a8: cf 93 push r28 2a2aa: df 93 push r29 2a2ac: cd b7 in r28, 0x3d ; 61 2a2ae: de b7 in r29, 0x3e ; 62 2a2b0: e0 97 sbiw r28, 0x30 ; 48 2a2b2: 0f b6 in r0, 0x3f ; 63 2a2b4: f8 94 cli 2a2b6: de bf out 0x3e, r29 ; 62 2a2b8: 0f be out 0x3f, r0 ; 63 2a2ba: cd bf out 0x3d, r28 ; 61 2a2bc: 6a 87 std Y+10, r22 ; 0x0a 2a2be: 7b 87 std Y+11, r23 ; 0x0b 2a2c0: 8c 87 std Y+12, r24 ; 0x0c 2a2c2: 9d 87 std Y+13, r25 ; 0x0d 2a2c4: 1a 01 movw r2, r20 2a2c6: 3a a7 std Y+42, r19 ; 0x2a 2a2c8: 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(); 2a2ca: 0f 94 57 45 call 0x28aae ; 0x28aae pid_tuning_finished = false; 2a2ce: 10 92 3e 02 sts 0x023E, r1 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> // codegen bug causing a stack overwrite issue in process_commands() void __attribute__((noinline)) PID_autotune(float temp, int extruder, int ncycles) { preparePidTuning(); pid_number_of_cycles = ncycles; 2a2d2: 29 a5 ldd r18, Y+41 ; 0x29 2a2d4: 3a a5 ldd r19, Y+42 ; 0x2a 2a2d6: 30 93 45 06 sts 0x0645, r19 ; 0x800645 2a2da: 20 93 44 06 sts 0x0644, r18 ; 0x800644 float input = 0.0; pid_cycle=0; 2a2de: 10 92 47 06 sts 0x0647, r1 ; 0x800647 2a2e2: 10 92 46 06 sts 0x0646, r1 ; 0x800646 bool heating = true; unsigned long temp_millis = _millis(); 2a2e6: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a2ea: 6e 83 std Y+6, r22 ; 0x06 2a2ec: 7f 83 std Y+7, r23 ; 0x07 2a2ee: 88 87 std Y+8, r24 ; 0x08 2a2f0: 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 2a2f2: 37 fe sbrs r3, 7 2a2f4: ff c0 rjmp .+510 ; 0x2a4f4 2a2f6: 3d e2 ldi r19, 0x2D ; 45 2a2f8: 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(); 2a2fa: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a2fe: 6c a3 std Y+36, r22 ; 0x24 2a300: 7d a3 std Y+37, r23 ; 0x25 2a302: 8e a3 std Y+38, r24 ; 0x26 2a304: 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."); 2a306: 80 eb ldi r24, 0xB0 ; 176 2a308: 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) 2a30a: 12 14 cp r1, r2 2a30c: 13 04 cpc r1, r3 2a30e: 0c f4 brge .+2 ; 0x2a312 2a310: 8a c2 rjmp .+1300 ; 0x2a826 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 2a312: 8d e9 ldi r24, 0x9D ; 157 2a314: 9b e9 ldi r25, 0x9B ; 155 2a316: 0e 94 06 7b call 0xf60c ; 0xf60c 2a31a: 6a 85 ldd r22, Y+10 ; 0x0a 2a31c: 7b 85 ldd r23, Y+11 ; 0x0b 2a31e: 8c 85 ldd r24, Y+12 ; 0x0c 2a320: 9d 85 ldd r25, Y+13 ; 0x0d 2a322: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 2a326: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 2a328: 21 14 cp r2, r1 2a32a: 31 04 cpc r3, r1 2a32c: 09 f4 brne .+2 ; 0x2a330 2a32e: e5 c0 rjmp .+458 ; 0x2a4fa { soft_pwm_bed = (MAX_BED_POWER)/2; 2a330: 20 93 1a 06 sts 0x061A, r18 ; 0x80061a bias = d = (MAX_BED_POWER)/2; target_temperature_bed = (int)temp; // to display the requested target bed temperature properly on the main screen 2a334: 70 93 6c 0e sts 0x0E6C, r23 ; 0x800e6c 2a338: 60 93 6b 0e sts 0x0E6B, r22 ; 0x800e6b long bias, d; float Ku, Tu; float max = 0, min = 10000; uint8_t safety_check_cycles = 0; const uint8_t safety_check_cycles_count = (extruder < 0) ? 45 : 10; //10 cycles / 20s delay for extruder and 45 cycles / 90s for heatbed 2a33c: 8e 81 ldd r24, Y+6 ; 0x06 2a33e: 9f 81 ldd r25, Y+7 ; 0x07 2a340: a8 85 ldd r26, Y+8 ; 0x08 2a342: b9 85 ldd r27, Y+9 ; 0x09 2a344: 8e 87 std Y+14, r24 ; 0x0e 2a346: 9f 87 std Y+15, r25 ; 0x0f 2a348: a8 8b std Y+16, r26 ; 0x10 2a34a: b9 8b std Y+17, r27 ; 0x11 2a34c: 88 a3 std Y+32, r24 ; 0x20 2a34e: 99 a3 std Y+33, r25 ; 0x21 2a350: aa a3 std Y+34, r26 ; 0x22 2a352: bb a3 std Y+35, r27 ; 0x23 2a354: 1a 8a std Y+18, r1 ; 0x12 2a356: 90 e4 ldi r25, 0x40 ; 64 2a358: 9b 8b std Y+19, r25 ; 0x13 2a35a: ac e1 ldi r26, 0x1C ; 28 2a35c: ac 8b std Y+20, r26 ; 0x14 2a35e: b6 e4 ldi r27, 0x46 ; 70 2a360: bd 8b std Y+21, r27 ; 0x15 2a362: 1e 8a std Y+22, r1 ; 0x16 2a364: 1f 8a std Y+23, r1 ; 0x17 2a366: 18 8e std Y+24, r1 ; 0x18 2a368: 19 8e std Y+25, r1 ; 0x19 2a36a: 6f e7 ldi r22, 0x7F ; 127 2a36c: c6 2e mov r12, r22 2a36e: d1 2c mov r13, r1 2a370: e1 2c mov r14, r1 2a372: f1 2c mov r15, r1 2a374: 00 e0 ldi r16, 0x00 ; 0 2a376: 10 e0 ldi r17, 0x00 ; 0 2a378: 18 aa std Y+48, r1 ; 0x30 2a37a: 1f a6 std Y+47, r1 ; 0x2f 2a37c: 1d 82 std Y+5, r1 ; 0x05 2a37e: 2f e7 ldi r18, 0x7F ; 127 2a380: 30 e0 ldi r19, 0x00 ; 0 2a382: 40 e0 ldi r20, 0x00 ; 0 2a384: 50 e0 ldi r21, 0x00 ; 0 2a386: 29 83 std Y+1, r18 ; 0x01 2a388: 3a 83 std Y+2, r19 ; 0x02 2a38a: 4b 83 std Y+3, r20 ; 0x03 2a38c: 5c 83 std Y+4, r21 ; 0x04 2a38e: 1b 8e std Y+27, r1 ; 0x1b 2a390: 1c 8e std Y+28, r1 ; 0x1c 2a392: 1d 8e std Y+29, r1 ; 0x1d 2a394: 1e 8e std Y+30, r1 ; 0x1e 2a396: 31 e0 ldi r19, 0x01 ; 1 2a398: 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(); 2a39a: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2a39c: 40 91 ff 05 lds r20, 0x05FF ; 0x8005ff 2a3a0: 48 a7 std Y+40, r20 ; 0x28 2a3a2: 44 23 and r20, r20 2a3a4: 09 f4 brne .+2 ; 0x2a3a8 2a3a6: 2c c2 rjmp .+1112 ; 0x2a800 updateTemperatures(); 2a3a8: 0f 94 c1 48 call 0x29182 ; 0x29182 input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a3ac: 21 14 cp r2, r1 2a3ae: 31 04 cpc r3, r1 2a3b0: 09 f0 breq .+2 ; 0x2a3b4 2a3b2: aa c0 rjmp .+340 ; 0x2a508 2a3b4: 00 91 61 0e lds r16, 0x0E61 ; 0x800e61 2a3b8: 10 91 62 0e lds r17, 0x0E62 ; 0x800e62 2a3bc: 50 91 63 0e lds r21, 0x0E63 ; 0x800e63 2a3c0: 58 ab std Y+48, r21 ; 0x30 2a3c2: 80 91 64 0e lds r24, 0x0E64 ; 0x800e64 2a3c6: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2a3c8: 2e 89 ldd r18, Y+22 ; 0x16 2a3ca: 3f 89 ldd r19, Y+23 ; 0x17 2a3cc: 48 8d ldd r20, Y+24 ; 0x18 2a3ce: 59 8d ldd r21, Y+25 ; 0x19 2a3d0: b8 01 movw r22, r16 2a3d2: 88 a9 ldd r24, Y+48 ; 0x30 2a3d4: 9f a5 ldd r25, Y+47 ; 0x2f 2a3d6: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 2a3da: 87 fd sbrc r24, 7 2a3dc: 06 c0 rjmp .+12 ; 0x2a3ea 2a3de: 0e 8b std Y+22, r16 ; 0x16 2a3e0: 1f 8b std Y+23, r17 ; 0x17 2a3e2: b8 a9 ldd r27, Y+48 ; 0x30 2a3e4: b8 8f std Y+24, r27 ; 0x18 2a3e6: 2f a5 ldd r18, Y+47 ; 0x2f 2a3e8: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2a3ea: 2a 89 ldd r18, Y+18 ; 0x12 2a3ec: 3b 89 ldd r19, Y+19 ; 0x13 2a3ee: 4c 89 ldd r20, Y+20 ; 0x14 2a3f0: 5d 89 ldd r21, Y+21 ; 0x15 2a3f2: b8 01 movw r22, r16 2a3f4: 88 a9 ldd r24, Y+48 ; 0x30 2a3f6: 9f a5 ldd r25, Y+47 ; 0x2f 2a3f8: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 2a3fc: 18 16 cp r1, r24 2a3fe: 34 f0 brlt .+12 ; 0x2a40c 2a400: 0a 8b std Y+18, r16 ; 0x12 2a402: 1b 8b std Y+19, r17 ; 0x13 2a404: 38 a9 ldd r19, Y+48 ; 0x30 2a406: 3c 8b std Y+20, r19 ; 0x14 2a408: 4f a5 ldd r20, Y+47 ; 0x2f 2a40a: 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) { 2a40c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a410: 2c a1 ldd r18, Y+36 ; 0x24 2a412: 3d a1 ldd r19, Y+37 ; 0x25 2a414: 4e a1 ldd r20, Y+38 ; 0x26 2a416: 5f a1 ldd r21, Y+39 ; 0x27 2a418: 62 1b sub r22, r18 2a41a: 73 0b sbc r23, r19 2a41c: 84 0b sbc r24, r20 2a41e: 95 0b sbc r25, r21 2a420: 65 3c cpi r22, 0xC5 ; 197 2a422: 79 40 sbci r23, 0x09 ; 9 2a424: 81 05 cpc r24, r1 2a426: 91 05 cpc r25, r1 2a428: 40 f0 brcs .+16 ; 0x2a43a checkExtruderAutoFans(); 2a42a: 0e 94 32 77 call 0xee64 ; 0xee64 extruder_autofan_last_check = _millis(); 2a42e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a432: 6c a3 std Y+36, r22 ; 0x24 2a434: 7d a3 std Y+37, r23 ; 0x25 2a436: 8e a3 std Y+38, r24 ; 0x26 2a438: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 2a43a: 4a 8d ldd r20, Y+26 ; 0x1a 2a43c: 44 23 and r20, r20 2a43e: 09 f4 brne .+2 ; 0x2a442 2a440: 4c c0 rjmp .+152 ; 0x2a4da 2a442: 2a 85 ldd r18, Y+10 ; 0x0a 2a444: 3b 85 ldd r19, Y+11 ; 0x0b 2a446: 4c 85 ldd r20, Y+12 ; 0x0c 2a448: 5d 85 ldd r21, Y+13 ; 0x0d 2a44a: b8 01 movw r22, r16 2a44c: 88 a9 ldd r24, Y+48 ; 0x30 2a44e: 9f a5 ldd r25, Y+47 ; 0x2f 2a450: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 2a454: 18 16 cp r1, r24 2a456: 0c f0 brlt .+2 ; 0x2a45a 2a458: d3 c1 rjmp .+934 ; 0x2a800 if(_millis() - t2 > 5000) { 2a45a: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a45e: 2e 85 ldd r18, Y+14 ; 0x0e 2a460: 3f 85 ldd r19, Y+15 ; 0x0f 2a462: 48 89 ldd r20, Y+16 ; 0x10 2a464: 59 89 ldd r21, Y+17 ; 0x11 2a466: 62 1b sub r22, r18 2a468: 73 0b sbc r23, r19 2a46a: 84 0b sbc r24, r20 2a46c: 95 0b sbc r25, r21 2a46e: 69 38 cpi r22, 0x89 ; 137 2a470: 73 41 sbci r23, 0x13 ; 19 2a472: 81 05 cpc r24, r1 2a474: 91 05 cpc r25, r1 2a476: 08 f4 brcc .+2 ; 0x2a47a 2a478: c3 c1 rjmp .+902 ; 0x2a800 2a47a: d7 01 movw r26, r14 2a47c: c6 01 movw r24, r12 2a47e: 29 81 ldd r18, Y+1 ; 0x01 2a480: 3a 81 ldd r19, Y+2 ; 0x02 2a482: 4b 81 ldd r20, Y+3 ; 0x03 2a484: 5c 81 ldd r21, Y+4 ; 0x04 2a486: 82 1b sub r24, r18 2a488: 93 0b sbc r25, r19 2a48a: a4 0b sbc r26, r20 2a48c: b5 0b sbc r27, r21 2a48e: b5 95 asr r27 2a490: a7 95 ror r26 2a492: 97 95 ror r25 2a494: 87 95 ror r24 heating=false; if (extruder<0) { 2a496: 21 14 cp r2, r1 2a498: 31 04 cpc r3, r1 2a49a: 09 f4 brne .+2 ; 0x2a49e 2a49c: 40 c0 rjmp .+128 ; 0x2a51e soft_pwm_bed = (bias - d) >> 1; 2a49e: 80 93 1a 06 sts 0x061A, r24 ; 0x80061a } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 2a4a2: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a4a6: 6e 83 std Y+6, r22 ; 0x06 2a4a8: 7f 83 std Y+7, r23 ; 0x07 2a4aa: 88 87 std Y+8, r24 ; 0x08 2a4ac: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 2a4ae: dc 01 movw r26, r24 2a4b0: cb 01 movw r24, r22 2a4b2: 2e 85 ldd r18, Y+14 ; 0x0e 2a4b4: 3f 85 ldd r19, Y+15 ; 0x0f 2a4b6: 48 89 ldd r20, Y+16 ; 0x10 2a4b8: 59 89 ldd r21, Y+17 ; 0x11 2a4ba: 82 1b sub r24, r18 2a4bc: 93 0b sbc r25, r19 2a4be: a4 0b sbc r26, r20 2a4c0: b5 0b sbc r27, r21 2a4c2: 8b 8f std Y+27, r24 ; 0x1b 2a4c4: 9c 8f std Y+28, r25 ; 0x1c 2a4c6: ad 8f std Y+29, r26 ; 0x1d 2a4c8: be 8f std Y+30, r27 ; 0x1e max=temp; 2a4ca: 3a 85 ldd r19, Y+10 ; 0x0a 2a4cc: 3e 8b std Y+22, r19 ; 0x16 2a4ce: 4b 85 ldd r20, Y+11 ; 0x0b 2a4d0: 4f 8b std Y+23, r20 ; 0x17 2a4d2: 5c 85 ldd r21, Y+12 ; 0x0c 2a4d4: 58 8f std Y+24, r21 ; 0x18 2a4d6: 8d 85 ldd r24, Y+13 ; 0x0d 2a4d8: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 2a4da: 2a 85 ldd r18, Y+10 ; 0x0a 2a4dc: 3b 85 ldd r19, Y+11 ; 0x0b 2a4de: 4c 85 ldd r20, Y+12 ; 0x0c 2a4e0: 5d 85 ldd r21, Y+13 ; 0x0d 2a4e2: b8 01 movw r22, r16 2a4e4: 88 a9 ldd r24, Y+48 ; 0x30 2a4e6: 9f a5 ldd r25, Y+47 ; 0x2f 2a4e8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 2a4ec: 87 fd sbrc r24, 7 2a4ee: 1a c0 rjmp .+52 ; 0x2a524 if(_millis() - t1 > 5000) { 2a4f0: 1a 8e std Y+26, r1 ; 0x1a 2a4f2: 86 c1 rjmp .+780 ; 0x2a800 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 2a4f4: 4a e0 ldi r20, 0x0A ; 10 2a4f6: 4f 8f std Y+31, r20 ; 0x1f 2a4f8: 00 cf rjmp .-512 ; 0x2a2fa 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; 2a4fa: 20 93 19 05 sts 0x0519, r18 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 2a4fe: 70 93 6e 0e sts 0x0E6E, r23 ; 0x800e6e 2a502: 60 93 6d 0e sts 0x0E6D, r22 ; 0x800e6d 2a506: 1a cf rjmp .-460 ; 0x2a33c wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2a508: 00 91 f1 04 lds r16, 0x04F1 ; 0x8004f1 2a50c: 10 91 f2 04 lds r17, 0x04F2 ; 0x8004f2 2a510: 90 91 f3 04 lds r25, 0x04F3 ; 0x8004f3 2a514: 98 ab std Y+48, r25 ; 0x30 2a516: a0 91 f4 04 lds r26, 0x04F4 ; 0x8004f4 2a51a: af a7 std Y+47, r26 ; 0x2f 2a51c: 55 cf rjmp .-342 ; 0x2a3c8 heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 2a51e: 80 93 19 05 sts 0x0519, r24 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 2a522: bf cf rjmp .-130 ; 0x2a4a2 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 2a524: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a528: 2e 81 ldd r18, Y+6 ; 0x06 2a52a: 3f 81 ldd r19, Y+7 ; 0x07 2a52c: 48 85 ldd r20, Y+8 ; 0x08 2a52e: 59 85 ldd r21, Y+9 ; 0x09 2a530: 62 1b sub r22, r18 2a532: 73 0b sbc r23, r19 2a534: 84 0b sbc r24, r20 2a536: 95 0b sbc r25, r21 2a538: 69 38 cpi r22, 0x89 ; 137 2a53a: 73 41 sbci r23, 0x13 ; 19 2a53c: 81 05 cpc r24, r1 2a53e: 91 05 cpc r25, r1 2a540: b8 f2 brcs .-82 ; 0x2a4f0 heating=true; t2=_millis(); 2a542: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a546: 6e 87 std Y+14, r22 ; 0x0e 2a548: 7f 87 std Y+15, r23 ; 0x0f 2a54a: 88 8b std Y+16, r24 ; 0x10 2a54c: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 2a54e: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a552: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a556: 18 16 cp r1, r24 2a558: 19 06 cpc r1, r25 2a55a: 0c f0 brlt .+2 ; 0x2a55e 2a55c: 2c c1 rjmp .+600 ; 0x2a7b6 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 2a55e: 8e 85 ldd r24, Y+14 ; 0x0e 2a560: 9f 85 ldd r25, Y+15 ; 0x0f 2a562: a8 89 ldd r26, Y+16 ; 0x10 2a564: b9 89 ldd r27, Y+17 ; 0x11 2a566: 2e 81 ldd r18, Y+6 ; 0x06 2a568: 3f 81 ldd r19, Y+7 ; 0x07 2a56a: 48 85 ldd r20, Y+8 ; 0x08 2a56c: 59 85 ldd r21, Y+9 ; 0x09 2a56e: 82 1b sub r24, r18 2a570: 93 0b sbc r25, r19 2a572: a4 0b sbc r26, r20 2a574: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 2a576: 4b 8c ldd r4, Y+27 ; 0x1b 2a578: 5c 8c ldd r5, Y+28 ; 0x1c 2a57a: 6d 8c ldd r6, Y+29 ; 0x1d 2a57c: 7e 8c ldd r7, Y+30 ; 0x1e 2a57e: 48 0e add r4, r24 2a580: 59 1e adc r5, r25 2a582: 6a 1e adc r6, r26 2a584: 7b 1e adc r7, r27 2a586: 2b 8d ldd r18, Y+27 ; 0x1b 2a588: 3c 8d ldd r19, Y+28 ; 0x1c 2a58a: 4d 8d ldd r20, Y+29 ; 0x1d 2a58c: 5e 8d ldd r21, Y+30 ; 0x1e 2a58e: 28 1b sub r18, r24 2a590: 39 0b sbc r19, r25 2a592: 4a 0b sbc r20, r26 2a594: 5b 0b sbc r21, r27 2a596: 69 81 ldd r22, Y+1 ; 0x01 2a598: 7a 81 ldd r23, Y+2 ; 0x02 2a59a: 8b 81 ldd r24, Y+3 ; 0x03 2a59c: 9c 81 ldd r25, Y+4 ; 0x04 2a59e: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__mulsi3> 2a5a2: a3 01 movw r20, r6 2a5a4: 92 01 movw r18, r4 2a5a6: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__divmodsi4> 2a5aa: da 01 movw r26, r20 2a5ac: c9 01 movw r24, r18 2a5ae: 8c 0d add r24, r12 2a5b0: 9d 1d adc r25, r13 2a5b2: ae 1d adc r26, r14 2a5b4: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 2a5b6: 84 31 cpi r24, 0x14 ; 20 2a5b8: 91 05 cpc r25, r1 2a5ba: a1 05 cpc r26, r1 2a5bc: b1 05 cpc r27, r1 2a5be: 0c f4 brge .+2 ; 0x2a5c2 2a5c0: 3c c1 rjmp .+632 ; 0x2a83a 2a5c2: 6c 01 movw r12, r24 2a5c4: 7d 01 movw r14, r26 2a5c6: 3c ee ldi r19, 0xEC ; 236 2a5c8: c3 16 cp r12, r19 2a5ca: d1 04 cpc r13, r1 2a5cc: e1 04 cpc r14, r1 2a5ce: f1 04 cpc r15, r1 2a5d0: 2c f0 brlt .+10 ; 0x2a5dc 2a5d2: 4b ee ldi r20, 0xEB ; 235 2a5d4: c4 2e mov r12, r20 2a5d6: d1 2c mov r13, r1 2a5d8: e1 2c mov r14, r1 2a5da: 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; 2a5dc: 80 38 cpi r24, 0x80 ; 128 2a5de: 91 05 cpc r25, r1 2a5e0: a1 05 cpc r26, r1 2a5e2: b1 05 cpc r27, r1 2a5e4: 0c f4 brge .+2 ; 0x2a5e8 2a5e6: 37 c1 rjmp .+622 ; 0x2a856 2a5e8: 8e ef ldi r24, 0xFE ; 254 2a5ea: 90 e0 ldi r25, 0x00 ; 0 2a5ec: a0 e0 ldi r26, 0x00 ; 0 2a5ee: b0 e0 ldi r27, 0x00 ; 0 2a5f0: 8c 19 sub r24, r12 2a5f2: 9d 09 sbc r25, r13 2a5f4: ae 09 sbc r26, r14 2a5f6: bf 09 sbc r27, r15 2a5f8: 89 83 std Y+1, r24 ; 0x01 2a5fa: 9a 83 std Y+2, r25 ; 0x02 2a5fc: ab 83 std Y+3, r26 ; 0x03 2a5fe: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 2a600: 85 e9 ldi r24, 0x95 ; 149 2a602: 9b e9 ldi r25, 0x9B ; 155 2a604: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a608: c7 01 movw r24, r14 2a60a: b6 01 movw r22, r12 2a60c: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 2a610: 80 e9 ldi r24, 0x90 ; 144 2a612: 9b e9 ldi r25, 0x9B ; 155 2a614: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a618: 69 81 ldd r22, Y+1 ; 0x01 2a61a: 7a 81 ldd r23, Y+2 ; 0x02 2a61c: 8b 81 ldd r24, Y+3 ; 0x03 2a61e: 9c 81 ldd r25, Y+4 ; 0x04 2a620: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 2a624: 89 e8 ldi r24, 0x89 ; 137 2a626: 9b e9 ldi r25, 0x9B ; 155 2a628: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2a62c: 42 e0 ldi r20, 0x02 ; 2 2a62e: 6a 89 ldd r22, Y+18 ; 0x12 2a630: 7b 89 ldd r23, Y+19 ; 0x13 2a632: 8c 89 ldd r24, Y+20 ; 0x14 2a634: 9d 89 ldd r25, Y+21 ; 0x15 2a636: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 2a63a: 82 e8 ldi r24, 0x82 ; 130 2a63c: 9b e9 ldi r25, 0x9B ; 155 2a63e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a642: 6e 89 ldd r22, Y+22 ; 0x16 2a644: 7f 89 ldd r23, Y+23 ; 0x17 2a646: 88 8d ldd r24, Y+24 ; 0x18 2a648: 99 8d ldd r25, Y+25 ; 0x19 2a64a: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 if(pid_cycle > 2) { 2a64e: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a652: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a656: 03 97 sbiw r24, 0x03 ; 3 2a658: 0c f4 brge .+2 ; 0x2a65c 2a65a: ad c0 rjmp .+346 ; 0x2a7b6 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 2a65c: 69 81 ldd r22, Y+1 ; 0x01 2a65e: 7a 81 ldd r23, Y+2 ; 0x02 2a660: 8b 81 ldd r24, Y+3 ; 0x03 2a662: 9c 81 ldd r25, Y+4 ; 0x04 2a664: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 2a668: 20 e0 ldi r18, 0x00 ; 0 2a66a: 30 e0 ldi r19, 0x00 ; 0 2a66c: 40 e8 ldi r20, 0x80 ; 128 2a66e: 50 e4 ldi r21, 0x40 ; 64 2a670: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2a674: 4b 01 movw r8, r22 2a676: 5c 01 movw r10, r24 2a678: 2a 89 ldd r18, Y+18 ; 0x12 2a67a: 3b 89 ldd r19, Y+19 ; 0x13 2a67c: 4c 89 ldd r20, Y+20 ; 0x14 2a67e: 5d 89 ldd r21, Y+21 ; 0x15 2a680: 6e 89 ldd r22, Y+22 ; 0x16 2a682: 7f 89 ldd r23, Y+23 ; 0x17 2a684: 88 8d ldd r24, Y+24 ; 0x18 2a686: 99 8d ldd r25, Y+25 ; 0x19 2a688: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 2a68c: 20 ed ldi r18, 0xD0 ; 208 2a68e: 3f e0 ldi r19, 0x0F ; 15 2a690: 49 e4 ldi r20, 0x49 ; 73 2a692: 50 e4 ldi r21, 0x40 ; 64 2a694: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2a698: 20 e0 ldi r18, 0x00 ; 0 2a69a: 30 e0 ldi r19, 0x00 ; 0 2a69c: 40 e0 ldi r20, 0x00 ; 0 2a69e: 5f e3 ldi r21, 0x3F ; 63 2a6a0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2a6a4: 9b 01 movw r18, r22 2a6a6: ac 01 movw r20, r24 2a6a8: c5 01 movw r24, r10 2a6aa: b4 01 movw r22, r8 2a6ac: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2a6b0: 4b 01 movw r8, r22 2a6b2: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 2a6b4: c3 01 movw r24, r6 2a6b6: b2 01 movw r22, r4 2a6b8: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 2a6bc: 20 e0 ldi r18, 0x00 ; 0 2a6be: 30 e0 ldi r19, 0x00 ; 0 2a6c0: 4a e7 ldi r20, 0x7A ; 122 2a6c2: 54 e4 ldi r21, 0x44 ; 68 2a6c4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2a6c8: 2b 01 movw r4, r22 2a6ca: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 2a6cc: 8c e7 ldi r24, 0x7C ; 124 2a6ce: 9b e9 ldi r25, 0x9B ; 155 2a6d0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a6d4: 42 e0 ldi r20, 0x02 ; 2 2a6d6: c5 01 movw r24, r10 2a6d8: b4 01 movw r22, r8 2a6da: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 2a6de: 86 e7 ldi r24, 0x76 ; 118 2a6e0: 9b e9 ldi r25, 0x9B ; 155 2a6e2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a6e6: c3 01 movw r24, r6 2a6e8: b2 01 movw r22, r4 2a6ea: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 _Kp = 0.6*Ku; 2a6ee: 2a e9 ldi r18, 0x9A ; 154 2a6f0: 39 e9 ldi r19, 0x99 ; 153 2a6f2: 49 e1 ldi r20, 0x19 ; 25 2a6f4: 5f e3 ldi r21, 0x3F ; 63 2a6f6: c5 01 movw r24, r10 2a6f8: b4 01 movw r22, r8 2a6fa: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2a6fe: 4b 01 movw r8, r22 2a700: 5c 01 movw r10, r24 2a702: 80 92 ef 03 sts 0x03EF, r8 ; 0x8003ef <_Kp> 2a706: 90 92 f0 03 sts 0x03F0, r9 ; 0x8003f0 <_Kp+0x1> 2a70a: a0 92 f1 03 sts 0x03F1, r10 ; 0x8003f1 <_Kp+0x2> 2a70e: b0 92 f2 03 sts 0x03F2, r11 ; 0x8003f2 <_Kp+0x3> _Ki = 2*_Kp/Tu; 2a712: ac 01 movw r20, r24 2a714: 9b 01 movw r18, r22 2a716: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2a71a: a3 01 movw r20, r6 2a71c: 92 01 movw r18, r4 2a71e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2a722: 60 93 eb 03 sts 0x03EB, r22 ; 0x8003eb <_Ki> 2a726: 70 93 ec 03 sts 0x03EC, r23 ; 0x8003ec <_Ki+0x1> 2a72a: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed <_Ki+0x2> 2a72e: 90 93 ee 03 sts 0x03EE, r25 ; 0x8003ee <_Ki+0x3> _Kd = _Kp*Tu/8; 2a732: a3 01 movw r20, r6 2a734: 92 01 movw r18, r4 2a736: c5 01 movw r24, r10 2a738: b4 01 movw r22, r8 2a73a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2a73e: 20 e0 ldi r18, 0x00 ; 0 2a740: 30 e0 ldi r19, 0x00 ; 0 2a742: 40 e0 ldi r20, 0x00 ; 0 2a744: 5e e3 ldi r21, 0x3E ; 62 2a746: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2a74a: 60 93 e7 03 sts 0x03E7, r22 ; 0x8003e7 <_Kd> 2a74e: 70 93 e8 03 sts 0x03E8, r23 ; 0x8003e8 <_Kd+0x1> 2a752: 80 93 e9 03 sts 0x03E9, r24 ; 0x8003e9 <_Kd+0x2> 2a756: 90 93 ea 03 sts 0x03EA, r25 ; 0x8003ea <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 2a75a: 88 e6 ldi r24, 0x68 ; 104 2a75c: 9b e9 ldi r25, 0x9B ; 155 2a75e: 0e 94 06 7b call 0xf60c ; 0xf60c SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 2a762: 82 e6 ldi r24, 0x62 ; 98 2a764: 9b e9 ldi r25, 0x9B ; 155 2a766: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a76a: 60 91 ef 03 lds r22, 0x03EF ; 0x8003ef <_Kp> 2a76e: 70 91 f0 03 lds r23, 0x03F0 ; 0x8003f0 <_Kp+0x1> 2a772: 80 91 f1 03 lds r24, 0x03F1 ; 0x8003f1 <_Kp+0x2> 2a776: 90 91 f2 03 lds r25, 0x03F2 ; 0x8003f2 <_Kp+0x3> 2a77a: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 2a77e: 8c e5 ldi r24, 0x5C ; 92 2a780: 9b e9 ldi r25, 0x9B ; 155 2a782: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a786: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb <_Ki> 2a78a: 70 91 ec 03 lds r23, 0x03EC ; 0x8003ec <_Ki+0x1> 2a78e: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed <_Ki+0x2> 2a792: 90 91 ee 03 lds r25, 0x03EE ; 0x8003ee <_Ki+0x3> 2a796: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 2a79a: 86 e5 ldi r24, 0x56 ; 86 2a79c: 9b e9 ldi r25, 0x9B ; 155 2a79e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a7a2: 60 91 e7 03 lds r22, 0x03E7 ; 0x8003e7 <_Kd> 2a7a6: 70 91 e8 03 lds r23, 0x03E8 ; 0x8003e8 <_Kd+0x1> 2a7aa: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 <_Kd+0x2> 2a7ae: 90 91 ea 03 lds r25, 0x03EA ; 0x8003ea <_Kd+0x3> 2a7b2: 0f 94 d8 76 call 0x2edb0 ; 0x2edb0 2a7b6: 89 81 ldd r24, Y+1 ; 0x01 2a7b8: 9a 81 ldd r25, Y+2 ; 0x02 2a7ba: ab 81 ldd r26, Y+3 ; 0x03 2a7bc: bc 81 ldd r27, Y+4 ; 0x04 2a7be: 8c 0d add r24, r12 2a7c0: 9d 1d adc r25, r13 2a7c2: ae 1d adc r26, r14 2a7c4: bf 1d adc r27, r15 2a7c6: b5 95 asr r27 2a7c8: a7 95 ror r26 2a7ca: 97 95 ror r25 2a7cc: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 2a7ce: 21 14 cp r2, r1 2a7d0: 31 04 cpc r3, r1 2a7d2: 09 f4 brne .+2 ; 0x2a7d6 2a7d4: 45 c0 rjmp .+138 ; 0x2a860 { soft_pwm_bed = (bias + d) >> 1; 2a7d6: 80 93 1a 06 sts 0x061A, r24 ; 0x80061a } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 2a7da: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a7de: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a7e2: 01 96 adiw r24, 0x01 ; 1 2a7e4: 90 93 47 06 sts 0x0647, r25 ; 0x800647 2a7e8: 80 93 46 06 sts 0x0646, r24 ; 0x800646 min=temp; 2a7ec: 3a 85 ldd r19, Y+10 ; 0x0a 2a7ee: 3a 8b std Y+18, r19 ; 0x12 2a7f0: 4b 85 ldd r20, Y+11 ; 0x0b 2a7f2: 4b 8b std Y+19, r20 ; 0x13 2a7f4: 5c 85 ldd r21, Y+12 ; 0x0c 2a7f6: 5c 8b std Y+20, r21 ; 0x14 2a7f8: 8d 85 ldd r24, Y+13 ; 0x0d 2a7fa: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 2a7fc: 98 a5 ldd r25, Y+40 ; 0x28 2a7fe: 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)) { 2a800: 20 e0 ldi r18, 0x00 ; 0 2a802: 30 e0 ldi r19, 0x00 ; 0 2a804: 40 ef ldi r20, 0xF0 ; 240 2a806: 51 e4 ldi r21, 0x41 ; 65 2a808: 6a 85 ldd r22, Y+10 ; 0x0a 2a80a: 7b 85 ldd r23, Y+11 ; 0x0b 2a80c: 8c 85 ldd r24, Y+12 ; 0x0c 2a80e: 9d 85 ldd r25, Y+13 ; 0x0d 2a810: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2a814: 98 01 movw r18, r16 2a816: 48 a9 ldd r20, Y+48 ; 0x30 2a818: 5f a5 ldd r21, Y+47 ; 0x2f 2a81a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 2a81e: 87 ff sbrs r24, 7 2a820: 22 c0 rjmp .+68 ; 0x2a866 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 2a822: 8c e2 ldi r24, 0x2C ; 44 2a824: 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"); 2a826: 0e 94 06 7b call 0xf60c ; 0xf60c pid_tuning_finished = true; 2a82a: 81 e0 ldi r24, 0x01 ; 1 2a82c: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> pid_cycle = 0; 2a830: 10 92 47 06 sts 0x0647, r1 ; 0x800647 2a834: 10 92 46 06 sts 0x0646, r1 ; 0x800646 2a838: 98 c0 rjmp .+304 ; 0x2a96a 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); 2a83a: 34 e1 ldi r19, 0x14 ; 20 2a83c: c3 2e mov r12, r19 2a83e: d1 2c mov r13, r1 2a840: e1 2c mov r14, r1 2a842: f1 2c mov r15, r1 2a844: 24 e1 ldi r18, 0x14 ; 20 2a846: 30 e0 ldi r19, 0x00 ; 0 2a848: 40 e0 ldi r20, 0x00 ; 0 2a84a: 50 e0 ldi r21, 0x00 ; 0 2a84c: 29 83 std Y+1, r18 ; 0x01 2a84e: 3a 83 std Y+2, r19 ; 0x02 2a850: 4b 83 std Y+3, r20 ; 0x03 2a852: 5c 83 std Y+4, r21 ; 0x04 2a854: d5 ce rjmp .-598 ; 0x2a600 2a856: c9 82 std Y+1, r12 ; 0x01 2a858: da 82 std Y+2, r13 ; 0x02 2a85a: eb 82 std Y+3, r14 ; 0x03 2a85c: fc 82 std Y+4, r15 ; 0x04 2a85e: d0 ce rjmp .-608 ; 0x2a600 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 2a860: 80 93 19 05 sts 0x0519, r24 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 2a864: ba cf rjmp .-140 ; 0x2a7da SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 2a866: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a86a: 28 a1 ldd r18, Y+32 ; 0x20 2a86c: 39 a1 ldd r19, Y+33 ; 0x21 2a86e: 4a a1 ldd r20, Y+34 ; 0x22 2a870: 5b a1 ldd r21, Y+35 ; 0x23 2a872: 62 1b sub r22, r18 2a874: 73 0b sbc r23, r19 2a876: 84 0b sbc r24, r20 2a878: 95 0b sbc r25, r21 2a87a: 61 3d cpi r22, 0xD1 ; 209 2a87c: 77 40 sbci r23, 0x07 ; 7 2a87e: 81 05 cpc r24, r1 2a880: 91 05 cpc r25, r1 2a882: 58 f1 brcs .+86 ; 0x2a8da int p; if (extruder<0){ p=soft_pwm_bed; 2a884: a0 90 1a 06 lds r10, 0x061A ; 0x80061a 2a888: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 2a88a: 89 e2 ldi r24, 0x29 ; 41 2a88c: 9b e9 ldi r25, 0x9B ; 155 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 2a88e: 21 14 cp r2, r1 2a890: 31 04 cpc r3, r1 2a892: 29 f4 brne .+10 ; 0x2a89e p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 2a894: a0 90 19 05 lds r10, 0x0519 ; 0x800519 <_ZL8soft_pwm.lto_priv.474> 2a898: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 2a89a: 86 e2 ldi r24, 0x26 ; 38 2a89c: 9b e9 ldi r25, 0x9B ; 155 2a89e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2a8a2: 42 e0 ldi r20, 0x02 ; 2 2a8a4: b8 01 movw r22, r16 2a8a6: 88 a9 ldd r24, Y+48 ; 0x30 2a8a8: 9f a5 ldd r25, Y+47 ; 0x2f 2a8aa: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 2a8ae: 82 e2 ldi r24, 0x22 ; 34 2a8b0: 9b e9 ldi r25, 0x9B ; 155 2a8b2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_PROTOCOLLN(p); 2a8b6: c5 01 movw r24, r10 2a8b8: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 if (safety_check_cycles == 0) { //save ambient temp 2a8bc: 4d 81 ldd r20, Y+5 ; 0x05 2a8be: 44 23 and r20, r20 2a8c0: 09 f4 brne .+2 ; 0x2a8c4 2a8c2: 6c c0 rjmp .+216 ; 0x2a99c temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 2a8c4: 5f 8d ldd r21, Y+31 ; 0x1f 2a8c6: 45 17 cp r20, r21 2a8c8: 70 f5 brcc .+92 ; 0x2a926 safety_check_cycles++; 2a8ca: 4f 5f subi r20, 0xFF ; 255 2a8cc: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 2a8ce: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a8d2: 68 a3 std Y+32, r22 ; 0x20 2a8d4: 79 a3 std Y+33, r23 ; 0x21 2a8d6: 8a a3 std Y+34, r24 ; 0x22 2a8d8: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 2a8da: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a8de: 4b 01 movw r8, r22 2a8e0: 5c 01 movw r10, r24 2a8e2: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a8e6: 4e 80 ldd r4, Y+6 ; 0x06 2a8e8: 5f 80 ldd r5, Y+7 ; 0x07 2a8ea: 68 84 ldd r6, Y+8 ; 0x08 2a8ec: 79 84 ldd r7, Y+9 ; 0x09 2a8ee: 2e 85 ldd r18, Y+14 ; 0x0e 2a8f0: 3f 85 ldd r19, Y+15 ; 0x0f 2a8f2: 48 89 ldd r20, Y+16 ; 0x10 2a8f4: 59 89 ldd r21, Y+17 ; 0x11 2a8f6: 42 0e add r4, r18 2a8f8: 53 1e adc r5, r19 2a8fa: 64 1e adc r6, r20 2a8fc: 75 1e adc r7, r21 2a8fe: 84 18 sub r8, r4 2a900: 95 08 sbc r9, r5 2a902: a6 08 sbc r10, r6 2a904: b7 08 sbc r11, r7 2a906: 86 0e add r8, r22 2a908: 97 1e adc r9, r23 2a90a: a8 1e adc r10, r24 2a90c: b9 1e adc r11, r25 2a90e: 31 e8 ldi r19, 0x81 ; 129 2a910: 83 16 cp r8, r19 2a912: 3f e4 ldi r19, 0x4F ; 79 2a914: 93 06 cpc r9, r19 2a916: 32 e1 ldi r19, 0x12 ; 18 2a918: a3 06 cpc r10, r19 2a91a: b1 04 cpc r11, r1 2a91c: 08 f4 brcc .+2 ; 0x2a920 2a91e: 47 c0 rjmp .+142 ; 0x2a9ae SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 2a920: 85 e0 ldi r24, 0x05 ; 5 2a922: 9b e9 ldi r25, 0x9B ; 155 2a924: 80 cf rjmp .-256 ; 0x2a826 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 2a926: 8d 81 ldd r24, Y+5 ; 0x05 2a928: 9f 8d ldd r25, Y+31 ; 0x1f 2a92a: 89 13 cpse r24, r25 2a92c: d0 cf rjmp .-96 ; 0x2a8ce safety_check_cycles++; 2a92e: 8f 5f subi r24, 0xFF ; 255 2a930: 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) { 2a932: 2b a5 ldd r18, Y+43 ; 0x2b 2a934: 3c a5 ldd r19, Y+44 ; 0x2c 2a936: 4d a5 ldd r20, Y+45 ; 0x2d 2a938: 5e a5 ldd r21, Y+46 ; 0x2e 2a93a: b8 01 movw r22, r16 2a93c: 88 a9 ldd r24, Y+48 ; 0x30 2a93e: 9f a5 ldd r25, Y+47 ; 0x2f 2a940: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 2a944: 9f 77 andi r25, 0x7F ; 127 2a946: 20 e0 ldi r18, 0x00 ; 0 2a948: 30 e0 ldi r19, 0x00 ; 0 2a94a: 40 ea ldi r20, 0xA0 ; 160 2a94c: 50 e4 ldi r21, 0x40 ; 64 2a94e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 2a952: 87 ff sbrs r24, 7 2a954: bc cf rjmp .-136 ; 0x2a8ce temp_runaway_stop(false, (extruder<0)); 2a956: 63 2d mov r22, r3 2a958: 66 1f adc r22, r22 2a95a: 66 27 eor r22, r22 2a95c: 66 1f adc r22, r22 2a95e: 80 e0 ldi r24, 0x00 ; 0 2a960: 0f 94 71 32 call 0x264e2 ; 0x264e2 pid_tuning_finished = true; 2a964: 81 e0 ldi r24, 0x01 ; 1 2a966: 80 93 3e 02 sts 0x023E, r24 ; 0x80023e <_ZL19pid_tuning_finished.lto_priv.473> pid_cycle = 0; return; } lcd_update(0); } } 2a96a: e0 96 adiw r28, 0x30 ; 48 2a96c: 0f b6 in r0, 0x3f ; 63 2a96e: f8 94 cli 2a970: de bf out 0x3e, r29 ; 62 2a972: 0f be out 0x3f, r0 ; 63 2a974: cd bf out 0x3d, r28 ; 61 2a976: df 91 pop r29 2a978: cf 91 pop r28 2a97a: 1f 91 pop r17 2a97c: 0f 91 pop r16 2a97e: ff 90 pop r15 2a980: ef 90 pop r14 2a982: df 90 pop r13 2a984: cf 90 pop r12 2a986: bf 90 pop r11 2a988: af 90 pop r10 2a98a: 9f 90 pop r9 2a98c: 8f 90 pop r8 2a98e: 7f 90 pop r7 2a990: 6f 90 pop r6 2a992: 5f 90 pop r5 2a994: 4f 90 pop r4 2a996: 3f 90 pop r3 2a998: 2f 90 pop r2 2a99a: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 2a99c: 0b a7 std Y+43, r16 ; 0x2b 2a99e: 1c a7 std Y+44, r17 ; 0x2c 2a9a0: a8 a9 ldd r26, Y+48 ; 0x30 2a9a2: ad a7 std Y+45, r26 ; 0x2d 2a9a4: bf a5 ldd r27, Y+47 ; 0x2f 2a9a6: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 2a9a8: 21 e0 ldi r18, 0x01 ; 1 2a9aa: 2d 83 std Y+5, r18 ; 0x05 2a9ac: 90 cf rjmp .-224 ; 0x2a8ce SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 2a9ae: 80 91 46 06 lds r24, 0x0646 ; 0x800646 2a9b2: 90 91 47 06 lds r25, 0x0647 ; 0x800647 2a9b6: 49 a5 ldd r20, Y+41 ; 0x29 2a9b8: 5a a5 ldd r21, Y+42 ; 0x2a 2a9ba: 48 17 cp r20, r24 2a9bc: 59 07 cpc r21, r25 2a9be: 1c f4 brge .+6 ; 0x2a9c6 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 2a9c0: 89 ea ldi r24, 0xA9 ; 169 2a9c2: 9a e9 ldi r25, 0x9A ; 154 2a9c4: 30 cf rjmp .-416 ; 0x2a826 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 2a9c6: 80 e0 ldi r24, 0x00 ; 0 2a9c8: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 2a9cc: e6 cc rjmp .-1588 ; 0x2a39a 0002a9ce : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 2a9ce: 0f 93 push r16 2a9d0: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2a9d2: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 2a9d6: 81 30 cpi r24, 0x01 ; 1 2a9d8: 19 f5 brne .+70 ; 0x2aa20 2a9da: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2a9de: 00 91 a8 05 lds r16, 0x05A8 ; 0x8005a8 2a9e2: 10 91 a9 05 lds r17, 0x05A9 ; 0x8005a9 2a9e6: 20 91 aa 05 lds r18, 0x05AA ; 0x8005aa 2a9ea: 30 91 ab 05 lds r19, 0x05AB ; 0x8005ab 2a9ee: 60 1b sub r22, r16 2a9f0: 71 0b sbc r23, r17 2a9f2: 82 0b sbc r24, r18 2a9f4: 93 0b sbc r25, r19 2a9f6: 28 ee ldi r18, 0xE8 ; 232 2a9f8: 33 e0 ldi r19, 0x03 ; 3 2a9fa: 40 e0 ldi r20, 0x00 ; 0 2a9fc: 50 e0 ldi r21, 0x00 ; 0 2a9fe: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 2aa02: 60 91 a4 05 lds r22, 0x05A4 ; 0x8005a4 2aa06: 70 91 a5 05 lds r23, 0x05A5 ; 0x8005a5 2aa0a: 80 91 a6 05 lds r24, 0x05A6 ; 0x8005a6 2aa0e: 90 91 a7 05 lds r25, 0x05A7 ; 0x8005a7 2aa12: 62 0f add r22, r18 2aa14: 73 1f adc r23, r19 2aa16: 84 1f adc r24, r20 2aa18: 95 1f adc r25, r21 } 2aa1a: 1f 91 pop r17 2aa1c: 0f 91 pop r16 2aa1e: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 2aa20: 60 91 4f 06 lds r22, 0x064F ; 0x80064f 2aa24: 70 91 50 06 lds r23, 0x0650 ; 0x800650 2aa28: 80 91 51 06 lds r24, 0x0651 ; 0x800651 2aa2c: 90 91 52 06 lds r25, 0x0652 ; 0x800652 2aa30: d6 cf rjmp .-84 ; 0x2a9de 0002aa32 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 2aa32: 4f 92 push r4 2aa34: 5f 92 push r5 2aa36: 6f 92 push r6 2aa38: 7f 92 push r7 2aa3a: 8f 92 push r8 2aa3c: 9f 92 push r9 2aa3e: af 92 push r10 2aa40: bf 92 push r11 2aa42: cf 92 push r12 2aa44: df 92 push r13 2aa46: ef 92 push r14 2aa48: ff 92 push r15 2aa4a: 0f 93 push r16 2aa4c: 1f 93 push r17 2aa4e: cf 93 push r28 2aa50: df 93 push r29 2aa52: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 2aa56: 0e 94 45 68 call 0xd08a ; 0xd08a 2aa5a: 88 23 and r24, r24 2aa5c: 09 f4 brne .+2 ; 0x2aa60 2aa5e: 6e c0 rjmp .+220 ; 0x2ab3c { const float _met = ((float)total_filament_used) / (100000.f); 2aa60: 60 91 62 06 lds r22, 0x0662 ; 0x800662 2aa64: 70 91 63 06 lds r23, 0x0663 ; 0x800663 2aa68: 80 91 64 06 lds r24, 0x0664 ; 0x800664 2aa6c: 90 91 65 06 lds r25, 0x0665 ; 0x800665 2aa70: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 2aa74: 20 e0 ldi r18, 0x00 ; 0 2aa76: 30 e5 ldi r19, 0x50 ; 80 2aa78: 43 ec ldi r20, 0xC3 ; 195 2aa7a: 57 e4 ldi r21, 0x47 ; 71 2aa7c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2aa80: 56 2e mov r5, r22 2aa82: 47 2e mov r4, r23 2aa84: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 2aa86: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce 2aa8a: 6b 01 movw r12, r22 2aa8c: 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(); 2aa8e: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P(_N( 2aa92: 84 e7 ldi r24, 0x74 ; 116 2aa94: 9c e4 ldi r25, 0x4C ; 76 2aa96: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2aa9a: 18 2f mov r17, r24 2aa9c: 09 2f mov r16, r25 2aa9e: 84 e6 ldi r24, 0x64 ; 100 2aaa0: 9c e4 ldi r25, 0x4C ; 76 2aaa2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2aaa6: 78 2e mov r7, r24 2aaa8: 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; 2aaaa: 8c e3 ldi r24, 0x3C ; 60 2aaac: 88 2e mov r8, r24 2aaae: 91 2c mov r9, r1 2aab0: a1 2c mov r10, r1 2aab2: b1 2c mov r11, r1 2aab4: c7 01 movw r24, r14 2aab6: b6 01 movw r22, r12 2aab8: a5 01 movw r20, r10 2aaba: 94 01 movw r18, r8 2aabc: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2aac0: 7f 93 push r23 2aac2: 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; 2aac4: ca 01 movw r24, r20 2aac6: b9 01 movw r22, r18 2aac8: a5 01 movw r20, r10 2aaca: 94 01 movw r18, r8 2aacc: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2aad0: 7f 93 push r23 2aad2: 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; 2aad4: c7 01 movw r24, r14 2aad6: b6 01 movw r22, r12 2aad8: 20 e1 ldi r18, 0x10 ; 16 2aada: 3e e0 ldi r19, 0x0E ; 14 2aadc: 40 e0 ldi r20, 0x00 ; 0 2aade: 50 e0 ldi r21, 0x00 ; 0 2aae0: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 2aae4: 5f 93 push r21 2aae6: 4f 93 push r20 2aae8: 3f 93 push r19 2aaea: 2f 93 push r18 2aaec: 0f 93 push r16 2aaee: 1f 93 push r17 2aaf0: df 93 push r29 2aaf2: cf 93 push r28 2aaf4: 4f 92 push r4 2aaf6: 5f 92 push r5 2aaf8: 6f 92 push r6 2aafa: 7f 92 push r7 2aafc: 89 ea ldi r24, 0xA9 ; 169 2aafe: 9f e6 ldi r25, 0x6F ; 111 2ab00: 9f 93 push r25 2ab02: 8f 93 push r24 2ab04: 0e 94 6e 6f call 0xdedc ; 0xdedc "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 2ab08: 8d b7 in r24, 0x3d ; 61 2ab0a: 9e b7 in r25, 0x3e ; 62 2ab0c: 42 96 adiw r24, 0x12 ; 18 2ab0e: 0f b6 in r0, 0x3f ; 63 2ab10: f8 94 cli 2ab12: 9e bf out 0x3e, r25 ; 62 2ab14: 0f be out 0x3f, r0 ; 63 2ab16: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 2ab18: df 91 pop r29 2ab1a: cf 91 pop r28 2ab1c: 1f 91 pop r17 2ab1e: 0f 91 pop r16 2ab20: ff 90 pop r15 2ab22: ef 90 pop r14 2ab24: df 90 pop r13 2ab26: cf 90 pop r12 2ab28: bf 90 pop r11 2ab2a: af 90 pop r10 2ab2c: 9f 90 pop r9 2ab2e: 8f 90 pop r8 2ab30: 7f 90 pop r7 2ab32: 6f 90 pop r6 2ab34: 5f 90 pop r5 2ab36: 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(); 2ab38: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in centimeters 2ab3c: 81 ef ldi r24, 0xF1 ; 241 2ab3e: 9f e0 ldi r25, 0x0F ; 15 2ab40: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 2ab44: 2b 01 movw r4, r22 2ab46: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 2ab48: 8d ee ldi r24, 0xED ; 237 2ab4a: 9f e0 ldi r25, 0x0F ; 15 2ab4c: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 2ab50: 6b 01 movw r12, r22 2ab52: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 2ab54: 0e 94 c1 6f call 0xdf82 ; 0xdf82 lcd_printf_P(_N( 2ab58: 81 e5 ldi r24, 0x51 ; 81 2ab5a: 9c e4 ldi r25, 0x4C ; 76 2ab5c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ab60: 98 2e mov r9, r24 2ab62: 89 2e mov r8, r25 2ab64: 80 e4 ldi r24, 0x40 ; 64 2ab66: 9c e4 ldi r25, 0x4C ; 76 2ab68: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ab6c: b8 2e mov r11, r24 2ab6e: 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; 2ab70: c7 01 movw r24, r14 2ab72: b6 01 movw r22, r12 2ab74: 2c e3 ldi r18, 0x3C ; 60 2ab76: 30 e0 ldi r19, 0x00 ; 0 2ab78: 40 e0 ldi r20, 0x00 ; 0 2ab7a: 50 e0 ldi r21, 0x00 ; 0 2ab7c: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 2ab80: 7f 93 push r23 2ab82: 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; 2ab84: ca 01 movw r24, r20 2ab86: b9 01 movw r22, r18 2ab88: 28 e1 ldi r18, 0x18 ; 24 2ab8a: 30 e0 ldi r19, 0x00 ; 0 2ab8c: 40 e0 ldi r20, 0x00 ; 0 2ab8e: 50 e0 ldi r21, 0x00 ; 0 2ab90: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2ab94: 7f 93 push r23 2ab96: 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; 2ab98: c7 01 movw r24, r14 2ab9a: b6 01 movw r22, r12 2ab9c: 20 ea ldi r18, 0xA0 ; 160 2ab9e: 35 e0 ldi r19, 0x05 ; 5 2aba0: 40 e0 ldi r20, 0x00 ; 0 2aba2: 50 e0 ldi r21, 0x00 ; 0 2aba4: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2aba8: 5f 93 push r21 2abaa: 4f 93 push r20 2abac: 3f 93 push r19 2abae: 2f 93 push r18 2abb0: 8f 92 push r8 2abb2: 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; 2abb4: c3 01 movw r24, r6 2abb6: b2 01 movw r22, r4 2abb8: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 2abbc: 20 e0 ldi r18, 0x00 ; 0 2abbe: 30 e0 ldi r19, 0x00 ; 0 2abc0: 48 ec ldi r20, 0xC8 ; 200 2abc2: 52 e4 ldi r21, 0x42 ; 66 2abc4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 2abc8: 9f 93 push r25 2abca: 8f 93 push r24 2abcc: 7f 93 push r23 2abce: 6f 93 push r22 2abd0: af 92 push r10 2abd2: bf 92 push r11 2abd4: 85 e8 ldi r24, 0x85 ; 133 2abd6: 9f e6 ldi r25, 0x6F ; 111 2abd8: 9f 93 push r25 2abda: 8f 93 push r24 2abdc: 0e 94 6e 6f call 0xdedc ; 0xdedc "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 2abe0: 8d b7 in r24, 0x3d ; 61 2abe2: 9e b7 in r25, 0x3e ; 62 2abe4: 42 96 adiw r24, 0x12 ; 18 2abe6: 0f b6 in r0, 0x3f ; 63 2abe8: f8 94 cli 2abea: 9e bf out 0x3e, r25 ; 62 2abec: 0f be out 0x3f, r0 ; 63 2abee: 8d bf out 0x3d, r24 ; 61 2abf0: 93 cf rjmp .-218 ; 0x2ab18 0002abf2 : 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()") { 2abf2: cf 92 push r12 2abf4: df 92 push r13 2abf6: ef 92 push r14 2abf8: ff 92 push r15 2abfa: 0f 93 push r16 2abfc: 1f 93 push r17 2abfe: cf 93 push r28 2ac00: df 93 push r29 2ac02: 00 d0 rcall .+0 ; 0x2ac04 2ac04: 00 d0 rcall .+0 ; 0x2ac06 2ac06: 1f 92 push r1 2ac08: 1f 92 push r1 2ac0a: cd b7 in r28, 0x3d ; 61 2ac0c: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 2ac0e: 80 91 37 05 lds r24, 0x0537 ; 0x800537 2ac12: 90 91 38 05 lds r25, 0x0538 ; 0x800538 2ac16: 00 97 sbiw r24, 0x00 ; 0 2ac18: e1 f1 breq .+120 ; 0x2ac92 { const int16_t initial_feedmultiply = feedmultiply; 2ac1a: 20 91 39 02 lds r18, 0x0239 ; 0x800239 2ac1e: 30 91 3a 02 lds r19, 0x023A ; 0x80023a // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2ac22: 24 36 cpi r18, 0x64 ; 100 2ac24: 31 05 cpc r19, r1 2ac26: 4c f4 brge .+18 ; 0x2ac3a 2ac28: ac 01 movw r20, r24 2ac2a: 42 0f add r20, r18 2ac2c: 53 1f adc r21, r19 2ac2e: 45 36 cpi r20, 0x65 ; 101 2ac30: 51 05 cpc r21, r1 2ac32: 6c f4 brge .+26 ; 0x2ac4e 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; 2ac34: 82 0f add r24, r18 2ac36: 93 1f adc r25, r19 2ac38: 0c c0 rjmp .+24 ; 0x2ac52 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2ac3a: 24 36 cpi r18, 0x64 ; 100 2ac3c: 31 05 cpc r19, r1 2ac3e: 09 f4 brne .+2 ; 0x2ac42 2ac40: 55 c0 rjmp .+170 ; 0x2acec (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 2ac42: ac 01 movw r20, r24 2ac44: 42 0f add r20, r18 2ac46: 53 1f adc r21, r19 2ac48: 44 36 cpi r20, 0x64 ; 100 2ac4a: 51 05 cpc r21, r1 2ac4c: 9c f7 brge .-26 ; 0x2ac34 { feedmultiply = 100; 2ac4e: 84 e6 ldi r24, 0x64 ; 100 2ac50: 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; 2ac52: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2ac56: 80 93 39 02 sts 0x0239, r24 ; 0x800239 if (initial_feedmultiply != feedmultiply) { 2ac5a: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2ac5e: 90 91 3a 02 lds r25, 0x023A ; 0x80023a 2ac62: 82 17 cp r24, r18 2ac64: 93 07 cpc r25, r19 2ac66: a9 f0 breq .+42 ; 0x2ac92 feedmultiply = constrain(feedmultiply, 10, 999); 2ac68: 88 3e cpi r24, 0xE8 ; 232 2ac6a: 53 e0 ldi r21, 0x03 ; 3 2ac6c: 95 07 cpc r25, r21 2ac6e: 14 f0 brlt .+4 ; 0x2ac74 2ac70: 87 ee ldi r24, 0xE7 ; 231 2ac72: 93 e0 ldi r25, 0x03 ; 3 2ac74: 8a 30 cpi r24, 0x0A ; 10 2ac76: 91 05 cpc r25, r1 2ac78: 14 f4 brge .+4 ; 0x2ac7e 2ac7a: 8a e0 ldi r24, 0x0A ; 10 2ac7c: 90 e0 ldi r25, 0x00 ; 0 2ac7e: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 2ac82: 80 93 39 02 sts 0x0239, r24 ; 0x800239 lcd_encoder = 0; // Consume rotation event 2ac86: 10 92 38 05 sts 0x0538, r1 ; 0x800538 2ac8a: 10 92 37 05 sts 0x0537, r1 ; 0x800537 refresh_saved_feedrate_multiplier_in_ram(); 2ac8e: 0e 94 98 65 call 0xcb30 ; 0xcb30 } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 2ac92: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2ac96: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 2ac98: 10 92 4e 06 sts 0x064E, r1 ; 0x80064e } if (lcd_status_update_delay) 2ac9c: 10 91 4e 06 lds r17, 0x064E ; 0x80064e 2aca0: 11 23 and r17, r17 2aca2: 91 f1 breq .+100 ; 0x2ad08 lcd_status_update_delay--; 2aca4: 2f ef ldi r18, 0xFF ; 255 2aca6: 21 0f add r18, r17 2aca8: 20 93 4e 06 sts 0x064E, r18 ; 0x80064e if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 2acac: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 2acb0: 81 11 cpse r24, r1 2acb2: 0d c0 rjmp .+26 ; 0x2acce 2acb4: 0e 94 b2 71 call 0xe364 ; 0xe364 2acb8: 88 23 and r24, r24 2acba: 49 f0 breq .+18 ; 0x2acce menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 2acbc: 10 92 f4 03 sts 0x03F4, r1 ; 0x8003f4 menu_submenu(lcd_main_menu); 2acc0: 60 e0 ldi r22, 0x00 ; 0 2acc2: 81 ec ldi r24, 0xC1 ; 193 2acc4: 94 ee ldi r25, 0xE4 ; 228 2acc6: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 2acca: 0e 94 41 70 call 0xe082 ; 0xe082 } } 2acce: 28 96 adiw r28, 0x08 ; 8 2acd0: 0f b6 in r0, 0x3f ; 63 2acd2: f8 94 cli 2acd4: de bf out 0x3e, r29 ; 62 2acd6: 0f be out 0x3f, r0 ; 63 2acd8: cd bf out 0x3d, r28 ; 61 2acda: df 91 pop r29 2acdc: cf 91 pop r28 2acde: 1f 91 pop r17 2ace0: 0f 91 pop r16 2ace2: ff 90 pop r15 2ace4: ef 90 pop r14 2ace6: df 90 pop r13 2ace8: cf 90 pop r12 2acea: 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) { 2acec: 8b 30 cpi r24, 0x0B ; 11 2acee: 91 05 cpc r25, r1 2acf0: 1c f0 brlt .+6 ; 0x2acf8 feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 2acf2: 86 5a subi r24, 0xA6 ; 166 2acf4: 9f 4f sbci r25, 0xFF ; 255 2acf6: ad cf rjmp .-166 ; 0x2ac52 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2acf8: 86 3f cpi r24, 0xF6 ; 246 2acfa: 4f ef ldi r20, 0xFF ; 255 2acfc: 94 07 cpc r25, r20 2acfe: 0c f0 brlt .+2 ; 0x2ad02 2ad00: ac cf rjmp .-168 ; 0x2ac5a feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 2ad02: 82 59 subi r24, 0x92 ; 146 2ad04: 9f 4f sbci r25, 0xFF ; 255 2ad06: a5 cf rjmp .-182 ; 0x2ac52 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; 2ad08: 6a e0 ldi r22, 0x0A ; 10 2ad0a: 60 93 4e 06 sts 0x064E, r22 ; 0x80064e ReInitLCD++; 2ad0e: 80 91 4d 06 lds r24, 0x064D ; 0x80064d 2ad12: 8f 5f subi r24, 0xFF ; 255 2ad14: 80 93 4d 06 sts 0x064D, r24 ; 0x80064d if (ReInitLCD == 30) 2ad18: 8e 31 cpi r24, 0x1E ; 30 2ad1a: 09 f0 breq .+2 ; 0x2ad1e 2ad1c: 9f c0 rjmp .+318 ; 0x2ae5c { ReInitLCD = 0 ; 2ad1e: 10 92 4d 06 sts 0x064D, r1 ; 0x80064d #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 2ad22: 0e 94 41 70 call 0xe082 ; 0xe082 lcd_status_message_idx = 0; // Re-draw message from beginning 2ad26: 10 92 39 05 sts 0x0539, r1 ; 0x800539 <_ZL22lcd_status_message_idx.lto_priv.464> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 2ad2a: 0e 94 49 6f call 0xde92 ; 0xde92 lcd_home(); //line 0 2ad2e: 0e 94 c1 6f call 0xdf82 ; 0xdf82 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 2ad32: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 2ad36: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 2ad3a: 07 2e mov r0, r23 2ad3c: 00 0c add r0, r0 2ad3e: 88 0b sbc r24, r24 2ad40: 99 0b sbc r25, r25 2ad42: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__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)); 2ad46: 20 e0 ldi r18, 0x00 ; 0 2ad48: 30 e0 ldi r19, 0x00 ; 0 2ad4a: 40 e0 ldi r20, 0x00 ; 0 2ad4c: 5f e3 ldi r21, 0x3F ; 63 2ad4e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2ad52: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 2ad56: 6b 01 movw r12, r22 2ad58: 20 e0 ldi r18, 0x00 ; 0 2ad5a: 30 e0 ldi r19, 0x00 ; 0 2ad5c: 40 e0 ldi r20, 0x00 ; 0 2ad5e: 5f e3 ldi r21, 0x3F ; 63 2ad60: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2ad64: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2ad68: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2ad6c: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2ad70: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2ad74: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 2ad78: a6 01 movw r20, r12 2ad7a: 82 e8 ldi r24, 0x82 ; 130 2ad7c: 0f 94 22 2f call 0x25e44 ; 0x25e44 lcd_space(3); //3 spaces 2ad80: 83 e0 ldi r24, 0x03 ; 3 2ad82: 0e 94 8b 6f call 0xdf16 ; 0xdf16 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 2ad86: 80 91 75 07 lds r24, 0x0775 ; 0x800775 2ad8a: 81 30 cpi r24, 0x01 ; 1 2ad8c: 09 f0 breq .+2 ; 0x2ad90 2ad8e: 6e c0 rjmp .+220 ; 0x2ae6c lcd_puts_P(_N("Z --- ")); 2ad90: 84 ee ldi r24, 0xE4 ; 228 2ad92: 9e e6 ldi r25, 0x6E ; 110 2ad94: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 2ad98: 61 e0 ldi r22, 0x01 ; 1 2ad9a: 80 e0 ldi r24, 0x00 ; 0 2ad9c: 0e 94 95 6f call 0xdf2a ; 0xdf2a }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 2ada0: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 2ada4: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 2ada8: 07 2e mov r0, r23 2adaa: 00 0c add r0, r0 2adac: 88 0b sbc r24, r24 2adae: 99 0b sbc r25, r25 2adb0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 2adb4: 20 e0 ldi r18, 0x00 ; 0 2adb6: 30 e0 ldi r19, 0x00 ; 0 2adb8: 40 e0 ldi r20, 0x00 ; 0 2adba: 5f e3 ldi r21, 0x3F ; 63 2adbc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2adc0: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 2adc4: 6b 01 movw r12, r22 2adc6: 20 e0 ldi r18, 0x00 ; 0 2adc8: 30 e0 ldi r19, 0x00 ; 0 2adca: 40 e0 ldi r20, 0x00 ; 0 2adcc: 5f e3 ldi r21, 0x3F ; 63 2adce: 60 91 f1 04 lds r22, 0x04F1 ; 0x8004f1 2add2: 70 91 f2 04 lds r23, 0x04F2 ; 0x8004f2 2add6: 80 91 f3 04 lds r24, 0x04F3 ; 0x8004f3 2adda: 90 91 f4 04 lds r25, 0x04F4 ; 0x8004f4 2adde: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 2ade2: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 2ade6: a6 01 movw r20, r12 2ade8: 80 e8 ldi r24, 0x80 ; 128 2adea: 0f 94 22 2f call 0x25e44 ; 0x25e44 lcd_space(3); //3 spaces 2adee: 83 e0 ldi r24, 0x03 ; 3 2adf0: 0e 94 8b 6f call 0xdf16 ; 0xdf16 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 2adf4: 80 91 3a 02 lds r24, 0x023A ; 0x80023a 2adf8: 8f 93 push r24 2adfa: 80 91 39 02 lds r24, 0x0239 ; 0x800239 2adfe: 8f 93 push r24 2ae00: 8d ee ldi r24, 0xED ; 237 2ae02: 9e e6 ldi r25, 0x6E ; 110 2ae04: 9f 93 push r25 2ae06: 8f 93 push r24 2ae08: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_space(8 - chars); 2ae0c: 98 e0 ldi r25, 0x08 ; 8 2ae0e: 98 1b sub r25, r24 2ae10: 89 2f mov r24, r25 2ae12: 0e 94 8b 6f call 0xdf16 ; 0xdf16 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2ae16: 62 e0 ldi r22, 0x02 ; 2 2ae18: 80 e0 ldi r24, 0x00 ; 0 2ae1a: 0e 94 95 6f call 0xdf2a ; 0xdf2a } // 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(" ")); 2ae1e: 0f 90 pop r0 2ae20: 0f 90 pop r0 2ae22: 0f 90 pop r0 2ae24: 0f 90 pop r0 2ae26: 80 91 11 05 lds r24, 0x0511 ; 0x800511 2ae2a: e0 90 6e 14 lds r14, 0x146E ; 0x80146e 2ae2e: 81 11 cpse r24, r1 2ae30: 3e c0 rjmp .+124 ; 0x2aeae 2ae32: 20 e0 ldi r18, 0x00 ; 0 2ae34: c2 2e mov r12, r18 2ae36: 2f e6 ldi r18, 0x6F ; 111 2ae38: d2 2e mov r13, r18 2ae3a: e1 10 cpse r14, r1 2ae3c: 3c c0 rjmp .+120 ; 0x2aeb6 2ae3e: 84 e0 ldi r24, 0x04 ; 4 2ae40: c8 2e mov r12, r24 2ae42: 8f e6 ldi r24, 0x6F ; 111 2ae44: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2ae46: 0e 94 96 68 call 0xd12c ; 0xd12c 2ae4a: f8 2e mov r15, r24 2ae4c: 88 23 and r24, r24 2ae4e: e1 f1 breq .+120 ; 0x2aec8 2ae50: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2ae54: 8f 3f cpi r24, 0xFF ; 255 2ae56: 89 f5 brne .+98 ; 0x2aeba 2ae58: f1 2c mov r15, r1 2ae5a: 36 c0 rjmp .+108 ; 0x2aec8 ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 2ae5c: 0f 94 4c de call 0x3bc98 ; 0x3bc98 <__divmodqi4> 2ae60: 91 11 cpse r25, r1 2ae62: 63 cf rjmp .-314 ; 0x2ad2a lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 2ae64: 80 e0 ldi r24, 0x00 ; 0 2ae66: 0e 94 00 70 call 0xe000 ; 0xe000 2ae6a: 5d cf rjmp .-326 ; 0x2ad26 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]?' ':'?'); 2ae6c: 80 91 42 07 lds r24, 0x0742 ; 0x800742 2ae70: 88 23 and r24, r24 2ae72: d9 f0 breq .+54 ; 0x2aeaa 2ae74: 80 e2 ldi r24, 0x20 ; 32 2ae76: 1f 92 push r1 2ae78: 8f 93 push r24 2ae7a: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 2ae7e: 8f 93 push r24 2ae80: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 2ae84: 8f 93 push r24 2ae86: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 2ae8a: 8f 93 push r24 2ae8c: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 2ae90: 8f 93 push r24 2ae92: 8b ed ldi r24, 0xDB ; 219 2ae94: 9e e6 ldi r25, 0x6E ; 110 2ae96: 9f 93 push r25 2ae98: 8f 93 push r24 2ae9a: 0e 94 6e 6f call 0xdedc ; 0xdedc 2ae9e: 0f b6 in r0, 0x3f ; 63 2aea0: f8 94 cli 2aea2: de bf out 0x3e, r29 ; 62 2aea4: 0f be out 0x3f, r0 ; 63 2aea6: cd bf out 0x3d, r28 ; 61 2aea8: 77 cf rjmp .-274 ; 0x2ad98 2aeaa: 8f e3 ldi r24, 0x3F ; 63 2aeac: e4 cf rjmp .-56 ; 0x2ae76 } // 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(" ")); 2aeae: 98 e0 ldi r25, 0x08 ; 8 2aeb0: c9 2e mov r12, r25 2aeb2: 9f e6 ldi r25, 0x6F ; 111 2aeb4: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2aeb6: ee 20 and r14, r14 2aeb8: 31 f2 breq .-116 ; 0x2ae46 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2aeba: 80 91 df 03 lds r24, 0x03DF ; 0x8003df // Print percent done in form "USB---%", " SD---%", " ---%" (7 chars total) void lcdui_print_percent_done(void) { const char* src = usb_timer.running()?_N(" HO"):(IS_SD_PRINTING?_N(" SD"):_N(" ")); bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2aebe: ff 24 eor r15, r15 2aec0: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 2aec2: 88 23 and r24, r24 2aec4: 09 f4 brne .+2 ; 0x2aec8 2aec6: bb c0 rjmp .+374 ; 0x2b03e { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 2aec8: 81 ea ldi r24, 0xA1 ; 161 2aeca: 9d e0 ldi r25, 0x0D ; 13 2aecc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2aed0: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 2aed2: 0e 94 da 77 call 0xefb4 ; 0xefb4 if ((nextSheet >= 0) && (sheetNR != nextSheet)) 2aed6: 87 fd sbrc r24, 7 2aed8: b2 c0 rjmp .+356 ; 0x2b03e 2aeda: 08 17 cp r16, r24 2aedc: 09 f4 brne .+2 ; 0x2aee0 2aede: af c0 rjmp .+350 ; 0x2b03e { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 2aee0: 9b e0 ldi r25, 0x0B ; 11 2aee2: 09 02 muls r16, r25 2aee4: b0 01 movw r22, r0 2aee6: 11 24 eor r1, r1 2aee8: 67 5b subi r22, 0xB7 ; 183 2aeea: 72 4f sbci r23, 0xF2 ; 242 2aeec: 47 e0 ldi r20, 0x07 ; 7 2aeee: 50 e0 ldi r21, 0x00 ; 0 2aef0: 8e 01 movw r16, r28 2aef2: 0f 5f subi r16, 0xFF ; 255 2aef4: 1f 4f sbci r17, 0xFF ; 255 2aef6: c8 01 movw r24, r16 2aef8: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 sheet[7] = '\0'; 2aefc: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 2aefe: 1f 93 push r17 2af00: 0f 93 push r16 2af02: 84 ed ldi r24, 0xD4 ; 212 2af04: 90 ea ldi r25, 0xA0 ; 160 lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2af06: 9f 93 push r25 2af08: 8f 93 push r24 2af0a: 0e 94 6e 6f call 0xdedc ; 0xdedc 2af0e: 0f 90 pop r0 2af10: 0f 90 pop r0 2af12: 0f 90 pop r0 2af14: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 2af16: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2af1a: 81 30 cpi r24, 0x01 ; 1 2af1c: 09 f0 breq .+2 ; 0x2af20 2af1e: e9 c0 rjmp .+466 ; 0x2b0f2 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 2af20: 0f 94 a9 37 call 0x26f52 ; 0x26f52 2af24: 95 e0 ldi r25, 0x05 ; 5 2af26: 98 1b sub r25, r24 2af28: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2af2a: 0e 94 8b 6f call 0xdf16 ; 0xdf16 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()) { 2af2e: 0e 94 96 68 call 0xd12c ; 0xd12c 2af32: 88 23 and r24, r24 2af34: 09 f4 brne .+2 ; 0x2af38 2af36: fa c0 rjmp .+500 ; 0x2b12c uint16_t print_tc = PRINT_TIME_REMAINING_INIT; // unit: minutes char suff = ' '; char suff_doubt = ' '; #ifdef TMC2130 if (SilentModeMenu != SILENT_MODE_OFF) { 2af38: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2af3c: 88 23 and r24, r24 2af3e: 09 f4 brne .+2 ; 0x2af42 2af40: da c0 rjmp .+436 ; 0x2b0f6 if (print_time_remaining_silent != PRINT_TIME_REMAINING_INIT) 2af42: c0 90 8d 02 lds r12, 0x028D ; 0x80028d 2af46: 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) 2af4a: e0 90 8b 02 lds r14, 0x028B ; 0x80028b 2af4e: f0 90 8c 02 lds r15, 0x028C ; 0x80028c #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 2af52: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2af56: 8a 30 cpi r24, 0x0A ; 10 2af58: 11 f4 brne .+4 ; 0x2af5e clock_interval = 0; 2af5a: 10 92 4c 06 sts 0x064C, r1 ; 0x80064c clock_interval++; 2af5e: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2af62: 8f 5f subi r24, 0xFF ; 255 2af64: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 2af68: 2f ef ldi r18, 0xFF ; 255 2af6a: e2 16 cp r14, r18 2af6c: f2 06 cpc r15, r18 2af6e: 21 f0 breq .+8 ; 0x2af78 2af70: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 2af72: 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) { 2af74: 86 30 cpi r24, 0x06 ; 6 2af76: 70 f4 brcc .+28 ; 0x2af94 print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 2af78: 3f ef ldi r19, 0xFF ; 255 2af7a: c3 16 cp r12, r19 2af7c: d3 06 cpc r13, r19 2af7e: 09 f0 breq .+2 ; 0x2af82 2af80: c3 c0 rjmp .+390 ; 0x2b108 print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 2af82: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce 2af86: 2c e3 ldi r18, 0x3C ; 60 2af88: 30 e0 ldi r19, 0x00 ; 0 2af8a: 40 e0 ldi r20, 0x00 ; 0 2af8c: 50 e0 ldi r21, 0x00 ; 0 2af8e: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__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 = ' '; 2af92: 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)) { 2af94: 40 91 39 02 lds r20, 0x0239 ; 0x800239 2af98: 50 91 3a 02 lds r21, 0x023A ; 0x80023a 2af9c: 44 36 cpi r20, 0x64 ; 100 2af9e: 51 05 cpc r21, r1 2afa0: 09 f4 brne .+2 ; 0x2afa4 2afa2: b5 c0 rjmp .+362 ; 0x2b10e 2afa4: c2 16 cp r12, r18 2afa6: d3 06 cpc r13, r19 2afa8: 21 f0 breq .+8 ; 0x2afb2 2afaa: e2 16 cp r14, r18 2afac: f3 06 cpc r15, r19 2afae: 09 f0 breq .+2 ; 0x2afb2 2afb0: ae c0 rjmp .+348 ; 0x2b10e 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); 2afb2: a4 e6 ldi r26, 0x64 ; 100 2afb4: b0 e0 ldi r27, 0x00 ; 0 2afb6: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 2afba: 9a 01 movw r18, r20 2afbc: 55 0f add r21, r21 2afbe: 44 0b sbc r20, r20 2afc0: 55 0b sbc r21, r21 2afc2: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2afc6: 4f e3 ldi r20, 0x3F ; 63 2afc8: e4 2e mov r14, r20 2afca: 04 2e mov r0, r20 2afcc: 00 0c add r0, r0 2afce: ff 08 sbc r15, r15 2afd0: e1 2f mov r30, r17 2afd2: 01 2e mov r0, r17 2afd4: 00 0c add r0, r0 2afd6: ff 0b sbc r31, r31 2afd8: c9 01 movw r24, r18 2afda: 6c e3 ldi r22, 0x3C ; 60 2afdc: 70 e0 ldi r23, 0x00 ; 0 2afde: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__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 2afe2: 20 37 cpi r18, 0x70 ; 112 2afe4: 37 41 sbci r19, 0x17 ; 23 2afe6: 08 f0 brcs .+2 ; 0x2afea 2afe8: 94 c0 rjmp .+296 ; 0x2b112 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 2afea: ff 92 push r15 2afec: 4f 93 push r20 2afee: ff 93 push r31 2aff0: 1f 93 push r17 2aff2: 9f 93 push r25 2aff4: 8f 93 push r24 2aff6: 7f 93 push r23 2aff8: 6f 93 push r22 2affa: 87 e1 ldi r24, 0x17 ; 23 2affc: 9f e6 ldi r25, 0x6F ; 111 2affe: 9f 93 push r25 2b000: 8f 93 push r24 2b002: 0e 94 6e 6f call 0xdedc ; 0xdedc else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 2b006: 0f b6 in r0, 0x3f ; 63 2b008: f8 94 cli 2b00a: de bf out 0x3e, r29 ; 62 2b00c: 0f be out 0x3f, r0 ; 63 2b00e: 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); 2b010: 98 e0 ldi r25, 0x08 ; 8 2b012: 98 1b sub r25, r24 2b014: 89 2f mov r24, r25 2b016: 0e 94 8b 6f call 0xdf16 ; 0xdf16 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 2b01a: 63 e0 ldi r22, 0x03 ; 3 2b01c: 80 e0 ldi r24, 0x00 ; 0 2b01e: 0e 94 95 6f call 0xdf2a ; 0xdf2a #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 2b022: 0f 94 b2 40 call 0x28164 ; 0x28164 lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 2b026: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 2b02a: 88 23 and r24, r24 2b02c: 09 f4 brne .+2 ; 0x2b030 2b02e: 3e ce rjmp .-900 ; 0x2acac 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) { 2b030: 80 91 5d 0e lds r24, 0x0E5D ; 0x800e5d 2b034: 81 11 cpse r24, r1 2b036: 3a ce rjmp .-908 ; 0x2acac 2b038: 0f 94 fb 0b call 0x217f6 ; 0x217f6 2b03c: 37 ce rjmp .-914 ; 0x2acac lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 2b03e: e1 10 cpse r14, r1 2b040: 04 c0 rjmp .+8 ; 0x2b04a 2b042: 80 91 9e 03 lds r24, 0x039E ; 0x80039e <_ZL9M79_timer.lto_priv.466> 2b046: 81 11 cpse r24, r1 2b048: 4a c0 rjmp .+148 ; 0x2b0de // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 2b04a: df 92 push r13 2b04c: cf 92 push r12 2b04e: 80 ed ldi r24, 0xD0 ; 208 2b050: 90 ea ldi r25, 0xA0 ; 160 2b052: 9f 93 push r25 2b054: 8f 93 push r24 2b056: 0e 94 6e 6f call 0xdedc ; 0xdedc 2b05a: 0f 90 pop r0 2b05c: 0f 90 pop r0 2b05e: 0f 90 pop r0 2b060: 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) 2b062: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2b066: 81 11 cpse r24, r1 2b068: 04 c0 rjmp .+8 ; 0x2b072 2b06a: 80 91 86 02 lds r24, 0x0286 ; 0x800286 2b06e: 85 36 cpi r24, 0x65 ; 101 2b070: f0 f1 brcs .+124 ; 0x2b0ee { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) 2b072: 80 91 85 02 lds r24, 0x0285 ; 0x800285 2b076: 85 36 cpi r24, 0x65 ; 101 2b078: d0 f1 brcs .+116 ; 0x2b0ee 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;}; 2b07a: 80 91 01 17 lds r24, 0x1701 ; 0x801701 2b07e: 88 23 and r24, r24 2b080: 19 f1 breq .+70 ; 0x2b0c8 2b082: 80 91 7b 17 lds r24, 0x177B ; 0x80177b 2b086: 90 91 7c 17 lds r25, 0x177C ; 0x80177c 2b08a: a0 91 7d 17 lds r26, 0x177D ; 0x80177d 2b08e: b0 91 7e 17 lds r27, 0x177E ; 0x80177e 2b092: 00 97 sbiw r24, 0x00 ; 0 2b094: a1 05 cpc r26, r1 2b096: b1 05 cpc r27, r1 2b098: b9 f0 breq .+46 ; 0x2b0c8 2b09a: bc 01 movw r22, r24 2b09c: cd 01 movw r24, r26 2b09e: 6d 59 subi r22, 0x9D ; 157 2b0a0: 7f 4f sbci r23, 0xFF ; 255 2b0a2: 8f 4f sbci r24, 0xFF ; 255 2b0a4: 9f 4f sbci r25, 0xFF ; 255 2b0a6: 24 e6 ldi r18, 0x64 ; 100 2b0a8: 30 e0 ldi r19, 0x00 ; 0 2b0aa: 40 e0 ldi r20, 0x00 ; 0 2b0ac: 50 e0 ldi r21, 0x00 ; 0 2b0ae: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 2b0b2: 60 91 82 17 lds r22, 0x1782 ; 0x801782 2b0b6: 70 91 83 17 lds r23, 0x1783 ; 0x801783 2b0ba: 80 91 84 17 lds r24, 0x1784 ; 0x801784 2b0be: 90 91 85 17 lds r25, 0x1785 ; 0x801785 2b0c2: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 2b0c6: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 2b0c8: 21 2f mov r18, r17 2b0ca: 30 e0 ldi r19, 0x00 ; 0 2b0cc: 8a ef ldi r24, 0xFA ; 250 2b0ce: 9e e6 ldi r25, 0x6E ; 110 2b0d0: f1 10 cpse r15, r1 2b0d2: 02 c0 rjmp .+4 ; 0x2b0d8 2b0d4: 84 ef ldi r24, 0xF4 ; 244 2b0d6: 9e e6 ldi r25, 0x6E ; 110 2b0d8: 3f 93 push r19 2b0da: 2f 93 push r18 2b0dc: 14 cf rjmp .-472 ; 0x2af06 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 2b0de: 81 e0 ldi r24, 0x01 ; 1 2b0e0: 0e 94 8b 6f call 0xdf16 ; 0xdf16 lcd_print(hostName); // Two characters 2b0e4: 89 e4 ldi r24, 0x49 ; 73 2b0e6: 96 e0 ldi r25, 0x06 ; 6 2b0e8: 0e 94 9c 71 call 0xe338 ; 0xe338 2b0ec: ba cf rjmp .-140 ; 0x2b062 2b0ee: 18 2f mov r17, r24 2b0f0: eb cf rjmp .-42 ; 0x2b0c8 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2b0f2: 85 e0 ldi r24, 0x05 ; 5 2b0f4: 1a cf rjmp .-460 ; 0x2af2a 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) 2b0f6: c0 90 89 02 lds r12, 0x0289 ; 0x800289 2b0fa: 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) 2b0fe: e0 90 87 02 lds r14, 0x0287 ; 0x800287 2b102: f0 90 88 02 lds r15, 0x0288 ; 0x800288 2b106: 25 cf rjmp .-438 ; 0x2af52 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) { 2b108: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 2b10a: 12 e5 ldi r17, 0x52 ; 82 2b10c: 43 cf rjmp .-378 ; 0x2af94 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 = ' '; 2b10e: 40 e2 ldi r20, 0x20 ; 32 2b110: 5b cf rjmp .-330 ; 0x2afc8 } 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); 2b112: ff 92 push r15 2b114: 4f 93 push r20 2b116: ff 93 push r31 2b118: 1f 93 push r17 2b11a: 7f 93 push r23 2b11c: 6f 93 push r22 2b11e: 8c e0 ldi r24, 0x0C ; 12 2b120: 9f e6 ldi r25, 0x6F ; 111 2b122: 9f 93 push r25 2b124: 8f 93 push r24 2b126: 0e 94 6e 6f call 0xdedc ; 0xdedc 2b12a: 6d cf rjmp .-294 ; 0x2b006 } 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); 2b12c: 85 ea ldi r24, 0xA5 ; 165 2b12e: 9d e0 ldi r25, 0x0D ; 13 2b130: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 2b134: bc 01 movw r22, r24 2b136: 90 e0 ldi r25, 0x00 ; 0 2b138: 80 e0 ldi r24, 0x00 ; 0 2b13a: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 2b13e: 20 e0 ldi r18, 0x00 ; 0 2b140: 30 e0 ldi r19, 0x00 ; 0 2b142: 4a e7 ldi r20, 0x7A ; 122 2b144: 54 e4 ldi r21, 0x44 ; 68 2b146: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 2b14a: 9f 93 push r25 2b14c: 8f 93 push r24 2b14e: 7f 93 push r23 2b150: 6f 93 push r22 2b152: 89 ed ldi r24, 0xD9 ; 217 2b154: 90 ea ldi r25, 0xA0 ; 160 2b156: 9f 93 push r25 2b158: 8f 93 push r24 2b15a: 0e 94 6e 6f call 0xdedc ; 0xdedc 2b15e: 0f 90 pop r0 2b160: 0f 90 pop r0 2b162: 0f 90 pop r0 2b164: 0f 90 pop r0 2b166: 0f 90 pop r0 2b168: 0f 90 pop r0 2b16a: 52 cf rjmp .-348 ; 0x2b010 0002b16c : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 2b16c: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d startTimestamp = 0; 2b170: 10 92 a8 05 sts 0x05A8, r1 ; 0x8005a8 2b174: 10 92 a9 05 sts 0x05A9, r1 ; 0x8005a9 2b178: 10 92 aa 05 sts 0x05AA, r1 ; 0x8005aa 2b17c: 10 92 ab 05 sts 0x05AB, r1 ; 0x8005ab stopTimestamp = 0; 2b180: 10 92 4f 06 sts 0x064F, r1 ; 0x80064f 2b184: 10 92 50 06 sts 0x0650, r1 ; 0x800650 2b188: 10 92 51 06 sts 0x0651, r1 ; 0x800651 2b18c: 10 92 52 06 sts 0x0652, r1 ; 0x800652 accumulator = 0; 2b190: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 2b194: 10 92 a5 05 sts 0x05A5, r1 ; 0x8005a5 2b198: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 2b19c: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 } 2b1a0: 08 95 ret 0002b1a2 : /** * @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; } 2b1a2: 80 91 9d 03 lds r24, 0x039D ; 0x80039d } else return false; } bool Stopwatch::start() { if (!isRunning()) { 2b1a6: 81 30 cpi r24, 0x01 ; 1 2b1a8: f1 f0 breq .+60 ; 0x2b1e6 if (isPaused()) accumulator = duration(); 2b1aa: 82 30 cpi r24, 0x02 ; 2 2b1ac: c9 f4 brne .+50 ; 0x2b1e0 2b1ae: 0f 94 e7 54 call 0x2a9ce ; 0x2a9ce 2b1b2: 60 93 a4 05 sts 0x05A4, r22 ; 0x8005a4 2b1b6: 70 93 a5 05 sts 0x05A5, r23 ; 0x8005a5 2b1ba: 80 93 a6 05 sts 0x05A6, r24 ; 0x8005a6 2b1be: 90 93 a7 05 sts 0x05A7, r25 ; 0x8005a7 else reset(); state = RUNNING; 2b1c2: 81 e0 ldi r24, 0x01 ; 1 2b1c4: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d startTimestamp = _millis(); 2b1c8: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2b1cc: 60 93 a8 05 sts 0x05A8, r22 ; 0x8005a8 2b1d0: 70 93 a9 05 sts 0x05A9, r23 ; 0x8005a9 2b1d4: 80 93 aa 05 sts 0x05AA, r24 ; 0x8005aa 2b1d8: 90 93 ab 05 sts 0x05AB, r25 ; 0x8005ab 2b1dc: 81 e0 ldi r24, 0x01 ; 1 2b1de: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 2b1e0: 0f 94 b6 58 call 0x2b16c ; 0x2b16c 2b1e4: ee cf rjmp .-36 ; 0x2b1c2 state = RUNNING; startTimestamp = _millis(); return true; } else return false; 2b1e6: 80 e0 ldi r24, 0x00 ; 0 } 2b1e8: 08 95 ret 0002b1ea : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 2b1ea: 80 91 9d 03 lds r24, 0x039D ; 0x80039d 2b1ee: 81 50 subi r24, 0x01 ; 1 2b1f0: 82 30 cpi r24, 0x02 ; 2 2b1f2: 70 f4 brcc .+28 ; 0x2b210 state = STOPPED; 2b1f4: 10 92 9d 03 sts 0x039D, r1 ; 0x80039d stopTimestamp = _millis(); 2b1f8: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2b1fc: 60 93 4f 06 sts 0x064F, r22 ; 0x80064f 2b200: 70 93 50 06 sts 0x0650, r23 ; 0x800650 2b204: 80 93 51 06 sts 0x0651, r24 ; 0x800651 2b208: 90 93 52 06 sts 0x0652, r25 ; 0x800652 2b20c: 81 e0 ldi r24, 0x01 ; 1 2b20e: 08 95 ret return true; } else return false; 2b210: 80 e0 ldi r24, 0x00 ; 0 } 2b212: 08 95 ret 0002b214 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 2b214: 2f b7 in r18, 0x3f ; 63 2b216: f8 94 cli count_pos = count_position[axis]; 2b218: 94 e0 ldi r25, 0x04 ; 4 2b21a: 89 9f mul r24, r25 2b21c: f0 01 movw r30, r0 2b21e: 11 24 eor r1, r1 2b220: ec 59 subi r30, 0x9C ; 156 2b222: f8 4f sbci r31, 0xF8 ; 248 2b224: 60 81 ld r22, Z 2b226: 71 81 ldd r23, Z+1 ; 0x01 2b228: 82 81 ldd r24, Z+2 ; 0x02 2b22a: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 2b22c: 2f bf out 0x3f, r18 ; 63 return count_pos; } 2b22e: 08 95 ret 0002b230 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 2b230: cf 93 push r28 2b232: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 2b234: 0f 94 0a 59 call 0x2b214 ; 0x2b214 2b238: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2b23c: 24 e0 ldi r18, 0x04 ; 4 2b23e: c2 9f mul r28, r18 2b240: f0 01 movw r30, r0 2b242: 11 24 eor r1, r1 2b244: ee 58 subi r30, 0x8E ; 142 2b246: f9 4f sbci r31, 0xF9 ; 249 2b248: 20 81 ld r18, Z 2b24a: 31 81 ldd r19, Z+1 ; 0x01 2b24c: 42 81 ldd r20, Z+2 ; 0x02 2b24e: 53 81 ldd r21, Z+3 ; 0x03 2b250: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> } 2b254: cf 91 pop r28 2b256: 08 95 ret 0002b258 : } // Block until all buffered steps are executed void st_synchronize() { 2b258: cf 93 push r28 2b25a: df 93 push r29 2b25c: 00 d0 rcall .+0 ; 0x2b25e 2b25e: 1f 92 push r1 2b260: cd b7 in r28, 0x3d ; 61 2b262: 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); 2b264: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2b268: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 while(blocks_queued()) 2b26c: 98 17 cp r25, r24 2b26e: 09 f4 brne .+2 ; 0x2b272 2b270: 46 c0 rjmp .+140 ; 0x2b2fe { #ifdef TMC2130 manage_heater(); 2b272: 0f 94 a0 4e call 0x29d40 ; 0x29d40 tmc2130_sg_stop_on_crash = eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET); } bool tmc2130_update_sg() { if (tmc2130_sg_measure <= E_AXIS) 2b276: 80 91 3b 02 lds r24, 0x023B ; 0x80023b <_ZL18tmc2130_sg_measure.lto_priv.489> 2b27a: 84 30 cpi r24, 0x04 ; 4 2b27c: 38 f0 brcs .+14 ; 0x2b28c // Vojtech: Don't disable motors inside the planner! if (!tmc2130_update_sg()) { manage_inactivity(true); 2b27e: 81 e0 ldi r24, 0x01 ; 1 2b280: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_update(0); 2b284: 80 e0 ldi r24, 0x00 ; 0 2b286: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 2b28a: ec cf rjmp .-40 ; 0x2b264 { uint32_t val32 = 0; 2b28c: 19 82 std Y+1, r1 ; 0x01 2b28e: 1a 82 std Y+2, r1 ; 0x02 2b290: 1b 82 std Y+3, r1 ; 0x03 2b292: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(tmc2130_sg_measure, TMC2130_REG_DRV_STATUS, &val32); 2b294: ae 01 movw r20, r28 2b296: 4f 5f subi r20, 0xFF ; 255 2b298: 5f 4f sbci r21, 0xFF ; 255 2b29a: 6f e6 ldi r22, 0x6F ; 111 2b29c: 0f 94 ac 39 call 0x27358 ; 0x27358 tmc2130_sg_measure_val += (val32 & 0x3ff); 2b2a0: 89 81 ldd r24, Y+1 ; 0x01 2b2a2: 9a 81 ldd r25, Y+2 ; 0x02 2b2a4: ab 81 ldd r26, Y+3 ; 0x03 2b2a6: bc 81 ldd r27, Y+4 ; 0x04 2b2a8: 93 70 andi r25, 0x03 ; 3 2b2aa: aa 27 eor r26, r26 2b2ac: bb 27 eor r27, r27 2b2ae: 40 91 cd 03 lds r20, 0x03CD ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490> 2b2b2: 50 91 ce 03 lds r21, 0x03CE ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 2b2b6: 60 91 cf 03 lds r22, 0x03CF ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 2b2ba: 70 91 d0 03 lds r23, 0x03D0 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> 2b2be: 84 0f add r24, r20 2b2c0: 95 1f adc r25, r21 2b2c2: a6 1f adc r26, r22 2b2c4: b7 1f adc r27, r23 2b2c6: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd <_ZL22tmc2130_sg_measure_val.lto_priv.490> 2b2ca: 90 93 ce 03 sts 0x03CE, r25 ; 0x8003ce <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x1> 2b2ce: a0 93 cf 03 sts 0x03CF, r26 ; 0x8003cf <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x2> 2b2d2: b0 93 d0 03 sts 0x03D0, r27 ; 0x8003d0 <_ZL22tmc2130_sg_measure_val.lto_priv.490+0x3> tmc2130_sg_measure_cnt++; 2b2d6: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 2b2da: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 2b2de: a0 91 cb 03 lds r26, 0x03CB ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 2b2e2: b0 91 cc 03 lds r27, 0x03CC ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> 2b2e6: 01 96 adiw r24, 0x01 ; 1 2b2e8: a1 1d adc r26, r1 2b2ea: b1 1d adc r27, r1 2b2ec: 80 93 c9 03 sts 0x03C9, r24 ; 0x8003c9 <_ZL22tmc2130_sg_measure_cnt.lto_priv.491> 2b2f0: 90 93 ca 03 sts 0x03CA, r25 ; 0x8003ca <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x1> 2b2f4: a0 93 cb 03 sts 0x03CB, r26 ; 0x8003cb <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x2> 2b2f8: b0 93 cc 03 sts 0x03CC, r27 ; 0x8003cc <_ZL22tmc2130_sg_measure_cnt.lto_priv.491+0x3> 2b2fc: b3 cf rjmp .-154 ; 0x2b264 #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); #endif //TMC2130 } } 2b2fe: 0f 90 pop r0 2b300: 0f 90 pop r0 2b302: 0f 90 pop r0 2b304: 0f 90 pop r0 2b306: df 91 pop r29 2b308: cf 91 pop r28 2b30a: 08 95 ret 0002b30c : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 2b30c: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 2b30e: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2b312: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 2b316: 80 ed ldi r24, 0xD0 ; 208 2b318: 97 e0 ldi r25, 0x07 ; 7 2b31a: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b31e: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 2b322: 10 92 e9 04 sts 0x04E9, r1 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2b326: 10 92 e8 04 sts 0x04E8, r1 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b32a: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> 2b32e: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b332: 01 97 sbiw r24, 0x01 ; 1 2b334: 8e 3f cpi r24, 0xFE ; 254 2b336: 9f 4f sbci r25, 0xFF ; 255 2b338: 20 f4 brcc .+8 ; 0x2b342 nextAdvanceISR = 0; 2b33a: 10 92 e7 04 sts 0x04E7, r1 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b33e: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> #endif } 2b342: 08 95 ret 0002b344 : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 2b344: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2b348: 81 11 cpse r24, r1 2b34a: 3c c0 rjmp .+120 ; 0x2b3c4 #ifdef TMC2130 case SILENT_MODE_NORMAL: SilentModeMenu = SILENT_MODE_STEALTH; break; 2b34c: 81 e0 ldi r24, 0x01 ; 1 2b34e: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 2b352: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 2b356: 8f ef ldi r24, 0xFF ; 255 2b358: 9f e0 ldi r25, 0x0F ; 15 2b35a: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 2b35e: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2b362: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 default: SilentModeMenu = SILENT_MODE_POWER; break; // (probably) not needed #endif //TMC2130 } eeprom_update_byte_notify((unsigned char *)EEPROM_SILENT, SilentModeMenu); #ifdef TMC2130 if (blocks_queued()) 2b366: 98 17 cp r25, r24 2b368: 41 f0 breq .+16 ; 0x2b37a { lcd_display_message_fullscreen_P(_T(MSG_MODE_CHANGE_IN_PROGRESS)); 2b36a: 83 e7 ldi r24, 0x73 ; 115 2b36c: 9e e4 ldi r25, 0x4E ; 78 2b36e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2b372: 0f 94 85 35 call 0x26b0a ; 0x26b0a // Wait until the planner queue is drained and the stepper routine achieves // an idle state. st_synchronize(); 2b376: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } tmc2130_wait_standstill_xy(1000); 2b37a: 0f 94 ea 87 call 0x30fd4 ; 0x30fd4 cli(); 2b37e: f8 94 cli tmc2130_mode = (SilentModeMenu != SILENT_MODE_NORMAL)?TMC2130_MODE_SILENT:TMC2130_MODE_NORMAL; 2b380: 81 e0 ldi r24, 0x01 ; 1 2b382: 90 91 a4 03 lds r25, 0x03A4 ; 0x8003a4 2b386: 91 11 cpse r25, r1 2b388: 01 c0 rjmp .+2 ; 0x2b38c 2b38a: 80 e0 ldi r24, 0x00 ; 0 2b38c: 80 93 6c 06 sts 0x066C, r24 ; 0x80066c update_mode_profile(); 2b390: 0f 94 c7 aa call 0x3558e ; 0x3558e 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(); 2b394: 0e 94 d6 f9 call 0x1f3ac ; 0x1f3ac 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) { } 2b398: 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())); 2b39a: 82 70 andi r24, 0x02 ; 2 2b39c: 0f 94 21 3c call 0x27842 ; 0x27842 // 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(); 2b3a0: 0f 94 86 59 call 0x2b30c ; 0x2b30c sei(); 2b3a4: 78 94 sei #else st_current_init(); #endif //TMC2130 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) 2b3a6: 89 e6 ldi r24, 0x69 ; 105 2b3a8: 9f e0 ldi r25, 0x0F ; 15 2b3aa: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2b3ae: 88 23 and r24, r24 2b3b0: 61 f0 breq .+24 ; 0x2b3ca 2b3b2: 80 91 a4 03 lds r24, 0x03A4 ; 0x8003a4 2b3b6: 88 23 and r24, r24 2b3b8: 41 f0 breq .+16 ; 0x2b3ca menu_submenu(lcd_crash_mode_info2); 2b3ba: 60 e0 ldi r22, 0x00 ; 0 2b3bc: 84 e6 ldi r24, 0x64 ; 100 2b3be: 9a e3 ldi r25, 0x3A ; 58 2b3c0: 0d 94 7d d0 jmp 0x3a0fa ; 0x3a0fa 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; 2b3c4: 10 92 a4 03 sts 0x03A4, r1 ; 0x8003a4 2b3c8: c4 cf rjmp .-120 ; 0x2b352 #ifdef TMC2130 if (eeprom_read_byte((uint8_t*)EEPROM_CRASH_DET) && (SilentModeMenu != SILENT_MODE_NORMAL)) menu_submenu(lcd_crash_mode_info2); #endif //TMC2130 } 2b3ca: 08 95 ret 0002b3cc <__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) { 2b3cc: 1f 92 push r1 2b3ce: 0f 92 push r0 2b3d0: 0f b6 in r0, 0x3f ; 63 2b3d2: 0f 92 push r0 2b3d4: 11 24 eor r1, r1 2b3d6: 0b b6 in r0, 0x3b ; 59 2b3d8: 0f 92 push r0 2b3da: 6f 92 push r6 2b3dc: 7f 92 push r7 2b3de: 8f 92 push r8 2b3e0: cf 92 push r12 2b3e2: df 92 push r13 2b3e4: ef 92 push r14 2b3e6: ff 92 push r15 2b3e8: 0f 93 push r16 2b3ea: 1f 93 push r17 2b3ec: 2f 93 push r18 2b3ee: 3f 93 push r19 2b3f0: 4f 93 push r20 2b3f2: 5f 93 push r21 2b3f4: 6f 93 push r22 2b3f6: 7f 93 push r23 2b3f8: 8f 93 push r24 2b3fa: 9f 93 push r25 2b3fc: af 93 push r26 2b3fe: bf 93 push r27 2b400: cf 93 push r28 2b402: df 93 push r29 2b404: ef 93 push r30 2b406: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 2b408: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> 2b40c: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b410: 9c 01 movw r18, r24 2b412: 21 50 subi r18, 0x01 ; 1 2b414: 31 09 sbc r19, r1 2b416: 2e 3f cpi r18, 0xFE ; 254 2b418: 3f 4f sbci r19, 0xFF ; 255 2b41a: 90 f4 brcc .+36 ; 0x2b440 <__vector_17+0x74> { if(nextAdvanceISR > OCR1A) 2b41c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b420: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b424: 28 17 cp r18, r24 2b426: 39 07 cpc r19, r25 2b428: 08 f0 brcs .+2 ; 0x2b42c <__vector_17+0x60> 2b42a: f9 c0 rjmp .+498 ; 0x2b61e <__vector_17+0x252> nextAdvanceISR -= OCR1A; 2b42c: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b430: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b434: 82 1b sub r24, r18 2b436: 93 0b sbc r25, r19 2b438: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b43c: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2b440: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b444: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b448: 80 91 e8 04 lds r24, 0x04E8 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2b44c: 90 91 e9 04 lds r25, 0x04E9 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2b450: 28 17 cp r18, r24 2b452: 39 07 cpc r19, r25 2b454: 08 f0 brcs .+2 ; 0x2b458 <__vector_17+0x8c> 2b456: e8 c0 rjmp .+464 ; 0x2b628 <__vector_17+0x25c> nextMainISR -= OCR1A; 2b458: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2b45c: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2b460: 82 1b sub r24, r18 2b462: 93 0b sbc r25, r19 2b464: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2b468: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 2b46c: 80 91 e8 04 lds r24, 0x04E8 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2b470: 90 91 e9 04 lds r25, 0x04E9 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2b474: 89 2b or r24, r25 2b476: 11 f0 breq .+4 ; 0x2b47c <__vector_17+0xb0> 2b478: 0d 94 36 63 jmp 0x2c66c ; 0x2c66c <__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) 2b47c: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b480: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b484: 30 97 sbiw r30, 0x00 ; 0 2b486: 09 f0 breq .+2 ; 0x2b48a <__vector_17+0xbe> 2b488: 87 c1 rjmp .+782 ; 0x2b798 <__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) { 2b48a: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2b48e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2b492: 98 17 cp r25, r24 2b494: 09 f4 brne .+2 ; 0x2b498 <__vector_17+0xcc> 2b496: f9 c1 rjmp .+1010 ; 0x2b88a <__vector_17+0x4be> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 2b498: c0 91 57 0e lds r28, 0x0E57 ; 0x800e57 2b49c: 2c 2f mov r18, r28 2b49e: 30 e0 ldi r19, 0x00 ; 0 2b4a0: 5e e6 ldi r21, 0x6E ; 110 2b4a2: c5 9f mul r28, r21 2b4a4: e0 01 movw r28, r0 2b4a6: 11 24 eor r1, r1 2b4a8: ca 58 subi r28, 0x8A ; 138 2b4aa: d8 4f sbci r29, 0xF8 ; 248 block->busy = true; 2b4ac: fe 01 movw r30, r28 2b4ae: e9 5b subi r30, 0xB9 ; 185 2b4b0: ff 4f sbci r31, 0xFF ; 255 2b4b2: 41 e0 ldi r20, 0x01 ; 1 2b4b4: 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(); 2b4b6: d0 93 a3 05 sts 0x05A3, r29 ; 0x8005a3 2b4ba: c0 93 a2 05 sts 0x05A2, r28 ; 0x8005a2 if (current_block != NULL) { 2b4be: 20 97 sbiw r28, 0x00 ; 0 2b4c0: 09 f4 brne .+2 ; 0x2b4c4 <__vector_17+0xf8> 2b4c2: e3 c1 rjmp .+966 ; 0x2b88a <__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; 2b4c4: 10 92 9e 05 sts 0x059E, r1 ; 0x80059e 2b4c8: 10 92 9f 05 sts 0x059F, r1 ; 0x80059f 2b4cc: 10 92 a0 05 sts 0x05A0, r1 ; 0x8005a0 2b4d0: 10 92 a1 05 sts 0x05A1, r1 ; 0x8005a1 // Set the nominal step loops to zero to indicate, that the timer value is not known yet. // That means, delay the initialization of nominal step rate and step loops until the steady // state is reached. step_loops_nominal = 0; 2b4d4: 10 92 9d 05 sts 0x059D, r1 ; 0x80059d acc_step_rate = uint16_t(current_block->initial_rate); 2b4d8: 8a ad ldd r24, Y+58 ; 0x3a 2b4da: 9b ad ldd r25, Y+59 ; 0x3b 2b4dc: 90 93 9c 05 sts 0x059C, r25 ; 0x80059c 2b4e0: 80 93 9b 05 sts 0x059B, r24 ; 0x80059b #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2b4e4: 81 34 cpi r24, 0x41 ; 65 2b4e6: ec e9 ldi r30, 0x9C ; 156 2b4e8: 9e 07 cpc r25, r30 2b4ea: 08 f0 brcs .+2 ; 0x2b4ee <__vector_17+0x122> 2b4ec: a2 c0 rjmp .+324 ; 0x2b632 <__vector_17+0x266> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2b4ee: 81 32 cpi r24, 0x21 ; 33 2b4f0: fe e4 ldi r31, 0x4E ; 78 2b4f2: 9f 07 cpc r25, r31 2b4f4: 08 f4 brcc .+2 ; 0x2b4f8 <__vector_17+0x12c> 2b4f6: a0 c0 rjmp .+320 ; 0x2b638 <__vector_17+0x26c> step_rate = (step_rate >> 2)&0x3fff; 2b4f8: 96 95 lsr r25 2b4fa: 87 95 ror r24 2b4fc: 96 95 lsr r25 2b4fe: 87 95 ror r24 step_loops = 4; 2b500: 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; 2b502: 40 93 9a 05 sts 0x059A, r20 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2b506: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2b508: 81 15 cp r24, r1 2b50a: e8 e0 ldi r30, 0x08 ; 8 2b50c: 9e 07 cpc r25, r30 2b50e: 08 f4 brcc .+2 ; 0x2b512 <__vector_17+0x146> 2b510: a4 c0 rjmp .+328 ; 0x2b65a <__vector_17+0x28e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2b512: e9 2f mov r30, r25 2b514: ff 27 eor r31, r31 2b516: ee 0f add r30, r30 2b518: ff 1f adc r31, r31 2b51a: ee 0f add r30, r30 2b51c: ff 1f adc r31, r31 2b51e: af 01 movw r20, r30 2b520: 47 55 subi r20, 0x57 ; 87 2b522: 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); 2b524: fa 01 movw r30, r20 2b526: 32 96 adiw r30, 0x02 ; 2 2b528: a5 91 lpm r26, Z+ 2b52a: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2b52c: fa 01 movw r30, r20 2b52e: 45 91 lpm r20, Z+ 2b530: 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. ); 2b532: b8 9f mul r27, r24 2b534: b0 01 movw r22, r0 2b536: a8 9f mul r26, r24 2b538: 00 0c add r0, r0 2b53a: 61 1d adc r22, r1 2b53c: 11 24 eor r1, r1 2b53e: 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); 2b540: ca 01 movw r24, r20 2b542: 86 1b sub r24, r22 2b544: 97 0b sbc r25, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2b546: 84 36 cpi r24, 0x64 ; 100 2b548: 91 05 cpc r25, r1 2b54a: 10 f4 brcc .+4 ; 0x2b550 <__vector_17+0x184> 2b54c: 84 e6 ldi r24, 0x64 ; 100 2b54e: 90 e0 ldi r25, 0x00 ; 0 2b550: b0 e0 ldi r27, 0x00 ; 0 2b552: a0 e0 ldi r26, 0x00 ; 0 2b554: 80 93 96 05 sts 0x0596, r24 ; 0x800596 2b558: 90 93 97 05 sts 0x0597, r25 ; 0x800597 2b55c: a0 93 98 05 sts 0x0598, r26 ; 0x800598 2b560: b0 93 99 05 sts 0x0599, r27 ; 0x800599 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2b564: 4e e6 ldi r20, 0x6E ; 110 2b566: 42 9f mul r20, r18 2b568: c0 01 movw r24, r0 2b56a: 43 9f mul r20, r19 2b56c: 90 0d add r25, r0 2b56e: 11 24 eor r1, r1 2b570: 8a 58 subi r24, 0x8A ; 138 2b572: 98 4f sbci r25, 0xF8 ; 248 2b574: fc 01 movw r30, r24 2b576: e4 5b subi r30, 0xB4 ; 180 2b578: ff 4f sbci r31, 0xFF ; 255 2b57a: 40 81 ld r20, Z 2b57c: 44 23 and r20, r20 2b57e: 49 f0 breq .+18 ; 0x2b592 <__vector_17+0x1c6> target_adv_steps = current_block->max_adv_steps; 2b580: 81 5b subi r24, 0xB1 ; 177 2b582: 9f 4f sbci r25, 0xFF ; 255 2b584: fc 01 movw r30, r24 2b586: 80 81 ld r24, Z 2b588: 91 81 ldd r25, Z+1 ; 0x01 2b58a: 90 93 95 05 sts 0x0595, r25 ; 0x800595 2b58e: 80 93 94 05 sts 0x0594, r24 ; 0x800594 } e_steps = 0; 2b592: 10 92 93 05 sts 0x0593, r1 ; 0x800593 nextAdvanceISR = ADV_NEVER; 2b596: 8f ef ldi r24, 0xFF ; 255 2b598: 9f ef ldi r25, 0xFF ; 255 2b59a: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b59e: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> LA_phase = -1; 2b5a2: 80 93 92 05 sts 0x0592, r24 ; 0x800592 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 2b5a6: 8e e6 ldi r24, 0x6E ; 110 2b5a8: 82 9f mul r24, r18 2b5aa: f0 01 movw r30, r0 2b5ac: 83 9f mul r24, r19 2b5ae: f0 0d add r31, r0 2b5b0: 11 24 eor r1, r1 2b5b2: ea 58 subi r30, 0x8A ; 138 2b5b4: f8 4f sbci r31, 0xF8 ; 248 2b5b6: 85 a9 ldd r24, Z+53 ; 0x35 2b5b8: 84 ff sbrs r24, 4 2b5ba: 08 c0 rjmp .+16 ; 0x2b5cc <__vector_17+0x200> count_position[E_AXIS] = 0; 2b5bc: 10 92 70 07 sts 0x0770, r1 ; 0x800770 2b5c0: 10 92 71 07 sts 0x0771, r1 ; 0x800771 2b5c4: 10 92 72 07 sts 0x0772, r1 ; 0x800772 2b5c8: 10 92 73 07 sts 0x0773, r1 ; 0x800773 } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 2b5cc: 83 ff sbrs r24, 3 2b5ce: 66 c0 rjmp .+204 ; 0x2b69c <__vector_17+0x2d0> const int16_t value = -(current_block->step_event_count.lo >> 1); 2b5d0: 8e e6 ldi r24, 0x6E ; 110 2b5d2: 82 9f mul r24, r18 2b5d4: f0 01 movw r30, r0 2b5d6: 83 9f mul r24, r19 2b5d8: f0 0d add r31, r0 2b5da: 11 24 eor r1, r1 2b5dc: ea 58 subi r30, 0x8A ; 138 2b5de: f8 4f sbci r31, 0xF8 ; 248 2b5e0: 80 89 ldd r24, Z+16 ; 0x10 2b5e2: 91 89 ldd r25, Z+17 ; 0x11 2b5e4: 96 95 lsr r25 2b5e6: 87 95 ror r24 2b5e8: 91 95 neg r25 2b5ea: 81 95 neg r24 2b5ec: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 2b5ee: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2b5f2: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2b5f6: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2b5fa: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2b5fe: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2b602: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2b606: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2b60a: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 2b60e: 81 e0 ldi r24, 0x01 ; 1 2b610: 24 85 ldd r18, Z+12 ; 0x0c 2b612: 35 85 ldd r19, Z+13 ; 0x0d 2b614: 23 2b or r18, r19 2b616: 09 f0 breq .+2 ; 0x2b61a <__vector_17+0x24e> 2b618: 82 c0 rjmp .+260 ; 0x2b71e <__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; 2b61a: 80 e0 ldi r24, 0x00 ; 0 2b61c: 80 c0 rjmp .+256 ; 0x2b71e <__vector_17+0x352> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 2b61e: 10 92 e7 04 sts 0x04E7, r1 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b622: 10 92 e6 04 sts 0x04E6, r1 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> 2b626: 0c cf rjmp .-488 ; 0x2b440 <__vector_17+0x74> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 2b628: 10 92 e9 04 sts 0x04E9, r1 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2b62c: 10 92 e8 04 sts 0x04E8, r1 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2b630: 1d cf rjmp .-454 ; 0x2b46c <__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; 2b632: 80 e4 ldi r24, 0x40 ; 64 2b634: 9c e9 ldi r25, 0x9C ; 156 2b636: 60 cf rjmp .-320 ; 0x2b4f8 <__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 2b638: 81 31 cpi r24, 0x11 ; 17 2b63a: 57 e2 ldi r21, 0x27 ; 39 2b63c: 95 07 cpc r25, r21 2b63e: 20 f0 brcs .+8 ; 0x2b648 <__vector_17+0x27c> step_rate = (step_rate >> 1)&0x7fff; 2b640: 96 95 lsr r25 2b642: 87 95 ror r24 step_loops = 2; 2b644: 42 e0 ldi r20, 0x02 ; 2 2b646: 5d cf rjmp .-326 ; 0x2b502 <__vector_17+0x136> } else { step_loops = 1; 2b648: 40 93 9a 05 sts 0x059A, r20 ; 0x80059a 2b64c: 80 32 cpi r24, 0x20 ; 32 2b64e: 91 05 cpc r25, r1 2b650: 08 f0 brcs .+2 ; 0x2b654 <__vector_17+0x288> 2b652: 59 cf rjmp .-334 ; 0x2b506 <__vector_17+0x13a> 2b654: 80 e2 ldi r24, 0x20 ; 32 2b656: 90 e0 ldi r25, 0x00 ; 0 2b658: 56 cf rjmp .-340 ; 0x2b506 <__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; 2b65a: ac 01 movw r20, r24 2b65c: 56 95 lsr r21 2b65e: 47 95 ror r20 2b660: 4c 7f andi r20, 0xFC ; 252 2b662: 47 55 subi r20, 0x57 ; 87 2b664: 5d 46 sbci r21, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2b666: fa 01 movw r30, r20 2b668: 65 91 lpm r22, Z+ 2b66a: 74 91 lpm r23, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2b66c: fa 01 movw r30, r20 2b66e: 32 96 adiw r30, 0x02 ; 2 2b670: a5 91 lpm r26, Z+ 2b672: b4 91 lpm r27, Z 2b674: ac 01 movw r20, r24 2b676: 47 70 andi r20, 0x07 ; 7 2b678: 55 27 eor r21, r21 2b67a: 4a 9f mul r20, r26 2b67c: c0 01 movw r24, r0 2b67e: 4b 9f mul r20, r27 2b680: 90 0d add r25, r0 2b682: 5a 9f mul r21, r26 2b684: 90 0d add r25, r0 2b686: 11 24 eor r1, r1 2b688: e3 e0 ldi r30, 0x03 ; 3 2b68a: 96 95 lsr r25 2b68c: 87 95 ror r24 2b68e: ea 95 dec r30 2b690: e1 f7 brne .-8 ; 0x2b68a <__vector_17+0x2be> 2b692: ab 01 movw r20, r22 2b694: 48 1b sub r20, r24 2b696: 59 0b sbc r21, r25 2b698: ca 01 movw r24, r20 2b69a: 55 cf rjmp .-342 ; 0x2b546 <__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); 2b69c: 8e e6 ldi r24, 0x6E ; 110 2b69e: 82 9f mul r24, r18 2b6a0: f0 01 movw r30, r0 2b6a2: 83 9f mul r24, r19 2b6a4: f0 0d add r31, r0 2b6a6: 11 24 eor r1, r1 2b6a8: ea 58 subi r30, 0x8A ; 138 2b6aa: f8 4f sbci r31, 0xF8 ; 248 2b6ac: 80 89 ldd r24, Z+16 ; 0x10 2b6ae: 91 89 ldd r25, Z+17 ; 0x11 2b6b0: a2 89 ldd r26, Z+18 ; 0x12 2b6b2: b3 89 ldd r27, Z+19 ; 0x13 2b6b4: b6 95 lsr r27 2b6b6: a7 95 ror r26 2b6b8: 97 95 ror r25 2b6ba: 87 95 ror r24 2b6bc: b0 95 com r27 2b6be: a0 95 com r26 2b6c0: 90 95 com r25 2b6c2: 81 95 neg r24 2b6c4: 9f 4f sbci r25, 0xFF ; 255 2b6c6: af 4f sbci r26, 0xFF ; 255 2b6c8: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 2b6ca: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2b6ce: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2b6d2: a0 93 84 05 sts 0x0584, r26 ; 0x800584 2b6d6: b0 93 85 05 sts 0x0585, r27 ; 0x800585 2b6da: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2b6de: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2b6e2: a0 93 88 05 sts 0x0588, r26 ; 0x800588 2b6e6: b0 93 89 05 sts 0x0589, r27 ; 0x800589 2b6ea: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2b6ee: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2b6f2: a0 93 8c 05 sts 0x058C, r26 ; 0x80058c 2b6f6: b0 93 8d 05 sts 0x058D, r27 ; 0x80058d 2b6fa: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2b6fe: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2b702: a0 93 90 05 sts 0x0590, r26 ; 0x800590 2b706: b0 93 91 05 sts 0x0591, r27 ; 0x800591 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 2b70a: 81 e0 ldi r24, 0x01 ; 1 2b70c: 44 85 ldd r20, Z+12 ; 0x0c 2b70e: 55 85 ldd r21, Z+13 ; 0x0d 2b710: 66 85 ldd r22, Z+14 ; 0x0e 2b712: 77 85 ldd r23, Z+15 ; 0x0f 2b714: 45 2b or r20, r21 2b716: 46 2b or r20, r22 2b718: 47 2b or r20, r23 2b71a: 09 f4 brne .+2 ; 0x2b71e <__vector_17+0x352> 2b71c: 7e cf rjmp .-260 ; 0x2b61a <__vector_17+0x24e> 2b71e: 80 93 81 05 sts 0x0581, r24 ; 0x800581 #endif } step_events_completed.wide = 0; 2b722: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 2b726: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 2b72a: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f 2b72e: 10 92 80 05 sts 0x0580, r1 ; 0x800580 // Set directions. out_bits = current_block->direction_bits; 2b732: 88 8d ldd r24, Y+24 ; 0x18 2b734: 80 93 7c 05 sts 0x057C, r24 ; 0x80057c // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< WRITE_NC(X_DIR_PIN, INVERT_X_DIR); 2b73c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b740: 81 60 ori r24, 0x01 ; 1 2b742: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 2b746: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 2b748: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f } if((out_bits & (1< 2b750: 81 ff sbrs r24, 1 2b752: 8b c0 rjmp .+278 ; 0x2b86a <__vector_17+0x49e> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 2b754: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b758: 8d 7f andi r24, 0xFD ; 253 2b75a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2b75e: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 2b760: 80 93 70 02 sts 0x0270, r24 ; 0x800270 } if ((out_bits & (1< 2b768: 82 ff sbrs r24, 2 2b76a: 86 c0 rjmp .+268 ; 0x2b878 <__vector_17+0x4ac> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2b76c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2b770: 84 60 ori r24, 0x04 ; 4 2b772: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 2b776: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 2b778: 80 93 71 02 sts 0x0271, r24 ; 0x800271 } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2b77c: 80 91 7c 05 lds r24, 0x057C ; 0x80057c 2b780: 83 ff sbrs r24, 3 2b782: 81 c0 rjmp .+258 ; 0x2b886 <__vector_17+0x4ba> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 2b784: 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; 2b786: 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) 2b78a: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b78e: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b792: 30 97 sbiw r30, 0x00 ; 0 2b794: 09 f4 brne .+2 ; 0x2b798 <__vector_17+0x3cc> 2b796: 3d c7 rjmp .+3706 ; 0x2c612 <__vector_17+0x1246> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 2b798: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 2b79c: 50 91 79 05 lds r21, 0x0579 ; 0x800579 2b7a0: 88 23 and r24, r24 2b7a2: 09 f4 brne .+2 ; 0x2b7a6 <__vector_17+0x3da> 2b7a4: cb c0 rjmp .+406 ; 0x2b93c <__vector_17+0x570> { uint8_t _endstop_hit = endstop_hit; 2b7a6: 20 91 0e 05 lds r18, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.496> uint8_t _endstop = endstop; 2b7aa: 80 91 7b 05 lds r24, 0x057B ; 0x80057b uint8_t _old_endstop = old_endstop; 2b7ae: 90 91 7a 05 lds r25, 0x057A ; 0x80057a #ifndef COREXY if ((out_bits & (1< #endif { #if ( (defined(X_MIN_PIN) && (X_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_XMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, X_AXIS, (!READ(X_TMC2130_DIAG))); 2b7b6: 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))); 2b7be: 42 fd sbrc r20, 2 2b7c0: 83 c0 rjmp .+262 ; 0x2b8c8 <__vector_17+0x4fc> 2b7c2: 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)) { 2b7c4: 49 2f mov r20, r25 2b7c6: 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)){ 2b7c8: 48 23 and r20, r24 2b7ca: b1 f0 breq .+44 ; 0x2b7f8 <__vector_17+0x42c> 2b7cc: c0 80 ld r12, Z 2b7ce: d1 80 ldd r13, Z+1 ; 0x01 2b7d0: e2 80 ldd r14, Z+2 ; 0x02 2b7d2: f3 80 ldd r15, Z+3 ; 0x03 2b7d4: 1c 14 cp r1, r12 2b7d6: 1d 04 cpc r1, r13 2b7d8: 1e 04 cpc r1, r14 2b7da: 1f 04 cpc r1, r15 2b7dc: 6c f4 brge .+26 ; 0x2b7f8 <__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); 2b7de: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 2b7e0: c0 88 ldd r12, Z+16 ; 0x10 2b7e2: d1 88 ldd r13, Z+17 ; 0x11 2b7e4: e2 88 ldd r14, Z+18 ; 0x12 2b7e6: f3 88 ldd r15, Z+19 ; 0x13 2b7e8: c0 92 7d 05 sts 0x057D, r12 ; 0x80057d 2b7ec: d0 92 7e 05 sts 0x057E, r13 ; 0x80057e 2b7f0: e0 92 7f 05 sts 0x057F, r14 ; 0x80057f 2b7f4: f0 92 80 05 sts 0x0580, r15 ; 0x800580 #endif { #if ( (defined(Y_MIN_PIN) && (Y_MIN_PIN > -1)) || defined(TMC2130_SG_HOMING) ) && !defined(DEBUG_DISABLE_YMINLIMIT) #ifdef TMC2130_SG_HOMING // Stall guard homing turned on SET_BIT_TO(_endstop, Y_AXIS, (!READ(Y_TMC2130_DIAG))); 2b7f8: 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))); 2b800: 47 fd sbrc r20, 7 2b802: 6c c0 rjmp .+216 ; 0x2b8dc <__vector_17+0x510> 2b804: 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)) { 2b806: 49 2f mov r20, r25 2b808: 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)){ 2b80a: 48 23 and r20, r24 2b80c: b1 f0 breq .+44 ; 0x2b83a <__vector_17+0x46e> 2b80e: c4 80 ldd r12, Z+4 ; 0x04 2b810: d5 80 ldd r13, Z+5 ; 0x05 2b812: e6 80 ldd r14, Z+6 ; 0x06 2b814: f7 80 ldd r15, Z+7 ; 0x07 2b816: 1c 14 cp r1, r12 2b818: 1d 04 cpc r1, r13 2b81a: 1e 04 cpc r1, r14 2b81c: 1f 04 cpc r1, r15 2b81e: 6c f4 brge .+26 ; 0x2b83a <__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); 2b820: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 2b822: c0 88 ldd r12, Z+16 ; 0x10 2b824: d1 88 ldd r13, Z+17 ; 0x11 2b826: e2 88 ldd r14, Z+18 ; 0x12 2b828: f3 88 ldd r15, Z+19 ; 0x13 2b82a: c0 92 7d 05 sts 0x057D, r12 ; 0x80057d 2b82e: d0 92 7e 05 sts 0x057E, r13 ; 0x80057e 2b832: e0 92 7f 05 sts 0x057F, r14 ; 0x80057f 2b836: f0 92 80 05 sts 0x0580, r15 ; 0x800580 } #endif } if ((out_bits & (1< { #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (! check_z_endstop) { 2b83e: 51 11 cpse r21, r1 2b840: 77 c0 rjmp .+238 ; 0x2b930 <__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)) 2b842: 30 91 6c 06 lds r19, 0x066C ; 0x80066c 2b846: 31 30 cpi r19, 0x01 ; 1 2b848: 09 f0 breq .+2 ; 0x2b84c <__vector_17+0x480> 2b84a: 52 c0 rjmp .+164 ; 0x2b8f0 <__vector_17+0x524> 2b84c: 30 91 40 06 lds r19, 0x0640 ; 0x800640 2b850: 32 fd sbrc r19, 2 2b852: 4e c0 rjmp .+156 ; 0x2b8f0 <__vector_17+0x524> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b854: 1c 9b sbis 0x03, 4 ; 3 2b856: 52 c0 rjmp .+164 ; 0x2b8fc <__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))); 2b858: 84 60 ori r24, 0x04 ; 4 2b85a: 51 c0 rjmp .+162 ; 0x2b8fe <__vector_17+0x532> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 2b860: 8e 7f andi r24, 0xFE ; 254 2b862: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 2b866: 81 e0 ldi r24, 0x01 ; 1 2b868: 6f cf rjmp .-290 ; 0x2b748 <__vector_17+0x37c> } if((out_bits & (1< 2b86e: 82 60 ori r24, 0x02 ; 2 2b870: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 2b874: 81 e0 ldi r24, 0x01 ; 1 2b876: 74 cf rjmp .-280 ; 0x2b760 <__vector_17+0x394> } if ((out_bits & (1< 2b87c: 8b 7f andi r24, 0xFB ; 251 2b87e: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 2b882: 81 e0 ldi r24, 0x01 ; 1 2b884: 79 cf rjmp .-270 ; 0x2b778 <__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; 2b886: 81 e0 ldi r24, 0x01 ; 1 2b888: 7e cf rjmp .-260 ; 0x2b786 <__vector_17+0x3ba> } } else { _NEXT_ISR(2000); // 1kHz. 2b88a: 80 ed ldi r24, 0xD0 ; 208 2b88c: 97 e0 ldi r25, 0x07 ; 7 2b88e: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2b892: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2b896: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.494+0x1> 2b89a: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.494> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 2b89e: 8f ef ldi r24, 0xFF ; 255 2b8a0: 9f ef ldi r25, 0xFF ; 255 2b8a2: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2b8a6: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> e_steps = 0; 2b8aa: 10 92 93 05 sts 0x0593, r1 ; 0x800593 // incrementally lose pressure to give a chance for // a new LA block to be scheduled and recover if(current_adv_steps) 2b8ae: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2b8b2: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2b8b6: 00 97 sbiw r24, 0x00 ; 0 2b8b8: 09 f4 brne .+2 ; 0x2b8bc <__vector_17+0x4f0> 2b8ba: 67 cf rjmp .-306 ; 0x2b78a <__vector_17+0x3be> --current_adv_steps; 2b8bc: 01 97 sbiw r24, 0x01 ; 1 2b8be: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2b8c2: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2b8c6: 61 cf rjmp .-318 ; 0x2b78a <__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))); 2b8c8: 8e 7f andi r24, 0xFE ; 254 2b8ca: 7c cf rjmp .-264 ; 0x2b7c4 <__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))); 2b8cc: 42 fd sbrc r20, 2 2b8ce: 04 c0 rjmp .+8 ; 0x2b8d8 <__vector_17+0x50c> 2b8d0: 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)){ 2b8d2: 49 2f mov r20, r25 2b8d4: 40 71 andi r20, 0x10 ; 16 2b8d6: 78 cf rjmp .-272 ; 0x2b7c8 <__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))); 2b8d8: 8f 7e andi r24, 0xEF ; 239 2b8da: fb cf rjmp .-10 ; 0x2b8d2 <__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))); 2b8dc: 8d 7f andi r24, 0xFD ; 253 2b8de: 93 cf rjmp .-218 ; 0x2b806 <__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))); 2b8e0: 47 fd sbrc r20, 7 2b8e2: 04 c0 rjmp .+8 ; 0x2b8ec <__vector_17+0x520> 2b8e4: 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)){ 2b8e6: 49 2f mov r20, r25 2b8e8: 40 72 andi r20, 0x20 ; 32 2b8ea: 8f cf rjmp .-226 ; 0x2b80a <__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))); 2b8ec: 8f 7d andi r24, 0xDF ; 223 2b8ee: fb cf rjmp .-10 ; 0x2b8e6 <__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))); 2b8f0: 1c 99 sbic 0x03, 4 ; 3 2b8f2: b2 cf rjmp .-156 ; 0x2b858 <__vector_17+0x48c> 2b8f4: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b8f8: 36 ff sbrs r19, 6 2b8fa: ae cf rjmp .-164 ; 0x2b858 <__vector_17+0x48c> 2b8fc: 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)) { 2b8fe: 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)) { 2b900: 98 23 and r25, r24 2b902: b1 f0 breq .+44 ; 0x2b930 <__vector_17+0x564> 2b904: c0 84 ldd r12, Z+8 ; 0x08 2b906: d1 84 ldd r13, Z+9 ; 0x09 2b908: e2 84 ldd r14, Z+10 ; 0x0a 2b90a: f3 84 ldd r15, Z+11 ; 0x0b 2b90c: 1c 14 cp r1, r12 2b90e: 1d 04 cpc r1, r13 2b910: 1e 04 cpc r1, r14 2b912: 1f 04 cpc r1, r15 2b914: 6c f4 brge .+26 ; 0x2b930 <__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); 2b916: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b918: c0 88 ldd r12, Z+16 ; 0x10 2b91a: d1 88 ldd r13, Z+17 ; 0x11 2b91c: e2 88 ldd r14, Z+18 ; 0x12 2b91e: f3 88 ldd r15, Z+19 ; 0x13 2b920: c0 92 7d 05 sts 0x057D, r12 ; 0x80057d 2b924: d0 92 7e 05 sts 0x057E, r13 ; 0x80057e 2b928: e0 92 7f 05 sts 0x057F, r14 ; 0x80057f 2b92c: f0 92 80 05 sts 0x0580, r15 ; 0x800580 } #endif } endstop = _endstop; 2b930: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b old_endstop = _endstop; //apply current endstop state to the old endstop 2b934: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a endstop_hit = _endstop_hit; 2b938: 20 93 0e 05 sts 0x050E, r18 ; 0x80050e <_ZL11endstop_hit.lto_priv.496> } // Supporting stopping on a trigger of the Z-stop induction sensor, not only for the Z-minus movements. #if defined(Z_MIN_PIN) && (Z_MIN_PIN > -1) && !defined(DEBUG_DISABLE_ZMINLIMIT) if (check_z_endstop) { 2b93c: 55 23 and r21, r21 2b93e: 09 f4 brne .+2 ; 0x2b942 <__vector_17+0x576> 2b940: 40 c0 rjmp .+128 ; 0x2b9c2 <__vector_17+0x5f6> uint8_t _endstop_hit = endstop_hit; 2b942: 20 91 0e 05 lds r18, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.496> uint8_t _endstop = endstop; 2b946: 80 91 7b 05 lds r24, 0x057B ; 0x80057b uint8_t _old_endstop = old_endstop; 2b94a: 90 91 7a 05 lds r25, 0x057A ; 0x80057a // Check the Z min end-stop no matter what. // Good for searching for the center of an induction target. #ifdef TMC2130_SG_HOMING // Stall guard homing turned on #ifdef TMC2130_STEALTH_Z if ((tmc2130_mode == TMC2130_MODE_SILENT) && !(tmc2130_sg_homing_axes_mask & 0x04)) 2b94e: 30 91 6c 06 lds r19, 0x066C ; 0x80066c 2b952: 31 30 cpi r19, 0x01 ; 1 2b954: c9 f4 brne .+50 ; 0x2b988 <__vector_17+0x5bc> 2b956: 30 91 40 06 lds r19, 0x0640 ; 0x800640 2b95a: 32 fd sbrc r19, 2 2b95c: 15 c0 rjmp .+42 ; 0x2b988 <__vector_17+0x5bc> SET_BIT_TO(_endstop, Z_AXIS, (READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING)); 2b95e: 1c 9b sbis 0x03, 4 ; 3 2b960: 19 c0 rjmp .+50 ; 0x2b994 <__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))); 2b962: 84 60 ori r24, 0x04 ; 4 2b964: 18 c0 rjmp .+48 ; 0x2b996 <__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)) 2b966: 30 91 6c 06 lds r19, 0x066C ; 0x80066c 2b96a: 31 30 cpi r19, 0x01 ; 1 2b96c: 31 f4 brne .+12 ; 0x2b97a <__vector_17+0x5ae> 2b96e: 30 91 40 06 lds r19, 0x0640 ; 0x800640 2b972: 32 fd sbrc r19, 2 2b974: 02 c0 rjmp .+4 ; 0x2b97a <__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))); 2b976: 8f 7b andi r24, 0xBF ; 191 2b978: 05 c0 rjmp .+10 ; 0x2b984 <__vector_17+0x5b8> 2b97a: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b97e: 36 fd sbrc r19, 6 2b980: fa cf rjmp .-12 ; 0x2b976 <__vector_17+0x5aa> 2b982: 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)) { 2b984: 90 74 andi r25, 0x40 ; 64 2b986: bc cf rjmp .-136 ; 0x2b900 <__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))); 2b988: 1c 99 sbic 0x03, 4 ; 3 2b98a: eb cf rjmp .-42 ; 0x2b962 <__vector_17+0x596> 2b98c: 30 91 06 01 lds r19, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2b990: 36 ff sbrs r19, 6 2b992: e7 cf rjmp .-50 ; 0x2b962 <__vector_17+0x596> 2b994: 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)) { 2b996: 94 70 andi r25, 0x04 ; 4 2b998: 98 23 and r25, r24 2b99a: 69 f0 breq .+26 ; 0x2b9b6 <__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); 2b99c: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2b99e: 40 89 ldd r20, Z+16 ; 0x10 2b9a0: 51 89 ldd r21, Z+17 ; 0x11 2b9a2: 62 89 ldd r22, Z+18 ; 0x12 2b9a4: 73 89 ldd r23, Z+19 ; 0x13 2b9a6: 40 93 7d 05 sts 0x057D, r20 ; 0x80057d 2b9aa: 50 93 7e 05 sts 0x057E, r21 ; 0x80057e 2b9ae: 60 93 7f 05 sts 0x057F, r22 ; 0x80057f 2b9b2: 70 93 80 05 sts 0x0580, r23 ; 0x800580 } endstop = _endstop; 2b9b6: 80 93 7b 05 sts 0x057B, r24 ; 0x80057b old_endstop = _endstop; //apply current endstop state to the old endstop 2b9ba: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a endstop_hit = _endstop_hit; 2b9be: 20 93 0e 05 sts 0x050E, r18 ; 0x80050e <_ZL11endstop_hit.lto_priv.496> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b9c2: 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) 2b9c4: 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); 2b9c6: 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); 2b9c8: 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); 2b9ca: 04 e0 ldi r16, 0x04 ; 4 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 2b9cc: 83 ff sbrs r24, 3 2b9ce: 08 c1 rjmp .+528 ; 0x2bbe0 <__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) 2b9d0: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2b9d4: c8 17 cp r28, r24 2b9d6: 08 f0 brcs .+2 ; 0x2b9da <__vector_17+0x60e> 2b9d8: 72 c2 rjmp .+1252 ; 0x2bebe <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2b9da: 0f 94 5f 22 call 0x244be ; 0x244be // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 2b9de: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2b9e2: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2b9e6: 80 81 ld r24, Z 2b9e8: 91 81 ldd r25, Z+1 ; 0x01 2b9ea: 20 91 82 05 lds r18, 0x0582 ; 0x800582 2b9ee: 30 91 83 05 lds r19, 0x0583 ; 0x800583 2b9f2: 82 0f add r24, r18 2b9f4: 93 1f adc r25, r19 2b9f6: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2b9fa: 80 93 82 05 sts 0x0582, r24 ; 0x800582 if (counter[X_AXIS].lo > 0) { 2b9fe: 18 16 cp r1, r24 2ba00: 19 06 cpc r1, r25 2ba02: 64 f5 brge .+88 ; 0x2ba5c <__vector_17+0x690> STEP_NC_HI(X_AXIS); 2ba04: 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; 2ba06: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2ba0a: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2ba0e: 80 91 82 05 lds r24, 0x0582 ; 0x800582 2ba12: 90 91 83 05 lds r25, 0x0583 ; 0x800583 2ba16: 20 89 ldd r18, Z+16 ; 0x10 2ba18: 31 89 ldd r19, Z+17 ; 0x11 2ba1a: 82 1b sub r24, r18 2ba1c: 93 0b sbc r25, r19 2ba1e: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2ba22: 80 93 82 05 sts 0x0582, r24 ; 0x800582 count_position[X_AXIS]+=count_direction[X_AXIS]; 2ba26: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2ba2a: 40 91 64 07 lds r20, 0x0764 ; 0x800764 2ba2e: 50 91 65 07 lds r21, 0x0765 ; 0x800765 2ba32: 60 91 66 07 lds r22, 0x0766 ; 0x800766 2ba36: 70 91 67 07 lds r23, 0x0767 ; 0x800767 2ba3a: 89 2f mov r24, r25 2ba3c: 99 0f add r25, r25 2ba3e: 99 0b sbc r25, r25 2ba40: aa 0b sbc r26, r26 2ba42: bb 0b sbc r27, r27 2ba44: 84 0f add r24, r20 2ba46: 95 1f adc r25, r21 2ba48: a6 1f adc r26, r22 2ba4a: b7 1f adc r27, r23 2ba4c: 80 93 64 07 sts 0x0764, r24 ; 0x800764 2ba50: 90 93 65 07 sts 0x0765, r25 ; 0x800765 2ba54: a0 93 66 07 sts 0x0766, r26 ; 0x800766 2ba58: b0 93 67 07 sts 0x0767, r27 ; 0x800767 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN } // Step in Y axis counter[Y_AXIS].lo += current_block->steps[Y_AXIS].lo; 2ba5c: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2ba60: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2ba64: 84 81 ldd r24, Z+4 ; 0x04 2ba66: 95 81 ldd r25, Z+5 ; 0x05 2ba68: 20 91 86 05 lds r18, 0x0586 ; 0x800586 2ba6c: 30 91 87 05 lds r19, 0x0587 ; 0x800587 2ba70: 82 0f add r24, r18 2ba72: 93 1f adc r25, r19 2ba74: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2ba78: 80 93 86 05 sts 0x0586, r24 ; 0x800586 if (counter[Y_AXIS].lo > 0) { 2ba7c: 18 16 cp r1, r24 2ba7e: 19 06 cpc r1, r25 2ba80: 44 f5 brge .+80 ; 0x2bad2 <__vector_17+0x706> STEP_NC_HI(Y_AXIS); 2ba82: 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; 2ba84: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2ba88: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2ba8c: 20 89 ldd r18, Z+16 ; 0x10 2ba8e: 31 89 ldd r19, Z+17 ; 0x11 2ba90: 82 1b sub r24, r18 2ba92: 93 0b sbc r25, r19 2ba94: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2ba98: 80 93 86 05 sts 0x0586, r24 ; 0x800586 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2ba9c: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2baa0: 40 91 68 07 lds r20, 0x0768 ; 0x800768 2baa4: 50 91 69 07 lds r21, 0x0769 ; 0x800769 2baa8: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 2baac: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 2bab0: 89 2f mov r24, r25 2bab2: 99 0f add r25, r25 2bab4: 99 0b sbc r25, r25 2bab6: aa 0b sbc r26, r26 2bab8: bb 0b sbc r27, r27 2baba: 84 0f add r24, r20 2babc: 95 1f adc r25, r21 2babe: a6 1f adc r26, r22 2bac0: b7 1f adc r27, r23 2bac2: 80 93 68 07 sts 0x0768, r24 ; 0x800768 2bac6: 90 93 69 07 sts 0x0769, r25 ; 0x800769 2baca: a0 93 6a 07 sts 0x076A, r26 ; 0x80076a 2bace: b0 93 6b 07 sts 0x076B, r27 ; 0x80076b #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN } // Step in Z axis counter[Z_AXIS].lo += current_block->steps[Z_AXIS].lo; 2bad2: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bad6: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bada: 80 85 ldd r24, Z+8 ; 0x08 2badc: 91 85 ldd r25, Z+9 ; 0x09 2bade: 20 91 8a 05 lds r18, 0x058A ; 0x80058a 2bae2: 30 91 8b 05 lds r19, 0x058B ; 0x80058b 2bae6: 82 0f add r24, r18 2bae8: 93 1f adc r25, r19 2baea: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2baee: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a if (counter[Z_AXIS].lo > 0) { 2baf2: 18 16 cp r1, r24 2baf4: 19 06 cpc r1, r25 2baf6: 44 f5 brge .+80 ; 0x2bb48 <__vector_17+0x77c> STEP_NC_HI(Z_AXIS); 2baf8: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 2bafa: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bafe: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bb02: 20 89 ldd r18, Z+16 ; 0x10 2bb04: 31 89 ldd r19, Z+17 ; 0x11 2bb06: 82 1b sub r24, r18 2bb08: 93 0b sbc r25, r19 2bb0a: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2bb0e: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2bb12: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2bb16: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 2bb1a: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 2bb1e: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 2bb22: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 2bb26: 89 2f mov r24, r25 2bb28: 99 0f add r25, r25 2bb2a: 99 0b sbc r25, r25 2bb2c: aa 0b sbc r26, r26 2bb2e: bb 0b sbc r27, r27 2bb30: 84 0f add r24, r20 2bb32: 95 1f adc r25, r21 2bb34: a6 1f adc r26, r22 2bb36: b7 1f adc r27, r23 2bb38: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 2bb3c: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 2bb40: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 2bb44: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 2bb48: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bb4c: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bb50: 80 91 8e 05 lds r24, 0x058E ; 0x80058e 2bb54: 90 91 8f 05 lds r25, 0x058F ; 0x80058f 2bb58: 24 85 ldd r18, Z+12 ; 0x0c 2bb5a: 35 85 ldd r19, Z+13 ; 0x0d 2bb5c: 82 0f add r24, r18 2bb5e: 93 1f adc r25, r19 2bb60: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2bb64: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2bb68: 20 89 ldd r18, Z+16 ; 0x10 2bb6a: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 2bb6c: 18 16 cp r1, r24 2bb6e: 19 06 cpc r1, r25 2bb70: 44 f5 brge .+80 ; 0x2bbc2 <__vector_17+0x7f6> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 2bb72: 82 1b sub r24, r18 2bb74: 93 0b sbc r25, r19 2bb76: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2bb7a: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e count_position[E_AXIS] += count_direction[E_AXIS]; 2bb7e: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bb82: 40 91 70 07 lds r20, 0x0770 ; 0x800770 2bb86: 50 91 71 07 lds r21, 0x0771 ; 0x800771 2bb8a: 60 91 72 07 lds r22, 0x0772 ; 0x800772 2bb8e: 70 91 73 07 lds r23, 0x0773 ; 0x800773 2bb92: 89 2f mov r24, r25 2bb94: 99 0f add r25, r25 2bb96: 99 0b sbc r25, r25 2bb98: aa 0b sbc r26, r26 2bb9a: bb 0b sbc r27, r27 2bb9c: 84 0f add r24, r20 2bb9e: 95 1f adc r25, r21 2bba0: a6 1f adc r26, r22 2bba2: b7 1f adc r27, r23 2bba4: 80 93 70 07 sts 0x0770, r24 ; 0x800770 2bba8: 90 93 71 07 sts 0x0771, r25 ; 0x800771 2bbac: a0 93 72 07 sts 0x0772, r26 ; 0x800772 2bbb0: b0 93 73 07 sts 0x0773, r27 ; 0x800773 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2bbb4: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2bbb8: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2bbbc: 89 0f add r24, r25 2bbbe: 80 93 93 05 sts 0x0593, r24 ; 0x800593 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.lo >= current_block->step_event_count.lo) 2bbc2: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2bbc6: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2bbca: 01 96 adiw r24, 0x01 ; 1 2bbcc: 90 93 7e 05 sts 0x057E, r25 ; 0x80057e 2bbd0: 80 93 7d 05 sts 0x057D, r24 ; 0x80057d 2bbd4: 82 17 cp r24, r18 2bbd6: 93 07 cpc r25, r19 2bbd8: 08 f0 brcs .+2 ; 0x2bbdc <__vector_17+0x810> 2bbda: 71 c1 rjmp .+738 ; 0x2bebe <__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) 2bbdc: cf 5f subi r28, 0xFF ; 255 2bbde: f8 ce rjmp .-528 ; 0x2b9d0 <__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) 2bbe0: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2bbe4: c8 17 cp r28, r24 2bbe6: 08 f0 brcs .+2 ; 0x2bbea <__vector_17+0x81e> 2bbe8: 6a c1 rjmp .+724 ; 0x2bebe <__vector_17+0xaf2> MSerial.checkRx(); // Check for serial chars. 2bbea: 0f 94 5f 22 call 0x244be ; 0x244be // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 2bbee: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bbf2: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bbf6: 80 81 ld r24, Z 2bbf8: 91 81 ldd r25, Z+1 ; 0x01 2bbfa: a2 81 ldd r26, Z+2 ; 0x02 2bbfc: b3 81 ldd r27, Z+3 ; 0x03 2bbfe: 40 91 82 05 lds r20, 0x0582 ; 0x800582 2bc02: 50 91 83 05 lds r21, 0x0583 ; 0x800583 2bc06: 60 91 84 05 lds r22, 0x0584 ; 0x800584 2bc0a: 70 91 85 05 lds r23, 0x0585 ; 0x800585 2bc0e: 84 0f add r24, r20 2bc10: 95 1f adc r25, r21 2bc12: a6 1f adc r26, r22 2bc14: b7 1f adc r27, r23 2bc16: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2bc1a: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2bc1e: a0 93 84 05 sts 0x0584, r26 ; 0x800584 2bc22: b0 93 85 05 sts 0x0585, r27 ; 0x800585 if (counter[X_AXIS].wide > 0) { 2bc26: 18 16 cp r1, r24 2bc28: 19 06 cpc r1, r25 2bc2a: 1a 06 cpc r1, r26 2bc2c: 1b 06 cpc r1, r27 2bc2e: c4 f5 brge .+112 ; 0x2bca0 <__vector_17+0x8d4> STEP_NC_HI(X_AXIS); 2bc30: 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; 2bc32: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bc36: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bc3a: 80 91 82 05 lds r24, 0x0582 ; 0x800582 2bc3e: 90 91 83 05 lds r25, 0x0583 ; 0x800583 2bc42: a0 91 84 05 lds r26, 0x0584 ; 0x800584 2bc46: b0 91 85 05 lds r27, 0x0585 ; 0x800585 2bc4a: 40 89 ldd r20, Z+16 ; 0x10 2bc4c: 51 89 ldd r21, Z+17 ; 0x11 2bc4e: 62 89 ldd r22, Z+18 ; 0x12 2bc50: 73 89 ldd r23, Z+19 ; 0x13 2bc52: 84 1b sub r24, r20 2bc54: 95 0b sbc r25, r21 2bc56: a6 0b sbc r26, r22 2bc58: b7 0b sbc r27, r23 2bc5a: 80 93 82 05 sts 0x0582, r24 ; 0x800582 2bc5e: 90 93 83 05 sts 0x0583, r25 ; 0x800583 2bc62: a0 93 84 05 sts 0x0584, r26 ; 0x800584 2bc66: b0 93 85 05 sts 0x0585, r27 ; 0x800585 count_position[X_AXIS]+=count_direction[X_AXIS]; 2bc6a: 90 91 6f 02 lds r25, 0x026F ; 0x80026f 2bc6e: 40 91 64 07 lds r20, 0x0764 ; 0x800764 2bc72: 50 91 65 07 lds r21, 0x0765 ; 0x800765 2bc76: 60 91 66 07 lds r22, 0x0766 ; 0x800766 2bc7a: 70 91 67 07 lds r23, 0x0767 ; 0x800767 2bc7e: 89 2f mov r24, r25 2bc80: 99 0f add r25, r25 2bc82: 99 0b sbc r25, r25 2bc84: aa 0b sbc r26, r26 2bc86: bb 0b sbc r27, r27 2bc88: 84 0f add r24, r20 2bc8a: 95 1f adc r25, r21 2bc8c: a6 1f adc r26, r22 2bc8e: b7 1f adc r27, r23 2bc90: 80 93 64 07 sts 0x0764, r24 ; 0x800764 2bc94: 90 93 65 07 sts 0x0765, r25 ; 0x800765 2bc98: a0 93 66 07 sts 0x0766, r26 ; 0x800766 2bc9c: b0 93 67 07 sts 0x0767, r27 ; 0x800767 #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_LO(X_DUP_AXIS); #endif //DEBUG_XSTEP_DUP_PIN } // Step in Y axis counter[Y_AXIS].wide += current_block->steps[Y_AXIS].wide; 2bca0: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bca4: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bca8: 84 81 ldd r24, Z+4 ; 0x04 2bcaa: 95 81 ldd r25, Z+5 ; 0x05 2bcac: a6 81 ldd r26, Z+6 ; 0x06 2bcae: b7 81 ldd r27, Z+7 ; 0x07 2bcb0: 40 91 86 05 lds r20, 0x0586 ; 0x800586 2bcb4: 50 91 87 05 lds r21, 0x0587 ; 0x800587 2bcb8: 60 91 88 05 lds r22, 0x0588 ; 0x800588 2bcbc: 70 91 89 05 lds r23, 0x0589 ; 0x800589 2bcc0: 84 0f add r24, r20 2bcc2: 95 1f adc r25, r21 2bcc4: a6 1f adc r26, r22 2bcc6: b7 1f adc r27, r23 2bcc8: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2bccc: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2bcd0: a0 93 88 05 sts 0x0588, r26 ; 0x800588 2bcd4: b0 93 89 05 sts 0x0589, r27 ; 0x800589 if (counter[Y_AXIS].wide > 0) { 2bcd8: 18 16 cp r1, r24 2bcda: 19 06 cpc r1, r25 2bcdc: 1a 06 cpc r1, r26 2bcde: 1b 06 cpc r1, r27 2bce0: 84 f5 brge .+96 ; 0x2bd42 <__vector_17+0x976> STEP_NC_HI(Y_AXIS); 2bce2: 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; 2bce4: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bce8: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bcec: 40 89 ldd r20, Z+16 ; 0x10 2bcee: 51 89 ldd r21, Z+17 ; 0x11 2bcf0: 62 89 ldd r22, Z+18 ; 0x12 2bcf2: 73 89 ldd r23, Z+19 ; 0x13 2bcf4: 84 1b sub r24, r20 2bcf6: 95 0b sbc r25, r21 2bcf8: a6 0b sbc r26, r22 2bcfa: b7 0b sbc r27, r23 2bcfc: 80 93 86 05 sts 0x0586, r24 ; 0x800586 2bd00: 90 93 87 05 sts 0x0587, r25 ; 0x800587 2bd04: a0 93 88 05 sts 0x0588, r26 ; 0x800588 2bd08: b0 93 89 05 sts 0x0589, r27 ; 0x800589 count_position[Y_AXIS]+=count_direction[Y_AXIS]; 2bd0c: 90 91 70 02 lds r25, 0x0270 ; 0x800270 2bd10: 40 91 68 07 lds r20, 0x0768 ; 0x800768 2bd14: 50 91 69 07 lds r21, 0x0769 ; 0x800769 2bd18: 60 91 6a 07 lds r22, 0x076A ; 0x80076a 2bd1c: 70 91 6b 07 lds r23, 0x076B ; 0x80076b 2bd20: 89 2f mov r24, r25 2bd22: 99 0f add r25, r25 2bd24: 99 0b sbc r25, r25 2bd26: aa 0b sbc r26, r26 2bd28: bb 0b sbc r27, r27 2bd2a: 84 0f add r24, r20 2bd2c: 95 1f adc r25, r21 2bd2e: a6 1f adc r26, r22 2bd30: b7 1f adc r27, r23 2bd32: 80 93 68 07 sts 0x0768, r24 ; 0x800768 2bd36: 90 93 69 07 sts 0x0769, r25 ; 0x800769 2bd3a: a0 93 6a 07 sts 0x076A, r26 ; 0x80076a 2bd3e: b0 93 6b 07 sts 0x076B, r27 ; 0x80076b #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_LO(Y_DUP_AXIS); #endif //DEBUG_YSTEP_DUP_PIN } // Step in Z axis counter[Z_AXIS].wide += current_block->steps[Z_AXIS].wide; 2bd42: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bd46: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bd4a: 80 85 ldd r24, Z+8 ; 0x08 2bd4c: 91 85 ldd r25, Z+9 ; 0x09 2bd4e: a2 85 ldd r26, Z+10 ; 0x0a 2bd50: b3 85 ldd r27, Z+11 ; 0x0b 2bd52: 40 91 8a 05 lds r20, 0x058A ; 0x80058a 2bd56: 50 91 8b 05 lds r21, 0x058B ; 0x80058b 2bd5a: 60 91 8c 05 lds r22, 0x058C ; 0x80058c 2bd5e: 70 91 8d 05 lds r23, 0x058D ; 0x80058d 2bd62: 84 0f add r24, r20 2bd64: 95 1f adc r25, r21 2bd66: a6 1f adc r26, r22 2bd68: b7 1f adc r27, r23 2bd6a: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2bd6e: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2bd72: a0 93 8c 05 sts 0x058C, r26 ; 0x80058c 2bd76: b0 93 8d 05 sts 0x058D, r27 ; 0x80058d if (counter[Z_AXIS].wide > 0) { 2bd7a: 18 16 cp r1, r24 2bd7c: 19 06 cpc r1, r25 2bd7e: 1a 06 cpc r1, r26 2bd80: 1b 06 cpc r1, r27 2bd82: 84 f5 brge .+96 ; 0x2bde4 <__vector_17+0xa18> STEP_NC_HI(Z_AXIS); 2bd84: 06 b9 out 0x06, r16 ; 6 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 2bd86: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bd8a: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bd8e: 40 89 ldd r20, Z+16 ; 0x10 2bd90: 51 89 ldd r21, Z+17 ; 0x11 2bd92: 62 89 ldd r22, Z+18 ; 0x12 2bd94: 73 89 ldd r23, Z+19 ; 0x13 2bd96: 84 1b sub r24, r20 2bd98: 95 0b sbc r25, r21 2bd9a: a6 0b sbc r26, r22 2bd9c: b7 0b sbc r27, r23 2bd9e: 80 93 8a 05 sts 0x058A, r24 ; 0x80058a 2bda2: 90 93 8b 05 sts 0x058B, r25 ; 0x80058b 2bda6: a0 93 8c 05 sts 0x058C, r26 ; 0x80058c 2bdaa: b0 93 8d 05 sts 0x058D, r27 ; 0x80058d count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2bdae: 90 91 71 02 lds r25, 0x0271 ; 0x800271 2bdb2: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 2bdb6: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 2bdba: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 2bdbe: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 2bdc2: 89 2f mov r24, r25 2bdc4: 99 0f add r25, r25 2bdc6: 99 0b sbc r25, r25 2bdc8: aa 0b sbc r26, r26 2bdca: bb 0b sbc r27, r27 2bdcc: 84 0f add r24, r20 2bdce: 95 1f adc r25, r21 2bdd0: a6 1f adc r26, r22 2bdd2: b7 1f adc r27, r23 2bdd4: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 2bdd8: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 2bddc: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 2bde0: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f STEP_NC_LO(Z_AXIS); } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 2bde4: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2bde8: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2bdec: 80 91 8e 05 lds r24, 0x058E ; 0x80058e 2bdf0: 90 91 8f 05 lds r25, 0x058F ; 0x80058f 2bdf4: a0 91 90 05 lds r26, 0x0590 ; 0x800590 2bdf8: b0 91 91 05 lds r27, 0x0591 ; 0x800591 2bdfc: 44 85 ldd r20, Z+12 ; 0x0c 2bdfe: 55 85 ldd r21, Z+13 ; 0x0d 2be00: 66 85 ldd r22, Z+14 ; 0x0e 2be02: 77 85 ldd r23, Z+15 ; 0x0f 2be04: 84 0f add r24, r20 2be06: 95 1f adc r25, r21 2be08: a6 1f adc r26, r22 2be0a: b7 1f adc r27, r23 2be0c: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2be10: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2be14: a0 93 90 05 sts 0x0590, r26 ; 0x800590 2be18: b0 93 91 05 sts 0x0591, r27 ; 0x800591 2be1c: 40 89 ldd r20, Z+16 ; 0x10 2be1e: 51 89 ldd r21, Z+17 ; 0x11 2be20: 62 89 ldd r22, Z+18 ; 0x12 2be22: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 2be24: 18 16 cp r1, r24 2be26: 19 06 cpc r1, r25 2be28: 1a 06 cpc r1, r26 2be2a: 1b 06 cpc r1, r27 2be2c: 74 f5 brge .+92 ; 0x2be8a <__vector_17+0xabe> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 2be2e: 84 1b sub r24, r20 2be30: 95 0b sbc r25, r21 2be32: a6 0b sbc r26, r22 2be34: b7 0b sbc r27, r23 2be36: 80 93 8e 05 sts 0x058E, r24 ; 0x80058e 2be3a: 90 93 8f 05 sts 0x058F, r25 ; 0x80058f 2be3e: a0 93 90 05 sts 0x0590, r26 ; 0x800590 2be42: b0 93 91 05 sts 0x0591, r27 ; 0x800591 count_position[E_AXIS] += count_direction[E_AXIS]; 2be46: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2be4a: c0 90 70 07 lds r12, 0x0770 ; 0x800770 2be4e: d0 90 71 07 lds r13, 0x0771 ; 0x800771 2be52: e0 90 72 07 lds r14, 0x0772 ; 0x800772 2be56: f0 90 73 07 lds r15, 0x0773 ; 0x800773 2be5a: 89 2f mov r24, r25 2be5c: 99 0f add r25, r25 2be5e: 99 0b sbc r25, r25 2be60: aa 0b sbc r26, r26 2be62: bb 0b sbc r27, r27 2be64: 8c 0d add r24, r12 2be66: 9d 1d adc r25, r13 2be68: ae 1d adc r26, r14 2be6a: bf 1d adc r27, r15 2be6c: 80 93 70 07 sts 0x0770, r24 ; 0x800770 2be70: 90 93 71 07 sts 0x0771, r25 ; 0x800771 2be74: a0 93 72 07 sts 0x0772, r26 ; 0x800772 2be78: b0 93 73 07 sts 0x0773, r27 ; 0x800773 #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 2be7c: 90 91 72 02 lds r25, 0x0272 ; 0x800272 2be80: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2be84: 89 0f add r24, r25 2be86: 80 93 93 05 sts 0x0593, r24 ; 0x800593 fsensor.stStep(count_direction[E_AXIS] < 0); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) STEP_NC_LO(E_AXIS); #endif } if(++ step_events_completed.wide >= current_block->step_event_count.wide) 2be8a: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2be8e: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2be92: a0 91 7f 05 lds r26, 0x057F ; 0x80057f 2be96: b0 91 80 05 lds r27, 0x0580 ; 0x800580 2be9a: 01 96 adiw r24, 0x01 ; 1 2be9c: a1 1d adc r26, r1 2be9e: b1 1d adc r27, r1 2bea0: 80 93 7d 05 sts 0x057D, r24 ; 0x80057d 2bea4: 90 93 7e 05 sts 0x057E, r25 ; 0x80057e 2bea8: a0 93 7f 05 sts 0x057F, r26 ; 0x80057f 2beac: b0 93 80 05 sts 0x0580, r27 ; 0x800580 2beb0: 84 17 cp r24, r20 2beb2: 95 07 cpc r25, r21 2beb4: a6 07 cpc r26, r22 2beb6: b7 07 cpc r27, r23 2beb8: 10 f4 brcc .+4 ; 0x2bebe <__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) 2beba: cf 5f subi r28, 0xFF ; 255 2bebc: 91 ce rjmp .-734 ; 0x2bbe0 <__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); 2bebe: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2bec2: 88 23 and r24, r24 2bec4: 39 f0 breq .+14 ; 0x2bed4 <__vector_17+0xb08> 2bec6: 87 fd sbrc r24, 7 2bec8: ee c0 rjmp .+476 ; 0x2c0a6 <__vector_17+0xcda> 2beca: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2bece: 80 64 ori r24, 0x40 ; 64 2bed0: 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) { 2bed4: 40 91 7d 05 lds r20, 0x057D ; 0x80057d 2bed8: 50 91 7e 05 lds r21, 0x057E ; 0x80057e 2bedc: 60 91 7f 05 lds r22, 0x057F ; 0x80057f 2bee0: 70 91 80 05 lds r23, 0x0580 ; 0x800580 2bee4: c0 91 a2 05 lds r28, 0x05A2 ; 0x8005a2 2bee8: d0 91 a3 05 lds r29, 0x05A3 ; 0x8005a3 2beec: 89 8d ldd r24, Y+25 ; 0x19 2beee: 9a 8d ldd r25, Y+26 ; 0x1a 2bef0: ab 8d ldd r26, Y+27 ; 0x1b 2bef2: bc 8d ldd r27, Y+28 ; 0x1c 2bef4: 84 17 cp r24, r20 2bef6: 95 07 cpc r25, r21 2bef8: a6 07 cpc r26, r22 2befa: b7 07 cpc r27, r23 2befc: 08 f4 brcc .+2 ; 0x2bf00 <__vector_17+0xb34> 2befe: 34 c1 rjmp .+616 ; 0x2c168 <__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); 2bf00: 40 91 96 05 lds r20, 0x0596 ; 0x800596 2bf04: 50 91 97 05 lds r21, 0x0597 ; 0x800597 2bf08: 60 91 98 05 lds r22, 0x0598 ; 0x800598 2bf0c: 70 91 99 05 lds r23, 0x0599 ; 0x800599 "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 2bf10: cc 88 ldd r12, Y+20 ; 0x14 2bf12: dd 88 ldd r13, Y+21 ; 0x15 2bf14: ee 88 ldd r14, Y+22 ; 0x16 2bf16: aa 27 eor r26, r26 2bf18: 4d 9d mul r20, r13 2bf1a: b1 2d mov r27, r1 2bf1c: 5e 9d mul r21, r14 2bf1e: c0 01 movw r24, r0 2bf20: 6e 9d mul r22, r14 2bf22: 90 0d add r25, r0 2bf24: 6d 9d mul r22, r13 2bf26: 80 0d add r24, r0 2bf28: 91 1d adc r25, r1 2bf2a: 4e 9d mul r20, r14 2bf2c: b0 0d add r27, r0 2bf2e: 81 1d adc r24, r1 2bf30: 9a 1f adc r25, r26 2bf32: 5d 9d mul r21, r13 2bf34: b0 0d add r27, r0 2bf36: 81 1d adc r24, r1 2bf38: 9a 1f adc r25, r26 2bf3a: 6c 9d mul r22, r12 2bf3c: b0 0d add r27, r0 2bf3e: 81 1d adc r24, r1 2bf40: 9a 1f adc r25, r26 2bf42: 5c 9d mul r21, r12 2bf44: b1 0d add r27, r1 2bf46: 8a 1f adc r24, r26 2bf48: 9a 1f adc r25, r26 2bf4a: bb 0f add r27, r27 2bf4c: 8a 1f adc r24, r26 2bf4e: 9a 1f adc r25, r26 2bf50: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 2bf52: 2a ad ldd r18, Y+58 ; 0x3a 2bf54: 3b ad ldd r19, Y+59 ; 0x3b 2bf56: 82 0f add r24, r18 2bf58: 93 1f adc r25, r19 2bf5a: 90 93 9c 05 sts 0x059C, r25 ; 0x80059c 2bf5e: 80 93 9b 05 sts 0x059B, r24 ; 0x80059b // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 2bf62: 2e a9 ldd r18, Y+54 ; 0x36 2bf64: 3f a9 ldd r19, Y+55 ; 0x37 2bf66: 28 17 cp r18, r24 2bf68: 39 07 cpc r19, r25 2bf6a: 20 f4 brcc .+8 ; 0x2bf74 <__vector_17+0xba8> acc_step_rate = current_block->nominal_rate; 2bf6c: 30 93 9c 05 sts 0x059C, r19 ; 0x80059c 2bf70: 20 93 9b 05 sts 0x059B, r18 ; 0x80059b // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 2bf74: 80 91 9b 05 lds r24, 0x059B ; 0x80059b 2bf78: 90 91 9c 05 lds r25, 0x059C ; 0x80059c #endif //_NO_ASM FORCE_INLINE unsigned short calc_timer(uint16_t step_rate, uint8_t& step_loops) { uint16_t timer; if(step_rate > MAX_STEP_FREQUENCY) step_rate = MAX_STEP_FREQUENCY; 2bf7c: 81 34 cpi r24, 0x41 ; 65 2bf7e: fc e9 ldi r31, 0x9C ; 156 2bf80: 9f 07 cpc r25, r31 2bf82: 08 f0 brcs .+2 ; 0x2bf86 <__vector_17+0xbba> 2bf84: 94 c0 rjmp .+296 ; 0x2c0ae <__vector_17+0xce2> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2bf86: 81 32 cpi r24, 0x21 ; 33 2bf88: 2e e4 ldi r18, 0x4E ; 78 2bf8a: 92 07 cpc r25, r18 2bf8c: 08 f4 brcc .+2 ; 0x2bf90 <__vector_17+0xbc4> 2bf8e: 92 c0 rjmp .+292 ; 0x2c0b4 <__vector_17+0xce8> step_rate = (step_rate >> 2)&0x3fff; 2bf90: 96 95 lsr r25 2bf92: 87 95 ror r24 2bf94: 96 95 lsr r25 2bf96: 87 95 ror r24 step_loops = 4; 2bf98: 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; 2bf9a: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2bf9e: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2bfa0: 81 15 cp r24, r1 2bfa2: f8 e0 ldi r31, 0x08 ; 8 2bfa4: 9f 07 cpc r25, r31 2bfa6: 08 f4 brcc .+2 ; 0x2bfaa <__vector_17+0xbde> 2bfa8: 97 c0 rjmp .+302 ; 0x2c0d8 <__vector_17+0xd0c> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2bfaa: e9 2f mov r30, r25 2bfac: ff 27 eor r31, r31 2bfae: ee 0f add r30, r30 2bfb0: ff 1f adc r31, r31 2bfb2: ee 0f add r30, r30 2bfb4: ff 1f adc r31, r31 2bfb6: 9f 01 movw r18, r30 2bfb8: 27 55 subi r18, 0x57 ; 87 2bfba: 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); 2bfbc: f9 01 movw r30, r18 2bfbe: 32 96 adiw r30, 0x02 ; 2 2bfc0: a5 91 lpm r26, Z+ 2bfc2: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2bfc4: f9 01 movw r30, r18 2bfc6: 25 91 lpm r18, Z+ 2bfc8: 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. ); 2bfca: b8 9f mul r27, r24 2bfcc: f0 01 movw r30, r0 2bfce: a8 9f mul r26, r24 2bfd0: 00 0c add r0, r0 2bfd2: e1 1d adc r30, r1 2bfd4: 11 24 eor r1, r1 2bfd6: 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); 2bfd8: c9 01 movw r24, r18 2bfda: 8e 1b sub r24, r30 2bfdc: 9f 0b sbc r25, r31 2bfde: 84 36 cpi r24, 0x64 ; 100 2bfe0: 91 05 cpc r25, r1 2bfe2: 10 f4 brcc .+4 ; 0x2bfe8 <__vector_17+0xc1c> 2bfe4: 84 e6 ldi r24, 0x64 ; 100 2bfe6: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 2bfe8: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2bfec: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2bff0: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.494+0x1> 2bff4: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.494> acceleration_time += timer; 2bff8: 48 0f add r20, r24 2bffa: 59 1f adc r21, r25 2bffc: 61 1d adc r22, r1 2bffe: 71 1d adc r23, r1 2c000: 40 93 96 05 sts 0x0596, r20 ; 0x800596 2c004: 50 93 97 05 sts 0x0597, r21 ; 0x800597 2c008: 60 93 98 05 sts 0x0598, r22 ; 0x800598 2c00c: 70 93 99 05 sts 0x0599, r23 ; 0x800599 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2c010: fe 01 movw r30, r28 2c012: e4 5b subi r30, 0xB4 ; 180 2c014: ff 4f sbci r31, 0xFF ; 255 2c016: 80 81 ld r24, Z 2c018: 81 11 cpse r24, r1 2c01a: 7d c0 rjmp .+250 ; 0x2c116 <__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; 2c01c: 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) { 2c01e: 80 ff sbrs r24, 0 2c020: 16 c0 rjmp .+44 ; 0x2c04e <__vector_17+0xc82> LA_phase = -1; 2c022: 9f ef ldi r25, 0xFF ; 255 2c024: 90 93 92 05 sts 0x0592, r25 ; 0x800592 if (current_adv_steps == target_adv_steps) { 2c028: e0 91 e2 04 lds r30, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c02c: f0 91 e3 04 lds r31, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c030: 20 91 94 05 lds r18, 0x0594 ; 0x800594 2c034: 30 91 95 05 lds r19, 0x0595 ; 0x800595 2c038: e2 17 cp r30, r18 2c03a: f3 07 cpc r31, r19 2c03c: 09 f0 breq .+2 ; 0x2c040 <__vector_17+0xc74> 2c03e: 24 c2 rjmp .+1096 ; 0x2c488 <__vector_17+0x10bc> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 2c040: 8f ef ldi r24, 0xFF ; 255 2c042: 9f ef ldi r25, 0xFF ; 255 2c044: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c048: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> if (la_state & ADV_INIT) { LA_phase = -1; if (current_adv_steps == target_adv_steps) { // nothing to be done in this phase, cancel any pending eisr la_state = 0; 2c04c: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 2c04e: 80 fd sbrc r24, 0 2c050: 07 c0 rjmp .+14 ; 0x2c060 <__vector_17+0xc94> 2c052: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> 2c056: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c05a: 01 96 adiw r24, 0x01 ; 1 2c05c: 09 f4 brne .+2 ; 0x2c060 <__vector_17+0xc94> 2c05e: b2 c2 rjmp .+1380 ; 0x2c5c4 <__vector_17+0x11f8> // update timers & phase for the next iteration advance_spread(main_Rate); 2c060: e0 91 e4 04 lds r30, 0x04E4 ; 0x8004e4 <_ZL9main_Rate.lto_priv.494> 2c064: f0 91 e5 04 lds r31, 0x04E5 ; 0x8004e5 <_ZL9main_Rate.lto_priv.494+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 2c068: 80 91 73 05 lds r24, 0x0573 ; 0x800573 2c06c: 90 91 74 05 lds r25, 0x0574 ; 0x800574 2c070: a0 91 75 05 lds r26, 0x0575 ; 0x800575 2c074: b0 91 76 05 lds r27, 0x0576 ; 0x800576 2c078: 8e 0f add r24, r30 2c07a: 9f 1f adc r25, r31 2c07c: a1 1d adc r26, r1 2c07e: b1 1d adc r27, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 2c080: c3 5b subi r28, 0xB3 ; 179 2c082: df 4f sbci r29, 0xFF ; 255 2c084: 08 81 ld r16, Y 2c086: 19 81 ldd r17, Y+1 ; 0x01 2c088: 30 e0 ldi r19, 0x00 ; 0 2c08a: 20 e0 ldi r18, 0x00 ; 0 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 2c08c: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 2c08e: 80 17 cp r24, r16 2c090: 91 07 cpc r25, r17 2c092: a2 07 cpc r26, r18 2c094: b3 07 cpc r27, r19 2c096: 08 f4 brcc .+2 ; 0x2c09a <__vector_17+0xcce> 2c098: 27 c2 rjmp .+1102 ; 0x2c4e8 <__vector_17+0x111c> { ++ticks; 2c09a: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 2c09c: 80 1b sub r24, r16 2c09e: 91 0b sbc r25, r17 2c0a0: a2 0b sbc r26, r18 2c0a2: b3 0b sbc r27, r19 2c0a4: f4 cf rjmp .-24 ; 0x2c08e <__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); 2c0a6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c0aa: 8f 7b andi r24, 0xBF ; 191 2c0ac: 11 cf rjmp .-478 ; 0x2bed0 <__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; 2c0ae: 80 e4 ldi r24, 0x40 ; 64 2c0b0: 9c e9 ldi r25, 0x9C ; 156 2c0b2: 6e cf rjmp .-292 ; 0x2bf90 <__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 2c0b4: 81 31 cpi r24, 0x11 ; 17 2c0b6: e7 e2 ldi r30, 0x27 ; 39 2c0b8: 9e 07 cpc r25, r30 2c0ba: 20 f0 brcs .+8 ; 0x2c0c4 <__vector_17+0xcf8> step_rate = (step_rate >> 1)&0x7fff; 2c0bc: 96 95 lsr r25 2c0be: 87 95 ror r24 step_loops = 2; 2c0c0: 22 e0 ldi r18, 0x02 ; 2 2c0c2: 6b cf rjmp .-298 ; 0x2bf9a <__vector_17+0xbce> } else { step_loops = 1; 2c0c4: 21 e0 ldi r18, 0x01 ; 1 2c0c6: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a 2c0ca: 80 32 cpi r24, 0x20 ; 32 2c0cc: 91 05 cpc r25, r1 2c0ce: 08 f0 brcs .+2 ; 0x2c0d2 <__vector_17+0xd06> 2c0d0: 66 cf rjmp .-308 ; 0x2bf9e <__vector_17+0xbd2> 2c0d2: 80 e2 ldi r24, 0x20 ; 32 2c0d4: 90 e0 ldi r25, 0x00 ; 0 2c0d6: 63 cf rjmp .-314 ; 0x2bf9e <__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; 2c0d8: 9c 01 movw r18, r24 2c0da: 36 95 lsr r19 2c0dc: 27 95 ror r18 2c0de: 2c 7f andi r18, 0xFC ; 252 2c0e0: 27 55 subi r18, 0x57 ; 87 2c0e2: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c0e4: f9 01 movw r30, r18 2c0e6: a5 91 lpm r26, Z+ 2c0e8: b4 91 lpm r27, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c0ea: f9 01 movw r30, r18 2c0ec: 32 96 adiw r30, 0x02 ; 2 2c0ee: 05 91 lpm r16, Z+ 2c0f0: 14 91 lpm r17, Z 2c0f2: 87 70 andi r24, 0x07 ; 7 2c0f4: 99 27 eor r25, r25 2c0f6: 80 9f mul r24, r16 2c0f8: 90 01 movw r18, r0 2c0fa: 81 9f mul r24, r17 2c0fc: 30 0d add r19, r0 2c0fe: 90 9f mul r25, r16 2c100: 30 0d add r19, r0 2c102: 11 24 eor r1, r1 2c104: f3 e0 ldi r31, 0x03 ; 3 2c106: 36 95 lsr r19 2c108: 27 95 ror r18 2c10a: fa 95 dec r31 2c10c: e1 f7 brne .-8 ; 0x2c106 <__vector_17+0xd3a> 2c10e: cd 01 movw r24, r26 2c110: 82 1b sub r24, r18 2c112: 93 0b sbc r25, r19 2c114: 64 cf rjmp .-312 ; 0x2bfde <__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) { 2c116: 40 91 7d 05 lds r20, 0x057D ; 0x80057d 2c11a: 50 91 7e 05 lds r21, 0x057E ; 0x80057e 2c11e: 60 91 7f 05 lds r22, 0x057F ; 0x80057f 2c122: 70 91 80 05 lds r23, 0x0580 ; 0x800580 2c126: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2c12a: 90 e0 ldi r25, 0x00 ; 0 2c12c: b0 e0 ldi r27, 0x00 ; 0 2c12e: a0 e0 ldi r26, 0x00 ; 0 2c130: 84 17 cp r24, r20 2c132: 95 07 cpc r25, r21 2c134: a6 07 cpc r26, r22 2c136: b7 07 cpc r27, r23 2c138: 08 f4 brcc .+2 ; 0x2c13c <__vector_17+0xd70> 2c13a: 70 cf rjmp .-288 ; 0x2c01c <__vector_17+0xc50> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 2c13c: 80 91 81 05 lds r24, 0x0581 ; 0x800581 2c140: 81 11 cpse r24, r1 2c142: 02 c0 rjmp .+4 ; 0x2c148 <__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; 2c144: 83 e0 ldi r24, 0x03 ; 3 2c146: 6b cf rjmp .-298 ; 0x2c01e <__vector_17+0xc52> if (e_extruding && current_adv_steps > target_adv_steps) 2c148: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c14c: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c150: 20 91 94 05 lds r18, 0x0594 ; 0x800594 2c154: 30 91 95 05 lds r19, 0x0595 ; 0x800595 2c158: 28 17 cp r18, r24 2c15a: 39 07 cpc r19, r25 2c15c: 98 f7 brcc .-26 ; 0x2c144 <__vector_17+0xd78> target_adv_steps = current_adv_steps; 2c15e: 90 93 95 05 sts 0x0595, r25 ; 0x800595 2c162: 80 93 94 05 sts 0x0594, r24 ; 0x800594 2c166: ee cf rjmp .-36 ; 0x2c144 <__vector_17+0xd78> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 2c168: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2c16c: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2c170: a0 91 7f 05 lds r26, 0x057F ; 0x80057f 2c174: b0 91 80 05 lds r27, 0x0580 ; 0x800580 2c178: 4d 8d ldd r20, Y+29 ; 0x1d 2c17a: 5e 8d ldd r21, Y+30 ; 0x1e 2c17c: 6f 8d ldd r22, Y+31 ; 0x1f 2c17e: 78 a1 ldd r23, Y+32 ; 0x20 2c180: 48 17 cp r20, r24 2c182: 59 07 cpc r21, r25 2c184: 6a 07 cpc r22, r26 2c186: 7b 07 cpc r23, r27 2c188: 08 f0 brcs .+2 ; 0x2c18c <__vector_17+0xdc0> 2c18a: e3 c0 rjmp .+454 ; 0x2c352 <__vector_17+0xf86> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 2c18c: c0 90 9e 05 lds r12, 0x059E ; 0x80059e 2c190: d0 90 9f 05 lds r13, 0x059F ; 0x80059f 2c194: e0 90 a0 05 lds r14, 0x05A0 ; 0x8005a0 2c198: f0 90 a1 05 lds r15, 0x05A1 ; 0x8005a1 "adc %B0, r26 \n\t" "clr r1 \n\t" : "=&r" (out) : "r" (x), "r" (y) : "r0", "r1", "r26" , "r27" //clobbers: Technically these are either scratch registers or always 0 registers, but I'm making sure the compiler knows just in case. R26 is __zero_reg__, R27 is a temporary register. ); 2c19c: 6c 88 ldd r6, Y+20 ; 0x14 2c19e: 7d 88 ldd r7, Y+21 ; 0x15 2c1a0: 8e 88 ldd r8, Y+22 ; 0x16 2c1a2: aa 27 eor r26, r26 2c1a4: c7 9c mul r12, r7 2c1a6: b1 2d mov r27, r1 2c1a8: d8 9c mul r13, r8 2c1aa: f0 01 movw r30, r0 2c1ac: e8 9c mul r14, r8 2c1ae: f0 0d add r31, r0 2c1b0: e7 9c mul r14, r7 2c1b2: e0 0d add r30, r0 2c1b4: f1 1d adc r31, r1 2c1b6: c8 9c mul r12, r8 2c1b8: b0 0d add r27, r0 2c1ba: e1 1d adc r30, r1 2c1bc: fa 1f adc r31, r26 2c1be: d7 9c mul r13, r7 2c1c0: b0 0d add r27, r0 2c1c2: e1 1d adc r30, r1 2c1c4: fa 1f adc r31, r26 2c1c6: e6 9c mul r14, r6 2c1c8: b0 0d add r27, r0 2c1ca: e1 1d adc r30, r1 2c1cc: fa 1f adc r31, r26 2c1ce: d6 9c mul r13, r6 2c1d0: b1 0d add r27, r1 2c1d2: ea 1f adc r30, r26 2c1d4: fa 1f adc r31, r26 2c1d6: bb 0f add r27, r27 2c1d8: ea 1f adc r30, r26 2c1da: fa 1f adc r31, r26 2c1dc: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 2c1de: 20 91 9b 05 lds r18, 0x059B ; 0x80059b 2c1e2: 30 91 9c 05 lds r19, 0x059C ; 0x80059c 2c1e6: 8e ad ldd r24, Y+62 ; 0x3e 2c1e8: 9f ad ldd r25, Y+63 ; 0x3f 2c1ea: 2e 17 cp r18, r30 2c1ec: 3f 07 cpc r19, r31 2c1ee: 30 f0 brcs .+12 ; 0x2c1fc <__vector_17+0xe30> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 2c1f0: 2e 1b sub r18, r30 2c1f2: 3f 0b sbc r19, r31 2c1f4: 82 17 cp r24, r18 2c1f6: 93 07 cpc r25, r19 2c1f8: 08 f4 brcc .+2 ; 0x2c1fc <__vector_17+0xe30> 2c1fa: 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; 2c1fc: 81 34 cpi r24, 0x41 ; 65 2c1fe: 2c e9 ldi r18, 0x9C ; 156 2c200: 92 07 cpc r25, r18 2c202: 08 f0 brcs .+2 ; 0x2c206 <__vector_17+0xe3a> 2c204: 75 c0 rjmp .+234 ; 0x2c2f0 <__vector_17+0xf24> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c206: 81 32 cpi r24, 0x21 ; 33 2c208: ee e4 ldi r30, 0x4E ; 78 2c20a: 9e 07 cpc r25, r30 2c20c: 08 f4 brcc .+2 ; 0x2c210 <__vector_17+0xe44> 2c20e: 73 c0 rjmp .+230 ; 0x2c2f6 <__vector_17+0xf2a> step_rate = (step_rate >> 2)&0x3fff; 2c210: 96 95 lsr r25 2c212: 87 95 ror r24 2c214: 96 95 lsr r25 2c216: 87 95 ror r24 step_loops = 4; 2c218: 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; 2c21a: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c21e: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c220: 81 15 cp r24, r1 2c222: 28 e0 ldi r18, 0x08 ; 8 2c224: 92 07 cpc r25, r18 2c226: 08 f4 brcc .+2 ; 0x2c22a <__vector_17+0xe5e> 2c228: 78 c0 rjmp .+240 ; 0x2c31a <__vector_17+0xf4e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c22a: e9 2f mov r30, r25 2c22c: ff 27 eor r31, r31 2c22e: ee 0f add r30, r30 2c230: ff 1f adc r31, r31 2c232: ee 0f add r30, r30 2c234: ff 1f adc r31, r31 2c236: 9f 01 movw r18, r30 2c238: 27 55 subi r18, 0x57 ; 87 2c23a: 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); 2c23c: f9 01 movw r30, r18 2c23e: 32 96 adiw r30, 0x02 ; 2 2c240: a5 91 lpm r26, Z+ 2c242: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c244: f9 01 movw r30, r18 2c246: 25 91 lpm r18, Z+ 2c248: 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. ); 2c24a: b8 9f mul r27, r24 2c24c: f0 01 movw r30, r0 2c24e: a8 9f mul r26, r24 2c250: 00 0c add r0, r0 2c252: e1 1d adc r30, r1 2c254: 11 24 eor r1, r1 2c256: 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); 2c258: 2e 1b sub r18, r30 2c25a: 3f 0b sbc r19, r31 2c25c: c9 01 movw r24, r18 2c25e: 24 36 cpi r18, 0x64 ; 100 2c260: 31 05 cpc r19, r1 2c262: 10 f4 brcc .+4 ; 0x2c268 <__vector_17+0xe9c> 2c264: 84 e6 ldi r24, 0x64 ; 100 2c266: 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); 2c268: 90 93 e9 04 sts 0x04E9, r25 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2c26c: 80 93 e8 04 sts 0x04E8, r24 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2c270: 90 93 e5 04 sts 0x04E5, r25 ; 0x8004e5 <_ZL9main_Rate.lto_priv.494+0x1> 2c274: 80 93 e4 04 sts 0x04E4, r24 ; 0x8004e4 <_ZL9main_Rate.lto_priv.494> deceleration_time += timer; 2c278: c8 0e add r12, r24 2c27a: d9 1e adc r13, r25 2c27c: e1 1c adc r14, r1 2c27e: f1 1c adc r15, r1 2c280: c0 92 9e 05 sts 0x059E, r12 ; 0x80059e 2c284: d0 92 9f 05 sts 0x059F, r13 ; 0x80059f 2c288: e0 92 a0 05 sts 0x05A0, r14 ; 0x8005a0 2c28c: f0 92 a1 05 sts 0x05A1, r15 ; 0x8005a1 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2c290: fe 01 movw r30, r28 2c292: e4 5b subi r30, 0xB4 ; 180 2c294: ff 4f sbci r31, 0xFF ; 255 2c296: 80 81 ld r24, Z 2c298: 88 23 and r24, r24 2c29a: 09 f4 brne .+2 ; 0x2c29e <__vector_17+0xed2> 2c29c: bf ce rjmp .-642 ; 0x2c01c <__vector_17+0xc50> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 2c29e: 80 91 7d 05 lds r24, 0x057D ; 0x80057d 2c2a2: 90 91 7e 05 lds r25, 0x057E ; 0x80057e 2c2a6: a0 91 7f 05 lds r26, 0x057F ; 0x80057f 2c2aa: b0 91 80 05 lds r27, 0x0580 ; 0x800580 2c2ae: 20 91 9a 05 lds r18, 0x059A ; 0x80059a 2c2b2: 42 0f add r20, r18 2c2b4: 51 1d adc r21, r1 2c2b6: 61 1d adc r22, r1 2c2b8: 71 1d adc r23, r1 2c2ba: 48 17 cp r20, r24 2c2bc: 59 07 cpc r21, r25 2c2be: 6a 07 cpc r22, r26 2c2c0: 7b 07 cpc r23, r27 2c2c2: 08 f4 brcc .+2 ; 0x2c2c6 <__vector_17+0xefa> 2c2c4: ab ce rjmp .-682 ; 0x2c01c <__vector_17+0xc50> target_adv_steps = current_block->final_adv_steps; 2c2c6: 35 96 adiw r30, 0x05 ; 5 2c2c8: 20 81 ld r18, Z 2c2ca: 31 81 ldd r19, Z+1 ; 0x01 2c2cc: 30 93 95 05 sts 0x0595, r19 ; 0x800595 2c2d0: 20 93 94 05 sts 0x0594, r18 ; 0x800594 la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 2c2d4: 80 91 81 05 lds r24, 0x0581 ; 0x800581 2c2d8: 88 23 and r24, r24 2c2da: 09 f4 brne .+2 ; 0x2c2de <__vector_17+0xf12> 2c2dc: 33 cf rjmp .-410 ; 0x2c144 <__vector_17+0xd78> 2c2de: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c2e2: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c2e6: 82 17 cp r24, r18 2c2e8: 93 07 cpc r25, r19 2c2ea: 08 f0 brcs .+2 ; 0x2c2ee <__vector_17+0xf22> 2c2ec: 2b cf rjmp .-426 ; 0x2c144 <__vector_17+0xd78> 2c2ee: 37 cf rjmp .-402 ; 0x2c15e <__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; 2c2f0: 80 e4 ldi r24, 0x40 ; 64 2c2f2: 9c e9 ldi r25, 0x9C ; 156 2c2f4: 8d cf rjmp .-230 ; 0x2c210 <__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 2c2f6: 81 31 cpi r24, 0x11 ; 17 2c2f8: f7 e2 ldi r31, 0x27 ; 39 2c2fa: 9f 07 cpc r25, r31 2c2fc: 20 f0 brcs .+8 ; 0x2c306 <__vector_17+0xf3a> step_rate = (step_rate >> 1)&0x7fff; 2c2fe: 96 95 lsr r25 2c300: 87 95 ror r24 step_loops = 2; 2c302: 22 e0 ldi r18, 0x02 ; 2 2c304: 8a cf rjmp .-236 ; 0x2c21a <__vector_17+0xe4e> } else { step_loops = 1; 2c306: 21 e0 ldi r18, 0x01 ; 1 2c308: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a 2c30c: 80 32 cpi r24, 0x20 ; 32 2c30e: 91 05 cpc r25, r1 2c310: 08 f0 brcs .+2 ; 0x2c314 <__vector_17+0xf48> 2c312: 85 cf rjmp .-246 ; 0x2c21e <__vector_17+0xe52> 2c314: 80 e2 ldi r24, 0x20 ; 32 2c316: 90 e0 ldi r25, 0x00 ; 0 2c318: 82 cf rjmp .-252 ; 0x2c21e <__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; 2c31a: dc 01 movw r26, r24 2c31c: b6 95 lsr r27 2c31e: a7 95 ror r26 2c320: ac 7f andi r26, 0xFC ; 252 2c322: a7 55 subi r26, 0x57 ; 87 2c324: bd 46 sbci r27, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c326: fd 01 movw r30, r26 2c328: 25 91 lpm r18, Z+ 2c32a: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c32c: fd 01 movw r30, r26 2c32e: 32 96 adiw r30, 0x02 ; 2 2c330: a5 91 lpm r26, Z+ 2c332: b4 91 lpm r27, Z 2c334: 87 70 andi r24, 0x07 ; 7 2c336: 99 27 eor r25, r25 2c338: 8a 9f mul r24, r26 2c33a: f0 01 movw r30, r0 2c33c: 8b 9f mul r24, r27 2c33e: f0 0d add r31, r0 2c340: 9a 9f mul r25, r26 2c342: f0 0d add r31, r0 2c344: 11 24 eor r1, r1 2c346: a3 e0 ldi r26, 0x03 ; 3 2c348: f6 95 lsr r31 2c34a: e7 95 ror r30 2c34c: aa 95 dec r26 2c34e: e1 f7 brne .-8 ; 0x2c348 <__vector_17+0xf7c> 2c350: 83 cf rjmp .-250 ; 0x2c258 <__vector_17+0xe8c> } } #endif } else { if (! step_loops_nominal) { 2c352: 80 91 9d 05 lds r24, 0x059D ; 0x80059d 2c356: 88 23 and r24, r24 2c358: 71 f0 breq .+28 ; 0x2c376 <__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; 2c35a: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 2c35c: 20 91 77 05 lds r18, 0x0577 ; 0x800577 2c360: 30 91 78 05 lds r19, 0x0578 ; 0x800578 2c364: 30 93 e9 04 sts 0x04E9, r19 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2c368: 20 93 e8 04 sts 0x04E8, r18 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2c36c: 30 93 e5 04 sts 0x04E5, r19 ; 0x8004e5 <_ZL9main_Rate.lto_priv.494+0x1> 2c370: 20 93 e4 04 sts 0x04E4, r18 ; 0x8004e4 <_ZL9main_Rate.lto_priv.494> 2c374: 54 ce rjmp .-856 ; 0x2c01e <__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); 2c376: 8e a9 ldd r24, Y+54 ; 0x36 2c378: 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; 2c37a: 81 34 cpi r24, 0x41 ; 65 2c37c: 4c e9 ldi r20, 0x9C ; 156 2c37e: 94 07 cpc r25, r20 2c380: 08 f0 brcs .+2 ; 0x2c384 <__vector_17+0xfb8> 2c382: 4e c0 rjmp .+156 ; 0x2c420 <__vector_17+0x1054> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 2c384: 81 32 cpi r24, 0x21 ; 33 2c386: 5e e4 ldi r21, 0x4E ; 78 2c388: 95 07 cpc r25, r21 2c38a: 08 f4 brcc .+2 ; 0x2c38e <__vector_17+0xfc2> 2c38c: 4c c0 rjmp .+152 ; 0x2c426 <__vector_17+0x105a> step_rate = (step_rate >> 2)&0x3fff; 2c38e: 96 95 lsr r25 2c390: 87 95 ror r24 2c392: 96 95 lsr r25 2c394: 87 95 ror r24 step_loops = 4; 2c396: 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; 2c398: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a else { step_loops = 1; } if(step_rate < (F_CPU/500000)) step_rate = (F_CPU/500000); step_rate -= (F_CPU/500000); // Correct for minimal speed 2c39c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 2c39e: 81 15 cp r24, r1 2c3a0: f8 e0 ldi r31, 0x08 ; 8 2c3a2: 9f 07 cpc r25, r31 2c3a4: 08 f4 brcc .+2 ; 0x2c3a8 <__vector_17+0xfdc> 2c3a6: 51 c0 rjmp .+162 ; 0x2c44a <__vector_17+0x107e> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2c3a8: e9 2f mov r30, r25 2c3aa: ff 27 eor r31, r31 2c3ac: ee 0f add r30, r30 2c3ae: ff 1f adc r31, r31 2c3b0: ee 0f add r30, r30 2c3b2: ff 1f adc r31, r31 2c3b4: 9f 01 movw r18, r30 2c3b6: 27 55 subi r18, 0x57 ; 87 2c3b8: 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); 2c3ba: f9 01 movw r30, r18 2c3bc: 32 96 adiw r30, 0x02 ; 2 2c3be: 65 91 lpm r22, Z+ 2c3c0: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 2c3c2: f9 01 movw r30, r18 2c3c4: 25 91 lpm r18, Z+ 2c3c6: 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. ); 2c3c8: 78 9f mul r23, r24 2c3ca: a0 01 movw r20, r0 2c3cc: 68 9f mul r22, r24 2c3ce: 00 0c add r0, r0 2c3d0: 41 1d adc r20, r1 2c3d2: 11 24 eor r1, r1 2c3d4: 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); 2c3d6: c9 01 movw r24, r18 2c3d8: 84 1b sub r24, r20 2c3da: 95 0b sbc r25, r21 2c3dc: 84 36 cpi r24, 0x64 ; 100 2c3de: 91 05 cpc r25, r1 2c3e0: 10 f4 brcc .+4 ; 0x2c3e6 <__vector_17+0x101a> 2c3e2: 84 e6 ldi r24, 0x64 ; 100 2c3e4: 90 e0 ldi r25, 0x00 ; 0 2c3e6: 90 93 78 05 sts 0x0578, r25 ; 0x800578 2c3ea: 80 93 77 05 sts 0x0577, r24 ; 0x800577 step_loops_nominal = step_loops; 2c3ee: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2c3f2: 80 93 9d 05 sts 0x059D, r24 ; 0x80059d #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 2c3f6: fe 01 movw r30, r28 2c3f8: e4 5b subi r30, 0xB4 ; 180 2c3fa: ff 4f sbci r31, 0xFF ; 255 2c3fc: 80 81 ld r24, Z 2c3fe: 88 23 and r24, r24 2c400: 09 f4 brne .+2 ; 0x2c404 <__vector_17+0x1038> 2c402: ab cf rjmp .-170 ; 0x2c35a <__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) 2c404: 80 91 81 05 lds r24, 0x0581 ; 0x800581 2c408: 88 23 and r24, r24 2c40a: 41 f0 breq .+16 ; 0x2c41c <__vector_17+0x1050> target_adv_steps = current_adv_steps; 2c40c: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c410: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c414: 90 93 95 05 sts 0x0595, r25 ; 0x800595 2c418: 80 93 94 05 sts 0x0594, r24 ; 0x800594 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { // Due to E-jerk, there can be discontinuities in pressure state where an // acceleration or deceleration can be skipped or joined with the previous block. // If LA was not previously active, re-check the pressure level la_state = ADV_INIT; 2c41c: 81 e0 ldi r24, 0x01 ; 1 2c41e: 9e cf rjmp .-196 ; 0x2c35c <__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; 2c420: 80 e4 ldi r24, 0x40 ; 64 2c422: 9c e9 ldi r25, 0x9C ; 156 2c424: b4 cf rjmp .-152 ; 0x2c38e <__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 2c426: 81 31 cpi r24, 0x11 ; 17 2c428: e7 e2 ldi r30, 0x27 ; 39 2c42a: 9e 07 cpc r25, r30 2c42c: 20 f0 brcs .+8 ; 0x2c436 <__vector_17+0x106a> step_rate = (step_rate >> 1)&0x7fff; 2c42e: 96 95 lsr r25 2c430: 87 95 ror r24 step_loops = 2; 2c432: 22 e0 ldi r18, 0x02 ; 2 2c434: b1 cf rjmp .-158 ; 0x2c398 <__vector_17+0xfcc> } else { step_loops = 1; 2c436: 21 e0 ldi r18, 0x01 ; 1 2c438: 20 93 9a 05 sts 0x059A, r18 ; 0x80059a 2c43c: 80 32 cpi r24, 0x20 ; 32 2c43e: 91 05 cpc r25, r1 2c440: 08 f0 brcs .+2 ; 0x2c444 <__vector_17+0x1078> 2c442: ac cf rjmp .-168 ; 0x2c39c <__vector_17+0xfd0> 2c444: 80 e2 ldi r24, 0x20 ; 32 2c446: 90 e0 ldi r25, 0x00 ; 0 2c448: a9 cf rjmp .-174 ; 0x2c39c <__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; 2c44a: 9c 01 movw r18, r24 2c44c: 36 95 lsr r19 2c44e: 27 95 ror r18 2c450: 2c 7f andi r18, 0xFC ; 252 2c452: 27 55 subi r18, 0x57 ; 87 2c454: 3d 46 sbci r19, 0x6D ; 109 timer = (unsigned short)pgm_read_word_near(table_address); 2c456: f9 01 movw r30, r18 2c458: 45 91 lpm r20, Z+ 2c45a: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 2c45c: f9 01 movw r30, r18 2c45e: 32 96 adiw r30, 0x02 ; 2 2c460: 65 91 lpm r22, Z+ 2c462: 74 91 lpm r23, Z 2c464: 87 70 andi r24, 0x07 ; 7 2c466: 99 27 eor r25, r25 2c468: 86 9f mul r24, r22 2c46a: 90 01 movw r18, r0 2c46c: 87 9f mul r24, r23 2c46e: 30 0d add r19, r0 2c470: 96 9f mul r25, r22 2c472: 30 0d add r19, r0 2c474: 11 24 eor r1, r1 2c476: a3 e0 ldi r26, 0x03 ; 3 2c478: 36 95 lsr r19 2c47a: 27 95 ror r18 2c47c: aa 95 dec r26 2c47e: e1 f7 brne .-8 ; 0x2c478 <__vector_17+0x10ac> 2c480: ca 01 movw r24, r20 2c482: 82 1b sub r24, r18 2c484: 93 0b sbc r25, r19 2c486: aa cf rjmp .-172 ; 0x2c3dc <__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; 2c488: de 01 movw r26, r28 2c48a: a3 5b subi r26, 0xB3 ; 179 2c48c: bf 4f sbci r27, 0xFF ; 255 2c48e: 4d 91 ld r20, X+ 2c490: 5c 91 ld r21, X 2c492: 11 97 sbiw r26, 0x01 ; 1 2c494: 70 e0 ldi r23, 0x00 ; 0 2c496: 60 e0 ldi r22, 0x00 ; 0 2c498: 40 93 73 05 sts 0x0573, r20 ; 0x800573 2c49c: 50 93 74 05 sts 0x0574, r21 ; 0x800574 2c4a0: 60 93 75 05 sts 0x0575, r22 ; 0x800575 2c4a4: 70 93 76 05 sts 0x0576, r23 ; 0x800576 e_step_loops = current_block->advance_step_loops; 2c4a8: 16 96 adiw r26, 0x06 ; 6 2c4aa: 9c 91 ld r25, X 2c4ac: 90 93 72 05 sts 0x0572, r25 ; 0x800572 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 2c4b0: 98 2f mov r25, r24 2c4b2: 92 70 andi r25, 0x02 ; 2 2c4b4: 09 f4 brne .+2 ; 0x2c4b8 <__vector_17+0x10ec> 2c4b6: cb cd rjmp .-1130 ; 0x2c04e <__vector_17+0xc82> 2c4b8: 90 91 81 05 lds r25, 0x0581 ; 0x800581 2c4bc: 99 23 and r25, r25 2c4be: 09 f4 brne .+2 ; 0x2c4c2 <__vector_17+0x10f6> 2c4c0: c6 cd rjmp .-1140 ; 0x2c04e <__vector_17+0xc82> 2c4c2: 2e 17 cp r18, r30 2c4c4: 3f 07 cpc r19, r31 2c4c6: 08 f0 brcs .+2 ; 0x2c4ca <__vector_17+0x10fe> 2c4c8: c2 cd rjmp .-1148 ; 0x2c04e <__vector_17+0xc82> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2c4ca: 44 0f add r20, r20 2c4cc: 55 1f adc r21, r21 2c4ce: 66 1f adc r22, r22 2c4d0: 77 1f adc r23, r23 2c4d2: 40 93 73 05 sts 0x0573, r20 ; 0x800573 2c4d6: 50 93 74 05 sts 0x0574, r21 ; 0x800574 2c4da: 60 93 75 05 sts 0x0575, r22 ; 0x800575 2c4de: 70 93 76 05 sts 0x0576, r23 ; 0x800576 LA_phase = 0; 2c4e2: 10 92 92 05 sts 0x0592, r1 ; 0x800592 2c4e6: b3 cd rjmp .-1178 ; 0x2c04e <__vector_17+0xc82> 2c4e8: 80 93 73 05 sts 0x0573, r24 ; 0x800573 2c4ec: 90 93 74 05 sts 0x0574, r25 ; 0x800574 2c4f0: a0 93 75 05 sts 0x0575, r26 ; 0x800575 2c4f4: b0 93 76 05 sts 0x0576, r27 ; 0x800576 while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 2c4f8: 61 11 cpse r22, r1 2c4fa: 1b c0 rjmp .+54 ; 0x2c532 <__vector_17+0x1166> { eISR_Rate = timer; 2c4fc: f0 93 71 05 sts 0x0571, r31 ; 0x800571 2c500: e0 93 70 05 sts 0x0570, r30 ; 0x800570 nextAdvanceISR = timer; 2c504: f0 93 e7 04 sts 0x04E7, r31 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c508: e0 93 e6 04 sts 0x04E6, r30 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 2c50c: 80 91 92 05 lds r24, 0x0592 ; 0x800592 2c510: 87 fd sbrc r24, 7 2c512: 58 c0 rjmp .+176 ; 0x2c5c4 <__vector_17+0x11f8> if (step_loops == e_step_loops) 2c514: 80 91 9a 05 lds r24, 0x059A ; 0x80059a 2c518: 10 91 72 05 lds r17, 0x0572 ; 0x800572 2c51c: 28 81 ld r18, Y 2c51e: 39 81 ldd r19, Y+1 ; 0x01 2c520: 81 13 cpse r24, r17 2c522: 35 c0 rjmp .+106 ; 0x2c58e <__vector_17+0x11c2> LA_phase = (current_block->advance_rate < main_Rate); 2c524: 81 e0 ldi r24, 0x01 ; 1 2c526: 2e 17 cp r18, r30 2c528: 3f 07 cpc r19, r31 2c52a: 08 f4 brcc .+2 ; 0x2c52e <__vector_17+0x1162> 2c52c: 49 c0 rjmp .+146 ; 0x2c5c0 <__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); 2c52e: 80 e0 ldi r24, 0x00 ; 0 2c530: 47 c0 rjmp .+142 ; 0x2c5c0 <__vector_17+0x11f4> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 2c532: 64 30 cpi r22, 0x04 ; 4 2c534: 28 f5 brcc .+74 ; 0x2c580 <__vector_17+0x11b4> eISR_Rate = fastdiv(timer, ticks + 1); 2c536: 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); 2c538: 63 30 cpi r22, 0x03 ; 3 2c53a: a9 f0 breq .+42 ; 0x2c566 <__vector_17+0x119a> 2c53c: 66 95 lsr r22 2c53e: af 01 movw r20, r30 2c540: 02 c0 rjmp .+4 ; 0x2c546 <__vector_17+0x117a> 2c542: 56 95 lsr r21 2c544: 47 95 ror r20 2c546: 6a 95 dec r22 2c548: e2 f7 brpl .-8 ; 0x2c542 <__vector_17+0x1176> 2c54a: 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); 2c54c: 70 93 71 05 sts 0x0571, r23 ; 0x800571 2c550: 60 93 70 05 sts 0x0570, r22 ; 0x800570 } nextAdvanceISR = eISR_Rate; 2c554: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2c558: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2c55c: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c560: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> 2c564: d3 cf rjmp .-90 ; 0x2c50c <__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; 2c566: 9f 01 movw r18, r30 2c568: ab ea ldi r26, 0xAB ; 171 2c56a: ba ea ldi r27, 0xAA ; 170 2c56c: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 2c570: 41 e1 ldi r20, 0x11 ; 17 2c572: 96 95 lsr r25 2c574: 87 95 ror r24 2c576: 77 95 ror r23 2c578: 67 95 ror r22 2c57a: 4a 95 dec r20 2c57c: d1 f7 brne .-12 ; 0x2c572 <__vector_17+0x11a6> 2c57e: e6 cf rjmp .-52 ; 0x2c54c <__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); 2c580: 70 e0 ldi r23, 0x00 ; 0 2c582: 6f 5f subi r22, 0xFF ; 255 2c584: 7f 4f sbci r23, 0xFF ; 255 2c586: cf 01 movw r24, r30 2c588: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 2c58c: df cf rjmp .-66 ; 0x2c54c <__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); 2c58e: 83 30 cpi r24, 0x03 ; 3 2c590: 09 f4 brne .+2 ; 0x2c594 <__vector_17+0x11c8> 2c592: cf c0 rjmp .+414 ; 0x2c732 <__vector_17+0x1366> 2c594: 86 95 lsr r24 2c596: a9 01 movw r20, r18 2c598: 02 c0 rjmp .+4 ; 0x2c59e <__vector_17+0x11d2> 2c59a: 56 95 lsr r21 2c59c: 47 95 ror r20 2c59e: 8a 95 dec r24 2c5a0: e2 f7 brpl .-8 ; 0x2c59a <__vector_17+0x11ce> 2c5a2: 13 30 cpi r17, 0x03 ; 3 2c5a4: 09 f4 brne .+2 ; 0x2c5a8 <__vector_17+0x11dc> 2c5a6: d3 c0 rjmp .+422 ; 0x2c74e <__vector_17+0x1382> 2c5a8: 16 95 lsr r17 2c5aa: bf 01 movw r22, r30 2c5ac: 02 c0 rjmp .+4 ; 0x2c5b2 <__vector_17+0x11e6> 2c5ae: 76 95 lsr r23 2c5b0: 67 95 ror r22 2c5b2: 1a 95 dec r17 2c5b4: e2 f7 brpl .-8 ; 0x2c5ae <__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); 2c5b6: 81 e0 ldi r24, 0x01 ; 1 2c5b8: 46 17 cp r20, r22 2c5ba: 57 07 cpc r21, r23 2c5bc: 08 f0 brcs .+2 ; 0x2c5c0 <__vector_17+0x11f4> 2c5be: b7 cf rjmp .-146 ; 0x2c52e <__vector_17+0x1162> 2c5c0: 80 93 92 05 sts 0x0592, r24 ; 0x800592 } } // Check for serial chars. This executes roughtly inbetween 50-60% of the total runtime of the // entire isr, making this spot a much better choice than checking during esteps MSerial.checkRx(); 2c5c4: 0f 94 5f 22 call 0x244be ; 0x244be #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 2c5c8: 40 91 7d 05 lds r20, 0x057D ; 0x80057d 2c5cc: 50 91 7e 05 lds r21, 0x057E ; 0x80057e 2c5d0: 60 91 7f 05 lds r22, 0x057F ; 0x80057f 2c5d4: 70 91 80 05 lds r23, 0x0580 ; 0x800580 2c5d8: e0 91 a2 05 lds r30, 0x05A2 ; 0x8005a2 2c5dc: f0 91 a3 05 lds r31, 0x05A3 ; 0x8005a3 2c5e0: 80 89 ldd r24, Z+16 ; 0x10 2c5e2: 91 89 ldd r25, Z+17 ; 0x11 2c5e4: a2 89 ldd r26, Z+18 ; 0x12 2c5e6: b3 89 ldd r27, Z+19 ; 0x13 2c5e8: 48 17 cp r20, r24 2c5ea: 59 07 cpc r21, r25 2c5ec: 6a 07 cpc r22, r26 2c5ee: 7b 07 cpc r23, r27 2c5f0: 80 f0 brcs .+32 ; 0x2c612 <__vector_17+0x1246> current_block = NULL; 2c5f2: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 2c5f6: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 extern volatile uint8_t block_buffer_tail; // Called when the current block is no longer needed. Discards the block and makes the memory // available for new blocks. FORCE_INLINE void plan_discard_current_block() { if (block_buffer_head != block_buffer_tail) { 2c5fa: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 2c5fe: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2c602: 98 17 cp r25, r24 2c604: 31 f0 breq .+12 ; 0x2c612 <__vector_17+0x1246> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 2c606: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 2c60a: 8f 5f subi r24, 0xFF ; 255 2c60c: 8f 70 andi r24, 0x0F ; 15 2c60e: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 return mask; } void tmc2130_st_isr() { if (tmc2130_mode == TMC2130_MODE_SILENT || tmc2130_sg_stop_on_crash == false || tmc2130_sg_homing_axes_mask != 0) 2c612: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 2c616: 81 30 cpi r24, 0x01 ; 1 2c618: 49 f1 breq .+82 ; 0x2c66c <__vector_17+0x12a0> 2c61a: 80 91 5c 02 lds r24, 0x025C ; 0x80025c 2c61e: 88 23 and r24, r24 2c620: 29 f1 breq .+74 ; 0x2c66c <__vector_17+0x12a0> 2c622: 80 91 40 06 lds r24, 0x0640 ; 0x800640 2c626: 81 11 cpse r24, r1 2c628: 21 c0 rjmp .+66 ; 0x2c66c <__vector_17+0x12a0> } uint8_t tmc2130_sample_diag() { uint8_t mask = 0; if (!READ(X_TMC2130_DIAG)) mask |= X_AXIS_MASK; 2c62a: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c62e: 81 e0 ldi r24, 0x01 ; 1 2c630: 29 2f mov r18, r25 2c632: 24 70 andi r18, 0x04 ; 4 2c634: 92 fd sbrc r25, 2 2c636: 80 e0 ldi r24, 0x00 ; 0 if (!READ(Y_TMC2130_DIAG)) mask |= Y_AXIS_MASK; 2c638: 90 91 06 01 lds r25, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 2c63c: 82 60 ori r24, 0x02 ; 2 2c63e: 97 ff sbrs r25, 7 2c640: 03 c0 rjmp .+6 ; 0x2c648 <__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) { 2c642: 21 11 cpse r18, r1 2c644: 13 c0 rjmp .+38 ; 0x2c66c <__vector_17+0x12a0> 2c646: 81 e0 ldi r24, 0x01 ; 1 tmc2130_sg_crash = mask; 2c648: 80 93 10 05 sts 0x0510, r24 ; 0x800510 tmc2130_sg_stop_on_crash = false; 2c64c: 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 2c650: 60 91 47 02 lds r22, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.497+0x8> 2c654: 70 91 48 02 lds r23, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.497+0x9> 2c658: 80 91 49 02 lds r24, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.497+0xa> 2c65c: 90 91 4a 02 lds r25, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.497+0xb> 2c660: 20 e0 ldi r18, 0x00 ; 0 2c662: 30 e0 ldi r19, 0x00 ; 0 2c664: 40 e8 ldi r20, 0x80 ; 128 2c666: 5f eb ldi r21, 0xBF ; 191 2c668: 0e 94 6a 8a call 0x114d4 ; 0x114d4 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c66c: 60 91 e6 04 lds r22, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> 2c670: 70 91 e7 04 lds r23, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> if (eisr) 2c674: 61 15 cp r22, r1 2c676: 71 05 cpc r23, r1 2c678: 09 f0 breq .+2 ; 0x2c67c <__vector_17+0x12b0> 2c67a: 46 c0 rjmp .+140 ; 0x2c708 <__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) { 2c67c: 40 91 e2 04 lds r20, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c680: 50 91 e3 04 lds r21, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c684: 20 91 94 05 lds r18, 0x0594 ; 0x800594 2c688: 30 91 95 05 lds r19, 0x0595 ; 0x800595 2c68c: 80 91 93 05 lds r24, 0x0593 ; 0x800593 2c690: 24 17 cp r18, r20 2c692: 35 07 cpc r19, r21 2c694: 08 f0 brcs .+2 ; 0x2c698 <__vector_17+0x12cc> 2c696: 6c c0 rjmp .+216 ; 0x2c770 <__vector_17+0x13a4> // decompression if (e_step_loops != 1) { 2c698: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c69c: 91 30 cpi r25, 0x01 ; 1 2c69e: 41 f0 breq .+16 ; 0x2c6b0 <__vector_17+0x12e4> uint16_t d_steps = current_adv_steps - target_adv_steps; 2c6a0: 42 1b sub r20, r18 2c6a2: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 2c6a4: 94 17 cp r25, r20 2c6a6: 15 06 cpc r1, r21 2c6a8: 19 f0 breq .+6 ; 0x2c6b0 <__vector_17+0x12e4> 2c6aa: 10 f0 brcs .+4 ; 0x2c6b0 <__vector_17+0x12e4> e_step_loops = d_steps; 2c6ac: 40 93 72 05 sts 0x0572, r20 ; 0x800572 } e_steps -= e_step_loops; 2c6b0: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c6b4: 89 1b sub r24, r25 2c6b6: 80 93 93 05 sts 0x0593, r24 ; 0x800593 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c6ba: 88 23 and r24, r24 2c6bc: 39 f0 breq .+14 ; 0x2c6cc <__vector_17+0x1300> 2c6be: 87 fd sbrc r24, 7 2c6c0: 53 c0 rjmp .+166 ; 0x2c768 <__vector_17+0x139c> 2c6c2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c6c6: 80 64 ori r24, 0x40 ; 64 2c6c8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 2c6cc: 20 91 72 05 lds r18, 0x0572 ; 0x800572 2c6d0: 80 91 e2 04 lds r24, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c6d4: 90 91 e3 04 lds r25, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c6d8: 82 1b sub r24, r18 2c6da: 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; 2c6dc: 90 93 e3 04 sts 0x04E3, r25 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c6e0: 80 93 e2 04 sts 0x04E2, r24 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> } if (current_adv_steps == target_adv_steps) { 2c6e4: 20 91 e2 04 lds r18, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c6e8: 30 91 e3 04 lds r19, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c6ec: 80 91 94 05 lds r24, 0x0594 ; 0x800594 2c6f0: 90 91 95 05 lds r25, 0x0595 ; 0x800595 2c6f4: 28 17 cp r18, r24 2c6f6: 39 07 cpc r19, r25 2c6f8: 09 f0 breq .+2 ; 0x2c6fc <__vector_17+0x1330> 2c6fa: 66 c0 rjmp .+204 ; 0x2c7c8 <__vector_17+0x13fc> // advance steps completed nextAdvanceISR = ADV_NEVER; 2c6fc: 8f ef ldi r24, 0xFF ; 255 2c6fe: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c700: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c704: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c708: 40 91 93 05 lds r20, 0x0593 ; 0x800593 2c70c: 41 11 cpse r20, r1 2c70e: 61 c0 rjmp .+194 ; 0x2c7d2 <__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) 2c710: 80 91 e6 04 lds r24, 0x04E6 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> 2c714: 90 91 e7 04 lds r25, 0x04E7 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 2c718: 20 91 e8 04 lds r18, 0x04E8 ; 0x8004e8 <_ZL11nextMainISR.lto_priv.492> 2c71c: 30 91 e9 04 lds r19, 0x04E9 ; 0x8004e9 <_ZL11nextMainISR.lto_priv.492+0x1> 2c720: 8f 3f cpi r24, 0xFF ; 255 2c722: 98 07 cpc r25, r24 2c724: 09 f0 breq .+2 ; 0x2c728 <__vector_17+0x135c> 2c726: 88 c0 rjmp .+272 ; 0x2c838 <__vector_17+0x146c> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 2c728: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c72c: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c730: 8e c0 rjmp .+284 ; 0x2c84e <__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; 2c732: ab ea ldi r26, 0xAB ; 171 2c734: ba ea ldi r27, 0xAA ; 170 2c736: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 2c73a: ab 01 movw r20, r22 2c73c: bc 01 movw r22, r24 2c73e: 31 e1 ldi r19, 0x11 ; 17 2c740: 76 95 lsr r23 2c742: 67 95 ror r22 2c744: 57 95 ror r21 2c746: 47 95 ror r20 2c748: 3a 95 dec r19 2c74a: d1 f7 brne .-12 ; 0x2c740 <__vector_17+0x1374> 2c74c: 2a cf rjmp .-428 ; 0x2c5a2 <__vector_17+0x11d6> 2c74e: 9f 01 movw r18, r30 2c750: ab ea ldi r26, 0xAB ; 171 2c752: ba ea ldi r27, 0xAA ; 170 2c754: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 2c758: 21 e1 ldi r18, 0x11 ; 17 2c75a: 96 95 lsr r25 2c75c: 87 95 ror r24 2c75e: 77 95 ror r23 2c760: 67 95 ror r22 2c762: 2a 95 dec r18 2c764: d1 f7 brne .-12 ; 0x2c75a <__vector_17+0x138e> 2c766: 27 cf rjmp .-434 ; 0x2c5b6 <__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); 2c768: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c76c: 8f 7b andi r24, 0xBF ; 191 2c76e: ac cf rjmp .-168 ; 0x2c6c8 <__vector_17+0x12fc> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 2c770: 42 17 cp r20, r18 2c772: 53 07 cpc r21, r19 2c774: 08 f0 brcs .+2 ; 0x2c778 <__vector_17+0x13ac> 2c776: b6 cf rjmp .-148 ; 0x2c6e4 <__vector_17+0x1318> // compression if (e_step_loops != 1) { 2c778: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c77c: 91 30 cpi r25, 0x01 ; 1 2c77e: 41 f0 breq .+16 ; 0x2c790 <__vector_17+0x13c4> uint16_t d_steps = target_adv_steps - current_adv_steps; 2c780: 24 1b sub r18, r20 2c782: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 2c784: 92 17 cp r25, r18 2c786: 13 06 cpc r1, r19 2c788: 19 f0 breq .+6 ; 0x2c790 <__vector_17+0x13c4> 2c78a: 10 f0 brcs .+4 ; 0x2c790 <__vector_17+0x13c4> e_step_loops = d_steps; 2c78c: 20 93 72 05 sts 0x0572, r18 ; 0x800572 } e_steps += e_step_loops; 2c790: 90 91 72 05 lds r25, 0x0572 ; 0x800572 2c794: 89 0f add r24, r25 2c796: 80 93 93 05 sts 0x0593, r24 ; 0x800593 if (e_steps) WRITE_NC(E0_DIR_PIN, e_steps < 0? INVERT_E0_DIR: !INVERT_E0_DIR); 2c79a: 88 23 and r24, r24 2c79c: 39 f0 breq .+14 ; 0x2c7ac <__vector_17+0x13e0> 2c79e: 87 fd sbrc r24, 7 2c7a0: 0f c0 rjmp .+30 ; 0x2c7c0 <__vector_17+0x13f4> 2c7a2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c7a6: 80 64 ori r24, 0x40 ; 64 2c7a8: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 2c7ac: 80 91 72 05 lds r24, 0x0572 ; 0x800572 2c7b0: 20 91 e2 04 lds r18, 0x04E2 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> 2c7b4: 30 91 e3 04 lds r19, 0x04E3 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 2c7b8: 82 0f add r24, r18 2c7ba: 93 2f mov r25, r19 2c7bc: 91 1d adc r25, r1 2c7be: 8e cf rjmp .-228 ; 0x2c6dc <__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); 2c7c0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2c7c4: 8f 7b andi r24, 0xBF ; 191 2c7c6: f0 cf rjmp .-32 ; 0x2c7a8 <__vector_17+0x13dc> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2c7c8: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2c7cc: 90 91 71 05 lds r25, 0x0571 ; 0x800571 2c7d0: 97 cf rjmp .-210 ; 0x2c700 <__vector_17+0x1334> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 2c7d2: 80 91 92 05 lds r24, 0x0592 ; 0x800592 2c7d6: 87 fd sbrc r24, 7 2c7d8: 0e c0 rjmp .+28 ; 0x2c7f6 <__vector_17+0x142a> 2c7da: 08 2e mov r0, r24 2c7dc: 00 0c add r0, r0 2c7de: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2c7e0: 21 e0 ldi r18, 0x01 ; 1 2c7e2: 30 e0 ldi r19, 0x00 ; 0 2c7e4: 61 15 cp r22, r1 2c7e6: 71 05 cpc r23, r1 2c7e8: 11 f0 breq .+4 ; 0x2c7ee <__vector_17+0x1422> 2c7ea: 30 e0 ldi r19, 0x00 ; 0 2c7ec: 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)) { 2c7ee: 82 17 cp r24, r18 2c7f0: 93 07 cpc r25, r19 2c7f2: 09 f0 breq .+2 ; 0x2c7f6 <__vector_17+0x142a> 2c7f4: 8d cf rjmp .-230 ; 0x2c710 <__vector_17+0x1344> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 2c7f6: 20 91 72 05 lds r18, 0x0572 ; 0x800572 2c7fa: 67 2b or r22, r23 2c7fc: 11 f0 breq .+4 ; 0x2c802 <__vector_17+0x1436> 2c7fe: 20 91 9a 05 lds r18, 0x059A ; 0x80059a max_ticks = min(abs(e_steps), max_ticks); 2c802: 84 2f mov r24, r20 2c804: 04 2e mov r0, r20 2c806: 00 0c add r0, r0 2c808: 99 0b sbc r25, r25 2c80a: 97 ff sbrs r25, 7 2c80c: 03 c0 rjmp .+6 ; 0x2c814 <__vector_17+0x1448> 2c80e: 91 95 neg r25 2c810: 81 95 neg r24 2c812: 91 09 sbc r25, r1 2c814: 30 e0 ldi r19, 0x00 ; 0 2c816: 28 17 cp r18, r24 2c818: 39 07 cpc r19, r25 2c81a: 0c f4 brge .+2 ; 0x2c81e <__vector_17+0x1452> 2c81c: c9 01 movw r24, r18 2c81e: 21 e0 ldi r18, 0x01 ; 1 2c820: 47 ff sbrs r20, 7 2c822: 2f ef ldi r18, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 2c824: 38 e0 ldi r19, 0x08 ; 8 2c826: 36 b9 out 0x06, r19 ; 6 e_steps += (rev? 1: -1); 2c828: 90 91 93 05 lds r25, 0x0593 ; 0x800593 2c82c: 92 0f add r25, r18 2c82e: 90 93 93 05 sts 0x0593, r25 ; 0x800593 STEP_NC_LO(E_AXIS); #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.stStep(rev); #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } while(--max_ticks); 2c832: 81 50 subi r24, 0x01 ; 1 2c834: c1 f7 brne .-16 ; 0x2c826 <__vector_17+0x145a> 2c836: 6c cf rjmp .-296 ; 0x2c710 <__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) 2c838: ac 01 movw r20, r24 2c83a: 48 5d subi r20, 0xD8 ; 216 2c83c: 5f 4f sbci r21, 0xFF ; 255 2c83e: 42 17 cp r20, r18 2c840: 53 07 cpc r21, r19 2c842: 08 f0 brcs .+2 ; 0x2c846 <__vector_17+0x147a> 2c844: 71 cf rjmp .-286 ; 0x2c728 <__vector_17+0x135c> OCR1A = nextAdvanceISR; 2c846: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c84a: 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) { 2c84e: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2c852: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c856: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c85a: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c85e: 40 96 adiw r24, 0x10 ; 16 2c860: 28 17 cp r18, r24 2c862: 39 07 cpc r19, r25 2c864: 48 f4 brcc .+18 ; 0x2c878 <__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; 2c866: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 2c86a: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 2c86e: 40 96 adiw r24, 0x10 ; 16 2c870: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2c874: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 2c878: ff 91 pop r31 2c87a: ef 91 pop r30 2c87c: df 91 pop r29 2c87e: cf 91 pop r28 2c880: bf 91 pop r27 2c882: af 91 pop r26 2c884: 9f 91 pop r25 2c886: 8f 91 pop r24 2c888: 7f 91 pop r23 2c88a: 6f 91 pop r22 2c88c: 5f 91 pop r21 2c88e: 4f 91 pop r20 2c890: 3f 91 pop r19 2c892: 2f 91 pop r18 2c894: 1f 91 pop r17 2c896: 0f 91 pop r16 2c898: ff 90 pop r15 2c89a: ef 90 pop r14 2c89c: df 90 pop r13 2c89e: cf 90 pop r12 2c8a0: 8f 90 pop r8 2c8a2: 7f 90 pop r7 2c8a4: 6f 90 pop r6 2c8a6: 0f 90 pop r0 2c8a8: 0b be out 0x3b, r0 ; 59 2c8aa: 0f 90 pop r0 2c8ac: 0f be out 0x3f, r0 ; 63 2c8ae: 0f 90 pop r0 2c8b0: 1f 90 pop r1 2c8b2: 18 95 reti 0002c8b4 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 2c8b4: 90 91 79 05 lds r25, 0x0579 ; 0x800579 check_z_endstop = check; 2c8b8: 80 93 79 05 sts 0x0579, r24 ; 0x800579 CRITICAL_SECTION_START; 2c8bc: 2f b7 in r18, 0x3f ; 63 2c8be: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c8c0: 80 91 0e 05 lds r24, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.496> 2c8c4: 8b 7f andi r24, 0xFB ; 251 2c8c6: 80 93 0e 05 sts 0x050E, r24 ; 0x80050e <_ZL11endstop_hit.lto_priv.496> CRITICAL_SECTION_END; 2c8ca: 2f bf out 0x3f, r18 ; 63 return old; } 2c8cc: 89 2f mov r24, r25 2c8ce: 08 95 ret 0002c8d0 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 2c8d0: 80 91 0e 05 lds r24, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.496> CRITICAL_SECTION_START; 2c8d4: 2f b7 in r18, 0x3f ; 63 2c8d6: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 2c8d8: 90 91 0e 05 lds r25, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.496> 2c8dc: 9b 7f andi r25, 0xFB ; 251 2c8de: 90 93 0e 05 sts 0x050E, r25 ; 0x80050e <_ZL11endstop_hit.lto_priv.496> CRITICAL_SECTION_END; 2c8e2: 2f bf out 0x3f, r18 ; 63 return hit; } 2c8e4: 82 fb bst r24, 2 2c8e6: 88 27 eor r24, r24 2c8e8: 80 f9 bld r24, 0 2c8ea: 08 95 ret 0002c8ec : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 2c8ec: 90 91 0e 05 lds r25, 0x050E ; 0x80050e <_ZL11endstop_hit.lto_priv.496> endstop_hit = 0; 2c8f0: 10 92 0e 05 sts 0x050E, r1 ; 0x80050e <_ZL11endstop_hit.lto_priv.496> return old; 2c8f4: 81 e0 ldi r24, 0x01 ; 1 2c8f6: 91 11 cpse r25, r1 2c8f8: 01 c0 rjmp .+2 ; 0x2c8fc 2c8fa: 80 e0 ldi r24, 0x00 ; 0 } 2c8fc: 08 95 ret 0002c8fe : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2c8fe: 90 91 e1 04 lds r25, 0x04E1 ; 0x8004e1 2c902: 91 30 cpi r25, 0x01 ; 1 2c904: a1 f0 breq .+40 ; 0x2c92e 2c906: 28 f0 brcs .+10 ; 0x2c912 2c908: 92 30 cpi r25, 0x02 ; 2 2c90a: a9 f0 breq .+42 ; 0x2c936 2c90c: 93 30 cpi r25, 0x03 ; 3 2c90e: c1 f0 breq .+48 ; 0x2c940 2c910: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 2c912: 81 11 cpse r24, r1 2c914: 02 c0 rjmp .+4 ; 0x2c91a 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(); 2c916: 0d 94 c7 22 jmp 0x2458e ; 0x2458e switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c91a: 82 30 cpi r24, 0x02 ; 2 2c91c: 11 f4 brne .+4 ; 0x2c922 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2c91e: 0d 94 a6 32 jmp 0x2654c ; 0x2654c 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) 2c922: 85 30 cpi r24, 0x05 ; 5 2c924: 09 f0 breq .+2 ; 0x2c928 2c926: 50 c0 rjmp .+160 ; 0x2c9c8 Sound_DoSound_Alert(false); 2c928: 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); 2c92a: 0d 94 a5 22 jmp 0x2454a ; 0x2454a 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) 2c92e: 88 23 and r24, r24 2c930: 91 f3 breq .-28 ; 0x2c916 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c932: 82 30 cpi r24, 0x02 ; 2 2c934: a1 f3 breq .-24 ; 0x2c91e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c936: 85 30 cpi r24, 0x05 ; 5 2c938: 09 f0 breq .+2 ; 0x2c93c 2c93a: 46 c0 rjmp .+140 ; 0x2c9c8 Sound_DoSound_Alert(true); 2c93c: 81 e0 ldi r24, 0x01 ; 1 2c93e: f5 cf rjmp .-22 ; 0x2c92a 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) 2c940: 88 23 and r24, r24 2c942: 49 f3 breq .-46 ; 0x2c916 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2c944: 82 30 cpi r24, 0x02 ; 2 2c946: 59 f3 breq .-42 ; 0x2c91e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 2c948: 85 30 cpi r24, 0x05 ; 5 2c94a: 71 f3 breq .-36 ; 0x2c928 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 2c94c: 86 30 cpi r24, 0x06 ; 6 2c94e: e1 f4 brne .+56 ; 0x2c988 2c950: 85 e0 ldi r24, 0x05 ; 5 2c952: 27 e2 ldi r18, 0x27 ; 39 2c954: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 2c956: 4f b7 in r20, 0x3f ; 63 2c958: f8 94 cli 2c95a: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c95e: 94 60 ori r25, 0x04 ; 4 2c960: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c964: 4f bf out 0x3f, r20 ; 63 2c966: f9 01 movw r30, r18 2c968: 31 97 sbiw r30, 0x01 ; 1 2c96a: f1 f7 brne .-4 ; 0x2c968 delayMicroseconds(75); WRITE(BEEPER,LOW); 2c96c: 4f b7 in r20, 0x3f ; 63 2c96e: f8 94 cli 2c970: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c974: 9b 7f andi r25, 0xFB ; 251 2c976: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c97a: 4f bf out 0x3f, r20 ; 63 2c97c: f9 01 movw r30, r18 2c97e: 31 97 sbiw r30, 0x01 ; 1 2c980: f1 f7 brne .-4 ; 0x2c97e 2c982: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 2c984: 41 f7 brne .-48 ; 0x2c956 2c986: 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) 2c988: 87 30 cpi r24, 0x07 ; 7 2c98a: f1 f4 brne .+60 ; 0x2c9c8 } } static void Sound_DoSound_Blind_Alert(void) { backlight_wake(1); 2c98c: 81 e0 ldi r24, 0x01 ; 1 2c98e: 0e 94 a0 8b call 0x11740 ; 0x11740 2c992: 84 e1 ldi r24, 0x14 ; 20 2c994: 23 e7 ldi r18, 0x73 ; 115 2c996: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 2c998: 4f b7 in r20, 0x3f ; 63 2c99a: f8 94 cli 2c99c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c9a0: 94 60 ori r25, 0x04 ; 4 2c9a2: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c9a6: 4f bf out 0x3f, r20 ; 63 2c9a8: f9 01 movw r30, r18 2c9aa: 31 97 sbiw r30, 0x01 ; 1 2c9ac: f1 f7 brne .-4 ; 0x2c9aa delayMicroseconds(94); WRITE(BEEPER,LOW); 2c9ae: 4f b7 in r20, 0x3f ; 63 2c9b0: f8 94 cli 2c9b2: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c9b6: 9b 7f andi r25, 0xFB ; 251 2c9b8: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2c9bc: 4f bf out 0x3f, r20 ; 63 2c9be: f9 01 movw r30, r18 2c9c0: 31 97 sbiw r30, 0x01 ; 1 2c9c2: f1 f7 brne .-4 ; 0x2c9c0 2c9c4: 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++) 2c9c6: 41 f7 brne .-48 ; 0x2c998 Sound_DoSound_Blind_Alert(); break; default: break; } } 2c9c8: 08 95 ret 0002c9ca : //! @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 ) { 2c9ca: 2f 92 push r2 2c9cc: 3f 92 push r3 2c9ce: 4f 92 push r4 2c9d0: 5f 92 push r5 2c9d2: 6f 92 push r6 2c9d4: 7f 92 push r7 2c9d6: 8f 92 push r8 2c9d8: 9f 92 push r9 2c9da: af 92 push r10 2c9dc: bf 92 push r11 2c9de: cf 92 push r12 2c9e0: df 92 push r13 2c9e2: ef 92 push r14 2c9e4: ff 92 push r15 2c9e6: 0f 93 push r16 2c9e8: 1f 93 push r17 2c9ea: cf 93 push r28 2c9ec: df 93 push r29 2c9ee: 00 d0 rcall .+0 ; 0x2c9f0 2c9f0: 00 d0 rcall .+0 ; 0x2c9f2 2c9f2: cd b7 in r28, 0x3d ; 61 2c9f4: de b7 in r29, 0x3e ; 62 2c9f6: 5c 01 movw r10, r24 2c9f8: 6c 83 std Y+4, r22 ; 0x04 2c9fa: 34 2e mov r3, r20 2c9fc: 3b 83 std Y+3, r19 ; 0x03 2c9fe: 2a 83 std Y+2, r18 ; 0x02 2ca00: 48 01 movw r8, r16 2ca02: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 2ca04: 00 97 sbiw r24, 0x00 ; 0 2ca06: 09 f0 breq .+2 ; 0x2ca0a 2ca08: 51 c0 rjmp .+162 ; 0x2caac 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); 2ca0a: 87 01 movw r16, r14 2ca0c: 22 2d mov r18, r2 2ca0e: a4 01 movw r20, r8 2ca10: 6a 81 ldd r22, Y+2 ; 0x02 2ca12: 7b 81 ldd r23, Y+3 ; 0x03 2ca14: 83 2d mov r24, r3 2ca16: 0f 94 34 35 call 0x26a68 ; 0x26a68 2ca1a: d1 2c mov r13, r1 2ca1c: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 2ca1e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2ca22: 2b 01 movw r4, r22 2ca24: 3c 01 movw r6, r24 lcd_consume_click(); 2ca26: 0e 94 ad 71 call 0xe35a ; 0xe35a KEEPALIVE_STATE(PAUSED_FOR_USER); 2ca2a: 84 e0 ldi r24, 0x04 ; 4 2ca2c: 80 93 96 02 sts 0x0296, r24 ; 0x800296 2ca30: de 82 std Y+6, r13 ; 0x06 2ca32: cd 82 std Y+5, r12 ; 0x05 2ca34: 24 e6 ldi r18, 0x64 ; 100 2ca36: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 2ca38: 82 e3 ldi r24, 0x32 ; 50 2ca3a: 90 e0 ldi r25, 0x00 ; 0 2ca3c: 0e 94 87 8e call 0x11d0e ; 0x11d0e if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 2ca40: 3c 81 ldd r19, Y+4 ; 0x04 2ca42: 31 11 cpse r19, r1 2ca44: 3a c0 rjmp .+116 ; 0x2caba current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 2ca46: 80 91 37 05 lds r24, 0x0537 ; 0x800537 2ca4a: 90 91 38 05 lds r25, 0x0538 ; 0x800538 2ca4e: 00 97 sbiw r24, 0x00 ; 0 2ca50: 09 f0 breq .+2 ; 0x2ca54 2ca52: 42 c0 rjmp .+132 ; 0x2cad8 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 2ca54: 0e 94 b2 71 call 0xe364 ; 0xe364 2ca58: 88 23 and r24, r24 2ca5a: 09 f4 brne .+2 ; 0x2ca5e 2ca5c: 67 c0 rjmp .+206 ; 0x2cb2c if (msg_next == NULL) { 2ca5e: 8d 81 ldd r24, Y+5 ; 0x05 2ca60: 9e 81 ldd r25, Y+6 ; 0x06 2ca62: 89 2b or r24, r25 2ca64: 09 f0 breq .+2 ; 0x2ca68 2ca66: 5e c0 rjmp .+188 ; 0x2cb24 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 2ca68: 82 e0 ldi r24, 0x02 ; 2 2ca6a: 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; 2ca6e: 91 e0 ldi r25, 0x01 ; 1 2ca70: 90 93 6e 02 sts 0x026E, r25 ; 0x80026e lcd_draw_update = 2; 2ca74: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d return current_selection; } 2ca78: 83 2d mov r24, r3 2ca7a: 26 96 adiw r28, 0x06 ; 6 2ca7c: 0f b6 in r0, 0x3f ; 63 2ca7e: f8 94 cli 2ca80: de bf out 0x3e, r29 ; 62 2ca82: 0f be out 0x3f, r0 ; 63 2ca84: cd bf out 0x3d, r28 ; 61 2ca86: df 91 pop r29 2ca88: cf 91 pop r28 2ca8a: 1f 91 pop r17 2ca8c: 0f 91 pop r16 2ca8e: ff 90 pop r15 2ca90: ef 90 pop r14 2ca92: df 90 pop r13 2ca94: cf 90 pop r12 2ca96: bf 90 pop r11 2ca98: af 90 pop r10 2ca9a: 9f 90 pop r9 2ca9c: 8f 90 pop r8 2ca9e: 7f 90 pop r7 2caa0: 6f 90 pop r6 2caa2: 5f 90 pop r5 2caa4: 4f 90 pop r4 2caa6: 3f 90 pop r3 2caa8: 2f 90 pop r2 2caaa: 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; 2caac: 0f 94 85 35 call 0x26b0a ; 0x26b0a 2cab0: 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) { 2cab2: 89 2b or r24, r25 2cab4: 09 f0 breq .+2 ; 0x2cab8 2cab6: b3 cf rjmp .-154 ; 0x2ca1e 2cab8: a8 cf rjmp .-176 ; 0x2ca0a 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) { 2caba: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2cabe: 64 19 sub r22, r4 2cac0: 75 09 sbc r23, r5 2cac2: 86 09 sbc r24, r6 2cac4: 97 09 sbc r25, r7 2cac6: 61 33 cpi r22, 0x31 ; 49 2cac8: 75 47 sbci r23, 0x75 ; 117 2caca: 81 05 cpc r24, r1 2cacc: 91 05 cpc r25, r1 2cace: 08 f4 brcc .+2 ; 0x2cad2 2cad0: ba cf rjmp .-140 ; 0x2ca46 current_selection = LCD_BUTTON_TIMEOUT; 2cad2: 33 24 eor r3, r3 2cad4: 3a 94 dec r3 2cad6: c8 cf rjmp .-112 ; 0x2ca68 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 2cad8: 2d 81 ldd r18, Y+5 ; 0x05 2cada: 3e 81 ldd r19, Y+6 ; 0x06 2cadc: 23 2b or r18, r19 2cade: f9 f4 brne .+62 ; 0x2cb1e if (third_choice) { // third_choice is not nullptr, safe to dereference 2cae0: e1 14 cp r14, r1 2cae2: f1 04 cpc r15, r1 2cae4: b1 f0 breq .+44 ; 0x2cb12 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2cae6: 97 ff sbrs r25, 7 2cae8: 0f c0 rjmp .+30 ; 0x2cb08 2caea: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 2caec: 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); 2caee: 87 01 movw r16, r14 2caf0: 22 2d mov r18, r2 2caf2: a4 01 movw r20, r8 2caf4: 6a 81 ldd r22, Y+2 ; 0x02 2caf6: 7b 81 ldd r23, Y+3 ; 0x03 2caf8: 83 2d mov r24, r3 2cafa: 0f 94 34 35 call 0x26a68 ; 0x26a68 lcd_encoder = 0; 2cafe: 10 92 38 05 sts 0x0538, r1 ; 0x800538 2cb02: 10 92 37 05 sts 0x0537, r1 ; 0x800537 2cb06: a6 cf rjmp .-180 ; 0x2ca54 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) { 2cb08: 32 e0 ldi r19, 0x02 ; 2 2cb0a: 33 16 cp r3, r19 2cb0c: 81 f3 breq .-32 ; 0x2caee // Rotating knob clockwise current_selection++; 2cb0e: 33 94 inc r3 2cb10: ee cf rjmp .-36 ; 0x2caee } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2cb12: 39 2e mov r3, r25 2cb14: 30 94 com r3 2cb16: 33 1c adc r3, r3 2cb18: 33 24 eor r3, r3 2cb1a: 33 1c adc r3, r3 2cb1c: e8 cf rjmp .-48 ; 0x2caee } } 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); 2cb1e: 87 e0 ldi r24, 0x07 ; 7 2cb20: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe goto exit; } else break; } } if (multi_screen) { 2cb24: c1 14 cp r12, r1 2cb26: d1 04 cpc r13, r1 2cb28: 79 f4 brne .+30 ; 0x2cb48 2cb2a: 84 cf rjmp .-248 ; 0x2ca34 2cb2c: 99 81 ldd r25, Y+1 ; 0x01 2cb2e: 91 50 subi r25, 0x01 ; 1 2cb30: 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) { 2cb32: 91 11 cpse r25, r1 2cb34: 81 cf rjmp .-254 ; 0x2ca38 goto exit; } else break; } } if (multi_screen) { 2cb36: c1 14 cp r12, r1 2cb38: d1 04 cpc r13, r1 2cb3a: 61 f0 breq .+24 ; 0x2cb54 if (msg_next == NULL) { 2cb3c: 2d 81 ldd r18, Y+5 ; 0x05 2cb3e: 3e 81 ldd r19, Y+6 ; 0x06 2cb40: 23 2b or r18, r19 2cb42: 11 f4 brne .+4 ; 0x2cb48 2cb44: be 82 std Y+6, r11 ; 0x06 2cb46: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 2cb48: 8d 81 ldd r24, Y+5 ; 0x05 2cb4a: 9e 81 ldd r25, Y+6 ; 0x06 2cb4c: 0f 94 85 35 call 0x26b0a ; 0x26b0a 2cb50: 9e 83 std Y+6, r25 ; 0x06 2cb52: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 2cb54: 8d 81 ldd r24, Y+5 ; 0x05 2cb56: 9e 81 ldd r25, Y+6 ; 0x06 2cb58: 89 2b or r24, r25 2cb5a: 09 f0 breq .+2 ; 0x2cb5e 2cb5c: 6b cf rjmp .-298 ; 0x2ca34 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 2cb5e: 87 01 movw r16, r14 2cb60: 22 2d mov r18, r2 2cb62: a4 01 movw r20, r8 2cb64: 6a 81 ldd r22, Y+2 ; 0x02 2cb66: 7b 81 ldd r23, Y+3 ; 0x03 2cb68: 83 2d mov r24, r3 2cb6a: 0f 94 34 35 call 0x26a68 ; 0x26a68 2cb6e: 62 cf rjmp .-316 ; 0x2ca34 0002cb70 : //! @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) { 2cb70: bf 92 push r11 2cb72: cf 92 push r12 2cb74: df 92 push r13 2cb76: ef 92 push r14 2cb78: ff 92 push r15 2cb7a: 0f 93 push r16 2cb7c: 1f 93 push r17 2cb7e: cf 93 push r28 2cb80: df 93 push r29 2cb82: ec 01 movw r28, r24 2cb84: d6 2e mov r13, r22 2cb86: 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); 2cb88: 8c e0 ldi r24, 0x0C ; 12 2cb8a: 9f e4 ldi r25, 0x4F ; 79 2cb8c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cb90: 8c 01 movw r16, r24 2cb92: 8d ec ldi r24, 0xCD ; 205 2cb94: 96 e5 ldi r25, 0x56 ; 86 2cb96: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cb9a: 2a e0 ldi r18, 0x0A ; 10 2cb9c: c2 2e mov r12, r18 2cb9e: f1 2c mov r15, r1 2cba0: e1 2c mov r14, r1 2cba2: 9c 01 movw r18, r24 2cba4: 4b 2d mov r20, r11 2cba6: 6d 2d mov r22, r13 2cba8: ce 01 movw r24, r28 2cbaa: 0f 94 e5 64 call 0x2c9ca ; 0x2c9ca } 2cbae: df 91 pop r29 2cbb0: cf 91 pop r28 2cbb2: 1f 91 pop r17 2cbb4: 0f 91 pop r16 2cbb6: ff 90 pop r15 2cbb8: ef 90 pop r14 2cbba: df 90 pop r13 2cbbc: cf 90 pop r12 2cbbe: bf 90 pop r11 2cbc0: 08 95 ret 0002cbc2 : //! @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) { 2cbc2: bf 92 push r11 2cbc4: cf 92 push r12 2cbc6: df 92 push r13 2cbc8: ef 92 push r14 2cbca: ff 92 push r15 2cbcc: 0f 93 push r16 2cbce: 1f 93 push r17 2cbd0: cf 93 push r28 2cbd2: df 93 push r29 2cbd4: ec 01 movw r28, r24 2cbd6: d6 2e mov r13, r22 2cbd8: 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); 2cbda: 88 e7 ldi r24, 0x78 ; 120 2cbdc: 9d e3 ldi r25, 0x3D ; 61 2cbde: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cbe2: 8c 01 movw r16, r24 2cbe4: 82 e7 ldi r24, 0x72 ; 114 2cbe6: 9d e3 ldi r25, 0x3D ; 61 2cbe8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cbec: 2a e0 ldi r18, 0x0A ; 10 2cbee: c2 2e mov r12, r18 2cbf0: f1 2c mov r15, r1 2cbf2: e1 2c mov r14, r1 2cbf4: 9c 01 movw r18, r24 2cbf6: 4b 2d mov r20, r11 2cbf8: 6d 2d mov r22, r13 2cbfa: ce 01 movw r24, r28 2cbfc: 0f 94 e5 64 call 0x2c9ca ; 0x2c9ca } 2cc00: df 91 pop r29 2cc02: cf 91 pop r28 2cc04: 1f 91 pop r17 2cc06: 0f 91 pop r16 2cc08: ff 90 pop r15 2cc0a: ef 90 pop r14 2cc0c: df 90 pop r13 2cc0e: cf 90 pop r12 2cc10: bf 90 pop r11 2cc12: 08 95 ret 0002cc14 : //! ---------------------- | ---------------- //! 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) { 2cc14: af 92 push r10 2cc16: bf 92 push r11 2cc18: cf 92 push r12 2cc1a: df 92 push r13 2cc1c: ef 92 push r14 2cc1e: ff 92 push r15 2cc20: 0f 93 push r16 2cc22: 1f 93 push r17 2cc24: cf 93 push r28 2cc26: 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); 2cc28: 88 23 and r24, r24 2cc2a: 29 f0 breq .+10 ; 0x2cc36 2cc2c: 61 e0 ldi r22, 0x01 ; 1 2cc2e: 8f e5 ldi r24, 0x5F ; 95 2cc30: 9f e0 ldi r25, 0x0F ; 15 2cc32: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a FORCE_BL_ON_START; 2cc36: 81 e0 ldi r24, 0x01 ; 1 2cc38: 0e 94 7c 8b call 0x116f8 ; 0x116f8 while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2cc3c: 89 e6 ldi r24, 0x69 ; 105 2cc3e: e8 2e mov r14, r24 2cc40: 84 ea ldi r24, 0xA4 ; 164 2cc42: f8 2e mov r15, r24 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cc44: 97 ed ldi r25, 0xD7 ; 215 2cc46: c9 2e mov r12, r25 2cc48: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2cc4a: 2c e3 ldi r18, 0x3C ; 60 2cc4c: a2 2e mov r10, r18 2cc4e: b1 2c mov r11, r1 2cc50: 0c 2f mov r16, r28 2cc52: 10 e0 ldi r17, 0x00 ; 0 2cc54: 1f 92 push r1 2cc56: cf 93 push r28 2cc58: ff 92 push r15 2cc5a: ef 92 push r14 2cc5c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 switch (state) { 2cc60: 0f 90 pop r0 2cc62: 0f 90 pop r0 2cc64: 0f 90 pop r0 2cc66: 0f 90 pop r0 2cc68: cf 30 cpi r28, 0x0F ; 15 2cc6a: a0 f7 brcc .-24 ; 0x2cc54 2cc6c: f8 01 movw r30, r16 2cc6e: 88 27 eor r24, r24 2cc70: e3 5c subi r30, 0xC3 ; 195 2cc72: f9 49 sbci r31, 0x99 ; 153 2cc74: 8e 4f sbci r24, 0xFE ; 254 2cc76: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 2cc7a: 76 3a cpi r23, 0xA6 ; 166 2cc7c: aa 39 cpi r26, 0x9A ; 154 2cc7e: 84 39 cpi r24, 0x94 ; 148 2cc80: c8 39 cpi r28, 0x98 ; 152 2cc82: 04 3a cpi r16, 0xA4 ; 164 2cc84: 86 39 cpi r24, 0x96 ; 150 2cc86: 6e 3b cpi r22, 0xBE ; 190 2cc88: 72 3a cpi r23, 0xA2 ; 162 2cc8a: ea 39 cpi r30, 0x9A ; 154 2cc8c: 6e 3a cpi r22, 0xAE ; 174 2cc8e: 7a 39 cpi r23, 0x9A ; 154 2cc90: f4 39 cpi r31, 0x94 ; 148 2cc92: 60 3b cpi r22, 0xB0 ; 176 2cc94: 8e 3a cpi r24, 0xAE ; 174 2cc96: 8e 3a cpi r24, 0xAE ; 174 // which results in distorted print. // This primarily happens when the printer is new and parked in 0,0 // So any new printer will fail the first layer calibration unless being reset or the Stop function gets called. // We really must find a way to prevent the crash from happening before the printer is started - that would be the correct solution. // Btw. the flag may even trigger the viper situation on normal start this way and the user won't be able to find out why. saved_printing = false; 2cc98: 10 92 5a 0e sts 0x0E5A, r1 ; 0x800e5a if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 2cc9c: 8f e5 ldi r24, 0x5F ; 95 2cc9e: 9f e0 ldi r25, 0x0F ; 15 2cca0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2cca4: 82 30 cpi r24, 0x02 ; 2 2cca6: 39 f4 brne .+14 ; 0x2ccb6 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 2cca8: 84 ee ldi r24, 0xE4 ; 228 2ccaa: 95 e5 ldi r25, 0x55 ; 85 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2ccac: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ccb0: 0f 94 0c 36 call 0x26c18 ; 0x26c18 2ccb4: 0f c0 rjmp .+30 ; 0x2ccd4 // 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); 2ccb6: 8f e7 ldi r24, 0x7F ; 127 2ccb8: 95 e5 ldi r25, 0x55 ; 85 2ccba: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ccbe: 40 e0 ldi r20, 0x00 ; 0 2ccc0: 60 e0 ldi r22, 0x00 ; 0 2ccc2: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2ccc6: 81 11 cpse r24, r1 2ccc8: 07 c0 rjmp .+14 ; 0x2ccd8 2ccca: 61 e0 ldi r22, 0x01 ; 1 2cccc: 8f e5 ldi r24, 0x5F ; 95 2ccce: 9f e0 ldi r25, 0x0F ; 15 2ccd0: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 2ccd4: c1 e0 ldi r28, 0x01 ; 1 2ccd6: bc cf rjmp .-136 ; 0x2cc50 2ccd8: 60 e0 ldi r22, 0x00 ; 0 2ccda: 8f e5 ldi r24, 0x5F ; 95 2ccdc: 9f e0 ldi r25, 0x0F ; 15 2ccde: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 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); 2cce2: 10 e0 ldi r17, 0x00 ; 0 2cce4: 00 e0 ldi r16, 0x00 ; 0 end = true; break; } } FORCE_BL_ON_END; 2cce6: 80 e0 ldi r24, 0x00 ; 0 2cce8: 0e 94 7c 8b call 0x116f8 ; 0x116f8 const char *msg = NULL; printf_P(_N("Wizard end state: %d\n"), (uint8_t)state); 2ccec: 1f 93 push r17 2ccee: 0f 93 push r16 2ccf0: 8b e2 ldi r24, 0x2B ; 43 2ccf2: 90 e7 ldi r25, 0x70 ; 112 2ccf4: 9f 93 push r25 2ccf6: 8f 93 push r24 2ccf8: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 switch (state) { 2ccfc: 0f 90 pop r0 2ccfe: 0f 90 pop r0 2cd00: 0f 90 pop r0 2cd02: 0f 90 pop r0 2cd04: cd 30 cpi r28, 0x0D ; 13 2cd06: 09 f4 brne .+2 ; 0x2cd0a 2cd08: ff c0 rjmp .+510 ; 0x2cf08 2cd0a: ce 30 cpi r28, 0x0E ; 14 2cd0c: 09 f4 brne .+2 ; 0x2cd10 2cd0e: 11 c1 rjmp .+546 ; 0x2cf32 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 2cd10: 8e e9 ldi r24, 0x9E ; 158 2cd12: 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) { 2cd14: cc 23 and r28, r28 2cd16: 09 f4 brne .+2 ; 0x2cd1a 2cd18: 0e c1 rjmp .+540 ; 0x2cf36 break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 2cd1a: 81 e0 ldi r24, 0x01 ; 1 2cd1c: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_update(2); 2cd20: 82 e0 ldi r24, 0x02 ; 2 } 2cd22: cf 91 pop r28 2cd24: 1f 91 pop r17 2cd26: 0f 91 pop r16 2cd28: ff 90 pop r15 2cd2a: ef 90 pop r14 2cd2c: df 90 pop r13 2cd2e: cf 90 pop r12 2cd30: bf 90 pop r11 2cd32: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 2cd34: 0c 94 5c 6f jmp 0xdeb8 ; 0xdeb8 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2cd38: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> case S::Restore: // clear any previous error for make _new_ errors visible lcd_reset_alert_level(); // determine the next step in the required order if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 2cd3c: 81 e0 ldi r24, 0x01 ; 1 2cd3e: 0e 94 4b f9 call 0x1f296 ; 0x1f296 state = S::Selftest; 2cd42: 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)) { 2cd44: 88 23 and r24, r24 2cd46: 09 f4 brne .+2 ; 0x2cd4a 2cd48: 83 cf rjmp .-250 ; 0x2cc50 state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 2cd4a: 82 e0 ldi r24, 0x02 ; 2 2cd4c: 0e 94 4b f9 call 0x1f296 ; 0x1f296 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 2cd50: 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)) { 2cd52: 88 23 and r24, r24 2cd54: 09 f4 brne .+2 ; 0x2cd58 2cd56: 7c cf rjmp .-264 ; 0x2cc50 // 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)) { 2cd58: 84 e0 ldi r24, 0x04 ; 4 2cd5a: 0e 94 4b f9 call 0x1f296 ; 0x1f296 state = S::Z; 2cd5e: 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)) { 2cd60: 88 23 and r24, r24 2cd62: 09 f4 brne .+2 ; 0x2cd66 2cd64: 75 cf rjmp .-278 ; 0x2cc50 state = S::Z; #ifdef THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_THERMAL_MODEL)) { 2cd66: 88 e0 ldi r24, 0x08 ; 8 2cd68: 0e 94 4b f9 call 0x1f296 ; 0x1f296 state = S::ThermalModel; 2cd6c: 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)) { 2cd6e: 88 23 and r24, r24 2cd70: 09 f4 brne .+2 ; 0x2cd74 2cd72: 6e cf rjmp .-292 ; 0x2cc50 state = S::ThermalModel; #endif //THERMAL_MODEL } else if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) { 2cd74: 80 e1 ldi r24, 0x10 ; 16 2cd76: 0e 94 4b f9 call 0x1f296 ; 0x1f296 state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 2cd7a: 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)) { 2cd7c: 81 11 cpse r24, r1 2cd7e: 68 cf rjmp .-304 ; 0x2cc50 state = S::IsFil; 2cd80: c6 e0 ldi r28, 0x06 ; 6 2cd82: 66 cf rjmp .-308 ; 0x2cc50 // all required steps completed, finish successfully state = S::Finish; } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 2cd84: 86 e3 ldi r24, 0x36 ; 54 2cd86: 95 e5 ldi r25, 0x55 ; 85 2cd88: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cd8c: 0f 94 0c 36 call 0x26c18 ; 0x26c18 wizard_event = lcd_selftest(); 2cd90: 0f 94 7c 1a call 0x234f8 ; 0x234f8 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); 2cd94: 81 11 cpse r24, r1 2cd96: 9e cf rjmp .-196 ; 0x2ccd4 } 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); 2cd98: ce e0 ldi r28, 0x0E ; 14 2cd9a: 5a cf rjmp .-332 ; 0x2cc50 break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 2cd9c: 88 ef ldi r24, 0xF8 ; 248 2cd9e: 94 e5 ldi r25, 0x54 ; 84 2cda0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cda4: 0f 94 0c 36 call 0x26c18 ; 0x26c18 wizard_event = gcode_M45(false, 0); 2cda8: 80 e0 ldi r24, 0x00 ; 0 2cdaa: 0e 94 73 e7 call 0x1cee6 ; 0x1cee6 2cdae: f2 cf rjmp .-28 ; 0x2cd94 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 2cdb0: 80 ed ldi r24, 0xD0 ; 208 2cdb2: 94 e5 ldi r25, 0x54 ; 84 2cdb4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cdb8: 0f 94 0c 36 call 0x26c18 ; 0x26c18 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 2cdbc: 82 ea ldi r24, 0xA2 ; 162 2cdbe: 94 e5 ldi r25, 0x54 ; 84 2cdc0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cdc4: 0f 94 0c 36 call 0x26c18 ; 0x26c18 lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 2cdc8: 82 e8 ldi r24, 0x82 ; 130 2cdca: 94 e5 ldi r25, 0x54 ; 84 2cdcc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cdd0: 0f 94 0c 36 call 0x26c18 ; 0x26c18 wizard_event = gcode_M45(true, 0); 2cdd4: 81 e0 ldi r24, 0x01 ; 1 2cdd6: 0e 94 73 e7 call 0x1cee6 ; 0x1cee6 if (!wizard_event) { 2cdda: 88 23 and r24, r24 2cddc: e9 f2 breq .-70 ; 0x2cd98 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 2cdde: 60 e0 ldi r22, 0x00 ; 0 2cde0: 70 e0 ldi r23, 0x00 ; 0 2cde2: 88 ed ldi r24, 0xD8 ; 216 2cde4: 91 e4 ldi r25, 0x41 ; 65 2cde6: 0e 94 15 6f call 0xde2a ; 0xde2a if(!MMU2::mmu2.Enabled()) { 2cdea: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2cdee: 81 30 cpi r24, 0x01 ; 1 2cdf0: 09 f4 brne .+2 ; 0x2cdf4 2cdf2: 70 cf rjmp .-288 ; 0x2ccd4 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2cdf4: d0 92 6e 0e sts 0x0E6E, r13 ; 0x800e6e 2cdf8: c0 92 6d 0e sts 0x0E6D, r12 ; 0x800e6d //current filament needs to be unloaded and then new filament should be loaded //start to preheat nozzle for unloading remaining PLA filament setTargetHotend(PLA_PREHEAT_HOTEND_TEMP); lcd_display_message_fullscreen_P(_T(MSG_WIZARD_WILL_PREHEAT)); 2cdfc: 8d e5 ldi r24, 0x5D ; 93 2cdfe: 94 e5 ldi r25, 0x54 ; 84 2ce00: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ce04: 0f 94 85 35 call 0x26b0a ; 0x26b0a wait_preheat(); 2ce08: 0f 94 92 35 call 0x26b24 ; 0x26b24 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 2ce0c: 60 e0 ldi r22, 0x00 ; 0 2ce0e: 70 e0 ldi r23, 0x00 ; 0 2ce10: cb 01 movw r24, r22 2ce12: 0f 94 d7 16 call 0x22dae ; 0x22dae lcd_wizard_load(); // load filament 2ce16: 0f 94 75 36 call 0x26cea ; 0x26cea 2ce1a: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 2ce1e: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d 2ce22: 58 cf rjmp .-336 ; 0x2ccd4 state = S::Restore; } break; #ifdef THERMAL_MODEL case S::ThermalModel: lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_CAL)); 2ce24: 8d e1 ldi r24, 0x1D ; 29 2ce26: 94 e5 ldi r25, 0x54 ; 84 2ce28: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ce2c: 0f 94 0c 36 call 0x26c18 ; 0x26c18 lcd_commands_type = LcdCommands::ThermalModel; 2ce30: 85 e0 ldi r24, 0x05 ; 5 2ce32: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2ce36: 05 e0 ldi r16, 0x05 ; 5 2ce38: 10 e0 ldi r17, 0x00 ; 0 2ce3a: 55 cf rjmp .-342 ; 0x2cce6 2ce3c: d0 92 6e 0e sts 0x0E6E, r13 ; 0x800e6e 2ce40: c0 92 6d 0e sts 0x0E6D, r12 ; 0x800e6d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2ce44: b0 92 6c 0e sts 0x0E6C, r11 ; 0x800e6c 2ce48: a0 92 6b 0e sts 0x0E6B, r10 ; 0x800e6b #endif //THERMAL_MODEL case S::IsFil: //start to preheat nozzle and bed to save some time later setTargetHotend(PLA_PREHEAT_HOTEND_TEMP); setTargetBed(PLA_PREHEAT_HPB_TEMP); wizard_event = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILAMENT_LOADED), false, LCD_MIDDLE_BUTTON_CHOICE); 2ce4c: 87 e0 ldi r24, 0x07 ; 7 2ce4e: 94 e5 ldi r25, 0x54 ; 84 2ce50: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ce54: 41 e0 ldi r20, 0x01 ; 1 2ce56: 60 e0 ldi r22, 0x00 ; 0 2ce58: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 2ce5c: 88 23 and r24, r24 2ce5e: 09 f1 breq .+66 ; 0x2cea2 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 2ce60: 80 91 98 13 lds r24, 0x1398 ; 0x801398 else state = S::Preheat; 2ce64: 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; 2ce66: 81 30 cpi r24, 0x01 ; 1 2ce68: 09 f0 breq .+2 ; 0x2ce6c 2ce6a: f2 ce rjmp .-540 ; 0x2cc50 2ce6c: c8 e0 ldi r28, 0x08 ; 8 2ce6e: f0 ce rjmp .-544 ; 0x2cc50 else state = S::Preheat; } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 2ce70: 20 e0 ldi r18, 0x00 ; 0 2ce72: 41 e0 ldi r20, 0x01 ; 1 2ce74: 70 e0 ldi r23, 0x00 ; 0 2ce76: 60 e0 ldi r22, 0x00 ; 0 2ce78: 8c e0 ldi r24, 0x0C ; 12 2ce7a: 9a e3 ldi r25, 0x3A ; 58 2ce7c: 0f 94 3a cf call 0x39e74 ; 0x39e74 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 2ce80: 86 ec ldi r24, 0xC6 ; 198 2ce82: 93 e5 ldi r25, 0x53 ; 83 2ce84: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2ce88: 0f 94 0c 36 call 0x26c18 ; 0x26c18 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); 2ce8c: 07 e0 ldi r16, 0x07 ; 7 2ce8e: 10 e0 ldi r17, 0x00 ; 0 2ce90: 2a cf rjmp .-428 ; 0x2cce6 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(); 2ce92: 0f 94 92 35 call 0x26b24 ; 0x26b24 lcd_wizard_load(); 2ce96: 0f 94 75 36 call 0x26cea ; 0x26cea state = S::Lay1CalHot; 2ce9a: cb e0 ldi r28, 0x0B ; 11 2ce9c: d9 ce rjmp .-590 ; 0x2cc50 break; case S::LoadFilCold: lcd_wizard_load(); 2ce9e: 0f 94 75 36 call 0x26cea ; 0x26cea 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; 2cea2: ca e0 ldi r28, 0x0A ; 10 2cea4: d5 ce rjmp .-598 ; 0x2cc50 case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 2cea6: 81 e0 ldi r24, 0x01 ; 1 2cea8: 0f 94 57 36 call 0x26cae ; 0x26cae menu_goto(lcd_v2_calibration, 0, true); 2ceac: 20 e0 ldi r18, 0x00 ; 0 2ceae: 41 e0 ldi r20, 0x01 ; 1 2ceb0: 70 e0 ldi r23, 0x00 ; 0 2ceb2: 60 e0 ldi r22, 0x00 ; 0 2ceb4: 8c e9 ldi r24, 0x9C ; 156 2ceb6: 99 e3 ldi r25, 0x39 ; 57 2ceb8: 0f 94 3a cf call 0x39e74 ; 0x39e74 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); 2cebc: 0a e0 ldi r16, 0x0A ; 10 2cebe: 10 e0 ldi r17, 0x00 ; 0 2cec0: 12 cf rjmp .-476 ; 0x2cce6 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); 2cec2: 80 e0 ldi r24, 0x00 ; 0 2cec4: 0f 94 57 36 call 0x26cae ; 0x26cae lcd_commands_type = LcdCommands::Layer1Cal; 2cec8: 84 e0 ldi r24, 0x04 ; 4 2ceca: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 if (state != S::Run) eeprom_update_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 2cece: 0b e0 ldi r16, 0x0B ; 11 2ced0: 10 e0 ldi r17, 0x00 ; 0 2ced2: 09 cf rjmp .-494 ; 0x2cce6 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); 2ced4: 83 e7 ldi r24, 0x73 ; 115 2ced6: 93 e5 ldi r25, 0x53 ; 83 2ced8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cedc: 41 e0 ldi r20, 0x01 ; 1 2cede: 60 e0 ldi r22, 0x00 ; 0 2cee0: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 2cee4: 81 11 cpse r24, r1 2cee6: 07 c0 rjmp .+14 ; 0x2cef6 { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 2cee8: 83 e4 ldi r24, 0x43 ; 67 2ceea: 93 e5 ldi r25, 0x53 ; 83 2ceec: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cef0: 0f 94 0c 36 call 0x26c18 ; 0x26c18 2cef4: d6 cf rjmp .-84 ; 0x2cea2 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 2cef6: 8d ed ldi r24, 0xDD ; 221 2cef8: 92 e5 ldi r25, 0x52 ; 82 2cefa: d8 ce rjmp .-592 ; 0x2ccac 2cefc: 60 e0 ldi r22, 0x00 ; 0 2cefe: 8f e5 ldi r24, 0x5F ; 95 2cf00: 9f e0 ldi r25, 0x0F ; 15 2cf02: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 2cf06: ef ce rjmp .-546 ; 0x2cce6 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 2cf08: 8f e7 ldi r24, 0x7F ; 127 2cf0a: 92 e5 ldi r25, 0x52 ; 82 2cf0c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cf10: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 2cf12: 10 92 d1 03 sts 0x03D1, r1 ; 0x8003d1 <_ZL24lcd_status_message_level.lto_priv.455> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 2cf16: 8a e6 ldi r24, 0x6A ; 106 2cf18: 90 e7 ldi r25, 0x70 ; 112 2cf1a: 0f 94 ea 0b call 0x217d4 ; 0x217d4 lcd_return_to_status(); 2cf1e: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 default: // exiting for later re-entry break; } if (msg) { 2cf22: 01 15 cp r16, r1 2cf24: 11 05 cpc r17, r1 2cf26: 09 f4 brne .+2 ; 0x2cf2a 2cf28: f8 ce rjmp .-528 ; 0x2cd1a lcd_show_fullscreen_message_and_wait_P(msg); 2cf2a: c8 01 movw r24, r16 2cf2c: 0f 94 0c 36 call 0x26c18 ; 0x26c18 2cf30: f4 ce rjmp .-536 ; 0x2cd1a lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 2cf32: 8d e1 ldi r24, 0x1D ; 29 2cf34: 92 e5 ldi r25, 0x52 ; 82 2cf36: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cf3a: 8c 01 movw r16, r24 2cf3c: f2 cf rjmp .-28 ; 0x2cf22 0002cf3e : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 2cf3e: 8f e1 ldi r24, 0x1F ; 31 2cf40: 0e 94 4b f9 call 0x1f296 ; 0x1f296 2cf44: 81 11 cpse r24, r1 2cf46: 06 c0 rjmp .+12 ; 0x2cf54 // 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); 2cf48: 8f e1 ldi r24, 0x1F ; 31 2cf4a: 0e 94 11 e7 call 0x1ce22 ; 0x1ce22 lcd_wizard(WizState::Run); 2cf4e: 80 e0 ldi r24, 0x00 ; 0 2cf50: 0d 94 0a 66 jmp 0x2cc14 ; 0x2cc14 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); 2cf54: 85 e1 ldi r24, 0x15 ; 21 2cf56: 9f e4 ldi r25, 0x4F ; 79 2cf58: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cf5c: 41 e0 ldi r20, 0x01 ; 1 2cf5e: 60 e0 ldi r22, 0x00 ; 0 2cf60: 0f 94 b8 65 call 0x2cb70 ; 0x2cb70 } if (result) { 2cf64: 88 23 and r24, r24 2cf66: 81 f3 breq .-32 ; 0x2cf48 calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 2cf68: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 lcd_update_enable(true); 2cf6c: 81 e0 ldi r24, 0x01 ; 1 2cf6e: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_update(2); 2cf72: 82 e0 ldi r24, 0x02 ; 2 2cf74: 0c 94 5c 6f jmp 0xdeb8 ; 0xdeb8 0002cf78 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 2cf78: cf 93 push r28 2cf7a: 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); 2cf7c: 80 e0 ldi r24, 0x00 ; 0 2cf7e: 92 e5 ldi r25, 0x52 ; 82 2cf80: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cf84: 41 e0 ldi r20, 0x01 ; 1 2cf86: 4c 27 eor r20, r28 2cf88: 60 e0 ldi r22, 0x00 ; 0 2cf8a: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 2cf8e: 91 e0 ldi r25, 0x01 ; 1 2cf90: 81 11 cpse r24, r1 2cf92: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 2cf94: c9 17 cp r28, r25 2cf96: 59 f0 breq .+22 ; 0x2cfae lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 2cf98: 86 ed ldi r24, 0xD6 ; 214 2cf9a: 91 e5 ldi r25, 0x51 ; 81 2cf9c: cc 23 and r28, r28 2cf9e: 11 f0 breq .+4 ; 0x2cfa4 2cfa0: 85 e6 ldi r24, 0x65 ; 101 2cfa2: 97 e4 ldi r25, 0x47 ; 71 2cfa4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 } #endif //STEEL_SHEET } 2cfa8: 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)); 2cfaa: 0d 94 0c 36 jmp 0x26c18 ; 0x26c18 } #endif //STEEL_SHEET } 2cfae: cf 91 pop r28 2cfb0: 08 95 ret 0002cfb2 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 2cfb2: cf 93 push r28 2cfb4: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 2cfb6: 8d ea ldi r24, 0xAD ; 173 2cfb8: 91 e5 ldi r25, 0x51 ; 81 2cfba: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cfbe: 40 e0 ldi r20, 0x00 ; 0 2cfc0: 6c 2f mov r22, r28 2cfc2: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 if (result == LCD_LEFT_BUTTON_CHOICE) { 2cfc6: 81 11 cpse r24, r1 2cfc8: 03 c0 rjmp .+6 ; 0x2cfd0 lcd_mesh_calibration_z(); } } 2cfca: 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(); 2cfcc: 0d 94 95 27 jmp 0x24f2a ; 0x24f2a } } 2cfd0: cf 91 pop r28 2cfd2: 08 95 ret 0002cfd4 : } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { 2cfd4: cf 93 push r28 2cfd6: c8 2f mov r28, r24 if (!lang_select(lang)) 2cfd8: 0e 94 e9 72 call 0xe5d2 ; 0xe5d2 2cfdc: 81 11 cpse r24, r1 2cfde: 37 c0 rjmp .+110 ; 0x2d04e { if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_COPY_SEL_LANG), false, LCD_LEFT_BUTTON_CHOICE) == LCD_LEFT_BUTTON_CHOICE) 2cfe0: 80 e9 ldi r24, 0x90 ; 144 2cfe2: 9e e4 ldi r25, 0x4E ; 78 2cfe4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2cfe8: 40 e0 ldi r20, 0x00 ; 0 2cfea: 60 e0 ldi r22, 0x00 ; 0 2cfec: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 2cff0: 81 11 cpse r24, r1 2cff2: 20 c0 rjmp .+64 ; 0x2d034 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 2cff4: 0e 94 9e 72 call 0xe53c ; 0xe53c if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 2cff8: c2 30 cpi r28, 0x02 ; 2 2cffa: e0 f0 brcs .+56 ; 0x2d034 2cffc: 8c 17 cp r24, r28 2cffe: d0 f0 brcs .+52 ; 0x2d034 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 2d000: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 2d002: 8a ea ldi r24, 0xAA ; 170 2d004: 95 e5 ldi r25, 0x55 ; 85 2d006: dc 01 movw r26, r24 2d008: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x7e3> 2d00c: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x7e4> 2d010: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x7e5> 2d014: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x7e6> boot_app_flags = BOOT_APP_FLG_USER0; 2d018: 80 e8 ldi r24, 0x80 ; 128 2d01a: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x7e2> boot_copy_size = 0; 2d01e: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x7e0> 2d022: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x7df> bootapp_reboot_user0(lang << 3); 2d026: cc 0f add r28, r28 2d028: cc 0f add r28, r28 2d02a: cc 0f add r28, r28 boot_reserved = reserved; 2d02c: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x7e1> // bootapp_print_vars(); softReset(); 2d030: 0e 94 01 68 call 0xd002 ; 0xd002 lang_boot_update_start(lang); lcd_update_enable(true); 2d034: 81 e0 ldi r24, 0x01 ; 1 2d036: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 menu_goto(lcd_language_menu, 0, true, true); 2d03a: 21 e0 ldi r18, 0x01 ; 1 2d03c: 41 e0 ldi r20, 0x01 ; 1 2d03e: 70 e0 ldi r23, 0x00 ; 0 2d040: 60 e0 ldi r22, 0x00 ; 0 2d042: 88 e2 ldi r24, 0x28 ; 40 2d044: 9b e3 ldi r25, 0x3B ; 59 2d046: 0f 94 3a cf call 0x39e74 ; 0x39e74 2d04a: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); //infinite timeout } } 2d04e: cf 91 pop r28 2d050: 08 95 ret 0002d052 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 2d052: cf 93 push r28 MENU_BEGIN(); 2d054: 0f 94 10 cf call 0x39e20 ; 0x39e20 2d058: 10 92 15 05 sts 0x0515, r1 ; 0x800515 2d05c: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2d060: 84 30 cpi r24, 0x04 ; 4 2d062: 08 f0 brcs .+2 ; 0x2d066 2d064: 4a c0 rjmp .+148 ; 0x2d0fa 2d066: 10 92 18 05 sts 0x0518, r1 ; 0x800518 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 2d06a: 0e 94 d2 71 call 0xe3a4 ; 0xe3a4 2d06e: 88 23 and r24, r24 2d070: 31 f0 breq .+12 ; 0x2d07e 2d072: 87 e6 ldi r24, 0x67 ; 103 2d074: 9d e3 ldi r25, 0x3D ; 61 2d076: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d07a: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 2d07e: 8e e6 ldi r24, 0x6E ; 110 2d080: 95 e6 ldi r25, 0x65 ; 101 2d082: 0e 94 e8 71 call 0xe3d0 ; 0xe3d0 2d086: 0f 94 be ce call 0x39d7c ; 0x39d7c 2d08a: 88 23 and r24, r24 2d08c: 21 f0 breq .+8 ; 0x2d096 { menu_setlang(0); 2d08e: 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(); } 2d090: 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); 2d092: 0d 94 ea 67 jmp 0x2cfd4 ; 0x2cfd4 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(); 2d096: 0e 94 9e 72 call 0xe53c ; 0xe53c 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 2d09a: 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 2d09c: 82 30 cpi r24, 0x02 ; 2 2d09e: 51 f4 brne .+20 ; 0x2d0b4 2d0a0: 0e 94 bf 71 call 0xe37e ; 0xe37e { if (menu_item_text_P(lang_get_name_by_code(lang_get_code(1)))) 2d0a4: 0e 94 e8 71 call 0xe3d0 ; 0xe3d0 2d0a8: 0f 94 be ce call 0x39d7c ; 0x39d7c 2d0ac: 88 23 and r24, r24 2d0ae: 81 f0 breq .+32 ; 0x2d0d0 { menu_setlang(1); 2d0b0: 81 e0 ldi r24, 0x01 ; 1 2d0b2: ee cf rjmp .-36 ; 0x2d090 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)))) 2d0b4: 8c 2f mov r24, r28 2d0b6: 0e 94 4f 72 call 0xe49e ; 0xe49e 2d0ba: 0e 94 e8 71 call 0xe3d0 ; 0xe3d0 2d0be: 0f 94 be ce call 0x39d7c ; 0x39d7c 2d0c2: 88 23 and r24, r24 2d0c4: 11 f0 breq .+4 ; 0x2d0ca { menu_setlang(i); 2d0c6: 8c 2f mov r24, r28 2d0c8: e3 cf rjmp .-58 ; 0x2d090 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 2d0ca: cf 5f subi r28, 0xFF ; 255 2d0cc: c8 30 cpi r28, 0x08 ; 8 2d0ce: 91 f7 brne .-28 ; 0x2d0b4 return; } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); 2d0d0: 8a ea ldi r24, 0xAA ; 170 2d0d2: 9e e4 ldi r25, 0x4E ; 78 2d0d4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d0d8: 6e ee ldi r22, 0xEE ; 238 2d0da: 7a e3 ldi r23, 0x3A ; 58 2d0dc: 0f 94 8e d1 call 0x3a31c ; 0x3a31c #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 2d0e0: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 2d0e4: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2d0e8: 8f 5f subi r24, 0xFF ; 255 2d0ea: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2d0ee: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2d0f2: 8f 5f subi r24, 0xFF ; 255 2d0f4: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2d0f8: b1 cf rjmp .-158 ; 0x2d05c MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 2d0fa: cf 91 pop r28 2d0fc: 08 95 ret 0002d0fe : } #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { 2d0fe: cf 93 push r28 2d100: df 93 push r29 MENU_BEGIN(); 2d102: 0f 94 10 cf call 0x39e20 ; 0x39e20 2d106: 10 92 15 05 sts 0x0515, r1 ; 0x800515 2d10a: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2d10e: 84 30 cpi r24, 0x04 ; 4 2d110: 58 f5 brcc .+86 ; 0x2d168 2d112: 10 92 18 05 sts 0x0518, r1 ; 0x800518 uint8_t cnt = lang_get_count(); 2d116: 0e 94 9e 72 call 0xe53c ; 0xe53c 2d11a: d8 2f mov r29, r24 MENU_ITEM_BACK_P(_T(MSG_SELECT_LANGUAGE)); //Back to previous Menu 2d11c: 8f e8 ldi r24, 0x8F ; 143 2d11e: 97 e5 ldi r25, 0x57 ; 87 2d120: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d124: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 for (uint8_t i = 8; i < cnt; i++) //all community languages 2d128: c8 e0 ldi r28, 0x08 ; 8 2d12a: cd 17 cp r28, r29 2d12c: 80 f4 brcc .+32 ; 0x2d14e if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 2d12e: 8c 2f mov r24, r28 2d130: 0e 94 4f 72 call 0xe49e ; 0xe49e 2d134: 0e 94 e8 71 call 0xe3d0 ; 0xe3d0 2d138: 0f 94 be ce call 0x39d7c ; 0x39d7c 2d13c: 88 23 and r24, r24 2d13e: 29 f0 breq .+10 ; 0x2d14a { menu_setlang(i); 2d140: 8c 2f mov r24, r28 return; } MENU_END(); } 2d142: df 91 pop r29 2d144: 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); 2d146: 0d 94 ea 67 jmp 0x2cfd4 ; 0x2cfd4 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 2d14a: cf 5f subi r28, 0xFF ; 255 2d14c: ee cf rjmp .-36 ; 0x2d12a if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) { menu_setlang(i); return; } MENU_END(); 2d14e: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 #ifdef COMMUNITY_LANGUAGE_SUPPORT #ifdef XFLASH static void lcd_community_language_menu() { MENU_BEGIN(); 2d152: 80 91 15 05 lds r24, 0x0515 ; 0x800515 2d156: 8f 5f subi r24, 0xFF ; 255 2d158: 80 93 15 05 sts 0x0515, r24 ; 0x800515 2d15c: 80 91 17 05 lds r24, 0x0517 ; 0x800517 2d160: 8f 5f subi r24, 0xFF ; 255 2d162: 80 93 17 05 sts 0x0517, r24 ; 0x800517 2d166: d1 cf rjmp .-94 ; 0x2d10a { menu_setlang(i); return; } MENU_END(); } 2d168: df 91 pop r29 2d16a: cf 91 pop r28 2d16c: 08 95 ret 0002d16e : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 2d16e: cf 92 push r12 2d170: ef 92 push r14 2d172: ff 92 push r15 2d174: 0f 93 push r16 2d176: 1f 93 push r17 2d178: cf 93 push r28 2d17a: 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); 2d17c: 82 e7 ldi r24, 0x72 ; 114 2d17e: 9d e3 ldi r25, 0x3D ; 61 2d180: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d184: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> 2d188: c8 2e mov r12, r24 2d18a: 8b ee ldi r24, 0xEB ; 235 2d18c: 9b e4 ldi r25, 0x4B ; 75 2d18e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d192: 7c 01 movw r14, r24 2d194: 88 e7 ldi r24, 0x78 ; 120 2d196: 9d e3 ldi r25, 0x3D ; 61 2d198: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d19c: 8c 01 movw r16, r24 2d19e: 82 e7 ldi r24, 0x72 ; 114 2d1a0: 9d e3 ldi r25, 0x3D ; 61 2d1a2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d1a6: ec 01 movw r28, r24 2d1a8: 80 ec ldi r24, 0xC0 ; 192 2d1aa: 9b e4 ldi r25, 0x4B ; 75 2d1ac: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d1b0: c3 94 inc r12 2d1b2: c3 94 inc r12 2d1b4: 9e 01 movw r18, r28 2d1b6: 40 e0 ldi r20, 0x00 ; 0 2d1b8: 60 e0 ldi r22, 0x00 ; 0 2d1ba: 0f 94 e5 64 call 0x2c9ca ; 0x2c9ca while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 2d1be: 81 30 cpi r24, 0x01 ; 1 2d1c0: 29 f4 brne .+10 ; 0x2d1cc load_filament_final_feed(); 2d1c2: 0e 94 48 65 call 0xca90 ; 0xca90 st_synchronize(); 2d1c6: 0f 94 2c 59 call 0x2b258 ; 0x2b258 2d1ca: d8 cf rjmp .-80 ; 0x2d17c 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) { 2d1cc: 82 30 cpi r24, 0x02 ; 2 2d1ce: 61 f4 brne .+24 ; 0x2d1e8 unload_filament(FILAMENTCHANGE_FINALRETRACT); 2d1d0: 60 e0 ldi r22, 0x00 ; 0 2d1d2: 70 e0 ldi r23, 0x00 ; 0 2d1d4: cb 01 movw r24, r22 } } 2d1d6: df 91 pop r29 2d1d8: cf 91 pop r28 2d1da: 1f 91 pop r17 2d1dc: 0f 91 pop r16 2d1de: ff 90 pop r15 2d1e0: ef 90 pop r14 2d1e2: 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); 2d1e4: 0d 94 d7 16 jmp 0x22dae ; 0x22dae } } 2d1e8: df 91 pop r29 2d1ea: cf 91 pop r28 2d1ec: 1f 91 pop r17 2d1ee: 0f 91 pop r16 2d1f0: ff 90 pop r15 2d1f2: ef 90 pop r14 2d1f4: cf 90 pop r12 2d1f6: 08 95 ret 0002d1f8 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 2d1f8: 0f 93 push r16 2d1fa: 1f 93 push r17 2d1fc: cf 93 push r28 2d1fe: df 93 push r29 2d200: 8c 01 movw r16, r24 2d202: 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; 2d204: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 2d208: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 2d20c: 0f 94 e3 22 call 0x245c6 ; 0x245c6 2d210: 81 11 cpse r24, r1 2d212: 04 c0 rjmp .+8 ; 0x2d21c resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d214: d0 93 6c 0e sts 0x0E6C, r29 ; 0x800e6c 2d218: c0 93 6b 0e sts 0x0E6B, r28 ; 0x800e6b { const FilamentAction action = eFilamentAction; 2d21c: c0 91 a7 03 lds r28, 0x03A7 ; 0x8003a7 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 2d220: 87 ef ldi r24, 0xF7 ; 247 2d222: 8c 0f add r24, r28 2d224: 82 30 cpi r24, 0x02 ; 2 2d226: f8 f4 brcc .+62 ; 0x2d266 { lcd_return_to_status(); 2d228: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 if (action == FilamentAction::Lay1Cal) 2d22c: ca 30 cpi r28, 0x0A ; 10 2d22e: 41 f4 brne .+16 ; 0x2d240 { lcd_commands_type = LcdCommands::Layer1Cal; 2d230: 84 e0 ldi r24, 0x04 ; 4 2d232: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 } menu_back(); clearFilamentAction(); } } } 2d236: df 91 pop r29 2d238: cf 91 pop r28 2d23a: 1f 91 pop r17 2d23c: 0f 91 pop r16 2d23e: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2d240: 60 e0 ldi r22, 0x00 ; 0 2d242: 70 e0 ldi r23, 0x00 ; 0 2d244: 80 e2 ldi r24, 0x20 ; 32 2d246: 91 e4 ldi r25, 0x41 ; 65 2d248: 0e 94 15 6f call 0xde2a ; 0xde2a if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2d24c: 8f e5 ldi r24, 0x5F ; 95 2d24e: 9f e0 ldi r25, 0x0F ; 15 2d250: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2d254: 88 23 and r24, r24 2d256: 79 f3 breq .-34 ; 0x2d236 lcd_wizard(WizState::LoadFilHot); 2d258: 89 e0 ldi r24, 0x09 ; 9 } menu_back(); clearFilamentAction(); } } } 2d25a: df 91 pop r29 2d25c: cf 91 pop r28 2d25e: 1f 91 pop r17 2d260: 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); 2d262: 0d 94 0a 66 jmp 0x2cc14 ; 0x2cc14 2d266: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 lcd_timeoutToStatus.stop(); // the current temperature is within +-TEMP_HYSTERESIS of the target // then continue with the filament action if any is set if (bFilamentSkipPreheat || abs((int)current_temperature[0] - (int)nTemp) < TEMP_HYSTERESIS) 2d26a: 80 91 61 06 lds r24, 0x0661 ; 0x800661 2d26e: 81 11 cpse r24, r1 2d270: 12 c0 rjmp .+36 ; 0x2d296 2d272: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 2d276: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 2d27a: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 2d27e: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 2d282: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 2d286: 60 1b sub r22, r16 2d288: 71 0b sbc r23, r17 2d28a: 6c 5f subi r22, 0xFC ; 252 2d28c: 7f 4f sbci r23, 0xFF ; 255 2d28e: 69 30 cpi r22, 0x09 ; 9 2d290: 71 05 cpc r23, r1 2d292: 08 f0 brcs .+2 ; 0x2d296 2d294: 60 c0 rjmp .+192 ; 0x2d356 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 2d296: c1 50 subi r28, 0x01 ; 1 2d298: c8 30 cpi r28, 0x08 ; 8 2d29a: 88 f5 brcc .+98 ; 0x2d2fe 2d29c: ec 2f mov r30, r28 2d29e: f0 e0 ldi r31, 0x00 ; 0 2d2a0: 88 27 eor r24, r24 2d2a2: ea 5a subi r30, 0xAA ; 170 2d2a4: f6 49 sbci r31, 0x96 ; 150 2d2a6: 8e 4f sbci r24, 0xFE ; 254 2d2a8: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 2d2ac: 7c 39 cpi r23, 0x9C ; 156 2d2ae: 7c 39 cpi r23, 0x9C ; 156 2d2b0: 7c 39 cpi r23, 0x9C ; 156 2d2b2: 56 3a cpi r21, 0xA6 ; 166 2d2b4: 14 3b cpi r17, 0xB4 ; 180 2d2b6: 9c 3a cpi r25, 0xAC ; 172 2d2b8: b2 39 cpi r27, 0x92 ; 146 2d2ba: 00 3b cpi r16, 0xB0 ; 176 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 2d2bc: ca e8 ldi r28, 0x8A ; 138 2d2be: d9 ed ldi r29, 0xD9 ; 217 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2d2c0: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d2c4: 88 23 and r24, r24 2d2c6: 29 f0 breq .+10 ; 0x2d2d2 Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 2d2c8: 82 e0 ldi r24, 0x02 ; 2 2d2ca: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe bFilamentWaitingFlag = false; 2d2ce: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f } if (filamentActionMenu) { 2d2d2: 20 97 sbiw r28, 0x00 ; 0 2d2d4: 09 f4 brne .+2 ; 0x2d2d8 2d2d6: af cf rjmp .-162 ; 0x2d236 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 2d2d8: 0f 94 19 2f call 0x25e32 ; 0x25e32 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 2d2dc: 61 e0 ldi r22, 0x01 ; 1 2d2de: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2d2e0: df 91 pop r29 2d2e2: cf 91 pop r28 2d2e4: 1f 91 pop r17 2d2e6: 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); 2d2e8: 0d 94 7d d0 jmp 0x3a0fa ; 0x3a0fa switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 2d2ec: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d2f0: 88 23 and r24, r24 2d2f2: 41 f0 breq .+16 ; 0x2d304 2d2f4: 61 e0 ldi r22, 0x01 ; 1 2d2f6: 80 e2 ldi r24, 0x20 ; 32 2d2f8: 9b e3 ldi r25, 0x3B ; 59 2d2fa: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa // 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; 2d2fe: d0 e0 ldi r29, 0x00 ; 0 2d300: c0 e0 ldi r28, 0x00 ; 0 2d302: de cf rjmp .-68 ; 0x2d2c0 case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 2d304: 0f 94 19 2f call 0x25e32 ; 0x25e32 if (eFilamentAction == FilamentAction::AutoLoad) { 2d308: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2d30c: 82 30 cpi r24, 0x02 ; 2 2d30e: 19 f4 brne .+6 ; 0x2d316 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2d310: 81 e0 ldi r24, 0x01 ; 1 2d312: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 } if (eFilamentAction == FilamentAction::Load) 2d316: 80 91 a7 03 lds r24, 0x03A7 ; 0x8003a7 2d31a: 81 30 cpi r24, 0x01 ; 1 2d31c: 31 f4 brne .+12 ; 0x2d32a enquecommand_P(MSG_M701); // load filament 2d31e: 61 e0 ldi r22, 0x01 ; 1 2d320: 80 e8 ldi r24, 0x80 ; 128 2d322: 9f e6 ldi r25, 0x6F ; 111 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 2d324: 0e 94 4b 89 call 0x11296 ; 0x11296 2d328: ea cf rjmp .-44 ; 0x2d2fe eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 2d32a: 83 30 cpi r24, 0x03 ; 3 2d32c: 41 f7 brne .-48 ; 0x2d2fe enquecommand_P(MSG_M702); // unload filament 2d32e: 61 e0 ldi r22, 0x01 ; 1 2d330: 88 e1 ldi r24, 0x18 ; 24 2d332: 9c e6 ldi r25, 0x6C ; 108 2d334: f7 cf rjmp .-18 ; 0x2d324 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 2d336: c4 e0 ldi r28, 0x04 ; 4 2d338: d9 ed ldi r29, 0xD9 ; 217 2d33a: c2 cf rjmp .-124 ; 0x2d2c0 break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 2d33c: 0f 94 19 2f call 0x25e32 ; 0x25e32 MMU2::mmu2.unload(); 2d340: 0f 94 6d a0 call 0x340da ; 0x340da // 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(); 2d344: 0f 94 f4 36 call 0x26de8 ; 0x26de8 2d348: da cf rjmp .-76 ; 0x2d2fe break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 2d34a: c2 e8 ldi r28, 0x82 ; 130 2d34c: d9 ed ldi r29, 0xD9 ; 217 2d34e: b8 cf rjmp .-144 ; 0x2d2c0 break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2d350: ca e7 ldi r28, 0x7A ; 122 2d352: d9 ed ldi r29, 0xD9 ; 217 2d354: b5 cf rjmp .-150 ; 0x2d2c0 menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 2d356: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d35a: 88 23 and r24, r24 2d35c: 21 f0 breq .+8 ; 0x2d366 2d35e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 2d362: 88 23 and r24, r24 2d364: a1 f1 breq .+104 ; 0x2d3ce // 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; 2d366: 81 e0 ldi r24, 0x01 ; 1 2d368: 80 93 5f 06 sts 0x065F, r24 ; 0x80065f // also force-enable lcd_draw_update (might be 0 when called from outside a menu) lcd_draw_update = 1; 2d36c: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d lcd_clear(); 2d370: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0,3, PSTR(">")); 2d374: 44 e8 ldi r20, 0x84 ; 132 2d376: 52 ea ldi r21, 0xA2 ; 162 2d378: 63 e0 ldi r22, 0x03 ; 3 2d37a: 80 e0 ldi r24, 0x00 ; 0 2d37c: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_puts_at_P(1, 3, _T(MSG_CANCEL)); 2d380: 8c e0 ldi r24, 0x0C ; 12 2d382: 9f e4 ldi r25, 0x4F ; 79 2d384: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d388: ac 01 movw r20, r24 2d38a: 63 e0 ldi r22, 0x03 ; 3 2d38c: 81 e0 ldi r24, 0x01 ; 1 2d38e: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(0, 1); 2d392: 61 e0 ldi r22, 0x01 ; 1 2d394: 80 e0 ldi r24, 0x00 ; 0 2d396: 0e 94 95 6f call 0xdf2a ; 0xdf2a switch (eFilamentAction) 2d39a: e0 91 a7 03 lds r30, 0x03A7 ; 0x8003a7 2d39e: e1 50 subi r30, 0x01 ; 1 2d3a0: e8 30 cpi r30, 0x08 ; 8 2d3a2: a8 f4 brcc .+42 ; 0x2d3ce 2d3a4: f0 e0 ldi r31, 0x00 ; 0 2d3a6: 88 27 eor r24, r24 2d3a8: e7 52 subi r30, 0x27 ; 39 2d3aa: f6 49 sbci r31, 0x96 ; 150 2d3ac: 8e 4f sbci r24, 0xFE ; 254 2d3ae: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 2d3b2: b6 3a cpi r27, 0xA6 ; 166 2d3b4: b6 3a cpi r27, 0xA6 ; 166 2d3b6: e0 3a cpi r30, 0xA0 ; 160 2d3b8: b6 3a cpi r27, 0xA6 ; 166 2d3ba: e0 3a cpi r30, 0xA0 ; 160 2d3bc: e2 3a cpi r30, 0xA2 ; 162 2d3be: 5e 3a cpi r21, 0xAE ; 174 2d3c0: b6 3a cpi r27, 0xA6 ; 166 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 2d3c2: 80 ea ldi r24, 0xA0 ; 160 2d3c4: 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)); 2d3c6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2d3ca: 0e 94 80 6f call 0xdf00 ; 0xdf00 // handled earlier break; } } if (bFilamentWaitingFlag) { 2d3ce: 80 91 5f 06 lds r24, 0x065F ; 0x80065f 2d3d2: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 2d3d4: 0f 94 40 2f call 0x25e80 ; 0x25e80 } if (lcd_clicked()) 2d3d8: 0e 94 b2 71 call 0xe364 ; 0xe364 2d3dc: 88 23 and r24, r24 2d3de: 09 f4 brne .+2 ; 0x2d3e2 2d3e0: 2a cf rjmp .-428 ; 0x2d236 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 2d3e2: 10 92 5f 06 sts 0x065F, r1 ; 0x80065f if (!bFilamentPreheatState) 2d3e6: 80 91 60 06 lds r24, 0x0660 ; 0x800660 2d3ea: 81 11 cpse r24, r1 2d3ec: 0e c0 rjmp .+28 ; 0x2d40a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2d3ee: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 2d3f2: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 2d3f6: 0e 94 3a 68 call 0xd074 ; 0xd074 2d3fa: 81 11 cpse r24, r1 2d3fc: 04 c0 rjmp .+8 ; 0x2d406 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2d3fe: 10 92 6c 0e sts 0x0E6C, r1 ; 0x800e6c 2d402: 10 92 6b 0e sts 0x0E6B, r1 ; 0x800e6b menu_back(); 2d406: 0f 94 d8 d1 call 0x3a3b0 ; 0x3a3b0 } menu_back(); 2d40a: 0f 94 d8 d1 call 0x3a3b0 ; 0x3a3b0 clearFilamentAction(); } } } 2d40e: df 91 pop r29 2d410: cf 91 pop r28 2d412: 1f 91 pop r17 2d414: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 2d416: 0d 94 f4 36 jmp 0x26de8 ; 0x26de8 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)); 2d41a: 89 e8 ldi r24, 0x89 ; 137 2d41c: 9b e4 ldi r25, 0x4B ; 75 2d41e: d3 cf rjmp .-90 ; 0x2d3c6 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 2d420: 83 e7 ldi r24, 0x73 ; 115 2d422: 9b e4 ldi r25, 0x4B ; 75 2d424: d0 cf rjmp .-96 ; 0x2d3c6 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 2d426: 8f e5 ldi r24, 0x5F ; 95 2d428: 9b e4 ldi r25, 0x4B ; 75 2d42a: cd cf rjmp .-102 ; 0x2d3c6 0002d42c : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2d42c: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d430: 40 91 98 13 lds r20, 0x1398 ; 0x801398 2d434: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 2d438: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 2d43c: 41 30 cpi r20, 0x01 ; 1 2d43e: 59 f0 breq .+22 ; 0x2d456 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() 2d440: 10 92 61 06 sts 0x0661, r1 ; 0x800661 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 2d444: 80 91 6b 02 lds r24, 0x026B ; 0x80026b 2d448: 90 91 6c 02 lds r25, 0x026C ; 0x80026c 2d44c: 28 17 cp r18, r24 2d44e: 39 07 cpc r19, r25 2d450: 5c f4 brge .+22 ; 0x2d468 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 2d452: 0d 94 f7 36 jmp 0x26dee ; 0x26dee 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() 2d456: 90 91 6e 13 lds r25, 0x136E ; 0x80136e 2d45a: 91 11 cpse r25, r1 2d45c: f1 cf rjmp .-30 ; 0x2d440 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2d45e: 86 50 subi r24, 0x06 ; 6 2d460: 82 30 cpi r24, 0x02 ; 2 2d462: 70 f7 brcc .-36 ; 0x2d440 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() 2d464: 40 93 61 06 sts 0x0661, r20 ; 0x800661 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 2d468: 81 e0 ldi r24, 0x01 ; 1 2d46a: 80 93 60 06 sts 0x0660, r24 ; 0x800660 mFilamentItem(target_temperature[0], target_temperature_bed); 2d46e: 60 91 6b 0e lds r22, 0x0E6B ; 0x800e6b 2d472: 70 91 6c 0e lds r23, 0x0E6C ; 0x800e6c 2d476: c9 01 movw r24, r18 2d478: 0f 94 fc 68 call 0x2d1f8 ; 0x2d1f8 bFilamentSkipPreheat = false; // Reset flag 2d47c: 10 92 61 06 sts 0x0661, r1 ; 0x800661 } else { lcd_generic_preheat_menu(); } } 2d480: 08 95 ret 0002d482 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 2d482: 82 e0 ldi r24, 0x02 ; 2 2d484: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0002d488 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 2d488: 81 e0 ldi r24, 0x01 ; 1 2d48a: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0002d48e : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 2d48e: 83 e0 ldi r24, 0x03 ; 3 2d490: 0d 94 16 6a jmp 0x2d42c ; 0x2d42c 0002d494 : mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 2d494: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 2d498: 6c e3 ldi r22, 0x3C ; 60 2d49a: 70 e0 ldi r23, 0x00 ; 0 2d49c: 87 ed ldi r24, 0xD7 ; 215 2d49e: 90 e0 ldi r25, 0x00 ; 0 2d4a0: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d4a4 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 2d4a4: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 2d4a8: 65 e5 ldi r22, 0x55 ; 85 2d4aa: 70 e0 ldi r23, 0x00 ; 0 2d4ac: 86 ee ldi r24, 0xE6 ; 230 2d4ae: 90 e0 ldi r25, 0x00 ; 0 2d4b0: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d4b4 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 2d4b4: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 2d4b8: 69 e6 ldi r22, 0x69 ; 105 2d4ba: 70 e0 ldi r23, 0x00 ; 0 2d4bc: 84 e0 ldi r24, 0x04 ; 4 2d4be: 91 e0 ldi r25, 0x01 ; 1 2d4c0: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d4c4 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 2d4c4: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 2d4c8: 6e e6 ldi r22, 0x6E ; 110 2d4ca: 70 e0 ldi r23, 0x00 ; 0 2d4cc: 83 e1 ldi r24, 0x13 ; 19 2d4ce: 91 e0 ldi r25, 0x01 ; 1 2d4d0: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d4d4 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 2d4d4: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 2d4d8: 6b e4 ldi r22, 0x4B ; 75 2d4da: 70 e0 ldi r23, 0x00 ; 0 2d4dc: 87 ed ldi r24, 0xD7 ; 215 2d4de: 90 e0 ldi r25, 0x00 ; 0 2d4e0: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d4e4 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 2d4e4: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 2d4e8: 6a e5 ldi r22, 0x5A ; 90 2d4ea: 70 e0 ldi r23, 0x00 ; 0 2d4ec: 83 e1 ldi r24, 0x13 ; 19 2d4ee: 91 e0 ldi r25, 0x01 ; 1 2d4f0: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d4f4 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 2d4f4: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 2d4f8: 64 e6 ldi r22, 0x64 ; 100 2d4fa: 70 e0 ldi r23, 0x00 ; 0 2d4fc: 8f ef ldi r24, 0xFF ; 255 2d4fe: 90 e0 ldi r25, 0x00 ; 0 2d500: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d504 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 2d504: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 2d508: 64 e6 ldi r22, 0x64 ; 100 2d50a: 70 e0 ldi r23, 0x00 ; 0 2d50c: 8c ed ldi r24, 0xDC ; 220 2d50e: 90 e0 ldi r25, 0x00 ; 0 2d510: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d514 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 2d514: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 2d518: 64 e6 ldi r22, 0x64 ; 100 2d51a: 70 e0 ldi r23, 0x00 ; 0 2d51c: 8e ef ldi r24, 0xFE ; 254 2d51e: 90 e0 ldi r25, 0x00 ; 0 2d520: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d524 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 2d524: 10 92 60 06 sts 0x0660, r1 ; 0x800660 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 2d528: 62 e3 ldi r22, 0x32 ; 50 2d52a: 70 e0 ldi r23, 0x00 ; 0 2d52c: 80 ef ldi r24, 0xF0 ; 240 2d52e: 90 e0 ldi r25, 0x00 ; 0 2d530: 0d 94 fc 68 jmp 0x2d1f8 ; 0x2d1f8 0002d534 : } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d534: 80 e0 ldi r24, 0x00 ; 0 2d536: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe #include "xflash_dump.h" static void lcd_dump_memory() { lcd_beeper_quick_feedback(); xfdump_dump(); 2d53a: 0e 94 69 e4 call 0x1c8d2 ; 0x1c8d2 lcd_return_to_status(); 2d53e: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 0002d542 : } 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){ 2d542: cf 92 push r12 2d544: df 92 push r13 2d546: ef 92 push r14 2d548: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 2d54a: 41 11 cpse r20, r1 2d54c: 04 c0 rjmp .+8 ; 0x2d556 2d54e: 20 91 e1 04 lds r18, 0x04E1 ; 0x8004e1 2d552: 22 30 cpi r18, 0x02 ; 2 2d554: d1 f0 breq .+52 ; 0x2d58a 2d556: 9b 01 movw r18, r22 2d558: 6c 01 movw r12, r24 2d55a: f1 2c mov r15, r1 2d55c: e1 2c mov r14, r1 if(!tone_) { 2d55e: 67 2b or r22, r23 2d560: c9 f4 brne .+50 ; 0x2d594 WRITE(BEEPER, HIGH); 2d562: 9f b7 in r25, 0x3f ; 63 2d564: f8 94 cli 2d566: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d56a: 84 60 ori r24, 0x04 ; 4 2d56c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d570: 9f bf out 0x3f, r25 ; 63 _delay(ms); 2d572: c7 01 movw r24, r14 2d574: b6 01 movw r22, r12 2d576: 0f 94 92 3d call 0x27b24 ; 0x27b24 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); 2d57a: 9f b7 in r25, 0x3f ; 63 2d57c: f8 94 cli 2d57e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d582: 8b 7f andi r24, 0xFB ; 251 2d584: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2d588: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 2d58a: ff 90 pop r15 2d58c: ef 90 pop r14 2d58e: df 90 pop r13 2d590: cf 90 pop r12 2d592: 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); 2d594: 22 0f add r18, r18 2d596: 33 1f adc r19, r19 2d598: 50 e0 ldi r21, 0x00 ; 0 2d59a: 40 e0 ldi r20, 0x00 ; 0 2d59c: 60 e0 ldi r22, 0x00 ; 0 2d59e: 74 e2 ldi r23, 0x24 ; 36 2d5a0: 84 ef ldi r24, 0xF4 ; 244 2d5a2: 90 e0 ldi r25, 0x00 ; 0 2d5a4: 0f 94 82 de call 0x3bd04 ; 0x3bd04 <__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; 2d5a8: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 2d5aa: 21 15 cp r18, r1 2d5ac: 31 05 cpc r19, r1 2d5ae: 81 e0 ldi r24, 0x01 ; 1 2d5b0: 48 07 cpc r20, r24 2d5b2: 51 05 cpc r21, r1 2d5b4: 44 f0 brlt .+16 ; 0x2d5c6 pwm_freq /= 64; // Increase prescaler to 64 2d5b6: 86 e0 ldi r24, 0x06 ; 6 2d5b8: 56 95 lsr r21 2d5ba: 47 95 ror r20 2d5bc: 37 95 ror r19 2d5be: 27 95 ror r18 2d5c0: 8a 95 dec r24 2d5c2: d1 f7 brne .-12 ; 0x2d5b8 prescalarbits = 0b011; 2d5c4: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 2d5c6: 21 50 subi r18, 0x01 ; 1 2d5c8: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 2d5ca: 4f b7 in r20, 0x3f ; 63 2d5cc: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 2d5ce: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d5d2: 88 7f andi r24, 0xF8 ; 248 2d5d4: 89 2b or r24, r25 2d5d6: 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); 2d5da: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d5de: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d5e2: 26 9f mul r18, r22 2d5e4: c0 01 movw r24, r0 2d5e6: 27 9f mul r18, r23 2d5e8: 90 0d add r25, r0 2d5ea: 36 9f mul r19, r22 2d5ec: 90 0d add r25, r0 2d5ee: 11 24 eor r1, r1 2d5f0: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d5f4: 6f ef ldi r22, 0xFF ; 255 2d5f6: 70 e0 ldi r23, 0x00 ; 0 2d5f8: 51 ff sbrs r21, 1 2d5fa: 04 c0 rjmp .+8 ; 0x2d604 2d5fc: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d600: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d604: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 2d608: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d60c: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 2d610: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d614: 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); 2d618: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d61c: 83 60 ori r24, 0x03 ; 3 2d61e: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d622: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 2d624: c7 01 movw r24, r14 2d626: b6 01 movw r22, r12 2d628: 0f 94 92 3d call 0x27b24 ; 0x27b24 } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 2d62c: 2f b7 in r18, 0x3f ; 63 2d62e: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 2d630: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 2d634: 88 7f andi r24, 0xF8 ; 248 2d636: 85 60 ori r24, 0x05 ; 5 2d638: 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); 2d63c: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 2d640: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d644: 3f ef ldi r19, 0xFF ; 255 2d646: 34 9f mul r19, r20 2d648: c0 01 movw r24, r0 2d64a: 35 9f mul r19, r21 2d64c: 90 0d add r25, r0 2d64e: 11 24 eor r1, r1 2d650: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d654: 6f ef ldi r22, 0xFF ; 255 2d656: 70 e0 ldi r23, 0x00 ; 0 2d658: 31 ff sbrs r19, 1 2d65a: 04 c0 rjmp .+8 ; 0x2d664 2d65c: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 2d660: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d664: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 2d668: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 2d66c: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 2d670: 8f ef ldi r24, 0xFF ; 255 2d672: 90 e0 ldi r25, 0x00 ; 0 2d674: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 2d678: 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)); 2d67c: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 2d680: 8c 7f andi r24, 0xFC ; 252 2d682: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 2d686: 2f bf out 0x3f, r18 ; 63 2d688: 78 cf rjmp .-272 ; 0x2d57a 0002d68a : /// 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() { 2d68a: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 2d68c: c0 91 e1 04 lds r28, 0x04E1 ; 0x8004e1 2d690: c2 30 cpi r28, 0x02 ; 2 2d692: 59 f1 breq .+86 ; 0x2d6ea // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 2d694: c1 30 cpi r28, 0x01 ; 1 2d696: 69 f4 brne .+26 ; 0x2d6b2 if (bFirst) return; 2d698: 80 91 6f 05 lds r24, 0x056F ; 0x80056f <_ZL6bFirst.lto_priv.514> 2d69c: 81 11 cpse r24, r1 2d69e: 25 c0 rjmp .+74 ; 0x2d6ea Sound_MakeCustom(80, 0, false); 2d6a0: 40 e0 ldi r20, 0x00 ; 0 2d6a2: 70 e0 ldi r23, 0x00 ; 0 2d6a4: 60 e0 ldi r22, 0x00 ; 0 2d6a6: 80 e5 ldi r24, 0x50 ; 80 2d6a8: 90 e0 ldi r25, 0x00 ; 0 2d6aa: 0f 94 a1 6a call 0x2d542 ; 0x2d542 bFirst = true; 2d6ae: c0 93 6f 05 sts 0x056F, r28 ; 0x80056f <_ZL6bFirst.lto_priv.514> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 2d6b2: 60 ed ldi r22, 0xD0 ; 208 2d6b4: 77 e0 ldi r23, 0x07 ; 7 2d6b6: 8c e6 ldi r24, 0x6C ; 108 2d6b8: 95 e0 ldi r25, 0x05 ; 5 2d6ba: 0f 94 e5 3f call 0x27fca ; 0x27fca ::expired_cont(unsigned short)> 2d6be: 88 23 and r24, r24 2d6c0: a1 f0 breq .+40 ; 0x2d6ea beep_timer.start(); 2d6c2: 8c e6 ldi r24, 0x6C ; 108 2d6c4: 95 e0 ldi r25, 0x05 ; 5 2d6c6: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 2d6ca: 80 91 e1 04 lds r24, 0x04E1 ; 0x8004e1 2d6ce: 81 11 cpse r24, r1 2d6d0: 08 c0 rjmp .+16 ; 0x2d6e2 Sound_MakeCustom(80, 0, false); 2d6d2: 40 e0 ldi r20, 0x00 ; 0 2d6d4: 70 e0 ldi r23, 0x00 ; 0 2d6d6: 60 e0 ldi r22, 0x00 ; 0 2d6d8: 80 e5 ldi r24, 0x50 ; 80 2d6da: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 2d6dc: 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); 2d6de: 0d 94 a1 6a jmp 0x2d542 ; 0x2d542 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 2d6e2: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 2d6e4: 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); 2d6e6: 0d 94 7f 64 jmp 0x2c8fe ; 0x2c8fe } } #endif // BEEPER > 0 } 2d6ea: cf 91 pop r28 2d6ec: 08 95 ret 0002d6ee : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 2d6ee: 82 30 cpi r24, 0x02 ; 2 2d6f0: b9 f0 breq .+46 ; 0x2d720 2d6f2: 83 30 cpi r24, 0x03 ; 3 2d6f4: e9 f0 breq .+58 ; 0x2d730 2d6f6: 81 30 cpi r24, 0x01 ; 1 2d6f8: 59 f0 breq .+22 ; 0x2d710 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; 2d6fa: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d6fe: 61 30 cpi r22, 0x01 ; 1 2d700: 29 f4 brne .+10 ; 0x2d70c 2d702: 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; 2d704: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif } asm("nop"); 2d708: 00 00 nop } 2d70a: 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; 2d70c: 8e 7f andi r24, 0xFE ; 254 2d70e: fa cf rjmp .-12 ; 0x2d704 case 1: if (dir == INVERT_Y_DIR) PORTL |= 2; else PORTL &= ~2; break; 2d710: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d714: 61 11 cpse r22, r1 2d716: 02 c0 rjmp .+4 ; 0x2d71c 2d718: 82 60 ori r24, 0x02 ; 2 2d71a: f4 cf rjmp .-24 ; 0x2d704 2d71c: 8d 7f andi r24, 0xFD ; 253 2d71e: f2 cf rjmp .-28 ; 0x2d704 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 2d720: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d724: 61 30 cpi r22, 0x01 ; 1 2d726: 11 f4 brne .+4 ; 0x2d72c 2d728: 84 60 ori r24, 0x04 ; 4 2d72a: ec cf rjmp .-40 ; 0x2d704 2d72c: 8b 7f andi r24, 0xFB ; 251 2d72e: ea cf rjmp .-44 ; 0x2d704 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 2d730: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2d734: 61 11 cpse r22, r1 2d736: 02 c0 rjmp .+4 ; 0x2d73c 2d738: 80 64 ori r24, 0x40 ; 64 2d73a: e4 cf rjmp .-56 ; 0x2d704 2d73c: 8f 7b andi r24, 0xBF ; 191 2d73e: e2 cf rjmp .-60 ; 0x2d704 0002d740 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 2d740: cf 93 push r28 if (cacheDirty_) { 2d742: 80 91 77 0e lds r24, 0x0E77 ; 0x800e77 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 2d746: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 2d748: 88 23 and r24, r24 2d74a: a1 f0 breq .+40 ; 0x2d774 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 2d74c: 40 91 6f 0e lds r20, 0x0E6F ; 0x800e6f 2d750: 50 91 70 0e lds r21, 0x0E70 ; 0x800e70 2d754: 60 91 71 0e lds r22, 0x0E71 ; 0x800e71 2d758: 70 91 72 0e lds r23, 0x0E72 ; 0x800e72 2d75c: 2b e7 ldi r18, 0x7B ; 123 2d75e: 3e e0 ldi r19, 0x0E ; 14 2d760: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2d764: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 2d768: 0f 94 38 a6 call 0x34c70 ; 0x34c70 2d76c: c8 2f mov r28, r24 2d76e: 81 11 cpse r24, r1 2d770: 04 c0 rjmp .+8 ; 0x2d77a cacheDirty_ = 0; } return true; fail: return false; 2d772: c0 e0 ldi r28, 0x00 ; 0 } 2d774: 8c 2f mov r24, r28 2d776: cf 91 pop r28 2d778: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 2d77a: 40 91 73 0e lds r20, 0x0E73 ; 0x800e73 2d77e: 50 91 74 0e lds r21, 0x0E74 ; 0x800e74 2d782: 60 91 75 0e lds r22, 0x0E75 ; 0x800e75 2d786: 70 91 76 0e lds r23, 0x0E76 ; 0x800e76 2d78a: 41 15 cp r20, r1 2d78c: 51 05 cpc r21, r1 2d78e: 61 05 cpc r22, r1 2d790: 71 05 cpc r23, r1 2d792: 91 f0 breq .+36 ; 0x2d7b8 if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 2d794: 2b e7 ldi r18, 0x7B ; 123 2d796: 3e e0 ldi r19, 0x0E ; 14 2d798: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2d79c: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 2d7a0: 0f 94 38 a6 call 0x34c70 ; 0x34c70 2d7a4: 88 23 and r24, r24 2d7a6: 29 f3 breq .-54 ; 0x2d772 goto fail; } cacheMirrorBlock_ = 0; 2d7a8: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 2d7ac: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 2d7b0: 10 92 75 0e sts 0x0E75, r1 ; 0x800e75 2d7b4: 10 92 76 0e sts 0x0E76, r1 ; 0x800e76 } cacheDirty_ = 0; 2d7b8: 10 92 77 0e sts 0x0E77, r1 ; 0x800e77 2d7bc: db cf rjmp .-74 ; 0x2d774 0002d7be : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 2d7be: cf 92 push r12 2d7c0: df 92 push r13 2d7c2: ef 92 push r14 2d7c4: ff 92 push r15 2d7c6: cf 93 push r28 2d7c8: 6b 01 movw r12, r22 2d7ca: 7c 01 movw r14, r24 2d7cc: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 2d7ce: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 2d7d2: 90 91 70 0e lds r25, 0x0E70 ; 0x800e70 2d7d6: a0 91 71 0e lds r26, 0x0E71 ; 0x800e71 2d7da: b0 91 72 0e lds r27, 0x0E72 ; 0x800e72 2d7de: 8c 15 cp r24, r12 2d7e0: 9d 05 cpc r25, r13 2d7e2: ae 05 cpc r26, r14 2d7e4: bf 05 cpc r27, r15 2d7e6: 01 f1 breq .+64 ; 0x2d828 if (!cacheFlush()) goto fail; 2d7e8: 0f 94 a0 6b call 0x2d740 ; 0x2d740 2d7ec: 81 11 cpse r24, r1 2d7ee: 08 c0 rjmp .+16 ; 0x2d800 } if (dirty) cacheDirty_ = true; return true; fail: return false; 2d7f0: c0 e0 ldi r28, 0x00 ; 0 } 2d7f2: 8c 2f mov r24, r28 2d7f4: cf 91 pop r28 2d7f6: ff 90 pop r15 2d7f8: ef 90 pop r14 2d7fa: df 90 pop r13 2d7fc: cf 90 pop r12 2d7fe: 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; 2d800: 2b e7 ldi r18, 0x7B ; 123 2d802: 3e e0 ldi r19, 0x0E ; 14 2d804: b7 01 movw r22, r14 2d806: a6 01 movw r20, r12 2d808: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 2d80c: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 2d810: 0f 94 9c a6 call 0x34d38 ; 0x34d38 2d814: 88 23 and r24, r24 2d816: 61 f3 breq .-40 ; 0x2d7f0 cacheBlockNumber_ = blockNumber; 2d818: c0 92 6f 0e sts 0x0E6F, r12 ; 0x800e6f 2d81c: d0 92 70 0e sts 0x0E70, r13 ; 0x800e70 2d820: e0 92 71 0e sts 0x0E71, r14 ; 0x800e71 2d824: f0 92 72 0e sts 0x0E72, r15 ; 0x800e72 } if (dirty) cacheDirty_ = true; 2d828: cc 23 and r28, r28 2d82a: 21 f0 breq .+8 ; 0x2d834 2d82c: 81 e0 ldi r24, 0x01 ; 1 2d82e: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 2d832: df cf rjmp .-66 ; 0x2d7f2 return true; 2d834: c1 e0 ldi r28, 0x01 ; 1 2d836: dd cf rjmp .-70 ; 0x2d7f2 0002d838 : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2d838: 4f 92 push r4 2d83a: 5f 92 push r5 2d83c: 6f 92 push r6 2d83e: 7f 92 push r7 2d840: 8f 92 push r8 2d842: 9f 92 push r9 2d844: af 92 push r10 2d846: bf 92 push r11 2d848: cf 92 push r12 2d84a: df 92 push r13 2d84c: ef 92 push r14 2d84e: ff 92 push r15 2d850: 0f 93 push r16 2d852: 1f 93 push r17 2d854: cf 93 push r28 2d856: df 93 push r29 2d858: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 2d85a: 42 30 cpi r20, 0x02 ; 2 2d85c: 51 05 cpc r21, r1 2d85e: 61 05 cpc r22, r1 2d860: 71 05 cpc r23, r1 2d862: 90 f4 brcc .+36 ; 0x2d888 // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 2d864: 80 e0 ldi r24, 0x00 ; 0 } 2d866: df 91 pop r29 2d868: cf 91 pop r28 2d86a: 1f 91 pop r17 2d86c: 0f 91 pop r16 2d86e: ff 90 pop r15 2d870: ef 90 pop r14 2d872: df 90 pop r13 2d874: cf 90 pop r12 2d876: bf 90 pop r11 2d878: af 90 pop r10 2d87a: 9f 90 pop r9 2d87c: 8f 90 pop r8 2d87e: 7f 90 pop r7 2d880: 6f 90 pop r6 2d882: 5f 90 pop r5 2d884: 4f 90 pop r4 2d886: 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; 2d888: 89 85 ldd r24, Y+9 ; 0x09 2d88a: 9a 85 ldd r25, Y+10 ; 0x0a 2d88c: ab 85 ldd r26, Y+11 ; 0x0b 2d88e: bc 85 ldd r27, Y+12 ; 0x0c 2d890: 01 96 adiw r24, 0x01 ; 1 2d892: a1 1d adc r26, r1 2d894: b1 1d adc r27, r1 2d896: 84 17 cp r24, r20 2d898: 95 07 cpc r25, r21 2d89a: a6 07 cpc r26, r22 2d89c: b7 07 cpc r27, r23 2d89e: 10 f3 brcs .-60 ; 0x2d864 tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 2d8a0: 8f 89 ldd r24, Y+23 ; 0x17 2d8a2: 80 31 cpi r24, 0x10 ; 16 2d8a4: c9 f5 brne .+114 ; 0x2d918 lba = fatStartBlock_ + (cluster >> 8); 2d8a6: 85 2e mov r8, r21 2d8a8: 96 2e mov r9, r22 2d8aa: a7 2e mov r10, r23 2d8ac: bb 24 eor r11, r11 2d8ae: 8b 89 ldd r24, Y+19 ; 0x13 2d8b0: 9c 89 ldd r25, Y+20 ; 0x14 2d8b2: ad 89 ldd r26, Y+21 ; 0x15 2d8b4: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d8b6: 88 0e add r8, r24 2d8b8: 99 1e adc r9, r25 2d8ba: aa 1e adc r10, r26 2d8bc: bb 1e adc r11, r27 2d8be: 28 01 movw r4, r16 2d8c0: 39 01 movw r6, r18 2d8c2: 6a 01 movw r12, r20 2d8c4: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2d8c6: 41 e0 ldi r20, 0x01 ; 1 2d8c8: c5 01 movw r24, r10 2d8ca: b4 01 movw r22, r8 2d8cc: 0f 94 df 6b call 0x2d7be ; 0x2d7be 2d8d0: 88 23 and r24, r24 2d8d2: 41 f2 breq .-112 ; 0x2d864 // store entry if (fatType_ == 16) { 2d8d4: 9f 89 ldd r25, Y+23 ; 0x17 2d8d6: 90 31 cpi r25, 0x10 ; 16 2d8d8: 81 f5 brne .+96 ; 0x2d93a cacheBuffer_.fat16[cluster & 0XFF] = value; 2d8da: dd 24 eor r13, r13 2d8dc: ee 24 eor r14, r14 2d8de: ff 24 eor r15, r15 2d8e0: f6 01 movw r30, r12 2d8e2: ee 0f add r30, r30 2d8e4: ff 1f adc r31, r31 2d8e6: e5 58 subi r30, 0x85 ; 133 2d8e8: f1 4f sbci r31, 0xF1 ; 241 2d8ea: 11 83 std Z+1, r17 ; 0x01 2d8ec: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 2d8ee: 9a 89 ldd r25, Y+18 ; 0x12 2d8f0: 92 30 cpi r25, 0x02 ; 2 2d8f2: 08 f4 brcc .+2 ; 0x2d8f6 2d8f4: b8 cf rjmp .-144 ; 0x2d866 2d8f6: 4d 81 ldd r20, Y+5 ; 0x05 2d8f8: 5e 81 ldd r21, Y+6 ; 0x06 2d8fa: 6f 81 ldd r22, Y+7 ; 0x07 2d8fc: 78 85 ldd r23, Y+8 ; 0x08 2d8fe: 84 0e add r8, r20 2d900: 95 1e adc r9, r21 2d902: a6 1e adc r10, r22 2d904: b7 1e adc r11, r23 2d906: 80 92 73 0e sts 0x0E73, r8 ; 0x800e73 2d90a: 90 92 74 0e sts 0x0E74, r9 ; 0x800e74 2d90e: a0 92 75 0e sts 0x0E75, r10 ; 0x800e75 2d912: b0 92 76 0e sts 0x0E76, r11 ; 0x800e76 2d916: a7 cf rjmp .-178 ; 0x2d866 cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2d918: 80 32 cpi r24, 0x20 ; 32 2d91a: 09 f0 breq .+2 ; 0x2d91e 2d91c: a3 cf rjmp .-186 ; 0x2d864 lba = fatStartBlock_ + (cluster >> 7); 2d91e: 8b 89 ldd r24, Y+19 ; 0x13 2d920: 9c 89 ldd r25, Y+20 ; 0x14 2d922: ad 89 ldd r26, Y+21 ; 0x15 2d924: be 89 ldd r27, Y+22 ; 0x16 2d926: 4a 01 movw r8, r20 2d928: 5b 01 movw r10, r22 2d92a: e7 e0 ldi r30, 0x07 ; 7 2d92c: b6 94 lsr r11 2d92e: a7 94 ror r10 2d930: 97 94 ror r9 2d932: 87 94 ror r8 2d934: ea 95 dec r30 2d936: d1 f7 brne .-12 ; 0x2d92c 2d938: be cf rjmp .-132 ; 0x2d8b6 if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 2d93a: e8 94 clt 2d93c: c7 f8 bld r12, 7 2d93e: dd 24 eor r13, r13 2d940: ee 24 eor r14, r14 2d942: ff 24 eor r15, r15 2d944: f6 01 movw r30, r12 2d946: ee 0f add r30, r30 2d948: ff 1f adc r31, r31 2d94a: ee 0f add r30, r30 2d94c: ff 1f adc r31, r31 2d94e: e5 58 subi r30, 0x85 ; 133 2d950: f1 4f sbci r31, 0xF1 ; 241 2d952: 40 82 st Z, r4 2d954: 51 82 std Z+1, r5 ; 0x01 2d956: 62 82 std Z+2, r6 ; 0x02 2d958: 73 82 std Z+3, r7 ; 0x03 2d95a: c9 cf rjmp .-110 ; 0x2d8ee 0002d95c : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 2d95c: cf 92 push r12 2d95e: df 92 push r13 2d960: ef 92 push r14 2d962: ff 92 push r15 2d964: 0f 93 push r16 2d966: 1f 93 push r17 2d968: cf 93 push r28 2d96a: df 93 push r29 2d96c: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 2d96e: 81 85 ldd r24, Z+9 ; 0x09 2d970: 92 85 ldd r25, Z+10 ; 0x0a 2d972: a3 85 ldd r26, Z+11 ; 0x0b 2d974: b4 85 ldd r27, Z+12 ; 0x0c 2d976: 01 96 adiw r24, 0x01 ; 1 2d978: a1 1d adc r26, r1 2d97a: b1 1d adc r27, r1 2d97c: 84 17 cp r24, r20 2d97e: 95 07 cpc r25, r21 2d980: a6 07 cpc r26, r22 2d982: b7 07 cpc r27, r23 2d984: 50 f4 brcc .+20 ; 0x2d99a *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 2d986: 80 e0 ldi r24, 0x00 ; 0 } 2d988: df 91 pop r29 2d98a: cf 91 pop r28 2d98c: 1f 91 pop r17 2d98e: 0f 91 pop r16 2d990: ff 90 pop r15 2d992: ef 90 pop r14 2d994: df 90 pop r13 2d996: cf 90 pop r12 2d998: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 2d99a: 87 89 ldd r24, Z+23 ; 0x17 2d99c: 80 31 cpi r24, 0x10 ; 16 2d99e: a9 f5 brne .+106 ; 0x2da0a lba = fatStartBlock_ + (cluster >> 8); 2d9a0: bb 27 eor r27, r27 2d9a2: a7 2f mov r26, r23 2d9a4: 96 2f mov r25, r22 2d9a6: 85 2f mov r24, r21 2d9a8: c3 88 ldd r12, Z+19 ; 0x13 2d9aa: d4 88 ldd r13, Z+20 ; 0x14 2d9ac: e5 88 ldd r14, Z+21 ; 0x15 2d9ae: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2d9b0: 8c 0d add r24, r12 2d9b2: 9d 1d adc r25, r13 2d9b4: ae 1d adc r26, r14 2d9b6: bf 1d adc r27, r15 2d9b8: e9 01 movw r28, r18 2d9ba: 6a 01 movw r12, r20 2d9bc: 7b 01 movw r14, r22 2d9be: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 2d9c0: 40 91 6f 0e lds r20, 0x0E6F ; 0x800e6f 2d9c4: 50 91 70 0e lds r21, 0x0E70 ; 0x800e70 2d9c8: 60 91 71 0e lds r22, 0x0E71 ; 0x800e71 2d9cc: 70 91 72 0e lds r23, 0x0E72 ; 0x800e72 2d9d0: 84 17 cp r24, r20 2d9d2: 95 07 cpc r25, r21 2d9d4: a6 07 cpc r26, r22 2d9d6: b7 07 cpc r27, r23 2d9d8: 49 f5 brne .+82 ; 0x2da2c if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 2d9da: f8 01 movw r30, r16 2d9dc: 87 89 ldd r24, Z+23 ; 0x17 2d9de: 80 31 cpi r24, 0x10 ; 16 2d9e0: 69 f5 brne .+90 ; 0x2da3c *value = cacheBuffer_.fat16[cluster & 0XFF]; 2d9e2: b7 01 movw r22, r14 2d9e4: a6 01 movw r20, r12 2d9e6: 55 27 eor r21, r21 2d9e8: 66 27 eor r22, r22 2d9ea: 77 27 eor r23, r23 2d9ec: 44 0f add r20, r20 2d9ee: 55 1f adc r21, r21 2d9f0: 45 58 subi r20, 0x85 ; 133 2d9f2: 51 4f sbci r21, 0xF1 ; 241 2d9f4: fa 01 movw r30, r20 2d9f6: 80 81 ld r24, Z 2d9f8: 91 81 ldd r25, Z+1 ; 0x01 2d9fa: b0 e0 ldi r27, 0x00 ; 0 2d9fc: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2d9fe: 88 83 st Y, r24 2da00: 99 83 std Y+1, r25 ; 0x01 2da02: aa 83 std Y+2, r26 ; 0x02 2da04: bb 83 std Y+3, r27 ; 0x03 2da06: 81 e0 ldi r24, 0x01 ; 1 2da08: bf cf rjmp .-130 ; 0x2d988 *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2da0a: 80 32 cpi r24, 0x20 ; 32 2da0c: 09 f0 breq .+2 ; 0x2da10 2da0e: bb cf rjmp .-138 ; 0x2d986 lba = fatStartBlock_ + (cluster >> 7); 2da10: c3 88 ldd r12, Z+19 ; 0x13 2da12: d4 88 ldd r13, Z+20 ; 0x14 2da14: e5 88 ldd r14, Z+21 ; 0x15 2da16: f6 88 ldd r15, Z+22 ; 0x16 2da18: db 01 movw r26, r22 2da1a: ca 01 movw r24, r20 2da1c: c7 e0 ldi r28, 0x07 ; 7 2da1e: b6 95 lsr r27 2da20: a7 95 ror r26 2da22: 97 95 ror r25 2da24: 87 95 ror r24 2da26: ca 95 dec r28 2da28: d1 f7 brne .-12 ; 0x2da1e 2da2a: c2 cf rjmp .-124 ; 0x2d9b0 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 2da2c: 40 e0 ldi r20, 0x00 ; 0 2da2e: bc 01 movw r22, r24 2da30: cd 01 movw r24, r26 2da32: 0f 94 df 6b call 0x2d7be ; 0x2d7be 2da36: 81 11 cpse r24, r1 2da38: d0 cf rjmp .-96 ; 0x2d9da 2da3a: a5 cf rjmp .-182 ; 0x2d986 } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 2da3c: b7 01 movw r22, r14 2da3e: a6 01 movw r20, r12 2da40: 4f 77 andi r20, 0x7F ; 127 2da42: 55 27 eor r21, r21 2da44: 66 27 eor r22, r22 2da46: 77 27 eor r23, r23 2da48: 44 0f add r20, r20 2da4a: 55 1f adc r21, r21 2da4c: 44 0f add r20, r20 2da4e: 55 1f adc r21, r21 2da50: 45 58 subi r20, 0x85 ; 133 2da52: 51 4f sbci r21, 0xF1 ; 241 2da54: fa 01 movw r30, r20 2da56: 80 81 ld r24, Z 2da58: 91 81 ldd r25, Z+1 ; 0x01 2da5a: a2 81 ldd r26, Z+2 ; 0x02 2da5c: b3 81 ldd r27, Z+3 ; 0x03 2da5e: bf 70 andi r27, 0x0F ; 15 2da60: ce cf rjmp .-100 ; 0x2d9fe 0002da62 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 2da62: 4f 92 push r4 2da64: 5f 92 push r5 2da66: 6f 92 push r6 2da68: 7f 92 push r7 2da6a: af 92 push r10 2da6c: bf 92 push r11 2da6e: cf 92 push r12 2da70: df 92 push r13 2da72: ef 92 push r14 2da74: ff 92 push r15 2da76: 0f 93 push r16 2da78: 1f 93 push r17 2da7a: cf 93 push r28 2da7c: df 93 push r29 2da7e: 00 d0 rcall .+0 ; 0x2da80 2da80: 1f 92 push r1 2da82: cd b7 in r28, 0x3d ; 61 2da84: de b7 in r29, 0x3e ; 62 2da86: 8c 01 movw r16, r24 2da88: 49 83 std Y+1, r20 ; 0x01 2da8a: 5a 83 std Y+2, r21 ; 0x02 2da8c: 6b 83 std Y+3, r22 ; 0x03 2da8e: 7c 83 std Y+4, r23 ; 0x04 2da90: 59 01 movw r10, r18 uint32_t s = 0; 2da92: c1 2c mov r12, r1 2da94: d1 2c mov r13, r1 2da96: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 2da98: 41 2c mov r4, r1 2da9a: 82 e0 ldi r24, 0x02 ; 2 2da9c: 58 2e mov r5, r24 2da9e: 61 2c mov r6, r1 2daa0: 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; 2daa2: 49 81 ldd r20, Y+1 ; 0x01 2daa4: 5a 81 ldd r21, Y+2 ; 0x02 2daa6: 6b 81 ldd r22, Y+3 ; 0x03 2daa8: 7c 81 ldd r23, Y+4 ; 0x04 2daaa: 9e 01 movw r18, r28 2daac: 2f 5f subi r18, 0xFF ; 255 2daae: 3f 4f sbci r19, 0xFF ; 255 2dab0: c8 01 movw r24, r16 2dab2: 0f 94 ae 6c call 0x2d95c ; 0x2d95c 2dab6: 88 23 and r24, r24 2dab8: 19 f1 breq .+70 ; 0x2db00 s += 512UL << clusterSizeShift_; 2daba: f8 01 movw r30, r16 2dabc: 85 85 ldd r24, Z+13 ; 0x0d 2dabe: a3 01 movw r20, r6 2dac0: 92 01 movw r18, r4 2dac2: 04 c0 rjmp .+8 ; 0x2dacc 2dac4: 22 0f add r18, r18 2dac6: 33 1f adc r19, r19 2dac8: 44 1f adc r20, r20 2daca: 55 1f adc r21, r21 2dacc: 8a 95 dec r24 2dace: d2 f7 brpl .-12 ; 0x2dac4 2dad0: da 01 movw r26, r20 2dad2: c9 01 movw r24, r18 2dad4: c8 0e add r12, r24 2dad6: d9 1e adc r13, r25 2dad8: ea 1e adc r14, r26 2dada: fb 1e adc r15, r27 } while (!isEOC(cluster)); 2dadc: 49 81 ldd r20, Y+1 ; 0x01 2dade: 5a 81 ldd r21, Y+2 ; 0x02 2dae0: 6b 81 ldd r22, Y+3 ; 0x03 2dae2: 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; 2dae4: 87 89 ldd r24, Z+23 ; 0x17 2dae6: 80 31 cpi r24, 0x10 ; 16 2dae8: f1 f4 brne .+60 ; 0x2db26 2daea: 81 e0 ldi r24, 0x01 ; 1 2daec: 48 3f cpi r20, 0xF8 ; 248 2daee: 5f 4f sbci r21, 0xFF ; 255 2daf0: 61 05 cpc r22, r1 2daf2: 71 05 cpc r23, r1 2daf4: b0 f2 brcs .-84 ; 0x2daa2 *size = s; 2daf6: f5 01 movw r30, r10 2daf8: c0 82 st Z, r12 2dafa: d1 82 std Z+1, r13 ; 0x01 2dafc: e2 82 std Z+2, r14 ; 0x02 2dafe: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 2db00: 0f 90 pop r0 2db02: 0f 90 pop r0 2db04: 0f 90 pop r0 2db06: 0f 90 pop r0 2db08: df 91 pop r29 2db0a: cf 91 pop r28 2db0c: 1f 91 pop r17 2db0e: 0f 91 pop r16 2db10: ff 90 pop r15 2db12: ef 90 pop r14 2db14: df 90 pop r13 2db16: cf 90 pop r12 2db18: bf 90 pop r11 2db1a: af 90 pop r10 2db1c: 7f 90 pop r7 2db1e: 6f 90 pop r6 2db20: 5f 90 pop r5 2db22: 4f 90 pop r4 2db24: 08 95 ret return cluster >= FAT32EOC_MIN; 2db26: 81 e0 ldi r24, 0x01 ; 1 2db28: 48 3f cpi r20, 0xF8 ; 248 2db2a: 5f 4f sbci r21, 0xFF ; 255 2db2c: 6f 4f sbci r22, 0xFF ; 255 2db2e: 7f 40 sbci r23, 0x0F ; 15 2db30: 08 f4 brcc .+2 ; 0x2db34 2db32: b7 cf rjmp .-146 ; 0x2daa2 2db34: e0 cf rjmp .-64 ; 0x2daf6 0002db36 : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2db36: cf 92 push r12 2db38: df 92 push r13 2db3a: ef 92 push r14 2db3c: ff 92 push r15 2db3e: 1f 93 push r17 2db40: cf 93 push r28 2db42: df 93 push r29 2db44: ec 01 movw r28, r24 2db46: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2db48: e1 11 cpse r30, r1 2db4a: 09 c0 rjmp .+18 ; 0x2db5e 2db4c: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 2db4e: df 91 pop r29 2db50: cf 91 pop r28 2db52: 1f 91 pop r17 2db54: ff 90 pop r15 2db56: ef 90 pop r14 2db58: df 90 pop r13 2db5a: cf 90 pop r12 2db5c: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2db5e: 89 81 ldd r24, Y+1 ; 0x01 2db60: 80 ff sbrs r24, 0 2db62: f4 cf rjmp .-24 ; 0x2db4c gfOffset = curPosition_ & 0X1FF; // offset in block 2db64: 48 85 ldd r20, Y+8 ; 0x08 2db66: 59 85 ldd r21, Y+9 ; 0x09 2db68: 6a 85 ldd r22, Y+10 ; 0x0a 2db6a: 7b 85 ldd r23, Y+11 ; 0x0b 2db6c: 9a 01 movw r18, r20 2db6e: 31 70 andi r19, 0x01 ; 1 2db70: 3a a3 std Y+34, r19 ; 0x22 2db72: 29 a3 std Y+33, r18 ; 0x21 2db74: 89 8d ldd r24, Y+25 ; 0x19 2db76: 9a 8d ldd r25, Y+26 ; 0x1a 2db78: 6a 01 movw r12, r20 2db7a: 7b 01 movw r14, r22 2db7c: f9 e0 ldi r31, 0x09 ; 9 2db7e: f6 94 lsr r15 2db80: e7 94 ror r14 2db82: d7 94 ror r13 2db84: c7 94 ror r12 2db86: fa 95 dec r31 2db88: d1 f7 brne .-12 ; 0x2db7e if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2db8a: e2 30 cpi r30, 0x02 ; 2 2db8c: 79 f4 brne .+30 ; 0x2dbac // 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); 2db8e: fc 01 movw r30, r24 2db90: 82 8d ldd r24, Z+26 ; 0x1a 2db92: 93 8d ldd r25, Z+27 ; 0x1b 2db94: a4 8d ldd r26, Z+28 ; 0x1c 2db96: b5 8d ldd r27, Z+29 ; 0x1d 2db98: 8c 0d add r24, r12 2db9a: 9d 1d adc r25, r13 2db9c: ae 1d adc r26, r14 2db9e: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 2dba0: 8d 8f std Y+29, r24 ; 0x1d 2dba2: 9e 8f std Y+30, r25 ; 0x1e 2dba4: af 8f std Y+31, r26 ; 0x1f 2dba6: b8 a3 std Y+32, r27 ; 0x20 } return true; 2dba8: 81 e0 ldi r24, 0x01 ; 1 2dbaa: d1 cf rjmp .-94 ; 0x2db4e 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);} 2dbac: fc 01 movw r30, r24 2dbae: 14 81 ldd r17, Z+4 ; 0x04 2dbb0: 11 50 subi r17, 0x01 ; 1 2dbb2: 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) { 2dbb4: 23 2b or r18, r19 2dbb6: 71 f4 brne .+28 ; 0x2dbd4 2dbb8: 11 11 cpse r17, r1 2dbba: 0c c0 rjmp .+24 ; 0x2dbd4 // start of new cluster if (curPosition_ == 0) { 2dbbc: 45 2b or r20, r21 2dbbe: 46 2b or r20, r22 2dbc0: 47 2b or r20, r23 2dbc2: 31 f5 brne .+76 ; 0x2dc10 // use first cluster in file curCluster_ = firstCluster_; 2dbc4: 8d 89 ldd r24, Y+21 ; 0x15 2dbc6: 9e 89 ldd r25, Y+22 ; 0x16 2dbc8: af 89 ldd r26, Y+23 ; 0x17 2dbca: b8 8d ldd r27, Y+24 ; 0x18 2dbcc: 8c 83 std Y+4, r24 ; 0x04 2dbce: 9d 83 std Y+5, r25 ; 0x05 2dbd0: ae 83 std Y+6, r26 ; 0x06 2dbd2: 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; 2dbd4: e9 8d ldd r30, Y+25 ; 0x19 2dbd6: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2dbd8: 8c 81 ldd r24, Y+4 ; 0x04 2dbda: 9d 81 ldd r25, Y+5 ; 0x05 2dbdc: ae 81 ldd r26, Y+6 ; 0x06 2dbde: bf 81 ldd r27, Y+7 ; 0x07 2dbe0: 02 97 sbiw r24, 0x02 ; 2 2dbe2: a1 09 sbc r26, r1 2dbe4: b1 09 sbc r27, r1 2dbe6: 25 85 ldd r18, Z+13 ; 0x0d 2dbe8: 04 c0 rjmp .+8 ; 0x2dbf2 2dbea: 88 0f add r24, r24 2dbec: 99 1f adc r25, r25 2dbee: aa 1f adc r26, r26 2dbf0: bb 1f adc r27, r27 2dbf2: 2a 95 dec r18 2dbf4: d2 f7 brpl .-12 ; 0x2dbea 2dbf6: 46 85 ldd r20, Z+14 ; 0x0e 2dbf8: 57 85 ldd r21, Z+15 ; 0x0f 2dbfa: 60 89 ldd r22, Z+16 ; 0x10 2dbfc: 71 89 ldd r23, Z+17 ; 0x11 2dbfe: 84 0f add r24, r20 2dc00: 95 1f adc r25, r21 2dc02: a6 1f adc r26, r22 2dc04: b7 1f adc r27, r23 2dc06: 81 0f add r24, r17 2dc08: 91 1d adc r25, r1 2dc0a: a1 1d adc r26, r1 2dc0c: b1 1d adc r27, r1 2dc0e: c8 cf rjmp .-112 ; 0x2dba0 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 2dc10: 4c 81 ldd r20, Y+4 ; 0x04 2dc12: 5d 81 ldd r21, Y+5 ; 0x05 2dc14: 6e 81 ldd r22, Y+6 ; 0x06 2dc16: 7f 81 ldd r23, Y+7 ; 0x07 2dc18: 9e 01 movw r18, r28 2dc1a: 2c 5f subi r18, 0xFC ; 252 2dc1c: 3f 4f sbci r19, 0xFF ; 255 2dc1e: 0f 94 ae 6c call 0x2d95c ; 0x2d95c 2dc22: 81 11 cpse r24, r1 2dc24: d7 cf rjmp .-82 ; 0x2dbd4 2dc26: 92 cf rjmp .-220 ; 0x2db4c 0002dc28 : * 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) { 2dc28: df 92 push r13 2dc2a: ef 92 push r14 2dc2c: ff 92 push r15 2dc2e: 0f 93 push r16 2dc30: 1f 93 push r17 2dc32: cf 93 push r28 2dc34: df 93 push r29 2dc36: 8c 01 movw r16, r24 2dc38: eb 01 movw r28, r22 2dc3a: 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; 2dc3c: 8d e0 ldi r24, 0x0D ; 13 2dc3e: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 2dc40: 40 e2 ldi r20, 0x20 ; 32 2dc42: 50 e0 ldi r21, 0x00 ; 0 2dc44: be 01 movw r22, r28 2dc46: c8 01 movw r24, r16 2dc48: 0f 94 55 a7 call 0x34eaa ; 0x34eaa if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 2dc4c: 80 32 cpi r24, 0x20 ; 32 2dc4e: 91 05 cpc r25, r1 2dc50: 71 f0 breq .+28 ; 0x2dc6e 2dc52: 21 e0 ldi r18, 0x01 ; 1 2dc54: 89 2b or r24, r25 2dc56: 09 f4 brne .+2 ; 0x2dc5a 2dc58: 20 e0 ldi r18, 0x00 ; 0 2dc5a: 82 2f mov r24, r18 2dc5c: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 2dc5e: df 91 pop r29 2dc60: cf 91 pop r28 2dc62: 1f 91 pop r17 2dc64: 0f 91 pop r16 2dc66: ff 90 pop r15 2dc68: ef 90 pop r14 2dc6a: df 90 pop r13 2dc6c: 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; 2dc6e: 28 81 ld r18, Y 2dc70: 22 23 and r18, r18 2dc72: 09 f4 brne .+2 ; 0x2dc76 2dc74: 3f c0 rjmp .+126 ; 0x2dcf4 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 2dc76: 25 3e cpi r18, 0xE5 ; 229 2dc78: 19 f3 breq .-58 ; 0x2dc40 2dc7a: 2e 32 cpi r18, 0x2E ; 46 2dc7c: 09 f3 breq .-62 ; 0x2dc40 //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) 2dc7e: 3b 85 ldd r19, Y+11 ; 0x0b 2dc80: 3f 73 andi r19, 0x3F ; 63 2dc82: 3f 30 cpi r19, 0x0F ; 15 2dc84: 99 f5 brne .+102 ; 0x2dcec 2dc86: e1 14 cp r14, r1 2dc88: f1 04 cpc r15, r1 2dc8a: 81 f1 breq .+96 ; 0x2dcec { 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) 2dc8c: 4a 8d ldd r20, Y+26 ; 0x1a 2dc8e: 5b 8d ldd r21, Y+27 ; 0x1b 2dc90: 45 2b or r20, r21 2dc92: 61 f5 brne .+88 ; 0x2dcec 2dc94: 2f 71 andi r18, 0x1F ; 31 2dc96: 3f ef ldi r19, 0xFF ; 255 2dc98: 32 0f add r19, r18 2dc9a: 34 30 cpi r19, 0x04 ; 4 2dc9c: 38 f5 brcc .+78 ; 0x2dcec { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 2dc9e: 21 50 subi r18, 0x01 ; 1 2dca0: 33 0b sbc r19, r19 2dca2: d2 9e mul r13, r18 2dca4: c0 01 movw r24, r0 2dca6: d3 9e mul r13, r19 2dca8: 90 0d add r25, r0 2dcaa: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 2dcac: f7 01 movw r30, r14 2dcae: e8 0f add r30, r24 2dcb0: f9 1f adc r31, r25 2dcb2: 29 81 ldd r18, Y+1 ; 0x01 2dcb4: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 2dcb6: 2b 81 ldd r18, Y+3 ; 0x03 2dcb8: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 2dcba: 2d 81 ldd r18, Y+5 ; 0x05 2dcbc: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 2dcbe: 2f 81 ldd r18, Y+7 ; 0x07 2dcc0: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 2dcc2: 29 85 ldd r18, Y+9 ; 0x09 2dcc4: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 2dcc6: 2e 85 ldd r18, Y+14 ; 0x0e 2dcc8: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 2dcca: 28 89 ldd r18, Y+16 ; 0x10 2dccc: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 2dcce: 2a 89 ldd r18, Y+18 ; 0x12 2dcd0: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 2dcd2: 2c 89 ldd r18, Y+20 ; 0x14 2dcd4: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 2dcd6: 2e 89 ldd r18, Y+22 ; 0x16 2dcd8: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 2dcda: 28 8d ldd r18, Y+24 ; 0x18 2dcdc: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 2dcde: 2c 8d ldd r18, Y+28 ; 0x1c 2dce0: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 2dce2: 2e 8d ldd r18, Y+30 ; 0x1e 2dce4: 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) 2dce6: 28 81 ld r18, Y 2dce8: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 2dcea: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 2dcec: 2b 85 ldd r18, Y+11 ; 0x0b 2dcee: 23 fd sbrc r18, 3 2dcf0: a7 cf rjmp .-178 ; 0x2dc40 2dcf2: b5 cf rjmp .-150 ; 0x2dc5e 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; 2dcf4: 80 e0 ldi r24, 0x00 ; 0 2dcf6: b3 cf rjmp .-154 ; 0x2dc5e 0002dcf8 : * \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() { 2dcf8: cf 93 push r28 2dcfa: df 93 push r29 2dcfc: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 2dcfe: 8b 81 ldd r24, Y+3 ; 0x03 2dd00: 88 23 and r24, r24 2dd02: 49 f1 breq .+82 ; 0x2dd56 if (flags_ & F_FILE_DIR_DIRTY) { 2dd04: 89 81 ldd r24, Y+1 ; 0x01 2dd06: 87 ff sbrs r24, 7 2dd08: 22 c0 rjmp .+68 ; 0x2dd4e dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 2dd0a: 61 e0 ldi r22, 0x01 ; 1 2dd0c: ce 01 movw r24, r28 2dd0e: 0f 94 7d a4 call 0x348fa ; 0x348fa 2dd12: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2dd14: 89 2b or r24, r25 2dd16: f9 f0 breq .+62 ; 0x2dd56 2dd18: 80 81 ld r24, Z 2dd1a: 85 3e cpi r24, 0xE5 ; 229 2dd1c: e1 f0 breq .+56 ; 0x2dd56 // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 2dd1e: 8b 81 ldd r24, Y+3 ; 0x03 2dd20: 82 30 cpi r24, 0x02 ; 2 2dd22: 40 f4 brcc .+16 ; 0x2dd34 2dd24: 89 89 ldd r24, Y+17 ; 0x11 2dd26: 9a 89 ldd r25, Y+18 ; 0x12 2dd28: ab 89 ldd r26, Y+19 ; 0x13 2dd2a: bc 89 ldd r27, Y+20 ; 0x14 2dd2c: 84 8f std Z+28, r24 ; 0x1c 2dd2e: 95 8f std Z+29, r25 ; 0x1d 2dd30: a6 8f std Z+30, r26 ; 0x1e 2dd32: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 2dd34: 8d 89 ldd r24, Y+21 ; 0x15 2dd36: 9e 89 ldd r25, Y+22 ; 0x16 2dd38: 93 8f std Z+27, r25 ; 0x1b 2dd3a: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 2dd3c: 8d 89 ldd r24, Y+21 ; 0x15 2dd3e: 9e 89 ldd r25, Y+22 ; 0x16 2dd40: af 89 ldd r26, Y+23 ; 0x17 2dd42: b8 8d ldd r27, Y+24 ; 0x18 2dd44: b5 8b std Z+21, r27 ; 0x15 2dd46: 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; 2dd48: 89 81 ldd r24, Y+1 ; 0x01 2dd4a: 8f 77 andi r24, 0x7F ; 127 2dd4c: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 2dd4e: df 91 pop r29 2dd50: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 2dd52: 0d 94 a0 6b jmp 0x2d740 ; 0x2d740 fail: writeError = true; 2dd56: 81 e0 ldi r24, 0x01 ; 1 2dd58: 88 83 st Y, r24 return false; } 2dd5a: 80 e0 ldi r24, 0x00 ; 0 2dd5c: df 91 pop r29 2dd5e: cf 91 pop r28 2dd60: 08 95 ret 0002dd62 : * \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) { 2dd62: 8f 92 push r8 2dd64: 9f 92 push r9 2dd66: af 92 push r10 2dd68: bf 92 push r11 2dd6a: cf 92 push r12 2dd6c: df 92 push r13 2dd6e: ef 92 push r14 2dd70: ff 92 push r15 2dd72: 0f 93 push r16 2dd74: 1f 93 push r17 2dd76: cf 93 push r28 2dd78: df 93 push r29 2dd7a: ec 01 movw r28, r24 2dd7c: 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; 2dd7e: 81 11 cpse r24, r1 2dd80: 0e c0 rjmp .+28 ; 0x2dd9e done: return true; fail: return false; 2dd82: 80 e0 ldi r24, 0x00 ; 0 } 2dd84: df 91 pop r29 2dd86: cf 91 pop r28 2dd88: 1f 91 pop r17 2dd8a: 0f 91 pop r16 2dd8c: ff 90 pop r15 2dd8e: ef 90 pop r14 2dd90: df 90 pop r13 2dd92: cf 90 pop r12 2dd94: bf 90 pop r11 2dd96: af 90 pop r10 2dd98: 9f 90 pop r9 2dd9a: 8f 90 pop r8 2dd9c: 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; 2dd9e: 09 89 ldd r16, Y+17 ; 0x11 2dda0: 1a 89 ldd r17, Y+18 ; 0x12 2dda2: 2b 89 ldd r18, Y+19 ; 0x13 2dda4: 3c 89 ldd r19, Y+20 ; 0x14 2dda6: 04 17 cp r16, r20 2dda8: 15 07 cpc r17, r21 2ddaa: 26 07 cpc r18, r22 2ddac: 37 07 cpc r19, r23 2ddae: 48 f3 brcs .-46 ; 0x2dd82 2ddb0: 4a 01 movw r8, r20 2ddb2: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 2ddb4: 82 30 cpi r24, 0x02 ; 2 2ddb6: 31 f4 brne .+12 ; 0x2ddc4 curPosition_ = pos; 2ddb8: 88 86 std Y+8, r8 ; 0x08 2ddba: 99 86 std Y+9, r9 ; 0x09 2ddbc: aa 86 std Y+10, r10 ; 0x0a 2ddbe: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2ddc0: 81 e0 ldi r24, 0x01 ; 1 2ddc2: e0 cf rjmp .-64 ; 0x2dd84 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 2ddc4: 81 14 cp r8, r1 2ddc6: 91 04 cpc r9, r1 2ddc8: a1 04 cpc r10, r1 2ddca: b1 04 cpc r11, r1 2ddcc: 49 f4 brne .+18 ; 0x2dde0 // set position to start of file curCluster_ = 0; 2ddce: 1c 82 std Y+4, r1 ; 0x04 2ddd0: 1d 82 std Y+5, r1 ; 0x05 2ddd2: 1e 82 std Y+6, r1 ; 0x06 2ddd4: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 2ddd6: 18 86 std Y+8, r1 ; 0x08 2ddd8: 19 86 std Y+9, r1 ; 0x09 2ddda: 1a 86 std Y+10, r1 ; 0x0a 2dddc: 1b 86 std Y+11, r1 ; 0x0b 2ddde: f0 cf rjmp .-32 ; 0x2ddc0 goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 2dde0: 08 85 ldd r16, Y+8 ; 0x08 2dde2: 19 85 ldd r17, Y+9 ; 0x09 2dde4: 2a 85 ldd r18, Y+10 ; 0x0a 2dde6: 3b 85 ldd r19, Y+11 ; 0x0b 2dde8: e9 8d ldd r30, Y+25 ; 0x19 2ddea: fa 8d ldd r31, Y+26 ; 0x1a 2ddec: 85 85 ldd r24, Z+13 ; 0x0d 2ddee: 90 e0 ldi r25, 0x00 ; 0 2ddf0: 09 96 adiw r24, 0x09 ; 9 2ddf2: b9 01 movw r22, r18 2ddf4: a8 01 movw r20, r16 2ddf6: 41 50 subi r20, 0x01 ; 1 2ddf8: 51 09 sbc r21, r1 2ddfa: 61 09 sbc r22, r1 2ddfc: 71 09 sbc r23, r1 2ddfe: 08 2e mov r0, r24 2de00: 04 c0 rjmp .+8 ; 0x2de0a 2de02: 76 95 lsr r23 2de04: 67 95 ror r22 2de06: 57 95 ror r21 2de08: 47 95 ror r20 2de0a: 0a 94 dec r0 2de0c: d2 f7 brpl .-12 ; 0x2de02 nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 2de0e: 75 01 movw r14, r10 2de10: 64 01 movw r12, r8 2de12: e1 e0 ldi r30, 0x01 ; 1 2de14: ce 1a sub r12, r30 2de16: d1 08 sbc r13, r1 2de18: e1 08 sbc r14, r1 2de1a: f1 08 sbc r15, r1 2de1c: 04 c0 rjmp .+8 ; 0x2de26 2de1e: f6 94 lsr r15 2de20: e7 94 ror r14 2de22: d7 94 ror r13 2de24: c7 94 ror r12 2de26: 8a 95 dec r24 2de28: d2 f7 brpl .-12 ; 0x2de1e if (nNew < nCur || curPosition_ == 0) { 2de2a: c4 16 cp r12, r20 2de2c: d5 06 cpc r13, r21 2de2e: e6 06 cpc r14, r22 2de30: f7 06 cpc r15, r23 2de32: 20 f0 brcs .+8 ; 0x2de3c 2de34: 01 2b or r16, r17 2de36: 02 2b or r16, r18 2de38: 03 2b or r16, r19 2de3a: 11 f5 brne .+68 ; 0x2de80 // must follow chain from first cluster curCluster_ = firstCluster_; 2de3c: 8d 89 ldd r24, Y+21 ; 0x15 2de3e: 9e 89 ldd r25, Y+22 ; 0x16 2de40: af 89 ldd r26, Y+23 ; 0x17 2de42: b8 8d ldd r27, Y+24 ; 0x18 2de44: 8c 83 std Y+4, r24 ; 0x04 2de46: 9d 83 std Y+5, r25 ; 0x05 2de48: ae 83 std Y+6, r26 ; 0x06 2de4a: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2de4c: 8e 01 movw r16, r28 2de4e: 0c 5f subi r16, 0xFC ; 252 2de50: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2de52: c1 14 cp r12, r1 2de54: d1 04 cpc r13, r1 2de56: e1 04 cpc r14, r1 2de58: f1 04 cpc r15, r1 2de5a: 09 f4 brne .+2 ; 0x2de5e 2de5c: ad cf rjmp .-166 ; 0x2ddb8 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2de5e: 4c 81 ldd r20, Y+4 ; 0x04 2de60: 5d 81 ldd r21, Y+5 ; 0x05 2de62: 6e 81 ldd r22, Y+6 ; 0x06 2de64: 7f 81 ldd r23, Y+7 ; 0x07 2de66: 98 01 movw r18, r16 2de68: 89 8d ldd r24, Y+25 ; 0x19 2de6a: 9a 8d ldd r25, Y+26 ; 0x1a 2de6c: 0f 94 ae 6c call 0x2d95c ; 0x2d95c 2de70: 91 e0 ldi r25, 0x01 ; 1 2de72: c9 1a sub r12, r25 2de74: d1 08 sbc r13, r1 2de76: e1 08 sbc r14, r1 2de78: f1 08 sbc r15, r1 2de7a: 81 11 cpse r24, r1 2de7c: ea cf rjmp .-44 ; 0x2de52 2de7e: 81 cf rjmp .-254 ; 0x2dd82 if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2de80: c4 1a sub r12, r20 2de82: d5 0a sbc r13, r21 2de84: e6 0a sbc r14, r22 2de86: f7 0a sbc r15, r23 2de88: e1 cf rjmp .-62 ; 0x2de4c 0002de8a : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 2de8a: 80 91 88 17 lds r24, 0x1788 ; 0x801788 2de8e: 88 23 and r24, r24 2de90: 61 f0 breq .+24 ; 0x2deaa 2de92: 0e 94 bc e4 call 0x1c978 ; 0x1c978 2de96: 88 23 and r24, r24 2de98: 41 f0 breq .+16 ; 0x2deaa lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 2de9a: 8c eb ldi r24, 0xBC ; 188 2de9c: 9e e3 ldi r25, 0x3E ; 62 2de9e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2dea2: 0f 94 0c 36 call 0x26c18 ; 0x26c18 lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 2dea6: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 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; 2deaa: 86 e0 ldi r24, 0x06 ; 6 2deac: 80 93 65 0e sts 0x0E65, r24 ; 0x800e65 2deb0: fa cf rjmp .-12 ; 0x2dea6 0002deb2 : 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() { 2deb2: cf 93 push r28 2deb4: df 93 push r29 if (MMU2::mmu2.Enabled()) { 2deb6: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2deba: 81 30 cpi r24, 0x01 ; 1 2debc: e9 f4 brne .+58 ; 0x2def8 const uint8_t filament = choose_menu_P( 2debe: 8c e0 ldi r24, 0x0C ; 12 2dec0: 9f e4 ldi r25, 0x4F ; 79 2dec2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2dec6: ec 01 movw r28, r24 2dec8: 8e e1 ldi r24, 0x1E ; 30 2deca: 9f e3 ldi r25, 0x3F ; 63 2decc: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 _T(MSG_SELECT_FILAMENT), MSG_FILAMENT,_T(MSG_CANCEL)); 2ded0: be 01 movw r22, r28 2ded2: 0e 94 ba d9 call 0x1b374 ; 0x1b374 if (filament < MMU_FILAMENT_COUNT) { 2ded6: 85 30 cpi r24, 0x05 ; 5 2ded8: a0 f5 brcc .+104 ; 0x2df42 lay1cal_filament = filament; 2deda: 80 93 f6 03 sts 0x03F6, r24 ; 0x8003f6 <_ZL16lay1cal_filament.lto_priv.456> return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 2dede: 8a e0 ldi r24, 0x0A ; 10 2dee0: 80 93 a7 03 sts 0x03A7, r24 ; 0x8003a7 menu_goto(lcd_generic_preheat_menu, 0, true); 2dee4: 20 e0 ldi r18, 0x00 ; 0 2dee6: 41 e0 ldi r20, 0x01 ; 1 2dee8: 70 e0 ldi r23, 0x00 ; 0 2deea: 60 e0 ldi r22, 0x00 ; 0 2deec: 86 e9 ldi r24, 0x96 ; 150 2deee: 9a e3 ldi r25, 0x3A ; 58 } 2def0: df 91 pop r29 2def2: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 2def4: 0d 94 3a cf jmp 0x39e74 ; 0x39e74 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 2def8: 8f e5 ldi r24, 0x5F ; 95 2defa: 9f e0 ldi r25, 0x0F ; 15 2defc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2df00: 81 11 cpse r24, r1 2df02: ed cf rjmp .-38 ; 0x2dede { bool loaded = false; if (fsensor.isReady()) { 2df04: 80 91 88 17 lds r24, 0x1788 ; 0x801788 2df08: 82 30 cpi r24, 0x02 ; 2 2df0a: f9 f4 brne .+62 ; 0x2df4a loaded = fsensor.getFilamentPresent(); 2df0c: 0e 94 bc e4 call 0x1c978 ; 0x1c978 2df10: 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) { 2df12: 91 11 cpse r25, r1 2df14: e4 cf rjmp .-56 ; 0x2dede lcd_display_message_fullscreen_P(_T(MSG_PLEASE_LOAD_PLA)); 2df16: 8e ee ldi r24, 0xEE ; 238 2df18: 9e e4 ldi r25, 0x4E ; 78 2df1a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2df1e: 0f 94 85 35 call 0x26b0a ; 0x26b0a lcd_consume_click(); 2df22: 0e 94 ad 71 call 0xe35a ; 0xe35a 2df26: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 2df28: 84 e6 ldi r24, 0x64 ; 100 2df2a: 90 e0 ldi r25, 0x00 ; 0 2df2c: 0e 94 87 8e call 0x11d0e ; 0x11d0e if (lcd_clicked()) { 2df30: 0e 94 b2 71 call 0xe364 ; 0xe364 2df34: 81 11 cpse r24, r1 2df36: 02 c0 rjmp .+4 ; 0x2df3c 2df38: 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 2df3a: b1 f7 brne .-20 ; 0x2df28 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 2df3c: 81 e0 ldi r24, 0x01 ; 1 2df3e: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 2df42: df 91 pop r29 2df44: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 2df46: 0d 94 d8 d1 jmp 0x3a3b0 ; 0x3a3b0 { 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); 2df4a: 87 e0 ldi r24, 0x07 ; 7 2df4c: 94 e5 ldi r25, 0x54 ; 84 2df4e: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2df52: 41 e0 ldi r20, 0x01 ; 1 2df54: 60 e0 ldi r22, 0x00 ; 0 2df56: 0f 94 e1 65 call 0x2cbc2 ; 0x2cbc2 2df5a: 91 e0 ldi r25, 0x01 ; 1 2df5c: 81 11 cpse r24, r1 2df5e: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 2df60: 81 e0 ldi r24, 0x01 ; 1 2df62: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 2df66: d5 cf rjmp .-86 ; 0x2df12 0002df68 : 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()") { 2df68: cf 93 push r28 2df6a: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 { //0: N/A; 1: OFF; 2: ON uint8_t pinda_state = STATE_NA; uint8_t idler_state = STATE_NA; pinda_state = READ(Z_MIN_PIN); 2df6e: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 2df70: 45 e2 ldi r20, 0x25 ; 37 2df72: 50 e7 ldi r21, 0x70 ; 112 2df74: 60 e0 ldi r22, 0x00 ; 0 2df76: 80 e0 ldi r24, 0x00 ; 0 2df78: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(LCD_WIDTH - 14, 0); 2df7c: 60 e0 ldi r22, 0x00 ; 0 2df7e: 86 e0 ldi r24, 0x06 ; 6 2df80: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print_state(pinda_state); 2df84: c4 fb bst r28, 4 2df86: 88 27 eor r24, r24 2df88: 80 f9 bld r24, 0 2df8a: 0f 94 41 27 call 0x24e82 ; 0x24e82 if (MMU2::mmu2.Enabled()) { 2df8e: 80 91 98 13 lds r24, 0x1398 ; 0x801398 2df92: 81 30 cpi r24, 0x01 ; 1 2df94: 99 f4 brne .+38 ; 0x2dfbc inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 2df96: c1 e0 ldi r28, 0x01 ; 1 2df98: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 2df9c: 81 11 cpse r24, r1 2df9e: 01 c0 rjmp .+2 ; 0x2dfa2 2dfa0: 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 2dfa2: 4f e1 ldi r20, 0x1F ; 31 2dfa4: 50 e7 ldi r21, 0x70 ; 112 2dfa6: 60 e0 ldi r22, 0x00 ; 0 2dfa8: 8a e0 ldi r24, 0x0A ; 10 2dfaa: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(LCD_WIDTH - 3, 0); 2dfae: 60 e0 ldi r22, 0x00 ; 0 2dfb0: 81 e1 ldi r24, 0x11 ; 17 2dfb2: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print_state(finda_state); 2dfb6: 8c 2f mov r24, r28 2dfb8: 0f 94 41 27 call 0x24e82 ; 0x24e82 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); 2dfbc: 0e 94 bc e4 call 0x1c978 ; 0x1c978 2dfc0: c8 2f mov r28, r24 lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 2dfc2: 88 ec ldi r24, 0xC8 ; 200 2dfc4: 9c e3 ldi r25, 0x3C ; 60 2dfc6: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2dfca: ac 01 movw r20, r24 2dfcc: 61 e0 ldi r22, 0x01 ; 1 2dfce: 80 e0 ldi r24, 0x00 ; 0 2dfd0: 0e 94 a9 6f call 0xdf52 ; 0xdf52 lcd_set_cursor(LCD_WIDTH - 3, 1); 2dfd4: 61 e0 ldi r22, 0x01 ; 1 2dfd6: 81 e1 ldi r24, 0x11 ; 17 2dfd8: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print_state(idler_state); 2dfdc: 8c 2f mov r24, r28 2dfde: 0f 94 41 27 call 0x24e82 ; 0x24e82 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(); } 2dfe2: 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(); 2dfe4: 0d 94 7a d2 jmp 0x3a4f4 ; 0x3a4f4 0002dfe8 : 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){ 2dfe8: 2f 92 push r2 2dfea: 3f 92 push r3 2dfec: 4f 92 push r4 2dfee: 5f 92 push r5 2dff0: 6f 92 push r6 2dff2: 7f 92 push r7 2dff4: 8f 92 push r8 2dff6: 9f 92 push r9 2dff8: af 92 push r10 2dffa: bf 92 push r11 2dffc: cf 92 push r12 2dffe: df 92 push r13 2e000: ef 92 push r14 2e002: ff 92 push r15 2e004: 0f 93 push r16 2e006: 1f 93 push r17 2e008: cf 93 push r28 2e00a: df 93 push r29 2e00c: 00 d0 rcall .+0 ; 0x2e00e 2e00e: 1f 92 push r1 2e010: 1f 92 push r1 2e012: cd b7 in r28, 0x3d ; 61 2e014: de b7 in r29, 0x3e ; 62 2e016: 1c 01 movw r2, r24 2e018: 2a 01 movw r4, r20 2e01a: 3b 01 movw r6, r22 2e01c: 00 e2 ldi r16, 0x20 ; 32 2e01e: 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){ 2e020: 19 82 std Y+1, r1 ; 0x01 2e022: 99 81 ldd r25, Y+1 ; 0x01 2e024: 89 2f mov r24, r25 2e026: 90 e0 ldi r25, 0x00 ; 0 2e028: 9b 83 std Y+3, r25 ; 0x03 2e02a: 8a 83 std Y+2, r24 ; 0x02 2e02c: 80 17 cp r24, r16 2e02e: 91 07 cpc r25, r17 2e030: 9c f5 brge .+102 ; 0x2e098 if (points[j] > points[j + 1]) 2e032: 88 0f add r24, r24 2e034: 99 1f adc r25, r25 2e036: 88 0f add r24, r24 2e038: 99 1f adc r25, r25 2e03a: 9d 83 std Y+5, r25 ; 0x05 2e03c: 8c 83 std Y+4, r24 ; 0x04 2e03e: 82 0d add r24, r2 2e040: 93 1d adc r25, r3 2e042: 9b 83 std Y+3, r25 ; 0x03 2e044: 8a 83 std Y+2, r24 ; 0x02 2e046: fc 01 movw r30, r24 2e048: c0 80 ld r12, Z 2e04a: d1 80 ldd r13, Z+1 ; 0x01 2e04c: e2 80 ldd r14, Z+2 ; 0x02 2e04e: f3 80 ldd r15, Z+3 ; 0x03 2e050: 8c 81 ldd r24, Y+4 ; 0x04 2e052: 9d 81 ldd r25, Y+5 ; 0x05 2e054: 04 96 adiw r24, 0x04 ; 4 2e056: 82 0d add r24, r2 2e058: 93 1d adc r25, r3 2e05a: 9d 83 std Y+5, r25 ; 0x05 2e05c: 8c 83 std Y+4, r24 ; 0x04 2e05e: fc 01 movw r30, r24 2e060: 80 80 ld r8, Z 2e062: 91 80 ldd r9, Z+1 ; 0x01 2e064: a2 80 ldd r10, Z+2 ; 0x02 2e066: b3 80 ldd r11, Z+3 ; 0x03 2e068: a5 01 movw r20, r10 2e06a: 94 01 movw r18, r8 2e06c: c7 01 movw r24, r14 2e06e: b6 01 movw r22, r12 2e070: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 2e074: 18 16 cp r1, r24 2e076: 64 f4 brge .+24 ; 0x2e090 SWAP(points[j], points[j + 1]); 2e078: ea 81 ldd r30, Y+2 ; 0x02 2e07a: fb 81 ldd r31, Y+3 ; 0x03 2e07c: 80 82 st Z, r8 2e07e: 91 82 std Z+1, r9 ; 0x01 2e080: a2 82 std Z+2, r10 ; 0x02 2e082: b3 82 std Z+3, r11 ; 0x03 2e084: ec 81 ldd r30, Y+4 ; 0x04 2e086: fd 81 ldd r31, Y+5 ; 0x05 2e088: c0 82 st Z, r12 2e08a: d1 82 std Z+1, r13 ; 0x01 2e08c: e2 82 std Z+2, r14 ; 0x02 2e08e: 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){ 2e090: f9 81 ldd r31, Y+1 ; 0x01 2e092: ff 5f subi r31, 0xFF ; 255 2e094: f9 83 std Y+1, r31 ; 0x01 2e096: c5 cf rjmp .-118 ; 0x2e022 2e098: 01 50 subi r16, 0x01 ; 1 2e09a: 11 09 sbc r17, r1 2e09c: 08 f6 brcc .-126 ; 0x2e020 /// 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]; 2e09e: f1 01 movw r30, r2 2e0a0: e0 5c subi r30, 0xC0 ; 192 2e0a2: 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); 2e0a4: 20 81 ld r18, Z 2e0a6: 31 81 ldd r19, Z+1 ; 0x01 2e0a8: 42 81 ldd r20, Z+2 ; 0x02 2e0aa: 53 81 ldd r21, Z+3 ; 0x03 2e0ac: c3 01 movw r24, r6 2e0ae: b2 01 movw r22, r4 2e0b0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 2e0b4: 6b 01 movw r12, r22 2e0b6: 7c 01 movw r14, r24 2e0b8: 20 e0 ldi r18, 0x00 ; 0 2e0ba: 30 e0 ldi r19, 0x00 ; 0 2e0bc: 40 e0 ldi r20, 0x00 ; 0 2e0be: 5f eb ldi r21, 0xBF ; 191 2e0c0: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 2e0c4: 87 fd sbrc r24, 7 2e0c6: 10 c0 rjmp .+32 ; 0x2e0e8 2e0c8: 20 e0 ldi r18, 0x00 ; 0 2e0ca: 30 e0 ldi r19, 0x00 ; 0 2e0cc: 40 e0 ldi r20, 0x00 ; 0 2e0ce: 5f e3 ldi r21, 0x3F ; 63 2e0d0: c7 01 movw r24, r14 2e0d2: b6 01 movw r22, r12 2e0d4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 2e0d8: 18 16 cp r1, r24 2e0da: 5c f4 brge .+22 ; 0x2e0f2 2e0dc: c1 2c mov r12, r1 2e0de: d1 2c mov r13, r1 2e0e0: e1 2c mov r14, r1 2e0e2: 8f e3 ldi r24, 0x3F ; 63 2e0e4: f8 2e mov r15, r24 2e0e6: 05 c0 rjmp .+10 ; 0x2e0f2 2e0e8: c1 2c mov r12, r1 2e0ea: d1 2c mov r13, r1 2e0ec: e1 2c mov r14, r1 2e0ee: 9f eb ldi r25, 0xBF ; 191 2e0f0: f9 2e mov r15, r25 } 2e0f2: c7 01 movw r24, r14 2e0f4: b6 01 movw r22, r12 2e0f6: 0f 90 pop r0 2e0f8: 0f 90 pop r0 2e0fa: 0f 90 pop r0 2e0fc: 0f 90 pop r0 2e0fe: 0f 90 pop r0 2e100: df 91 pop r29 2e102: cf 91 pop r28 2e104: 1f 91 pop r17 2e106: 0f 91 pop r16 2e108: ff 90 pop r15 2e10a: ef 90 pop r14 2e10c: df 90 pop r13 2e10e: cf 90 pop r12 2e110: bf 90 pop r11 2e112: af 90 pop r10 2e114: 9f 90 pop r9 2e116: 8f 90 pop r8 2e118: 7f 90 pop r7 2e11a: 6f 90 pop r6 2e11c: 5f 90 pop r5 2e11e: 4f 90 pop r4 2e120: 3f 90 pop r3 2e122: 2f 90 pop r2 2e124: 08 95 ret 0002e126 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2e126: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2e12a: 60 93 38 13 sts 0x1338, r22 ; 0x801338 2e12e: 70 93 39 13 sts 0x1339, r23 ; 0x801339 2e132: 80 93 3a 13 sts 0x133A, r24 ; 0x80133a 2e136: 90 93 3b 13 sts 0x133B, r25 ; 0x80133b } 2e13a: 08 95 ret 0002e13c : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2e13c: 80 91 7e 13 lds r24, 0x137E ; 0x80137e 2e140: 88 23 and r24, r24 2e142: 69 f0 breq .+26 ; 0x2e15e 2e144: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 2e148: 88 23 and r24, r24 2e14a: 49 f0 breq .+18 ; 0x2e15e SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2e14c: 89 e7 ldi r24, 0x79 ; 121 2e14e: 99 ea ldi r25, 0xA9 ; 169 2e150: 0e 94 06 7b call 0xf60c ; 0xf60c retryAttempts--; 2e154: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 2e158: 81 50 subi r24, 0x01 ; 1 2e15a: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d } } 2e15e: 08 95 ret 0002e160 : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2e160: 9f 92 push r9 2e162: af 92 push r10 2e164: bf 92 push r11 2e166: cf 92 push r12 2e168: df 92 push r13 2e16a: ef 92 push r14 2e16c: ff 92 push r15 2e16e: 0f 93 push r16 2e170: 1f 93 push r17 2e172: cf 93 push r28 2e174: df 93 push r29 2e176: cd b7 in r28, 0x3d ; 61 2e178: de b7 in r29, 0x3e ; 62 2e17a: e0 97 sbiw r28, 0x30 ; 48 2e17c: 0f b6 in r0, 0x3f ; 63 2e17e: f8 94 cli 2e180: de bf out 0x3e, r29 ; 62 2e182: 0f be out 0x3f, r0 ; 63 2e184: cd bf out 0x3d, r28 ; 61 2e186: 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()]; 2e188: e0 90 66 13 lds r14, 0x1366 ; 0x801366 2e18c: fe 01 movw r30, r28 2e18e: 31 96 adiw r30, 0x01 ; 1 2e190: 21 e0 ldi r18, 0x01 ; 1 2e192: 30 e0 ldi r19, 0x00 ; 0 2e194: 5f 01 movw r10, r30 2e196: f1 2c mov r15, r1 2e198: 40 e1 ldi r20, 0x10 ; 16 2e19a: c4 2e mov r12, r20 2e19c: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2e19e: 50 e2 ldi r21, 0x20 ; 32 2e1a0: 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()]; 2e1a2: c7 01 movw r24, r14 2e1a4: 82 1b sub r24, r18 2e1a6: 93 0b sbc r25, r19 2e1a8: b6 01 movw r22, r12 2e1aa: 0f 94 6e de call 0x3bcdc ; 0x3bcdc <__divmodhi4> 2e1ae: dc 01 movw r26, r24 2e1b0: bb 27 eor r27, r27 2e1b2: a7 5d subi r26, 0xD7 ; 215 2e1b4: bc 4e sbci r27, 0xEC ; 236 2e1b6: 9d 96 adiw r26, 0x2d ; 45 2e1b8: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2e1ba: 48 2f mov r20, r24 2e1bc: 50 e0 ldi r21, 0x00 ; 0 2e1be: 94 e0 ldi r25, 0x04 ; 4 2e1c0: 55 95 asr r21 2e1c2: 47 95 ror r20 2e1c4: 9a 95 dec r25 2e1c6: e1 f7 brne .-8 ; 0x2e1c0 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2e1c8: 96 ef ldi r25, 0xF6 ; 246 2e1ca: 94 0f add r25, r20 2e1cc: 96 30 cpi r25, 0x06 ; 6 2e1ce: a8 f1 brcs .+106 ; 0x2e23a case 5: case 6: case 7: case 8: case 9: return c + '0'; 2e1d0: 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); 2e1d2: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2e1d4: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2e1d6: 96 ef ldi r25, 0xF6 ; 246 2e1d8: 98 0f add r25, r24 2e1da: 96 30 cpi r25, 0x06 ; 6 2e1dc: 80 f1 brcs .+96 ; 0x2e23e case 5: case 6: case 7: case 8: case 9: return c + '0'; 2e1de: 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); 2e1e0: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2e1e2: 92 82 std Z+2, r9 ; 0x02 2e1e4: 2f 5f subi r18, 0xFF ; 255 2e1e6: 3f 4f sbci r19, 0xFF ; 255 2e1e8: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2e1ea: 21 31 cpi r18, 0x11 ; 17 2e1ec: 31 05 cpc r19, r1 2e1ee: c9 f6 brne .-78 ; 0x2e1a2 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 2e1f0: 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); 2e1f2: 82 ef ldi r24, 0xF2 ; 242 2e1f4: 99 ea ldi r25, 0xA9 ; 169 2e1f6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2e1fa: 8c ee ldi r24, 0xEC ; 236 2e1fc: 99 ea ldi r25, 0xA9 ; 169 2e1fe: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2e202: c8 01 movw r24, r16 2e204: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOPGM(", last bytes: "); 2e208: 84 ea ldi r24, 0xA4 ; 164 2e20a: 99 ea ldi r25, 0xA9 ; 169 2e20c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(lrb); 2e210: c5 01 movw r24, r10 2e212: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c } 2e216: e0 96 adiw r28, 0x30 ; 48 2e218: 0f b6 in r0, 0x3f ; 63 2e21a: f8 94 cli 2e21c: de bf out 0x3e, r29 ; 62 2e21e: 0f be out 0x3f, r0 ; 63 2e220: cd bf out 0x3d, r28 ; 61 2e222: df 91 pop r29 2e224: cf 91 pop r28 2e226: 1f 91 pop r17 2e228: 0f 91 pop r16 2e22a: ff 90 pop r15 2e22c: ef 90 pop r14 2e22e: df 90 pop r13 2e230: cf 90 pop r12 2e232: bf 90 pop r11 2e234: af 90 pop r10 2e236: 9f 90 pop r9 2e238: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2e23a: 49 5a subi r20, 0xA9 ; 169 2e23c: ca cf rjmp .-108 ; 0x2e1d2 2e23e: 89 5a subi r24, 0xA9 ; 169 2e240: cf cf rjmp .-98 ; 0x2e1e0 0002e242 : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2e242: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2e244: 90 91 3d 13 lds r25, 0x133D ; 0x80133d 2e248: 9a 30 cpi r25, 0x0A ; 10 2e24a: 11 f4 brne .+4 ; 0x2e250 cause = ss; 2e24c: 60 93 3c 13 sts 0x133C, r22 ; 0x80133c } --occurrences; 2e250: 91 50 subi r25, 0x01 ; 1 2e252: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { if (dataTO.Record(ss)) { 2e256: 91 11 cpse r25, r1 2e258: 0d c0 rjmp .+26 ; 0x2e274 2e25a: c9 01 movw r24, r18 LogError(msg_P); 2e25c: 0f 94 b0 70 call 0x2e160 ; 0x2e160 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2e260: 85 e9 ldi r24, 0x95 ; 149 2e262: 99 ea ldi r25, 0xA9 ; 169 2e264: 0e 94 06 7b call 0xf60c ; 0xf60c /// @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; } 2e268: 8a e0 ldi r24, 0x0A ; 10 2e26a: 80 93 3d 13 sts 0x133D, r24 ; 0x80133d 2e26e: 80 91 3c 13 lds r24, 0x133C ; 0x80133c 2e272: 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 2e274: 80 e0 ldi r24, 0x00 ; 0 } } 2e276: 08 95 ret 0002e278 : } *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) { 2e278: cf 93 push r28 2e27a: df 93 push r29 2e27c: cd b7 in r28, 0x3d ; 61 2e27e: de b7 in r29, 0x3e ; 62 2e280: 2e 97 sbiw r28, 0x0e ; 14 2e282: 0f b6 in r0, 0x3f ; 63 2e284: f8 94 cli 2e286: de bf out 0x3e, r29 ; 62 2e288: 0f be out 0x3f, r0 ; 63 2e28a: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2e28c: 2e e3 ldi r18, 0x3E ; 62 2e28e: 30 e0 ldi r19, 0x00 ; 0 2e290: 3a 83 std Y+2, r19 ; 0x02 2e292: 29 83 std Y+1, r18 ; 0x01 2e294: fe 01 movw r30, r28 2e296: 33 96 adiw r30, 0x03 ; 3 2e298: 2c e0 ldi r18, 0x0C ; 12 2e29a: df 01 movw r26, r30 2e29c: 1d 92 st X+, r1 2e29e: 2a 95 dec r18 2e2a0: e9 f7 brne .-6 ; 0x2e29c 2e2a2: de 01 movw r26, r28 2e2a4: 12 96 adiw r26, 0x02 ; 2 2e2a6: 48 2f mov r20, r24 2e2a8: fc 01 movw r30, r24 2e2aa: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2e2ac: 8e 2f mov r24, r30 2e2ae: 84 1b sub r24, r20 2e2b0: 86 17 cp r24, r22 2e2b2: 40 f4 brcc .+16 ; 0x2e2c4 uint8_t b = txbuff[i]; 2e2b4: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2e2b6: 90 ee ldi r25, 0xE0 ; 224 2e2b8: 98 0f add r25, r24 2e2ba: 90 36 cpi r25, 0x60 ; 96 2e2bc: 08 f0 brcs .+2 ; 0x2e2c0 b = '.'; 2e2be: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2e2c0: 8d 93 st X+, r24 2e2c2: f4 cf rjmp .-24 ; 0x2e2ac } tmp[size + 1] = 0; 2e2c4: f9 01 movw r30, r18 2e2c6: e6 0f add r30, r22 2e2c8: f1 1d adc r31, r1 2e2ca: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2e2cc: 4e e0 ldi r20, 0x0E ; 14 2e2ce: 50 e0 ldi r21, 0x00 ; 0 2e2d0: 68 ef ldi r22, 0xF8 ; 248 2e2d2: 79 ea ldi r23, 0xA9 ; 169 2e2d4: ce 01 movw r24, r28 2e2d6: 01 96 adiw r24, 0x01 ; 1 2e2d8: 0f 94 70 db call 0x3b6e0 ; 0x3b6e0 2e2dc: 89 2b or r24, r25 2e2de: 59 f4 brne .+22 ; 0x2e2f6 2e2e0: 4e e0 ldi r20, 0x0E ; 14 2e2e2: 50 e0 ldi r21, 0x00 ; 0 2e2e4: be 01 movw r22, r28 2e2e6: 6f 5f subi r22, 0xFF ; 255 2e2e8: 7f 4f sbci r23, 0xFF ; 255 2e2ea: 80 e8 ldi r24, 0x80 ; 128 2e2ec: 92 e1 ldi r25, 0x12 ; 18 2e2ee: 0f 94 03 e4 call 0x3c806 ; 0x3c806 2e2f2: 89 2b or r24, r25 2e2f4: 61 f0 breq .+24 ; 0x2e30e // 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); 2e2f6: 82 ef ldi r24, 0xF2 ; 242 2e2f8: 99 ea ldi r25, 0xA9 ; 169 2e2fa: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2e2fe: 8c ee ldi r24, 0xEC ; 236 2e300: 99 ea ldi r25, 0xA9 ; 169 2e302: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 2e306: ce 01 movw r24, r28 2e308: 01 96 adiw r24, 0x01 ; 1 2e30a: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c } strncpy(lastMsg, tmp, rqs); 2e30e: 4e e0 ldi r20, 0x0E ; 14 2e310: 50 e0 ldi r21, 0x00 ; 0 2e312: be 01 movw r22, r28 2e314: 6f 5f subi r22, 0xFF ; 255 2e316: 7f 4f sbci r23, 0xFF ; 255 2e318: 80 e8 ldi r24, 0x80 ; 128 2e31a: 92 e1 ldi r25, 0x12 ; 18 2e31c: 0f 94 11 e4 call 0x3c822 ; 0x3c822 } 2e320: 2e 96 adiw r28, 0x0e ; 14 2e322: 0f b6 in r0, 0x3f ; 63 2e324: f8 94 cli 2e326: de bf out 0x3e, r29 ; 62 2e328: 0f be out 0x3f, r0 ; 63 2e32a: cd bf out 0x3d, r28 ; 61 2e32c: df 91 pop r29 2e32e: cf 91 pop r28 2e330: 08 95 ret 0002e332 : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2e332: cf 92 push r12 2e334: df 92 push r13 2e336: ef 92 push r14 2e338: ff 92 push r15 2e33a: 1f 93 push r17 2e33c: cf 93 push r28 2e33e: df 93 push r29 2e340: cd b7 in r28, 0x3d ; 61 2e342: de b7 in r29, 0x3e ; 62 2e344: 62 97 sbiw r28, 0x12 ; 18 2e346: 0f b6 in r0, 0x3f ; 63 2e348: f8 94 cli 2e34a: de bf out 0x3e, r29 ; 62 2e34c: 0f be out 0x3f, r0 ; 63 2e34e: cd bf out 0x3d, r28 ; 61 2e350: 4e 87 std Y+14, r20 ; 0x0e 2e352: 5f 87 std Y+15, r21 ; 0x0f 2e354: 68 8b std Y+16, r22 ; 0x10 2e356: 79 8b std Y+17, r23 ; 0x11 2e358: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2e35a: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2e35c: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e35e: 51 11 cpse r21, r1 2e360: 31 c0 rjmp .+98 ; 0x2e3c4 *dst = '0'; 2e362: 80 e3 ldi r24, 0x30 ; 48 2e364: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e366: 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); 2e368: e1 e0 ldi r30, 0x01 ; 1 2e36a: e1 0f add r30, r17 2e36c: 81 e0 ldi r24, 0x01 ; 1 2e36e: 90 e0 ldi r25, 0x00 ; 0 2e370: 8c 0f add r24, r28 2e372: 9d 1f adc r25, r29 2e374: 8e 0f add r24, r30 2e376: 91 1d adc r25, r1 2e378: fc 01 movw r30, r24 2e37a: 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 2e37c: 9a e2 ldi r25, 0x2A ; 42 2e37e: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e380: 81 11 cpse r24, r1 2e382: 27 c0 rjmp .+78 ; 0x2e3d2 *dst = '0'; 2e384: 80 e3 ldi r24, 0x30 ; 48 2e386: 81 83 std Z+1, r24 ; 0x01 return 1; 2e388: 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); 2e38a: 1e 5f subi r17, 0xFE ; 254 2e38c: 18 0f add r17, r24 txbuff[i] = '\n'; 2e38e: e1 e0 ldi r30, 0x01 ; 1 2e390: f0 e0 ldi r31, 0x00 ; 0 2e392: ec 0f add r30, r28 2e394: fd 1f adc r31, r29 2e396: e1 0f add r30, r17 2e398: f1 1d adc r31, r1 2e39a: 8a e0 ldi r24, 0x0A ; 10 2e39c: 80 83 st Z, r24 ++i; 2e39e: 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); 2e3a0: fe 01 movw r30, r28 2e3a2: 31 96 adiw r30, 0x01 ; 1 2e3a4: 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--){ 2e3a6: 6f 01 movw r12, r30 2e3a8: c1 0e add r12, r17 2e3aa: d1 1c adc r13, r1 2e3ac: ec 14 cp r14, r12 2e3ae: fd 04 cpc r15, r13 2e3b0: b1 f0 breq .+44 ; 0x2e3de fputc(*buffer, uart2io); 2e3b2: f7 01 movw r30, r14 2e3b4: 81 91 ld r24, Z+ 2e3b6: 7f 01 movw r14, r30 2e3b8: 62 e7 ldi r22, 0x72 ; 114 2e3ba: 72 e1 ldi r23, 0x12 ; 18 2e3bc: 90 e0 ldi r25, 0x00 ; 0 2e3be: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 2e3c2: f4 cf rjmp .-24 ; 0x2e3ac 2e3c4: be 01 movw r22, r28 2e3c6: 6e 5f subi r22, 0xFE ; 254 2e3c8: 7f 4f sbci r23, 0xFF ; 255 2e3ca: 0f 94 bc c2 call 0x38578 ; 0x38578 2e3ce: 18 2f mov r17, r24 2e3d0: cb cf rjmp .-106 ; 0x2e368 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); 2e3d2: bf 01 movw r22, r30 2e3d4: 6f 5f subi r22, 0xFF ; 255 2e3d6: 7f 4f sbci r23, 0xFF ; 255 2e3d8: 0f 94 bc c2 call 0x38578 ; 0x38578 2e3dc: d6 cf rjmp .-84 ; 0x2e38a LogRequestMsg(txbuff, len); 2e3de: 61 2f mov r22, r17 2e3e0: ce 01 movw r24, r28 2e3e2: 01 96 adiw r24, 0x01 ; 1 2e3e4: 0f 94 3c 71 call 0x2e278 ; 0x2e278 RecordUARTActivity(); 2e3e8: 0f 94 93 70 call 0x2e126 ; 0x2e126 } 2e3ec: 62 96 adiw r28, 0x12 ; 18 2e3ee: 0f b6 in r0, 0x3f ; 63 2e3f0: f8 94 cli 2e3f2: de bf out 0x3e, r29 ; 62 2e3f4: 0f be out 0x3f, r0 ; 63 2e3f6: cd bf out 0x3d, r28 ; 61 2e3f8: df 91 pop r29 2e3fa: cf 91 pop r28 2e3fc: 1f 91 pop r17 2e3fe: ff 90 pop r15 2e400: ef 90 pop r14 2e402: df 90 pop r13 2e404: cf 90 pop r12 2e406: 08 95 ret 0002e408 : 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) { 2e408: 8f 92 push r8 2e40a: 9f 92 push r9 2e40c: af 92 push r10 2e40e: bf 92 push r11 2e410: df 92 push r13 2e412: ef 92 push r14 2e414: ff 92 push r15 2e416: 0f 93 push r16 2e418: 1f 93 push r17 2e41a: cf 93 push r28 2e41c: df 93 push r29 2e41e: cd b7 in r28, 0x3d ; 61 2e420: de b7 in r29, 0x3e ; 62 2e422: 67 97 sbiw r28, 0x17 ; 23 2e424: 0f b6 in r0, 0x3f ; 63 2e426: f8 94 cli 2e428: de bf out 0x3e, r29 ; 62 2e42a: 0f be out 0x3f, r0 ; 63 2e42c: cd bf out 0x3d, r28 ; 61 2e42e: 18 2f mov r17, r24 2e430: 7b 01 movw r14, r22 2e432: d4 2e mov r13, r20 2e434: 07 e5 ldi r16, 0x57 ; 87 2e436: 0b 8b std Y+19, r16 ; 0x13 2e438: 8c 8b std Y+20, r24 ; 0x14 2e43a: 7e 8b std Y+22, r23 ; 0x16 2e43c: 6d 8b std Y+21, r22 ; 0x15 2e43e: ce 01 movw r24, r28 2e440: 43 96 adiw r24, 0x13 ; 19 2e442: 0f 94 e8 c2 call 0x385d0 ; 0x385d0 2e446: 8f 8b std Y+23, r24 ; 0x17 2e448: 0e 87 std Y+14, r16 ; 0x0e 2e44a: 1f 87 std Y+15, r17 ; 0x0f 2e44c: f9 8a std Y+17, r15 ; 0x11 2e44e: e8 8a std Y+16, r14 ; 0x10 2e450: ce 01 movw r24, r28 2e452: 0e 96 adiw r24, 0x0e ; 14 2e454: 0f 94 e8 c2 call 0x385d0 ; 0x385d0 2e458: 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; 2e45a: 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) { 2e45c: 11 11 cpse r17, r1 2e45e: 27 c0 rjmp .+78 ; 0x2e4ae *dst = '0'; 2e460: 80 e3 ldi r24, 0x30 ; 48 2e462: 8a 83 std Y+2, r24 ; 0x02 return 1; 2e464: 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); 2e466: e1 e0 ldi r30, 0x01 ; 1 2e468: e8 0f add r30, r24 dst[i] = ' '; 2e46a: 21 e0 ldi r18, 0x01 ; 1 2e46c: 30 e0 ldi r19, 0x00 ; 0 2e46e: 2c 0f add r18, r28 2e470: 3d 1f adc r19, r29 2e472: 2e 0f add r18, r30 2e474: 31 1d adc r19, r1 2e476: f9 01 movw r30, r18 2e478: 90 e2 ldi r25, 0x20 ; 32 2e47a: 90 83 st Z, r25 return i + 1; 2e47c: 02 e0 ldi r16, 0x02 ; 2 2e47e: 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); 2e480: aa 24 eor r10, r10 2e482: a3 94 inc r10 2e484: b1 2c mov r11, r1 2e486: ac 0e add r10, r28 2e488: bd 1e adc r11, r29 2e48a: a0 0e add r10, r16 2e48c: 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) { 2e48e: e1 14 cp r14, r1 2e490: f1 04 cpc r15, r1 2e492: 39 f1 breq .+78 ; 0x2e4e2 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2e494: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2e496: c7 01 movw r24, r14 2e498: 88 27 eor r24, r24 2e49a: 90 7f andi r25, 0xF0 ; 240 2e49c: 89 2b or r24, r25 2e49e: 71 f4 brne .+28 ; 0x2e4bc value <<= 4U; 2e4a0: 24 e0 ldi r18, 0x04 ; 4 2e4a2: ee 0c add r14, r14 2e4a4: ff 1c adc r15, r15 2e4a6: 2a 95 dec r18 2e4a8: e1 f7 brne .-8 ; 0x2e4a2 --charsOut; 2e4aa: 11 50 subi r17, 0x01 ; 1 2e4ac: f4 cf rjmp .-24 ; 0x2e496 2e4ae: be 01 movw r22, r28 2e4b0: 6e 5f subi r22, 0xFE ; 254 2e4b2: 7f 4f sbci r23, 0xFF ; 255 2e4b4: 81 2f mov r24, r17 2e4b6: 0f 94 bc c2 call 0x38578 ; 0x38578 2e4ba: d5 cf rjmp .-86 ; 0x2e466 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2e4bc: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2e4be: 88 2d mov r24, r8 2e4c0: 8a 19 sub r24, r10 2e4c2: 81 17 cp r24, r17 2e4c4: 90 f4 brcc .+36 ; 0x2e4ea uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2e4c6: 8f 2d mov r24, r15 2e4c8: 82 95 swap r24 2e4ca: 8f 70 andi r24, 0x0F ; 15 2e4cc: 94 e0 ldi r25, 0x04 ; 4 2e4ce: ee 0c add r14, r14 2e4d0: ff 1c adc r15, r15 2e4d2: 9a 95 dec r25 2e4d4: e1 f7 brne .-8 ; 0x2e4ce 2e4d6: 0f 94 b2 c2 call 0x38564 ; 0x38564 2e4da: f4 01 movw r30, r8 2e4dc: 81 93 st Z+, r24 2e4de: 4f 01 movw r8, r30 2e4e0: ee cf rjmp .-36 ; 0x2e4be } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2e4e2: 80 e3 ldi r24, 0x30 ; 48 2e4e4: f5 01 movw r30, r10 2e4e6: 80 83 st Z, r24 return 1; 2e4e8: 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); 2e4ea: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2e4ec: e1 e0 ldi r30, 0x01 ; 1 2e4ee: f0 e0 ldi r31, 0x00 ; 0 2e4f0: ec 0f add r30, r28 2e4f2: fd 1f adc r31, r29 2e4f4: e1 0f add r30, r17 2e4f6: f1 1d adc r31, r1 2e4f8: 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 2e4fa: 9a e2 ldi r25, 0x2A ; 42 2e4fc: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2e4fe: 81 11 cpse r24, r1 2e500: 21 c0 rjmp .+66 ; 0x2e544 *dst = '0'; 2e502: 80 e3 ldi r24, 0x30 ; 48 2e504: 81 83 std Z+1, r24 ; 0x01 return 1; 2e506: 81 e0 ldi r24, 0x01 ; 1 2e508: 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); 2e50a: 18 0f add r17, r24 txbuff[i] = '\n'; 2e50c: e1 e0 ldi r30, 0x01 ; 1 2e50e: f0 e0 ldi r31, 0x00 ; 0 2e510: ec 0f add r30, r28 2e512: fd 1f adc r31, r29 2e514: e1 0f add r30, r17 2e516: f1 1d adc r31, r1 2e518: 8a e0 ldi r24, 0x0A ; 10 2e51a: 80 83 st Z, r24 ++i; 2e51c: 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); 2e51e: 9e 01 movw r18, r28 2e520: 2f 5f subi r18, 0xFF ; 255 2e522: 3f 4f sbci r19, 0xFF ; 255 2e524: 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--){ 2e526: 59 01 movw r10, r18 2e528: a1 0e add r10, r17 2e52a: b1 1c adc r11, r1 2e52c: ea 14 cp r14, r10 2e52e: fb 04 cpc r15, r11 2e530: 79 f0 breq .+30 ; 0x2e550 fputc(*buffer, uart2io); 2e532: f7 01 movw r30, r14 2e534: 81 91 ld r24, Z+ 2e536: 7f 01 movw r14, r30 2e538: 62 e7 ldi r22, 0x72 ; 114 2e53a: 72 e1 ldi r23, 0x12 ; 18 2e53c: 90 e0 ldi r25, 0x00 ; 0 2e53e: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 2e542: f4 cf rjmp .-24 ; 0x2e52c 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); 2e544: bf 01 movw r22, r30 2e546: 6f 5f subi r22, 0xFF ; 255 2e548: 7f 4f sbci r23, 0xFF ; 255 2e54a: 0f 94 bc c2 call 0x38578 ; 0x38578 2e54e: dc cf rjmp .-72 ; 0x2e508 LogRequestMsg(txbuff, len); 2e550: 61 2f mov r22, r17 2e552: ce 01 movw r24, r28 2e554: 01 96 adiw r24, 0x01 ; 1 2e556: 0f 94 3c 71 call 0x2e278 ; 0x2e278 RecordUARTActivity(); 2e55a: 0f 94 93 70 call 0x2e126 ; 0x2e126 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2e55e: d0 92 2c 13 sts 0x132C, r13 ; 0x80132c } 2e562: 67 96 adiw r28, 0x17 ; 23 2e564: 0f b6 in r0, 0x3f ; 63 2e566: f8 94 cli 2e568: de bf out 0x3e, r29 ; 62 2e56a: 0f be out 0x3f, r0 ; 63 2e56c: cd bf out 0x3d, r28 ; 61 2e56e: df 91 pop r29 2e570: cf 91 pop r28 2e572: 1f 91 pop r17 2e574: 0f 91 pop r16 2e576: ff 90 pop r15 2e578: ef 90 pop r14 2e57a: df 90 pop r13 2e57c: bf 90 pop r11 2e57e: af 90 pop r10 2e580: 9f 90 pop r9 2e582: 8f 90 pop r8 2e584: 08 95 ret 0002e586 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2e586: 20 91 77 13 lds r18, 0x1377 ; 0x801377 2e58a: 2f 5f subi r18, 0xFF ; 255 2e58c: 20 93 77 13 sts 0x1377, r18 ; 0x801377 if (regIndex >= initRegs8Count) { 2e590: 22 30 cpi r18, 0x02 ; 2 2e592: 78 f4 brcc .+30 ; 0x2e5b2 return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2e594: 30 e0 ldi r19, 0x00 ; 0 2e596: f9 01 movw r30, r18 2e598: ed 56 subi r30, 0x6D ; 109 2e59a: f6 45 sbci r31, 0x56 ; 86 2e59c: 84 91 lpm r24, Z 2e59e: 2b 58 subi r18, 0x8B ; 139 2e5a0: 3c 4e sbci r19, 0xEC ; 236 2e5a2: f9 01 movw r30, r18 2e5a4: 60 81 ld r22, Z 2e5a6: 70 e0 ldi r23, 0x00 ; 0 2e5a8: 49 e0 ldi r20, 0x09 ; 9 2e5aa: 0f 94 04 72 call 0x2e408 ; 0x2e408 } return false; 2e5ae: 80 e0 ldi r24, 0x00 ; 0 2e5b0: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2e5b2: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2e5b4: 08 95 ret 0002e5b6 : * \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) { 2e5b6: 8f 92 push r8 2e5b8: 9f 92 push r9 2e5ba: af 92 push r10 2e5bc: bf 92 push r11 2e5be: cf 92 push r12 2e5c0: df 92 push r13 2e5c2: ef 92 push r14 2e5c4: ff 92 push r15 2e5c6: cf 93 push r28 2e5c8: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2e5ca: 2b ed ldi r18, 0xDB ; 219 2e5cc: 36 e1 ldi r19, 0x16 ; 22 2e5ce: 30 93 79 0e sts 0x0E79, r19 ; 0x800e79 2e5d2: 20 93 78 0e sts 0x0E78, r18 ; 0x800e78 fatType_ = 0; 2e5d6: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 allocSearchStart_ = 2; 2e5da: 42 e0 ldi r20, 0x02 ; 2 2e5dc: 50 e0 ldi r21, 0x00 ; 0 2e5de: 60 e0 ldi r22, 0x00 ; 0 2e5e0: 70 e0 ldi r23, 0x00 ; 0 2e5e2: 40 93 e0 16 sts 0x16E0, r20 ; 0x8016e0 2e5e6: 50 93 e1 16 sts 0x16E1, r21 ; 0x8016e1 2e5ea: 60 93 e2 16 sts 0x16E2, r22 ; 0x8016e2 2e5ee: 70 93 e3 16 sts 0x16E3, r23 ; 0x8016e3 cacheDirty_ = 0; // cacheFlush() will write block if true 2e5f2: 10 92 77 0e sts 0x0E77, r1 ; 0x800e77 cacheMirrorBlock_ = 0; 2e5f6: 10 92 73 0e sts 0x0E73, r1 ; 0x800e73 2e5fa: 10 92 74 0e sts 0x0E74, r1 ; 0x800e74 2e5fe: 10 92 75 0e sts 0x0E75, r1 ; 0x800e75 2e602: 10 92 76 0e sts 0x0E76, r1 ; 0x800e76 cacheBlockNumber_ = 0XFFFFFFFF; 2e606: 4f ef ldi r20, 0xFF ; 255 2e608: 5f ef ldi r21, 0xFF ; 255 2e60a: ba 01 movw r22, r20 2e60c: 40 93 6f 0e sts 0x0E6F, r20 ; 0x800e6f 2e610: 50 93 70 0e sts 0x0E70, r21 ; 0x800e70 2e614: 60 93 71 0e sts 0x0E71, r22 ; 0x800e71 2e618: 70 93 72 0e sts 0x0E72, r23 ; 0x800e72 // if part == 0 assume super floppy with FAT boot sector in block zero // if part > 0 assume mbr volume with partition table if (part) { 2e61c: 88 23 and r24, r24 2e61e: 09 f4 brne .+2 ; 0x2e622 2e620: 70 c0 rjmp .+224 ; 0x2e702 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e622: 40 e0 ldi r20, 0x00 ; 0 2e624: 60 e0 ldi r22, 0x00 ; 0 2e626: 70 e0 ldi r23, 0x00 ; 0 2e628: cb 01 movw r24, r22 2e62a: 0f 94 df 6b call 0x2d7be ; 0x2d7be 2e62e: 81 11 cpse r24, r1 2e630: 0d c0 rjmp .+26 ; 0x2e64c fatType_ = 32; } return true; fail: return false; 2e632: c0 e0 ldi r28, 0x00 ; 0 } 2e634: 8c 2f mov r24, r28 2e636: df 91 pop r29 2e638: cf 91 pop r28 2e63a: ff 90 pop r15 2e63c: ef 90 pop r14 2e63e: df 90 pop r13 2e640: cf 90 pop r12 2e642: bf 90 pop r11 2e644: af 90 pop r10 2e646: 9f 90 pop r9 2e648: 8f 90 pop r8 2e64a: 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 || 2e64c: 80 91 39 10 lds r24, 0x1039 ; 0x801039 2e650: 8f 77 andi r24, 0x7F ; 127 2e652: 79 f7 brne .-34 ; 0x2e632 2e654: 80 91 45 10 lds r24, 0x1045 ; 0x801045 2e658: 90 91 46 10 lds r25, 0x1046 ; 0x801046 2e65c: a0 91 47 10 lds r26, 0x1047 ; 0x801047 2e660: b0 91 48 10 lds r27, 0x1048 ; 0x801048 2e664: 84 36 cpi r24, 0x64 ; 100 2e666: 91 05 cpc r25, r1 2e668: a1 05 cpc r26, r1 2e66a: b1 05 cpc r27, r1 2e66c: 10 f3 brcs .-60 ; 0x2e632 p->totalSectors < 100 || p->firstSector == 0) { 2e66e: c0 90 41 10 lds r12, 0x1041 ; 0x801041 2e672: d0 90 42 10 lds r13, 0x1042 ; 0x801042 2e676: e0 90 43 10 lds r14, 0x1043 ; 0x801043 2e67a: f0 90 44 10 lds r15, 0x1044 ; 0x801044 if (part) { if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; part_t* p = &cacheBuffer_.mbr.part[part-1]; if ((p->boot & 0X7F) !=0 || p->totalSectors < 100 || 2e67e: c1 14 cp r12, r1 2e680: d1 04 cpc r13, r1 2e682: e1 04 cpc r14, r1 2e684: f1 04 cpc r15, r1 2e686: a9 f2 breq .-86 ; 0x2e632 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2e688: 40 e0 ldi r20, 0x00 ; 0 2e68a: c7 01 movw r24, r14 2e68c: b6 01 movw r22, r12 2e68e: 0f 94 df 6b call 0x2d7be ; 0x2d7be 2e692: c8 2f mov r28, r24 2e694: 88 23 and r24, r24 2e696: 69 f2 breq .-102 ; 0x2e632 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e698: 80 91 86 0e lds r24, 0x0E86 ; 0x800e86 2e69c: 90 91 87 0e lds r25, 0x0E87 ; 0x800e87 2e6a0: 81 15 cp r24, r1 2e6a2: 92 40 sbci r25, 0x02 ; 2 2e6a4: 31 f6 brne .-116 ; 0x2e632 fbs->fatCount == 0 || 2e6a6: a0 91 8b 0e lds r26, 0x0E8B ; 0x800e8b } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2e6aa: aa 23 and r26, r26 2e6ac: 11 f2 breq .-124 ; 0x2e632 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e6ae: 60 91 89 0e lds r22, 0x0E89 ; 0x800e89 2e6b2: 70 91 8a 0e lds r23, 0x0E8A ; 0x800e8a volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || 2e6b6: 61 15 cp r22, r1 2e6b8: 71 05 cpc r23, r1 2e6ba: 09 f4 brne .+2 ; 0x2e6be 2e6bc: ba cf rjmp .-140 ; 0x2e632 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2e6be: 20 91 88 0e lds r18, 0x0E88 ; 0x800e88 } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2e6c2: 22 23 and r18, r18 2e6c4: 09 f4 brne .+2 ; 0x2e6c8 2e6c6: b5 cf rjmp .-150 ; 0x2e632 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2e6c8: a0 93 f2 16 sts 0x16F2, r26 ; 0x8016f2 blocksPerCluster_ = fbs->sectorsPerCluster; 2e6cc: 20 93 e4 16 sts 0x16E4, r18 ; 0x8016e4 // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2e6d0: 90 e0 ldi r25, 0x00 ; 0 2e6d2: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2e6d4: 30 e0 ldi r19, 0x00 ; 0 2e6d6: e1 e0 ldi r30, 0x01 ; 1 2e6d8: f0 e0 ldi r31, 0x00 ; 0 2e6da: d8 2f mov r29, r24 2e6dc: af 01 movw r20, r30 2e6de: 08 2e mov r0, r24 2e6e0: 02 c0 rjmp .+4 ; 0x2e6e6 2e6e2: 44 0f add r20, r20 2e6e4: 55 1f adc r21, r21 2e6e6: 0a 94 dec r0 2e6e8: e2 f7 brpl .-8 ; 0x2e6e2 2e6ea: 24 17 cp r18, r20 2e6ec: 35 07 cpc r19, r21 2e6ee: 69 f0 breq .+26 ; 0x2e70a 2e6f0: 41 e0 ldi r20, 0x01 ; 1 2e6f2: 48 0f add r20, r24 2e6f4: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2e6f6: 89 30 cpi r24, 0x09 ; 9 2e6f8: 91 05 cpc r25, r1 2e6fa: 79 f7 brne .-34 ; 0x2e6da 2e6fc: 40 93 ed 16 sts 0x16ED, r20 ; 0x8016ed 2e700: 98 cf rjmp .-208 ; 0x2e632 * 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; 2e702: c1 2c mov r12, r1 2e704: d1 2c mov r13, r1 2e706: 76 01 movw r14, r12 2e708: bf cf rjmp .-130 ; 0x2e688 2e70a: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed clusterSizeShift_ = 0; while (blocksPerCluster_ != (1 << clusterSizeShift_)) { // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; } blocksPerFat_ = fbs->sectorsPerFat16 ? 2e70e: 20 91 91 0e lds r18, 0x0E91 ; 0x800e91 2e712: 30 91 92 0e lds r19, 0x0E92 ; 0x800e92 2e716: 50 e0 ldi r21, 0x00 ; 0 2e718: 40 e0 ldi r20, 0x00 ; 0 2e71a: 21 15 cp r18, r1 2e71c: 31 05 cpc r19, r1 2e71e: 41 f4 brne .+16 ; 0x2e730 2e720: 20 91 9f 0e lds r18, 0x0E9F ; 0x800e9f 2e724: 30 91 a0 0e lds r19, 0x0EA0 ; 0x800ea0 2e728: 40 91 a1 0e lds r20, 0x0EA1 ; 0x800ea1 2e72c: 50 91 a2 0e lds r21, 0x0EA2 ; 0x800ea2 2e730: 20 93 e5 16 sts 0x16E5, r18 ; 0x8016e5 2e734: 30 93 e6 16 sts 0x16E6, r19 ; 0x8016e6 2e738: 40 93 e7 16 sts 0x16E7, r20 ; 0x8016e7 2e73c: 50 93 e8 16 sts 0x16E8, r21 ; 0x8016e8 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2e740: 46 01 movw r8, r12 2e742: 57 01 movw r10, r14 2e744: 86 0e add r8, r22 2e746: 97 1e adc r9, r23 2e748: a1 1c adc r10, r1 2e74a: b1 1c adc r11, r1 2e74c: 80 92 f3 16 sts 0x16F3, r8 ; 0x8016f3 2e750: 90 92 f4 16 sts 0x16F4, r9 ; 0x8016f4 2e754: a0 92 f5 16 sts 0x16F5, r10 ; 0x8016f5 2e758: b0 92 f6 16 sts 0x16F6, r11 ; 0x8016f6 // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2e75c: e0 91 8c 0e lds r30, 0x0E8C ; 0x800e8c 2e760: f0 91 8d 0e lds r31, 0x0E8D ; 0x800e8d 2e764: f0 93 f9 16 sts 0x16F9, r31 ; 0x8016f9 2e768: e0 93 f8 16 sts 0x16F8, r30 ; 0x8016f8 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2e76c: b0 e0 ldi r27, 0x00 ; 0 2e76e: 0f 94 26 de call 0x3bc4c ; 0x3bc4c <__muluhisi3> 2e772: dc 01 movw r26, r24 2e774: cb 01 movw r24, r22 2e776: 88 0d add r24, r8 2e778: 99 1d adc r25, r9 2e77a: aa 1d adc r26, r10 2e77c: bb 1d adc r27, r11 2e77e: 80 93 fa 16 sts 0x16FA, r24 ; 0x8016fa 2e782: 90 93 fb 16 sts 0x16FB, r25 ; 0x8016fb 2e786: a0 93 fc 16 sts 0x16FC, r26 ; 0x8016fc 2e78a: b0 93 fd 16 sts 0x16FD, r27 ; 0x8016fd // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2e78e: 25 e0 ldi r18, 0x05 ; 5 2e790: ee 0f add r30, r30 2e792: ff 1f adc r31, r31 2e794: 2a 95 dec r18 2e796: e1 f7 brne .-8 ; 0x2e790 2e798: e1 50 subi r30, 0x01 ; 1 2e79a: fe 4f sbci r31, 0xFE ; 254 2e79c: ef 2f mov r30, r31 2e79e: ff 27 eor r31, r31 2e7a0: e6 95 lsr r30 2e7a2: 8e 0f add r24, r30 2e7a4: 9f 1f adc r25, r31 2e7a6: a1 1d adc r26, r1 2e7a8: b1 1d adc r27, r1 2e7aa: 80 93 ee 16 sts 0x16EE, r24 ; 0x8016ee 2e7ae: 90 93 ef 16 sts 0x16EF, r25 ; 0x8016ef 2e7b2: a0 93 f0 16 sts 0x16F0, r26 ; 0x8016f0 2e7b6: b0 93 f1 16 sts 0x16F1, r27 ; 0x8016f1 // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2e7ba: 80 90 8e 0e lds r8, 0x0E8E ; 0x800e8e 2e7be: 90 90 8f 0e lds r9, 0x0E8F ; 0x800e8f 2e7c2: b1 2c mov r11, r1 2e7c4: a1 2c mov r10, r1 2e7c6: 81 14 cp r8, r1 2e7c8: 91 04 cpc r9, r1 2e7ca: 41 f4 brne .+16 ; 0x2e7dc 2e7cc: 80 90 9b 0e lds r8, 0x0E9B ; 0x800e9b 2e7d0: 90 90 9c 0e lds r9, 0x0E9C ; 0x800e9c 2e7d4: a0 90 9d 0e lds r10, 0x0E9D ; 0x800e9d 2e7d8: b0 90 9e 0e lds r11, 0x0E9E ; 0x800e9e fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2e7dc: c8 1a sub r12, r24 2e7de: d9 0a sbc r13, r25 2e7e0: ea 0a sbc r14, r26 2e7e2: fb 0a sbc r15, r27 2e7e4: c8 0c add r12, r8 2e7e6: d9 1c adc r13, r9 2e7e8: ea 1c adc r14, r10 2e7ea: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2e7ec: 04 c0 rjmp .+8 ; 0x2e7f6 2e7ee: f6 94 lsr r15 2e7f0: e7 94 ror r14 2e7f2: d7 94 ror r13 2e7f4: c7 94 ror r12 2e7f6: da 95 dec r29 2e7f8: d2 f7 brpl .-12 ; 0x2e7ee 2e7fa: c0 92 e9 16 sts 0x16E9, r12 ; 0x8016e9 2e7fe: d0 92 ea 16 sts 0x16EA, r13 ; 0x8016ea 2e802: e0 92 eb 16 sts 0x16EB, r14 ; 0x8016eb 2e806: f0 92 ec 16 sts 0x16EC, r15 ; 0x8016ec // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2e80a: 85 ef ldi r24, 0xF5 ; 245 2e80c: c8 16 cp r12, r24 2e80e: 8f e0 ldi r24, 0x0F ; 15 2e810: d8 06 cpc r13, r24 2e812: e1 04 cpc r14, r1 2e814: f1 04 cpc r15, r1 2e816: 20 f4 brcc .+8 ; 0x2e820 fatType_ = 12; 2e818: 8c e0 ldi r24, 0x0C ; 12 2e81a: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e81e: 09 cf rjmp .-494 ; 0x2e632 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2e820: 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) { 2e822: 25 ef ldi r18, 0xF5 ; 245 2e824: c2 16 cp r12, r18 2e826: 2f ef ldi r18, 0xFF ; 255 2e828: d2 06 cpc r13, r18 2e82a: e1 04 cpc r14, r1 2e82c: f1 04 cpc r15, r1 2e82e: 88 f0 brcs .+34 ; 0x2e852 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2e830: 80 91 a7 0e lds r24, 0x0EA7 ; 0x800ea7 2e834: 90 91 a8 0e lds r25, 0x0EA8 ; 0x800ea8 2e838: a0 91 a9 0e lds r26, 0x0EA9 ; 0x800ea9 2e83c: b0 91 aa 0e lds r27, 0x0EAA ; 0x800eaa 2e840: 80 93 fa 16 sts 0x16FA, r24 ; 0x8016fa 2e844: 90 93 fb 16 sts 0x16FB, r25 ; 0x8016fb 2e848: a0 93 fc 16 sts 0x16FC, r26 ; 0x8016fc 2e84c: b0 93 fd 16 sts 0x16FD, r27 ; 0x8016fd fatType_ = 32; 2e850: 80 e2 ldi r24, 0x20 ; 32 2e852: 80 93 f7 16 sts 0x16F7, r24 ; 0x8016f7 2e856: ee ce rjmp .-548 ; 0x2e634 0002e858 : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2e858: 20 e0 ldi r18, 0x00 ; 0 2e85a: 30 e0 ldi r19, 0x00 ; 0 2e85c: 40 ea ldi r20, 0xA0 ; 160 2e85e: 52 e4 ldi r21, 0x42 ; 66 2e860: 60 e0 ldi r22, 0x00 ; 0 2e862: 70 e0 ldi r23, 0x00 ; 0 2e864: 80 ea ldi r24, 0xA0 ; 160 2e866: 92 ec ldi r25, 0xC2 ; 194 2e868: 0d 94 30 c3 jmp 0x38660 ; 0x38660 0002e86c : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2e86c: 90 91 99 13 lds r25, 0x1399 ; 0x801399 2e870: 91 fd sbrc r25, 1 2e872: 17 c0 rjmp .+46 ; 0x2e8a2 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2e874: 88 23 and r24, r24 2e876: a9 f0 breq .+42 ; 0x2e8a2 2e878: 92 fd sbrc r25, 2 2e87a: 13 c0 rjmp .+38 ; 0x2e8a2 Disable_E0(); 2e87c: 0f 94 2e c3 call 0x3865c ; 0x3865c resume_hotend_temp = thermal_degTargetHotend(); 2e880: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 2e884: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 2e888: 90 93 8e 13 sts 0x138E, r25 ; 0x80138e 2e88c: 80 93 8d 13 sts 0x138D, r24 ; 0x80138d mmu_print_saved |= SavedState::CooldownPending; 2e890: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e894: 84 60 ori r24, 0x04 ; 4 2e896: 80 93 99 13 sts 0x1399, r24 ; 0x801399 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2e89a: 88 e7 ldi r24, 0x78 ; 120 2e89c: 96 ea ldi r25, 0xA6 ; 166 2e89e: 0d 94 54 c3 jmp 0x386a8 ; 0x386a8 } } 2e8a2: 08 95 ret 0002e8a4 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2e8a4: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e8a8: 80 ff sbrs r24, 0 2e8aa: 47 c0 rjmp .+142 ; 0x2e93a LogEchoEvent_P(PSTR("Resuming XYZ")); 2e8ac: 80 e9 ldi r24, 0x90 ; 144 2e8ae: 96 ea ldi r25, 0xA6 ; 166 2e8b0: 0f 94 54 c3 call 0x386a8 ; 0x386a8 // 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)); 2e8b4: 80 91 85 13 lds r24, 0x1385 ; 0x801385 2e8b8: 90 91 86 13 lds r25, 0x1386 ; 0x801386 2e8bc: a0 91 87 13 lds r26, 0x1387 ; 0x801387 2e8c0: b0 91 88 13 lds r27, 0x1388 ; 0x801388 pos3d planner_current_position() { return pos3d(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); } void motion_do_blocking_move_to_xy(float rx, float ry, float feedRate_mm_s) { current_position[X_AXIS] = rx; 2e8c4: 40 91 81 13 lds r20, 0x1381 ; 0x801381 2e8c8: 50 91 82 13 lds r21, 0x1382 ; 0x801382 2e8cc: 60 91 83 13 lds r22, 0x1383 ; 0x801383 2e8d0: 70 91 84 13 lds r23, 0x1384 ; 0x801384 2e8d4: 40 93 43 07 sts 0x0743, r20 ; 0x800743 2e8d8: 50 93 44 07 sts 0x0744, r21 ; 0x800744 2e8dc: 60 93 45 07 sts 0x0745, r22 ; 0x800745 2e8e0: 70 93 46 07 sts 0x0746, r23 ; 0x800746 current_position[Y_AXIS] = ry; 2e8e4: 80 93 47 07 sts 0x0747, r24 ; 0x800747 2e8e8: 90 93 48 07 sts 0x0748, r25 ; 0x800748 2e8ec: a0 93 49 07 sts 0x0749, r26 ; 0x800749 2e8f0: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a planner_line_to_current_position_sync(feedRate_mm_s); 2e8f4: 60 e0 ldi r22, 0x00 ; 0 2e8f6: 70 e0 ldi r23, 0x00 ; 0 2e8f8: 88 e4 ldi r24, 0x48 ; 72 2e8fa: 92 e4 ldi r25, 0x42 ; 66 2e8fc: 0f 94 50 c3 call 0x386a0 ; 0x386a0 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2e900: 80 91 89 13 lds r24, 0x1389 ; 0x801389 2e904: 90 91 8a 13 lds r25, 0x138A ; 0x80138a 2e908: a0 91 8b 13 lds r26, 0x138B ; 0x80138b 2e90c: b0 91 8c 13 lds r27, 0x138C ; 0x80138c 2e910: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 2e914: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 2e918: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 2e91c: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e planner_line_to_current_position_sync(feedRate_mm_s); 2e920: 60 e0 ldi r22, 0x00 ; 0 2e922: 70 e0 ldi r23, 0x00 ; 0 2e924: 80 e7 ldi r24, 0x70 ; 112 2e926: 91 e4 ldi r25, 0x41 ; 65 2e928: 0f 94 50 c3 call 0x386a0 ; 0x386a0 void clear_print_state_in_ram() { // Set flag to false in order to avoid using // the saved values during power panic isPartialBackupAvailable = false; 2e92c: 10 92 53 07 sts 0x0753, r1 ; 0x800753 // From this point forward, power panic should not use // the partial backup in RAM since the extruder is no // longer in parking position marlin_clear_print_state_in_ram(); mmu_print_saved &= ~(SavedState::ParkExtruder); 2e930: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e934: 8e 7f andi r24, 0xFE ; 254 2e936: 80 93 99 13 sts 0x1399, r24 ; 0x801399 } } 2e93a: 08 95 ret 0002e93c : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2e93c: 0f 93 push r16 2e93e: 1f 93 push r17 2e940: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2e942: 90 91 99 13 lds r25, 0x1399 ; 0x801399 2e946: 91 11 cpse r25, r1 2e948: 72 c0 rjmp .+228 ; 0x2ea2e 2e94a: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2e94c: 85 e6 ldi r24, 0x65 ; 101 2e94e: 96 ea ldi r25, 0xA6 ; 166 2e950: 0f 94 54 c3 call 0x386a8 ; 0x386a8 Disable_E0(); 2e954: 0f 94 2e c3 call 0x3865c ; 0x3865c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2e958: 0f 94 2c 59 call 0x2b258 ; 0x2b258 /// 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; 2e95c: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 2e960: 81 11 cpse r24, r1 2e962: 02 c0 rjmp .+4 ; 0x2e968 2e964: 0e 94 fe 64 call 0xc9fc ; 0xc9fc // 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) { 2e968: cc 23 and r28, r28 2e96a: 09 f4 brne .+2 ; 0x2e96e 2e96c: 60 c0 rjmp .+192 ; 0x2ea2e mmu_print_saved |= SavedState::ParkExtruder; 2e96e: 80 91 99 13 lds r24, 0x1399 ; 0x801399 2e972: 81 60 ori r24, 0x01 ; 1 2e974: 80 93 99 13 sts 0x1399, r24 ; 0x801399 void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; } pos3d planner_current_position() { return pos3d(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS]); 2e978: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 2e97c: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 2e980: a0 91 4d 07 lds r26, 0x074D ; 0x80074d 2e984: b0 91 4e 07 lds r27, 0x074E ; 0x80074e 2e988: 40 91 47 07 lds r20, 0x0747 ; 0x800747 2e98c: 50 91 48 07 lds r21, 0x0748 ; 0x800748 2e990: 60 91 49 07 lds r22, 0x0749 ; 0x800749 2e994: 70 91 4a 07 lds r23, 0x074A ; 0x80074a resume_position = planner_current_position(); // save current pos 2e998: 00 91 43 07 lds r16, 0x0743 ; 0x800743 2e99c: 10 91 44 07 lds r17, 0x0744 ; 0x800744 2e9a0: 20 91 45 07 lds r18, 0x0745 ; 0x800745 2e9a4: 30 91 46 07 lds r19, 0x0746 ; 0x800746 2e9a8: 00 93 81 13 sts 0x1381, r16 ; 0x801381 2e9ac: 10 93 82 13 sts 0x1382, r17 ; 0x801382 2e9b0: 20 93 83 13 sts 0x1383, r18 ; 0x801383 2e9b4: 30 93 84 13 sts 0x1384, r19 ; 0x801384 2e9b8: 40 93 85 13 sts 0x1385, r20 ; 0x801385 2e9bc: 50 93 86 13 sts 0x1386, r21 ; 0x801386 2e9c0: 60 93 87 13 sts 0x1387, r22 ; 0x801387 2e9c4: 70 93 88 13 sts 0x1388, r23 ; 0x801388 2e9c8: 80 93 89 13 sts 0x1389, r24 ; 0x801389 2e9cc: 90 93 8a 13 sts 0x138A, r25 ; 0x80138a 2e9d0: a0 93 8b 13 sts 0x138B, r26 ; 0x80138b 2e9d4: b0 93 8c 13 sts 0x138C, r27 ; 0x80138c current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } float move_raise_z(float delta) { return raise_z(delta); 2e9d8: 60 e0 ldi r22, 0x00 ; 0 2e9da: 70 e0 ldi r23, 0x00 ; 0 2e9dc: 80 ea ldi r24, 0xA0 ; 160 2e9de: 91 e4 ldi r25, 0x41 ; 65 2e9e0: 0e 94 96 6e call 0xdd2c ; 0xdd2c void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2e9e4: 80 91 40 07 lds r24, 0x0740 ; 0x800740 2e9e8: 88 23 and r24, r24 2e9ea: 09 f1 breq .+66 ; 0x2ea2e 2e9ec: 80 91 41 07 lds r24, 0x0741 ; 0x800741 2e9f0: 88 23 and r24, r24 2e9f2: e9 f0 breq .+58 ; 0x2ea2e 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; 2e9f4: 80 e0 ldi r24, 0x00 ; 0 2e9f6: 90 e0 ldi r25, 0x00 ; 0 2e9f8: aa ef ldi r26, 0xFA ; 250 2e9fa: b2 e4 ldi r27, 0x42 ; 66 2e9fc: 80 93 43 07 sts 0x0743, r24 ; 0x800743 2ea00: 90 93 44 07 sts 0x0744, r25 ; 0x800744 2ea04: a0 93 45 07 sts 0x0745, r26 ; 0x800745 2ea08: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2ea0c: 10 92 47 07 sts 0x0747, r1 ; 0x800747 2ea10: 10 92 48 07 sts 0x0748, r1 ; 0x800748 2ea14: 10 92 49 07 sts 0x0749, r1 ; 0x800749 2ea18: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2ea1c: 60 e0 ldi r22, 0x00 ; 0 2ea1e: 70 e0 ldi r23, 0x00 ; 0 2ea20: 88 e4 ldi r24, 0x48 ; 72 2ea22: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2ea24: cf 91 pop r28 2ea26: 1f 91 pop r17 2ea28: 0f 91 pop r16 2ea2a: 0d 94 50 c3 jmp 0x386a0 ; 0x386a0 2ea2e: cf 91 pop r28 2ea30: 1f 91 pop r17 2ea32: 0f 91 pop r16 2ea34: 08 95 ret 0002ea36 : 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){ 2ea36: ef 92 push r14 2ea38: ff 92 push r15 2ea3a: 0f 93 push r16 2ea3c: 1f 93 push r17 2ea3e: cf 93 push r28 2ea40: df 93 push r29 2ea42: 1f 92 push r1 2ea44: 1f 92 push r1 2ea46: cd b7 in r28, 0x3d ; 61 2ea48: de b7 in r29, 0x3e ; 62 2ea4a: f8 2e mov r15, r24 2ea4c: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2ea4e: 80 e1 ldi r24, 0x10 ; 16 2ea50: 97 e2 ldi r25, 0x27 ; 39 2ea52: 9a 83 std Y+2, r25 ; 0x02 2ea54: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2ea56: 8a 01 movw r16, r20 2ea58: 16 95 lsr r17 2ea5a: 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); 2ea5c: 8f 2d mov r24, r15 2ea5e: 0e 94 9b e1 call 0x1c336 ; 0x1c336 while (steps--){ 2ea62: 01 50 subi r16, 0x01 ; 1 2ea64: 11 09 sbc r17, r1 2ea66: 78 f0 brcs .+30 ; 0x2ea86 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2ea68: 28 ec ldi r18, 0xC8 ; 200 2ea6a: 30 e0 ldi r19, 0x00 ; 0 2ea6c: ae 01 movw r20, r28 2ea6e: 4f 5f subi r20, 0xFF ; 255 2ea70: 5f 4f sbci r21, 0xFF ; 255 2ea72: 68 ee ldi r22, 0xE8 ; 232 2ea74: 73 e0 ldi r23, 0x03 ; 3 2ea76: 8f 2d mov r24, r15 2ea78: 0e 94 6c e0 call 0x1c0d8 ; 0x1c0d8 update_position_1_step(axes, dir); 2ea7c: 6e 2d mov r22, r14 2ea7e: 8f 2d mov r24, r15 2ea80: 0e 94 b4 e1 call 0x1c368 ; 0x1c368 2ea84: ee cf rjmp .-36 ; 0x2ea62 } /// \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); 2ea86: 6e 2d mov r22, r14 2ea88: 8f 2d mov r24, r15 2ea8a: 0e 94 9b e1 call 0x1c336 ; 0x1c336 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); } 2ea8e: 0f 90 pop r0 2ea90: 0f 90 pop r0 2ea92: df 91 pop r29 2ea94: cf 91 pop r28 2ea96: 1f 91 pop r17 2ea98: 0f 91 pop r16 2ea9a: ff 90 pop r15 2ea9c: ef 90 pop r14 2ea9e: 08 95 ret 0002eaa0 : 2eaa0: ef 92 push r14 2eaa2: ff 92 push r15 2eaa4: 0f 93 push r16 2eaa6: 1f 93 push r17 2eaa8: cf 93 push r28 2eaaa: df 93 push r29 2eaac: cd b7 in r28, 0x3d ; 61 2eaae: de b7 in r29, 0x3e ; 62 2eab0: 2f 97 sbiw r28, 0x0f ; 15 2eab2: 0f b6 in r0, 0x3f ; 63 2eab4: f8 94 cli 2eab6: de bf out 0x3e, r29 ; 62 2eab8: 0f be out 0x3f, r0 ; 63 2eaba: cd bf out 0x3d, r28 ; 61 2eabc: ee e8 ldi r30, 0x8E ; 142 2eabe: f2 e1 ldi r31, 0x12 ; 18 2eac0: 10 a2 std Z+32, r1 ; 0x20 2eac2: 11 a2 std Z+33, r1 ; 0x21 2eac4: 12 a2 std Z+34, r1 ; 0x22 2eac6: 13 a2 std Z+35, r1 ; 0x23 2eac8: 14 a2 std Z+36, r1 ; 0x24 2eaca: 15 a2 std Z+37, r1 ; 0x25 2eacc: 16 a2 std Z+38, r1 ; 0x26 2eace: 17 a2 std Z+39, r1 ; 0x27 2ead0: 10 a6 std Z+40, r1 ; 0x28 2ead2: 11 a6 std Z+41, r1 ; 0x29 2ead4: 10 92 27 13 sts 0x1327, r1 ; 0x801327 2ead8: 09 e2 ldi r16, 0x29 ; 41 2eada: 13 e1 ldi r17, 0x13 ; 19 2eadc: ee 24 eor r14, r14 2eade: e3 94 inc r14 2eae0: f1 2c mov r15, r1 2eae2: d8 01 movw r26, r16 2eae4: 11 96 adiw r26, 0x01 ; 1 2eae6: fc 92 st X, r15 2eae8: ee 92 st -X, r14 2eaea: 12 96 adiw r26, 0x02 ; 2 2eaec: 1c 92 st X, r1 2eaee: 12 97 sbiw r26, 0x02 ; 2 2eaf0: 82 e8 ldi r24, 0x82 ; 130 2eaf2: 13 96 adiw r26, 0x03 ; 3 2eaf4: 8c 93 st X, r24 2eaf6: 40 e0 ldi r20, 0x00 ; 0 2eaf8: 60 e0 ldi r22, 0x00 ; 0 2eafa: 8e e2 ldi r24, 0x2E ; 46 2eafc: 93 e1 ldi r25, 0x13 ; 19 2eafe: 0f 94 0c c3 call 0x38618 ; 0x38618 2eb02: 40 e0 ldi r20, 0x00 ; 0 2eb04: 60 e0 ldi r22, 0x00 ; 0 2eb06: 83 e3 ldi r24, 0x33 ; 51 2eb08: 93 e1 ldi r25, 0x13 ; 19 2eb0a: 0f 94 0c c3 call 0x38618 ; 0x38618 2eb0e: f8 01 movw r30, r16 2eb10: 17 86 std Z+15, r1 ; 0x0f 2eb12: 10 8a std Z+16, r1 ; 0x10 2eb14: 11 8a std Z+17, r1 ; 0x11 2eb16: 12 8a std Z+18, r1 ; 0x12 2eb18: 13 8a std Z+19, r1 ; 0x13 2eb1a: 8a e0 ldi r24, 0x0A ; 10 2eb1c: 84 8b std Z+20, r24 ; 0x14 2eb1e: 40 e0 ldi r20, 0x00 ; 0 2eb20: 60 e0 ldi r22, 0x00 ; 0 2eb22: ce 01 movw r24, r28 2eb24: 01 96 adiw r24, 0x01 ; 1 2eb26: 0f 94 0c c3 call 0x38618 ; 0x38618 2eb2a: 85 e0 ldi r24, 0x05 ; 5 2eb2c: fe 01 movw r30, r28 2eb2e: 31 96 adiw r30, 0x01 ; 1 2eb30: de 01 movw r26, r28 2eb32: 16 96 adiw r26, 0x06 ; 6 2eb34: 01 90 ld r0, Z+ 2eb36: 0d 92 st X+, r0 2eb38: 8a 95 dec r24 2eb3a: e1 f7 brne .-8 ; 0x2eb34 2eb3c: 85 e0 ldi r24, 0x05 ; 5 2eb3e: fe 01 movw r30, r28 2eb40: 36 96 adiw r30, 0x06 ; 6 2eb42: ae e3 ldi r26, 0x3E ; 62 2eb44: b3 e1 ldi r27, 0x13 ; 19 2eb46: 01 90 ld r0, Z+ 2eb48: 0d 92 st X+, r0 2eb4a: 8a 95 dec r24 2eb4c: e1 f7 brne .-8 ; 0x2eb46 2eb4e: d8 01 movw r26, r16 2eb50: 5a 96 adiw r26, 0x1a ; 26 2eb52: 1c 92 st X, r1 2eb54: 5a 97 sbiw r26, 0x1a ; 26 2eb56: 5c 96 adiw r26, 0x1c ; 28 2eb58: 1c 92 st X, r1 2eb5a: 1e 92 st -X, r1 2eb5c: 5b 97 sbiw r26, 0x1b ; 27 2eb5e: 8e e3 ldi r24, 0x3E ; 62 2eb60: 93 e1 ldi r25, 0x13 ; 19 2eb62: 0f 94 fb c2 call 0x385f6 ; 0x385f6 2eb66: f8 01 movw r30, r16 2eb68: 81 8f std Z+25, r24 ; 0x19 2eb6a: 15 8e std Z+29, r1 ; 0x1d 2eb6c: 16 8e std Z+30, r1 ; 0x1e 2eb6e: 40 e0 ldi r20, 0x00 ; 0 2eb70: 60 e0 ldi r22, 0x00 ; 0 2eb72: 88 e4 ldi r24, 0x48 ; 72 2eb74: 93 e1 ldi r25, 0x13 ; 19 2eb76: 0f 94 0c c3 call 0x38618 ; 0x38618 2eb7a: d8 01 movw r26, r16 2eb7c: 94 96 adiw r26, 0x24 ; 36 2eb7e: 1c 92 st X, r1 2eb80: 40 e0 ldi r20, 0x00 ; 0 2eb82: 60 e0 ldi r22, 0x00 ; 0 2eb84: ce 01 movw r24, r28 2eb86: 0b 96 adiw r24, 0x0b ; 11 2eb88: 0f 94 0c c3 call 0x38618 ; 0x38618 2eb8c: 85 e0 ldi r24, 0x05 ; 5 2eb8e: fe 01 movw r30, r28 2eb90: 3b 96 adiw r30, 0x0b ; 11 2eb92: de 01 movw r26, r28 2eb94: 11 96 adiw r26, 0x01 ; 1 2eb96: 01 90 ld r0, Z+ 2eb98: 0d 92 st X+, r0 2eb9a: 8a 95 dec r24 2eb9c: e1 f7 brne .-8 ; 0x2eb96 2eb9e: 85 e0 ldi r24, 0x05 ; 5 2eba0: fe 01 movw r30, r28 2eba2: 31 96 adiw r30, 0x01 ; 1 2eba4: ae e4 ldi r26, 0x4E ; 78 2eba6: b3 e1 ldi r27, 0x13 ; 19 2eba8: 01 90 ld r0, Z+ 2ebaa: 0d 92 st X+, r0 2ebac: 8a 95 dec r24 2ebae: e1 f7 brne .-8 ; 0x2eba8 2ebb0: f8 01 movw r30, r16 2ebb2: 12 a6 std Z+42, r1 ; 0x2a 2ebb4: 14 a6 std Z+44, r1 ; 0x2c 2ebb6: 13 a6 std Z+43, r1 ; 0x2b 2ebb8: 8e e4 ldi r24, 0x4E ; 78 2ebba: 93 e1 ldi r25, 0x13 ; 19 2ebbc: 0f 94 fb c2 call 0x385f6 ; 0x385f6 2ebc0: d8 01 movw r26, r16 2ebc2: 99 96 adiw r26, 0x29 ; 41 2ebc4: 8c 93 st X, r24 2ebc6: 99 97 sbiw r26, 0x29 ; 41 2ebc8: dd 96 adiw r26, 0x3d ; 61 2ebca: 1c 92 st X, r1 2ebcc: dd 97 sbiw r26, 0x3d ; 61 2ebce: 88 e2 ldi r24, 0x28 ; 40 2ebd0: 93 e1 ldi r25, 0x13 ; 19 2ebd2: df 96 adiw r26, 0x3f ; 63 2ebd4: 9c 93 st X, r25 2ebd6: 8e 93 st -X, r24 2ebd8: de 97 sbiw r26, 0x3e ; 62 2ebda: f0 92 6a 13 sts 0x136A, r15 ; 0x80136a 2ebde: e0 92 69 13 sts 0x1369, r14 ; 0x801369 2ebe2: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b 2ebe6: 1f ef ldi r17, 0xFF ; 255 2ebe8: 10 93 6c 13 sts 0x136C, r17 ; 0x80136c 2ebec: 0f 94 64 c3 call 0x386c8 ; 0x386c8 2ebf0: 80 93 6d 13 sts 0x136D, r24 ; 0x80136d 2ebf4: 10 92 6e 13 sts 0x136E, r1 ; 0x80136e 2ebf8: 10 92 6f 13 sts 0x136F, r1 ; 0x80136f 2ebfc: 10 92 70 13 sts 0x1370, r1 ; 0x801370 2ec00: 10 92 72 13 sts 0x1372, r1 ; 0x801372 2ec04: 10 92 71 13 sts 0x1371, r1 ; 0x801371 2ec08: 10 92 74 13 sts 0x1374, r1 ; 0x801374 2ec0c: 10 92 73 13 sts 0x1373, r1 ; 0x801373 2ec10: 10 92 77 13 sts 0x1377, r1 ; 0x801377 2ec14: 10 92 78 13 sts 0x1378, r1 ; 0x801378 2ec18: 10 92 79 13 sts 0x1379, r1 ; 0x801379 2ec1c: 10 92 7a 13 sts 0x137A, r1 ; 0x80137a 2ec20: 83 e0 ldi r24, 0x03 ; 3 2ec22: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d 2ec26: 10 92 7e 13 sts 0x137E, r1 ; 0x80137e 2ec2a: 85 e0 ldi r24, 0x05 ; 5 2ec2c: 80 93 75 13 sts 0x1375, r24 ; 0x801375 2ec30: 84 e1 ldi r24, 0x14 ; 20 2ec32: 80 93 76 13 sts 0x1376, r24 ; 0x801376 2ec36: 83 e6 ldi r24, 0x63 ; 99 2ec38: 80 93 7f 13 sts 0x137F, r24 ; 0x80137f 2ec3c: 80 93 80 13 sts 0x1380, r24 ; 0x801380 2ec40: 10 92 81 13 sts 0x1381, r1 ; 0x801381 2ec44: 10 92 82 13 sts 0x1382, r1 ; 0x801382 2ec48: 10 92 83 13 sts 0x1383, r1 ; 0x801383 2ec4c: 10 92 84 13 sts 0x1384, r1 ; 0x801384 2ec50: 10 92 85 13 sts 0x1385, r1 ; 0x801385 2ec54: 10 92 86 13 sts 0x1386, r1 ; 0x801386 2ec58: 10 92 87 13 sts 0x1387, r1 ; 0x801387 2ec5c: 10 92 88 13 sts 0x1388, r1 ; 0x801388 2ec60: 10 92 89 13 sts 0x1389, r1 ; 0x801389 2ec64: 10 92 8a 13 sts 0x138A, r1 ; 0x80138a 2ec68: 10 92 8b 13 sts 0x138B, r1 ; 0x80138b 2ec6c: 10 92 8c 13 sts 0x138C, r1 ; 0x80138c 2ec70: 10 92 8e 13 sts 0x138E, r1 ; 0x80138e 2ec74: 10 92 8d 13 sts 0x138D, r1 ; 0x80138d 2ec78: 10 92 8f 13 sts 0x138F, r1 ; 0x80138f 2ec7c: 8e e2 ldi r24, 0x2E ; 46 2ec7e: 90 e8 ldi r25, 0x80 ; 128 2ec80: 90 93 91 13 sts 0x1391, r25 ; 0x801391 2ec84: 80 93 90 13 sts 0x1390, r24 ; 0x801390 2ec88: 10 93 92 13 sts 0x1392, r17 ; 0x801392 2ec8c: 10 93 93 13 sts 0x1393, r17 ; 0x801393 2ec90: 10 92 95 13 sts 0x1395, r1 ; 0x801395 2ec94: 10 92 94 13 sts 0x1394, r1 ; 0x801394 2ec98: 10 93 96 13 sts 0x1396, r17 ; 0x801396 2ec9c: 82 e0 ldi r24, 0x02 ; 2 2ec9e: 80 93 97 13 sts 0x1397, r24 ; 0x801397 2eca2: 10 92 98 13 sts 0x1398, r1 ; 0x801398 2eca6: 10 92 99 13 sts 0x1399, r1 ; 0x801399 2ecaa: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 2ecae: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 2ecb2: 10 92 9d 13 sts 0x139D, r1 ; 0x80139d 2ecb6: 10 92 9c 13 sts 0x139C, r1 ; 0x80139c 2ecba: 10 92 9f 13 sts 0x139F, r1 ; 0x80139f 2ecbe: 10 92 9e 13 sts 0x139E, r1 ; 0x80139e 2ecc2: 0f 94 1f 8c call 0x3183e ; 0x3183e 2ecc6: ec e6 ldi r30, 0x6C ; 108 2ecc8: f4 e1 ldi r31, 0x14 ; 20 2ecca: 10 92 f4 14 sts 0x14F4, r1 ; 0x8014f4 2ecce: 10 92 f7 14 sts 0x14F7, r1 ; 0x8014f7 2ecd2: 10 92 19 15 sts 0x1519, r1 ; 0x801519 2ecd6: 10 92 1c 15 sts 0x151C, r1 ; 0x80151c 2ecda: 89 e1 ldi r24, 0x19 ; 25 2ecdc: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 2ece0: 10 92 de 16 sts 0x16DE, r1 ; 0x8016de 2ece4: 10 92 df 16 sts 0x16DF, r1 ; 0x8016df 2ece8: 10 92 f7 16 sts 0x16F7, r1 ; 0x8016f7 2ecec: 10 92 fe 16 sts 0x16FE, r1 ; 0x8016fe 2ecf0: 10 92 01 17 sts 0x1701, r1 ; 0x801701 2ecf4: 10 92 7f 17 sts 0x177F, r1 ; 0x80177f 2ecf8: 10 92 81 17 sts 0x1781, r1 ; 0x801781 2ecfc: 10 92 80 17 sts 0x1780, r1 ; 0x801780 2ed00: 10 92 10 16 sts 0x1610, r1 ; 0x801610 2ed04: 10 92 0f 16 sts 0x160F, r1 ; 0x80160f 2ed08: 10 92 7b 17 sts 0x177B, r1 ; 0x80177b 2ed0c: 10 92 7c 17 sts 0x177C, r1 ; 0x80177c 2ed10: 10 92 7d 17 sts 0x177D, r1 ; 0x80177d 2ed14: 10 92 7e 17 sts 0x177E, r1 ; 0x80177e 2ed18: 10 92 82 17 sts 0x1782, r1 ; 0x801782 2ed1c: 10 92 83 17 sts 0x1783, r1 ; 0x801783 2ed20: 10 92 84 17 sts 0x1784, r1 ; 0x801784 2ed24: 10 92 85 17 sts 0x1785, r1 ; 0x801785 2ed28: 12 82 std Z+2, r1 ; 0x02 2ed2a: 13 82 std Z+3, r1 ; 0x03 2ed2c: 10 82 st Z, r1 2ed2e: 11 82 std Z+1, r1 ; 0x01 2ed30: 10 92 0e 16 sts 0x160E, r1 ; 0x80160e 2ed34: 10 92 21 17 sts 0x1721, r1 ; 0x801721 2ed38: ec e3 ldi r30, 0x3C ; 60 2ed3a: f5 e1 ldi r31, 0x15 ; 21 2ed3c: 82 ed ldi r24, 0xD2 ; 210 2ed3e: df 01 movw r26, r30 2ed40: 1d 92 st X+, r1 2ed42: 8a 95 dec r24 2ed44: e9 f7 brne .-6 ; 0x2ed40 2ed46: 10 92 bd 14 sts 0x14BD, r1 ; 0x8014bd 2ed4a: 10 92 bc 14 sts 0x14BC, r1 ; 0x8014bc 2ed4e: 10 92 bb 14 sts 0x14BB, r1 ; 0x8014bb 2ed52: 8f e7 ldi r24, 0x7F ; 127 2ed54: 97 e1 ldi r25, 0x17 ; 23 2ed56: 0f 94 ec 3f call 0x27fd8 ; 0x27fd8 ::start()> 2ed5a: e5 e6 ldi r30, 0x65 ; 101 2ed5c: f4 e1 ldi r31, 0x14 ; 20 2ed5e: 11 82 std Z+1, r1 ; 0x01 2ed60: 12 82 std Z+2, r1 ; 0x02 2ed62: 13 82 std Z+3, r1 ; 0x03 2ed64: 14 82 std Z+4, r1 ; 0x04 2ed66: 15 82 std Z+5, r1 ; 0x05 2ed68: 16 82 std Z+6, r1 ; 0x06 2ed6a: 10 83 st Z, r17 2ed6c: e8 e8 ldi r30, 0x88 ; 136 2ed6e: f7 e1 ldi r31, 0x17 ; 23 2ed70: 15 82 std Z+5, r1 ; 0x05 2ed72: 17 82 std Z+7, r1 ; 0x07 2ed74: 16 82 std Z+6, r1 ; 0x06 2ed76: 8a eb ldi r24, 0xBA ; 186 2ed78: 9c e4 ldi r25, 0x4C ; 76 2ed7a: 96 87 std Z+14, r25 ; 0x0e 2ed7c: 85 87 std Z+13, r24 ; 0x0d 2ed7e: 10 8a std Z+16, r1 ; 0x10 2ed80: 17 86 std Z+15, r1 ; 0x0f 2ed82: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2ed86: 60 93 9c 17 sts 0x179C, r22 ; 0x80179c 2ed8a: 70 93 9d 17 sts 0x179D, r23 ; 0x80179d 2ed8e: 80 93 9e 17 sts 0x179E, r24 ; 0x80179e 2ed92: 90 93 9f 17 sts 0x179F, r25 ; 0x80179f 2ed96: 2f 96 adiw r28, 0x0f ; 15 2ed98: 0f b6 in r0, 0x3f ; 63 2ed9a: f8 94 cli 2ed9c: de bf out 0x3e, r29 ; 62 2ed9e: 0f be out 0x3f, r0 ; 63 2eda0: cd bf out 0x3d, r28 ; 61 2eda2: df 91 pop r29 2eda4: cf 91 pop r28 2eda6: 1f 91 pop r17 2eda8: 0f 91 pop r16 2edaa: ff 90 pop r15 2edac: ef 90 pop r14 2edae: 08 95 ret 0002edb0 : 2edb0: 42 e0 ldi r20, 0x02 ; 2 2edb2: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2edb6: 0d 94 93 d6 jmp 0x3ad26 ; 0x3ad26 0002edba : 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; 2edba: 80 91 7f 13 lds r24, 0x137F ; 0x80137f 2edbe: 83 36 cpi r24, 0x63 ; 99 2edc0: 09 f4 brne .+2 ; 0x2edc4 2edc2: 8f ef ldi r24, 0xFF ; 255 } 2edc4: 08 95 ret 0002edc6 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2edc6: 9f b7 in r25, 0x3f ; 63 2edc8: f8 94 cli 2edca: e5 e0 ldi r30, 0x05 ; 5 2edcc: f1 e0 ldi r31, 0x01 ; 1 2edce: 80 81 ld r24, Z 2edd0: 80 64 ori r24, 0x40 ; 64 2edd2: 80 83 st Z, r24 2edd4: 9f bf out 0x3f, r25 ; 63 } 2edd6: 08 95 ret 0002edd8 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2edd8: 0f 93 push r16 2edda: 1f 93 push r17 2eddc: cf 93 push r28 2edde: df 93 push r29 2ede0: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2ede2: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2ede6: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2ede8: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 2edec: 8f 3f cpi r24, 0xFF ; 255 2edee: 69 f0 breq .+26 ; 0x2ee0a if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2edf0: 0f 94 8b 3f call 0x27f16 ; 0x27f16 2edf4: 60 1b sub r22, r16 2edf6: 71 0b sbc r23, r17 2edf8: 6c 17 cp r22, r28 2edfa: 7d 07 cpc r23, r29 2edfc: a8 f3 brcs .-22 ; 0x2ede8 } return true; fail: return false; 2edfe: 80 e0 ldi r24, 0x00 ; 0 } 2ee00: df 91 pop r29 2ee02: cf 91 pop r28 2ee04: 1f 91 pop r17 2ee06: 0f 91 pop r16 2ee08: 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; 2ee0a: 81 e0 ldi r24, 0x01 ; 1 2ee0c: f9 cf rjmp .-14 ; 0x2ee00 0002ee0e : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2ee0e: 80 e0 ldi r24, 0x00 ; 0 2ee10: 9a ea ldi r25, 0xAA ; 170 2ee12: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2ee16: 60 e0 ldi r22, 0x00 ; 0 2ee18: 8c ea ldi r24, 0xAC ; 172 2ee1a: 9c e0 ldi r25, 0x0C ; 12 2ee1c: 0e 94 94 77 call 0xef28 ; 0xef28 if (status == 1) { 2ee20: 81 30 cpi r24, 0x01 ; 1 2ee22: 21 f4 brne .+8 ; 0x2ee2c SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2ee24: 8a e4 ldi r24, 0x4A ; 74 2ee26: 9d e5 ldi r25, 0x5D ; 93 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2ee28: 0c 94 06 7b jmp 0xf60c ; 0xf60c 2ee2c: 84 e4 ldi r24, 0x44 ; 68 2ee2e: 9d e5 ldi r25, 0x5D ; 93 2ee30: fb cf rjmp .-10 ; 0x2ee28 0002ee32 : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2ee32: bc 01 movw r22, r24 2ee34: 99 0f add r25, r25 2ee36: 88 0b sbc r24, r24 2ee38: 99 0b sbc r25, r25 2ee3a: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2ee3e: 0d 94 93 d6 jmp 0x3ad26 ; 0x3ad26 0002ee42 : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2ee42: 0f 93 push r16 2ee44: 1f 93 push r17 2ee46: cf 93 push r28 2ee48: df 93 push r29 2ee4a: ec 01 movw r28, r24 2ee4c: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> 2ee50: 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) 2ee52: 80 36 cpi r24, 0x60 ; 96 2ee54: 91 05 cpc r25, r1 2ee56: 08 f0 brcs .+2 ; 0x2ee5a 2ee58: 85 c0 rjmp .+266 ; 0x2ef64 return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ee5a: 80 91 80 10 lds r24, 0x1080 ; 0x801080 2ee5e: 81 11 cpse r24, r1 2ee60: 05 c0 rjmp .+10 ; 0x2ee6c cmdqueue_pop_front(); 2ee62: 0e 94 47 78 call 0xf08e ; 0xf08e cmdbuffer_front_already_processed = true; 2ee66: 81 e0 ldi r24, 0x01 ; 1 2ee68: 80 93 80 10 sts 0x1080, r24 ; 0x801080 } if (bufindr == bufindw && buflen > 0) 2ee6c: 40 91 70 12 lds r20, 0x1270 ; 0x801270 2ee70: 50 91 71 12 lds r21, 0x1271 ; 0x801271 2ee74: 80 91 7e 10 lds r24, 0x107E ; 0x80107e <_ZL7bufindw.lto_priv.571> 2ee78: 90 91 7f 10 lds r25, 0x107F ; 0x80107f <_ZL7bufindw.lto_priv.571+0x1> 2ee7c: 48 17 cp r20, r24 2ee7e: 59 07 cpc r21, r25 2ee80: 41 f4 brne .+16 ; 0x2ee92 2ee82: 20 91 81 10 lds r18, 0x1081 ; 0x801081 2ee86: 30 91 82 10 lds r19, 0x1082 ; 0x801082 2ee8a: 12 16 cp r1, r18 2ee8c: 13 06 cpc r1, r19 2ee8e: 0c f4 brge .+2 ; 0x2ee92 2ee90: 69 c0 rjmp .+210 ; 0x2ef64 // 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; 2ee92: 20 91 7c 10 lds r18, 0x107C ; 0x80107c 2ee96: 30 91 7d 10 lds r19, 0x107D ; 0x80107d 2ee9a: 12 16 cp r1, r18 2ee9c: 13 06 cpc r1, r19 2ee9e: 0c f0 brlt .+2 ; 0x2eea2 2eea0: 41 c0 rjmp .+130 ; 0x2ef24 2eea2: 9c 01 movw r18, r24 2eea4: 2f 59 subi r18, 0x9F ; 159 2eea6: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2eea8: 84 17 cp r24, r20 2eeaa: 95 07 cpc r25, r21 2eeac: e8 f5 brcc .+122 ; 0x2ef28 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2eeae: 44 50 subi r20, 0x04 ; 4 2eeb0: 51 09 sbc r21, r1 2eeb2: 40 1b sub r20, r16 2eeb4: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2eeb6: 42 17 cp r20, r18 2eeb8: 53 07 cpc r21, r19 2eeba: 0c f4 brge .+2 ; 0x2eebe 2eebc: 53 c0 rjmp .+166 ; 0x2ef64 } } 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); 2eebe: 50 93 71 12 sts 0x1271, r21 ; 0x801271 2eec2: 40 93 70 12 sts 0x1270, r20 ; 0x801270 void enquecommand_front(const char *cmd, bool from_progmem) { size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); // Does cmd fit the queue? This call shall move bufindr, so the command may be copied. if (cmdqueue_could_enqueue_front(len)) { cmdbuffer[bufindr] = CMDBUFFER_CURRENT_TYPE_UI; 2eec6: 80 91 70 12 lds r24, 0x1270 ; 0x801270 2eeca: 90 91 71 12 lds r25, 0x1271 ; 0x801271 2eece: fc 01 movw r30, r24 2eed0: ed 57 subi r30, 0x7D ; 125 2eed2: ff 4e sbci r31, 0xEF ; 239 2eed4: 23 e0 ldi r18, 0x03 ; 3 2eed6: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2eed8: be 01 movw r22, r28 2eeda: 8a 57 subi r24, 0x7A ; 122 2eedc: 9f 4e sbci r25, 0xEF ; 239 2eede: 0f 94 48 db call 0x3b690 ; 0x3b690 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2eee2: 80 91 81 10 lds r24, 0x1081 ; 0x801081 2eee6: 90 91 82 10 lds r25, 0x1082 ; 0x801082 2eeea: 01 96 adiw r24, 0x01 ; 1 2eeec: 90 93 82 10 sts 0x1082, r25 ; 0x801082 2eef0: 80 93 81 10 sts 0x1081, r24 ; 0x801081 SERIAL_ECHO_START; 2eef4: 82 ef ldi r24, 0xF2 ; 242 2eef6: 99 ea ldi r25, 0xA9 ; 169 2eef8: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(enqueingFront); 2eefc: 83 ed ldi r24, 0xD3 ; 211 2eefe: 99 ea ldi r25, 0xA9 ; 169 2ef00: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ef04: 80 91 70 12 lds r24, 0x1270 ; 0x801270 2ef08: 90 91 71 12 lds r25, 0x1271 ; 0x801271 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 2ef0c: 8a 57 subi r24, 0x7A ; 122 2ef0e: 9f 4e sbci r25, 0xEF ; 239 2ef10: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_ECHOLNPGM("\""); 2ef14: 81 ed ldi r24, 0xD1 ; 209 2ef16: 99 ea ldi r25, 0xA9 ; 169 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2ef18: df 91 pop r29 2ef1a: cf 91 pop r28 2ef1c: 1f 91 pop r17 2ef1e: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ef20: 0c 94 06 7b jmp 0xf60c ; 0xf60c // 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) 2ef24: 9c 01 movw r18, r24 2ef26: c0 cf rjmp .-128 ; 0x2eea8 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2ef28: c8 01 movw r24, r16 2ef2a: 04 96 adiw r24, 0x04 ; 4 2ef2c: 48 17 cp r20, r24 2ef2e: 59 07 cpc r21, r25 2ef30: 28 f0 brcs .+10 ; 0x2ef3c // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2ef32: 44 50 subi r20, 0x04 ; 4 2ef34: 51 09 sbc r21, r1 2ef36: 40 1b sub r20, r16 2ef38: 51 0b sbc r21, r17 2ef3a: c1 cf rjmp .-126 ; 0x2eebe return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2ef3c: 89 ee ldi r24, 0xE9 ; 233 2ef3e: 91 e0 ldi r25, 0x01 ; 1 2ef40: bc 01 movw r22, r24 2ef42: 60 1b sub r22, r16 2ef44: 71 0b sbc r23, r17 2ef46: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2ef48: 62 17 cp r22, r18 2ef4a: 73 07 cpc r23, r19 2ef4c: 5c f0 brlt .+22 ; 0x2ef64 memset(cmdbuffer, 0, bufindr); 2ef4e: 70 e0 ldi r23, 0x00 ; 0 2ef50: 60 e0 ldi r22, 0x00 ; 0 2ef52: 83 e8 ldi r24, 0x83 ; 131 2ef54: 90 e1 ldi r25, 0x10 ; 16 2ef56: 0f 94 c3 e3 call 0x3c786 ; 0x3c786 bufindr = bufindr_new; 2ef5a: 10 93 71 12 sts 0x1271, r17 ; 0x801271 2ef5e: 00 93 70 12 sts 0x1270, r16 ; 0x801270 2ef62: b1 cf rjmp .-158 ; 0x2eec6 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2ef64: 8a ec ldi r24, 0xCA ; 202 2ef66: 99 ea ldi r25, 0xA9 ; 169 2ef68: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(enqueingFront); 2ef6c: 83 ed ldi r24, 0xD3 ; 211 2ef6e: 99 ea ldi r25, 0xA9 ; 169 2ef70: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2ef74: ce 01 movw r24, r28 2ef76: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2ef7a: 83 eb ldi r24, 0xB3 ; 179 2ef7c: 99 ea ldi r25, 0xA9 ; 169 2ef7e: cc cf rjmp .-104 ; 0x2ef18 0002ef80 : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2ef80: ab 01 movw r20, r22 2ef82: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2ef84: 8e ef ldi r24, 0xFE ; 254 2ef86: 96 e1 ldi r25, 0x16 ; 22 2ef88: 0f 94 b1 6e call 0x2dd62 ; 0x2dd62 2ef8c: 81 11 cpse r24, r1 2ef8e: 02 c0 rjmp .+4 ; 0x2ef94 2ef90: 80 e0 ldi r24, 0x00 ; 0 2ef92: 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() ) 2ef94: 8e ef ldi r24, 0xFE ; 254 2ef96: 96 e1 ldi r25, 0x16 ; 22 2ef98: 0f 94 9b 6d call 0x2db36 ; 0x2db36 2ef9c: 88 23 and r24, r24 2ef9e: c1 f3 breq .-16 ; 0x2ef90 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; 2efa0: 20 91 1f 17 lds r18, 0x171F ; 0x80171f 2efa4: 30 91 20 17 lds r19, 0x1720 ; 0x801720 2efa8: 25 58 subi r18, 0x85 ; 133 2efaa: 31 4f sbci r19, 0xF1 ; 241 2efac: 30 93 1a 17 sts 0x171A, r19 ; 0x80171a 2efb0: 20 93 19 17 sts 0x1719, r18 ; 0x801719 bool SdFile::seekSetFilteredGcode(uint32_t pos){ if(! seekSet(pos) )return false; if(! gfComputeNextFileBlock() )return false; gfReset(); return true; } 2efb4: 08 95 ret 0002efb6 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2efb6: 8f 92 push r8 2efb8: 9f 92 push r9 2efba: af 92 push r10 2efbc: bf 92 push r11 2efbe: cf 92 push r12 2efc0: df 92 push r13 2efc2: ef 92 push r14 2efc4: ff 92 push r15 2efc6: 0f 93 push r16 2efc8: 1f 93 push r17 2efca: cf 93 push r28 2efcc: df 93 push r29 2efce: cd b7 in r28, 0x3d ; 61 2efd0: de b7 in r29, 0x3e ; 62 2efd2: ee 97 sbiw r28, 0x3e ; 62 2efd4: 0f b6 in r0, 0x3f ; 63 2efd6: f8 94 cli 2efd8: de bf out 0x3e, r29 ; 62 2efda: 0f be out 0x3f, r0 ; 63 2efdc: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2efde: 80 91 bc 14 lds r24, 0x14BC ; 0x8014bc 2efe2: 8f 93 push r24 2efe4: 80 91 bb 14 lds r24, 0x14BB ; 0x8014bb 2efe8: 8f 93 push r24 2efea: 8e e6 ldi r24, 0x6E ; 110 2efec: 99 ea ldi r25, 0xA9 ; 169 2efee: 9f 93 push r25 2eff0: 8f 93 push r24 2eff2: 8e 01 movw r16, r28 2eff4: 0f 5d subi r16, 0xDF ; 223 2eff6: 1f 4f sbci r17, 0xFF ; 255 2eff8: 1f 93 push r17 2effa: 0f 93 push r16 2effc: 0f 94 a8 dc call 0x3b950 ; 0x3b950 2f000: 0f 90 pop r0 2f002: 0f 90 pop r0 2f004: 0f 90 pop r0 2f006: 0f 90 pop r0 2f008: 0f 90 pop r0 2f00a: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2f00c: f1 2c mov r15, r1 2f00e: f8 01 movw r30, r16 2f010: 01 90 ld r0, Z+ 2f012: 00 20 and r0, r0 2f014: e9 f7 brne .-6 ; 0x2f010 2f016: 31 97 sbiw r30, 0x01 ; 1 2f018: e0 1b sub r30, r16 2f01a: f1 0b sbc r31, r17 2f01c: fe 16 cp r15, r30 2f01e: 84 f4 brge .+32 ; 0x2f040 autoname[i]=tolower(autoname[i]); 2f020: 68 01 movw r12, r16 2f022: cf 0c add r12, r15 2f024: d1 1c adc r13, r1 2f026: f7 fc sbrc r15, 7 2f028: da 94 dec r13 2f02a: f6 01 movw r30, r12 2f02c: 80 81 ld r24, Z 2f02e: 08 2e mov r0, r24 2f030: 00 0c add r0, r0 2f032: 99 0b sbc r25, r25 2f034: 0f 94 a5 e3 call 0x3c74a ; 0x3c74a 2f038: f6 01 movw r30, r12 2f03a: 80 83 st Z, r24 2f03c: f3 94 inc r15 2f03e: e7 cf rjmp .-50 ; 0x2f00e dir_t p; root.rewind(); 2f040: 84 ef ldi r24, 0xF4 ; 244 2f042: 94 e1 ldi r25, 0x14 ; 20 2f044: 0e 94 b7 78 call 0xf16e ; 0xf16e bool found=false; 2f048: a1 2c mov r10, r1 2f04a: ce 01 movw r24, r28 2f04c: 01 96 adiw r24, 0x01 ; 1 2f04e: 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); 2f050: 8d ee ldi r24, 0xED ; 237 2f052: c8 2e mov r12, r24 2f054: 80 e7 ldi r24, 0x70 ; 112 2f056: 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; 2f058: 80 91 f7 14 lds r24, 0x14F7 ; 0x8014f7 2f05c: 82 30 cpi r24, 0x02 ; 2 2f05e: 08 f4 brcc .+2 ; 0x2f062 2f060: 50 c0 rjmp .+160 ; 0x2f102 2f062: 80 91 fc 14 lds r24, 0x14FC ; 0x8014fc 2f066: 90 91 fd 14 lds r25, 0x14FD ; 0x8014fd 2f06a: a0 91 fe 14 lds r26, 0x14FE ; 0x8014fe 2f06e: b0 91 ff 14 lds r27, 0x14FF ; 0x8014ff 2f072: 8f 71 andi r24, 0x1F ; 31 2f074: 99 27 eor r25, r25 2f076: aa 27 eor r26, r26 2f078: bb 27 eor r27, r27 2f07a: 89 2b or r24, r25 2f07c: 8a 2b or r24, r26 2f07e: 8b 2b or r24, r27 2f080: 09 f0 breq .+2 ; 0x2f084 2f082: 3f c0 rjmp .+126 ; 0x2f102 2f084: 50 e0 ldi r21, 0x00 ; 0 2f086: 40 e0 ldi r20, 0x00 ; 0 2f088: b7 01 movw r22, r14 2f08a: 84 ef ldi r24, 0xF4 ; 244 2f08c: 94 e1 ldi r25, 0x14 ; 20 2f08e: 0f 94 14 6e call 0x2dc28 ; 0x2dc28 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2f092: 18 16 cp r1, r24 2f094: b4 f5 brge .+108 ; 0x2f102 { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2f096: b1 2c mov r11, r1 2f098: f7 01 movw r30, r14 2f09a: 01 90 ld r0, Z+ 2f09c: 00 20 and r0, r0 2f09e: e9 f7 brne .-6 ; 0x2f09a 2f0a0: 31 97 sbiw r30, 0x01 ; 1 2f0a2: ee 19 sub r30, r14 2f0a4: ff 09 sbc r31, r15 2f0a6: be 16 cp r11, r30 2f0a8: 74 f4 brge .+28 ; 0x2f0c6 p.name[i]=tolower(p.name[i]); 2f0aa: 47 01 movw r8, r14 2f0ac: 8b 0c add r8, r11 2f0ae: 91 1c adc r9, r1 2f0b0: b7 fc sbrc r11, 7 2f0b2: 9a 94 dec r9 2f0b4: f4 01 movw r30, r8 2f0b6: 80 81 ld r24, Z 2f0b8: 90 e0 ldi r25, 0x00 ; 0 2f0ba: 0f 94 a5 e3 call 0x3c74a ; 0x3c74a 2f0be: f4 01 movw r30, r8 2f0c0: 80 83 st Z, r24 2f0c2: b3 94 inc r11 2f0c4: e9 cf rjmp .-46 ; 0x2f098 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2f0c6: 8a 85 ldd r24, Y+10 ; 0x0a 2f0c8: 8e 37 cpi r24, 0x7E ; 126 2f0ca: 31 f2 breq .-116 ; 0x2f058 if(strncmp((char*)p.name,autoname,5)==0) 2f0cc: 45 e0 ldi r20, 0x05 ; 5 2f0ce: 50 e0 ldi r21, 0x00 ; 0 2f0d0: b8 01 movw r22, r16 2f0d2: c7 01 movw r24, r14 2f0d4: 0f 94 03 e4 call 0x3c806 ; 0x3c806 2f0d8: 89 2b or r24, r25 2f0da: 09 f0 breq .+2 ; 0x2f0de 2f0dc: bd cf rjmp .-134 ; 0x2f058 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2f0de: 1f 93 push r17 2f0e0: 0f 93 push r16 2f0e2: df 92 push r13 2f0e4: cf 92 push r12 2f0e6: 0e 94 e9 89 call 0x113d2 ; 0x113d2 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2f0ea: 61 e0 ldi r22, 0x01 ; 1 2f0ec: 89 ee ldi r24, 0xE9 ; 233 2f0ee: 90 e7 ldi r25, 0x70 ; 112 2f0f0: 0e 94 4b 89 call 0x11296 ; 0x11296 2f0f4: 0f 90 pop r0 2f0f6: 0f 90 pop r0 2f0f8: 0f 90 pop r0 2f0fa: 0f 90 pop r0 found=true; 2f0fc: aa 24 eor r10, r10 2f0fe: a3 94 inc r10 2f100: ab cf rjmp .-170 ; 0x2f058 } } if(!found) lastnr=-1; 2f102: 8f ef ldi r24, 0xFF ; 255 2f104: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2f106: aa 20 and r10, r10 2f108: 29 f0 breq .+10 ; 0x2f114 lastnr=-1; else lastnr++; 2f10a: 80 91 bb 14 lds r24, 0x14BB ; 0x8014bb 2f10e: 90 91 bc 14 lds r25, 0x14BC ; 0x8014bc 2f112: 01 96 adiw r24, 0x01 ; 1 2f114: 90 93 bc 14 sts 0x14BC, r25 ; 0x8014bc 2f118: 80 93 bb 14 sts 0x14BB, r24 ; 0x8014bb } 2f11c: ee 96 adiw r28, 0x3e ; 62 2f11e: 0f b6 in r0, 0x3f ; 63 2f120: f8 94 cli 2f122: de bf out 0x3e, r29 ; 62 2f124: 0f be out 0x3f, r0 ; 63 2f126: cd bf out 0x3d, r28 ; 61 2f128: df 91 pop r29 2f12a: cf 91 pop r28 2f12c: 1f 91 pop r17 2f12e: 0f 91 pop r16 2f130: ff 90 pop r15 2f132: ef 90 pop r14 2f134: df 90 pop r13 2f136: cf 90 pop r12 2f138: bf 90 pop r11 2f13a: af 90 pop r10 2f13c: 9f 90 pop r9 2f13e: 8f 90 pop r8 2f140: 08 95 ret 0002f142 : * \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) { 2f142: 8f 92 push r8 2f144: 9f 92 push r9 2f146: af 92 push r10 2f148: bf 92 push r11 2f14a: cf 92 push r12 2f14c: df 92 push r13 2f14e: ef 92 push r14 2f150: ff 92 push r15 2f152: 0f 93 push r16 2f154: 1f 93 push r17 2f156: cf 93 push r28 2f158: df 93 push r29 2f15a: 00 d0 rcall .+0 ; 0x2f15c 2f15c: 1f 92 push r1 2f15e: cd b7 in r28, 0x3d ; 61 2f160: de b7 in r29, 0x3e ; 62 2f162: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2f164: 83 81 ldd r24, Z+3 ; 0x03 2f166: 81 30 cpi r24, 0x01 ; 1 2f168: 11 f0 breq .+4 ; 0x2f16e // set file to correct position return seekSet(newPos); fail: return false; 2f16a: 80 e0 ldi r24, 0x00 ; 0 2f16c: 60 c0 rjmp .+192 ; 0x2f22e * \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; 2f16e: 81 81 ldd r24, Z+1 ; 0x01 2f170: 81 ff sbrs r24, 1 2f172: fb cf rjmp .-10 ; 0x2f16a // 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; 2f174: 81 89 ldd r24, Z+17 ; 0x11 2f176: 92 89 ldd r25, Z+18 ; 0x12 2f178: a3 89 ldd r26, Z+19 ; 0x13 2f17a: b4 89 ldd r27, Z+20 ; 0x14 2f17c: 89 2b or r24, r25 2f17e: 8a 2b or r24, r26 2f180: 8b 2b or r24, r27 2f182: 09 f4 brne .+2 ; 0x2f186 2f184: 6e c0 rjmp .+220 ; 0x2f262 2f186: 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; 2f188: 40 e0 ldi r20, 0x00 ; 0 2f18a: 50 e0 ldi r21, 0x00 ; 0 2f18c: ba 01 movw r22, r20 2f18e: cf 01 movw r24, r30 2f190: 0f 94 b1 6e call 0x2dd62 ; 0x2dd62 2f194: 88 23 and r24, r24 2f196: 49 f3 breq .-46 ; 0x2f16a if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2f198: f7 01 movw r30, r14 2f19a: c1 8c ldd r12, Z+25 ; 0x19 2f19c: d2 8c ldd r13, Z+26 ; 0x1a 2f19e: 85 88 ldd r8, Z+21 ; 0x15 2f1a0: 96 88 ldd r9, Z+22 ; 0x16 2f1a2: a7 88 ldd r10, Z+23 ; 0x17 2f1a4: 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; 2f1a6: 82 e0 ldi r24, 0x02 ; 2 2f1a8: 90 e0 ldi r25, 0x00 ; 0 2f1aa: a0 e0 ldi r26, 0x00 ; 0 2f1ac: b0 e0 ldi r27, 0x00 ; 0 2f1ae: f6 01 movw r30, r12 2f1b0: 80 83 st Z, r24 2f1b2: 91 83 std Z+1, r25 ; 0x01 2f1b4: a2 83 std Z+2, r26 ; 0x02 2f1b6: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2f1b8: 9e 01 movw r18, r28 2f1ba: 2f 5f subi r18, 0xFF ; 255 2f1bc: 3f 4f sbci r19, 0xFF ; 255 2f1be: b5 01 movw r22, r10 2f1c0: a4 01 movw r20, r8 2f1c2: c6 01 movw r24, r12 2f1c4: 0f 94 ae 6c call 0x2d95c ; 0x2d95c 2f1c8: 88 23 and r24, r24 2f1ca: 79 f2 breq .-98 ; 0x2f16a // free cluster if (!fatPut(cluster, 0)) goto fail; 2f1cc: 00 e0 ldi r16, 0x00 ; 0 2f1ce: 10 e0 ldi r17, 0x00 ; 0 2f1d0: 98 01 movw r18, r16 2f1d2: b5 01 movw r22, r10 2f1d4: a4 01 movw r20, r8 2f1d6: c6 01 movw r24, r12 2f1d8: 0f 94 1c 6c call 0x2d838 ; 0x2d838 2f1dc: 88 23 and r24, r24 2f1de: 29 f2 breq .-118 ; 0x2f16a cluster = next; 2f1e0: 89 80 ldd r8, Y+1 ; 0x01 2f1e2: 9a 80 ldd r9, Y+2 ; 0x02 2f1e4: ab 80 ldd r10, Y+3 ; 0x03 2f1e6: 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; 2f1e8: f6 01 movw r30, r12 2f1ea: 87 89 ldd r24, Z+23 ; 0x17 2f1ec: 80 31 cpi r24, 0x10 ; 16 2f1ee: 81 f5 brne .+96 ; 0x2f250 2f1f0: f8 ef ldi r31, 0xF8 ; 248 2f1f2: 8f 16 cp r8, r31 2f1f4: ff ef ldi r31, 0xFF ; 255 2f1f6: 9f 06 cpc r9, r31 2f1f8: a1 04 cpc r10, r1 2f1fa: b1 04 cpc r11, r1 2f1fc: e8 f2 brcs .-70 ; 0x2f1b8 firstCluster_ = 0; 2f1fe: f7 01 movw r30, r14 2f200: 15 8a std Z+21, r1 ; 0x15 2f202: 16 8a std Z+22, r1 ; 0x16 2f204: 17 8a std Z+23, r1 ; 0x17 2f206: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2f208: 11 8a std Z+17, r1 ; 0x11 2f20a: 12 8a std Z+18, r1 ; 0x12 2f20c: 13 8a std Z+19, r1 ; 0x13 2f20e: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2f210: 81 81 ldd r24, Z+1 ; 0x01 2f212: 80 68 ori r24, 0x80 ; 128 2f214: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2f216: c7 01 movw r24, r14 2f218: 0f 94 7c 6e call 0x2dcf8 ; 0x2dcf8 2f21c: 88 23 and r24, r24 2f21e: 09 f4 brne .+2 ; 0x2f222 2f220: a4 cf rjmp .-184 ; 0x2f16a // set file to correct position return seekSet(newPos); 2f222: 40 e0 ldi r20, 0x00 ; 0 2f224: 50 e0 ldi r21, 0x00 ; 0 2f226: ba 01 movw r22, r20 2f228: c7 01 movw r24, r14 2f22a: 0f 94 b1 6e call 0x2dd62 ; 0x2dd62 fail: return false; } 2f22e: 0f 90 pop r0 2f230: 0f 90 pop r0 2f232: 0f 90 pop r0 2f234: 0f 90 pop r0 2f236: df 91 pop r29 2f238: cf 91 pop r28 2f23a: 1f 91 pop r17 2f23c: 0f 91 pop r16 2f23e: ff 90 pop r15 2f240: ef 90 pop r14 2f242: df 90 pop r13 2f244: cf 90 pop r12 2f246: bf 90 pop r11 2f248: af 90 pop r10 2f24a: 9f 90 pop r9 2f24c: 8f 90 pop r8 2f24e: 08 95 ret return cluster >= FAT32EOC_MIN; 2f250: 88 ef ldi r24, 0xF8 ; 248 2f252: 88 16 cp r8, r24 2f254: 8f ef ldi r24, 0xFF ; 255 2f256: 98 06 cpc r9, r24 2f258: a8 06 cpc r10, r24 2f25a: 8f e0 ldi r24, 0x0F ; 15 2f25c: b8 06 cpc r11, r24 2f25e: 78 f6 brcc .-98 ; 0x2f1fe 2f260: ab cf rjmp .-170 ; 0x2f1b8 // 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; 2f262: 81 e0 ldi r24, 0x01 ; 1 2f264: e4 cf rjmp .-56 ; 0x2f22e 0002f266 : +* 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) { 2f266: 2f 92 push r2 2f268: 3f 92 push r3 2f26a: 4f 92 push r4 2f26c: 5f 92 push r5 2f26e: 6f 92 push r6 2f270: 7f 92 push r7 2f272: 8f 92 push r8 2f274: 9f 92 push r9 2f276: af 92 push r10 2f278: bf 92 push r11 2f27a: cf 92 push r12 2f27c: df 92 push r13 2f27e: ef 92 push r14 2f280: ff 92 push r15 2f282: 0f 93 push r16 2f284: 1f 93 push r17 2f286: cf 93 push r28 2f288: df 93 push r29 2f28a: cd b7 in r28, 0x3d ; 61 2f28c: de b7 in r29, 0x3e ; 62 2f28e: c6 57 subi r28, 0x76 ; 118 2f290: d1 09 sbc r29, r1 2f292: 0f b6 in r0, 0x3f ; 63 2f294: f8 94 cli 2f296: de bf out 0x3e, r29 ; 62 2f298: 0f be out 0x3f, r0 ; 63 2f29a: cd bf out 0x3d, r28 ; 61 2f29c: 4c 01 movw r8, r24 2f29e: 6b 01 movw r12, r22 2f2a0: 3a 01 movw r6, r20 2f2a2: e5 96 adiw r28, 0x35 ; 53 2f2a4: 2f af std Y+63, r18 ; 0x3f 2f2a6: e5 97 sbiw r28, 0x35 ; 53 2f2a8: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2f2aa: 2d b6 in r2, 0x3d ; 61 2f2ac: 3e b6 in r3, 0x3e ; 62 2f2ae: 10 2f mov r17, r16 2f2b0: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2f2b2: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 2f2b6: 8f 5f subi r24, 0xFF ; 255 2f2b8: 80 93 7a 0e sts 0x0E7A, r24 ; 0x800e7a } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; // Read the next entry from a directory for (position = parent.curPosition(); parent.readDir(p, longFilename) > 0; position = parent.curPosition()) { 2f2bc: fb 01 movw r30, r22 2f2be: 80 85 ldd r24, Z+8 ; 0x08 2f2c0: 91 85 ldd r25, Z+9 ; 0x09 2f2c2: a2 85 ldd r26, Z+10 ; 0x0a 2f2c4: b3 85 ldd r27, Z+11 ; 0x0b 2f2c6: 80 93 81 14 sts 0x1481, r24 ; 0x801481 2f2ca: 90 93 82 14 sts 0x1482, r25 ; 0x801482 2f2ce: a0 93 83 14 sts 0x1483, r26 ; 0x801483 2f2d2: b0 93 84 14 sts 0x1484, r27 ; 0x801484 _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2f2d6: 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); 2f2d8: 5e 01 movw r10, r28 2f2da: f7 e6 ldi r31, 0x67 ; 103 2f2dc: af 0e add r10, r31 2f2de: 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; 2f2e0: f6 01 movw r30, r12 2f2e2: 83 81 ldd r24, Z+3 ; 0x03 2f2e4: 82 30 cpi r24, 0x02 ; 2 2f2e6: 08 f4 brcc .+2 ; 0x2f2ea 2f2e8: c0 c1 rjmp .+896 ; 0x2f66a 2f2ea: 80 85 ldd r24, Z+8 ; 0x08 2f2ec: 91 85 ldd r25, Z+9 ; 0x09 2f2ee: a2 85 ldd r26, Z+10 ; 0x0a 2f2f0: b3 85 ldd r27, Z+11 ; 0x0b 2f2f2: 8f 71 andi r24, 0x1F ; 31 2f2f4: 99 27 eor r25, r25 2f2f6: aa 27 eor r26, r26 2f2f8: bb 27 eor r27, r27 2f2fa: 89 2b or r24, r25 2f2fc: 8a 2b or r24, r26 2f2fe: 8b 2b or r24, r27 2f300: 09 f0 breq .+2 ; 0x2f304 2f302: b3 c1 rjmp .+870 ; 0x2f66a //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'; 2f304: 10 92 85 14 sts 0x1485, r1 ; 0x801485 2f308: 45 e8 ldi r20, 0x85 ; 133 2f30a: 54 e1 ldi r21, 0x14 ; 20 2f30c: be 01 movw r22, r28 2f30e: 69 5b subi r22, 0xB9 ; 185 2f310: 7f 4f sbci r23, 0xFF ; 255 2f312: c6 01 movw r24, r12 2f314: 0f 94 14 6e call 0x2dc28 ; 0x2dc28 } 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()) { 2f318: 18 16 cp r1, r24 2f31a: 0c f0 brlt .+2 ; 0x2f31e 2f31c: a6 c1 rjmp .+844 ; 0x2f66a if (recursionCnt > MAX_DIR_DEPTH) 2f31e: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 2f322: 87 30 cpi r24, 0x07 ; 7 2f324: 08 f0 brcs .+2 ; 0x2f328 2f326: a1 c1 rjmp .+834 ; 0x2f66a return; uint8_t pn0 = p.name[0]; 2f328: 28 96 adiw r28, 0x08 ; 8 2f32a: 8f ad ldd r24, Y+63 ; 0x3f 2f32c: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2f32e: 88 23 and r24, r24 2f330: 09 f4 brne .+2 ; 0x2f334 2f332: 9b c1 rjmp .+822 ; 0x2f66a if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2f334: 85 3e cpi r24, 0xE5 ; 229 2f336: 09 f4 brne .+2 ; 0x2f33a 2f338: 39 c1 rjmp .+626 ; 0x2f5ac 2f33a: 8e 32 cpi r24, 0x2E ; 46 2f33c: 09 f4 brne .+2 ; 0x2f340 2f33e: 36 c1 rjmp .+620 ; 0x2f5ac if (longFilename[0] == '.') continue; 2f340: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f344: 8e 32 cpi r24, 0x2E ; 46 2f346: 09 f4 brne .+2 ; 0x2f34a 2f348: 31 c1 rjmp .+610 ; 0x2f5ac 2f34a: 63 96 adiw r28, 0x13 ; 19 2f34c: 8f ad ldd r24, Y+63 ; 0x3f 2f34e: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2f350: 98 2f mov r25, r24 2f352: 9a 70 andi r25, 0x0A ; 10 2f354: 09 f0 breq .+2 ; 0x2f358 2f356: 2a c1 rjmp .+596 ; 0x2f5ac 2f358: 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; 2f35a: 91 e0 ldi r25, 0x01 ; 1 2f35c: 80 31 cpi r24, 0x10 ; 16 2f35e: 19 f0 breq .+6 ; 0x2f366 2f360: 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 2f362: 80 31 cpi r24, 0x10 ; 16 2f364: 31 f4 brne .+12 ; 0x2f372 2f366: e5 96 adiw r28, 0x35 ; 53 2f368: ff ad ldd r31, Y+63 ; 0x3f 2f36a: e5 97 sbiw r28, 0x35 ; 53 2f36c: ff 23 and r31, r31 2f36e: 09 f4 brne .+2 ; 0x2f372 2f370: 94 c0 rjmp .+296 ; 0x2f49a if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2f372: 90 93 ba 14 sts 0x14BA, r25 ; 0x8014ba if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2f376: 80 31 cpi r24, 0x10 ; 16 2f378: 61 f0 breq .+24 ; 0x2f392 2f37a: 60 96 adiw r28, 0x10 ; 16 2f37c: 8f ad ldd r24, Y+63 ; 0x3f 2f37e: 60 97 sbiw r28, 0x10 ; 16 2f380: 87 34 cpi r24, 0x47 ; 71 2f382: 09 f0 breq .+2 ; 0x2f386 2f384: 13 c1 rjmp .+550 ; 0x2f5ac 2f386: 61 96 adiw r28, 0x11 ; 17 2f388: 8f ad ldd r24, Y+63 ; 0x3f 2f38a: 61 97 sbiw r28, 0x11 ; 17 2f38c: 8e 37 cpi r24, 0x7E ; 126 2f38e: 09 f4 brne .+2 ; 0x2f392 2f390: 0d c1 rjmp .+538 ; 0x2f5ac switch (lsAction) { 2f392: e5 96 adiw r28, 0x35 ; 53 2f394: ff ad ldd r31, Y+63 ; 0x3f 2f396: e5 97 sbiw r28, 0x35 ; 53 2f398: f1 30 cpi r31, 0x01 ; 1 2f39a: 09 f4 brne .+2 ; 0x2f39e 2f39c: 1b c1 rjmp .+566 ; 0x2f5d4 2f39e: f2 30 cpi r31, 0x02 ; 2 2f3a0: 09 f4 brne .+2 ; 0x2f3a4 2f3a2: 25 c1 rjmp .+586 ; 0x2f5ee case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2f3a4: be 01 movw r22, r28 2f3a6: 69 5b subi r22, 0xB9 ; 185 2f3a8: 7f 4f sbci r23, 0xFF ; 255 2f3aa: 80 e7 ldi r24, 0x70 ; 112 2f3ac: 94 e1 ldi r25, 0x14 ; 20 2f3ae: 0e 94 a1 78 call 0xf142 ; 0xf142 2f3b2: c4 01 movw r24, r8 2f3b4: 0e 94 3f 89 call 0x1127e ; 0x1127e 2f3b8: 80 e7 ldi r24, 0x70 ; 112 2f3ba: 94 e1 ldi r25, 0x14 ; 20 2f3bc: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2f3c0: 80 e2 ldi r24, 0x20 ; 32 2f3c2: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2f3c6: a7 96 adiw r28, 0x27 ; 39 2f3c8: 6c ad ldd r22, Y+60 ; 0x3c 2f3ca: 7d ad ldd r23, Y+61 ; 0x3d 2f3cc: 8e ad ldd r24, Y+62 ; 0x3e 2f3ce: 9f ad ldd r25, Y+63 ; 0x3f 2f3d0: a7 97 sbiw r28, 0x27 ; 39 2f3d2: 4a e0 ldi r20, 0x0A ; 10 2f3d4: 0f 94 80 d2 call 0x3a500 ; 0x3a500 SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2f3d8: 51 fe sbrs r5, 1 2f3da: 45 c0 rjmp .+138 ; 0x2f466 { crmodDate = p.lastWriteDate; 2f3dc: a1 96 adiw r28, 0x21 ; 33 2f3de: 2e ad ldd r18, Y+62 ; 0x3e 2f3e0: 3f ad ldd r19, Y+63 ; 0x3f 2f3e2: a1 97 sbiw r28, 0x21 ; 33 2f3e4: 30 93 80 14 sts 0x1480, r19 ; 0x801480 2f3e8: 20 93 7f 14 sts 0x147F, r18 ; 0x80147f crmodTime = p.lastWriteTime; 2f3ec: 6f 96 adiw r28, 0x1f ; 31 2f3ee: 4e ad ldd r20, Y+62 ; 0x3e 2f3f0: 5f ad ldd r21, Y+63 ; 0x3f 2f3f2: 6f 97 sbiw r28, 0x1f ; 31 2f3f4: 50 93 7e 14 sts 0x147E, r21 ; 0x80147e 2f3f8: 40 93 7d 14 sts 0x147D, r20 ; 0x80147d if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f3fc: 69 96 adiw r28, 0x19 ; 25 2f3fe: 8e ad ldd r24, Y+62 ; 0x3e 2f400: 9f ad ldd r25, Y+63 ; 0x3f 2f402: 69 97 sbiw r28, 0x19 ; 25 2f404: 28 17 cp r18, r24 2f406: 39 07 cpc r19, r25 2f408: 50 f0 brcs .+20 ; 0x2f41e 2f40a: 28 17 cp r18, r24 2f40c: 39 07 cpc r19, r25 2f40e: 99 f4 brne .+38 ; 0x2f436 2f410: 67 96 adiw r28, 0x17 ; 23 2f412: 2e ad ldd r18, Y+62 ; 0x3e 2f414: 3f ad ldd r19, Y+63 ; 0x3f 2f416: 67 97 sbiw r28, 0x17 ; 23 2f418: 42 17 cp r20, r18 2f41a: 53 07 cpc r21, r19 2f41c: 60 f4 brcc .+24 ; 0x2f436 crmodDate = p.creationDate; 2f41e: 90 93 80 14 sts 0x1480, r25 ; 0x801480 2f422: 80 93 7f 14 sts 0x147F, r24 ; 0x80147f crmodTime = p.creationTime; 2f426: 67 96 adiw r28, 0x17 ; 23 2f428: 8e ad ldd r24, Y+62 ; 0x3e 2f42a: 9f ad ldd r25, Y+63 ; 0x3f 2f42c: 67 97 sbiw r28, 0x17 ; 23 2f42e: 90 93 7e 14 sts 0x147E, r25 ; 0x80147e 2f432: 80 93 7d 14 sts 0x147D, r24 ; 0x80147d } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2f436: 80 91 80 14 lds r24, 0x1480 ; 0x801480 2f43a: 8f 93 push r24 2f43c: 80 91 7f 14 lds r24, 0x147F ; 0x80147f 2f440: 8f 93 push r24 2f442: 80 91 7e 14 lds r24, 0x147E ; 0x80147e 2f446: 8f 93 push r24 2f448: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2f44c: 8f 93 push r24 2f44e: 2b e4 ldi r18, 0x4B ; 75 2f450: 39 ea ldi r19, 0xA9 ; 169 2f452: 3f 93 push r19 2f454: 2f 93 push r18 2f456: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 2f45a: 0f 90 pop r0 2f45c: 0f 90 pop r0 2f45e: 0f 90 pop r0 2f460: 0f 90 pop r0 2f462: 0f 90 pop r0 2f464: 0f 90 pop r0 } if (lsParams.LFN) 2f466: 11 23 and r17, r17 2f468: 99 f0 breq .+38 ; 0x2f490 printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f46a: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f46e: 88 23 and r24, r24 2f470: 09 f4 brne .+2 ; 0x2f474 2f472: ba c0 rjmp .+372 ; 0x2f5e8 2f474: 85 e8 ldi r24, 0x85 ; 133 2f476: 94 e1 ldi r25, 0x14 ; 20 2f478: 9f 93 push r25 2f47a: 8f 93 push r24 2f47c: e5 e4 ldi r30, 0x45 ; 69 2f47e: f9 ea ldi r31, 0xA9 ; 169 2f480: ff 93 push r31 2f482: ef 93 push r30 2f484: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 2f488: 0f 90 pop r0 2f48a: 0f 90 pop r0 2f48c: 0f 90 pop r0 2f48e: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2f490: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 manage_heater(); 2f494: 0f 94 a0 4e call 0x29d40 ; 0x29d40 2f498: 89 c0 rjmp .+274 ; 0x2f5ac } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2f49a: 2d b7 in r18, 0x3d ; 61 2f49c: 3e b7 in r19, 0x3e ; 62 2f49e: e7 96 adiw r28, 0x37 ; 55 2f4a0: 3f af std Y+63, r19 ; 0x3f 2f4a2: 2e af std Y+62, r18 ; 0x3e 2f4a4: 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); 2f4a6: be 01 movw r22, r28 2f4a8: 69 5b subi r22, 0xB9 ; 185 2f4aa: 7f 4f sbci r23, 0xFF ; 255 2f4ac: c5 01 movw r24, r10 2f4ae: 0e 94 a1 78 call 0xf142 ; 0xf142 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2f4b2: f4 01 movw r30, r8 2f4b4: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2f4b6: 88 23 and r24, r24 2f4b8: 09 f4 brne .+2 ; 0x2f4bc 2f4ba: 86 c0 rjmp .+268 ; 0x2f5c8 2f4bc: 01 90 ld r0, Z+ 2f4be: 00 20 and r0, r0 2f4c0: e9 f7 brne .-6 ; 0x2f4bc 2f4c2: 31 97 sbiw r30, 0x01 ; 1 2f4c4: e8 19 sub r30, r8 2f4c6: f9 09 sbc r31, r9 2f4c8: d5 01 movw r26, r10 2f4ca: 0d 90 ld r0, X+ 2f4cc: 00 20 and r0, r0 2f4ce: e9 f7 brne .-6 ; 0x2f4ca 2f4d0: ea 19 sub r30, r10 2f4d2: fb 09 sbc r31, r11 char path[len]; 2f4d4: ea 0f add r30, r26 2f4d6: fb 1f adc r31, r27 2f4d8: 31 96 adiw r30, 0x01 ; 1 2f4da: 2d b7 in r18, 0x3d ; 61 2f4dc: 3e b7 in r19, 0x3e ; 62 2f4de: 2e 1b sub r18, r30 2f4e0: 3f 0b sbc r19, r31 2f4e2: 0f b6 in r0, 0x3f ; 63 2f4e4: f8 94 cli 2f4e6: 3e bf out 0x3e, r19 ; 62 2f4e8: 0f be out 0x3f, r0 ; 63 2f4ea: 2d bf out 0x3d, r18 ; 61 2f4ec: ed b7 in r30, 0x3d ; 61 2f4ee: fe b7 in r31, 0x3e ; 62 2f4f0: 31 96 adiw r30, 0x01 ; 1 2f4f2: 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 2f4f4: 6f e1 ldi r22, 0x1F ; 31 2f4f6: 73 e0 ldi r23, 0x03 ; 3 2f4f8: 81 11 cpse r24, r1 2f4fa: b4 01 movw r22, r8 2f4fc: c7 01 movw r24, r14 2f4fe: 0f 94 fc e3 call 0x3c7f8 ; 0x3c7f8 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2f502: b5 01 movw r22, r10 2f504: c7 01 movw r24, r14 2f506: 0f 94 dd e3 call 0x3c7ba ; 0x3c7ba strcat(path, "/"); // 1 character 2f50a: 6f e1 ldi r22, 0x1F ; 31 2f50c: 73 e0 ldi r23, 0x03 ; 3 2f50e: c7 01 movw r24, r14 2f510: 0f 94 dd e3 call 0x3c7ba ; 0x3c7ba // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2f514: 11 23 and r17, r17 2f516: a9 f0 breq .+42 ; 0x2f542 printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2f518: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f51c: 81 11 cpse r24, r1 2f51e: 57 c0 rjmp .+174 ; 0x2f5ce 2f520: c5 01 movw r24, r10 2f522: 9f 93 push r25 2f524: 8f 93 push r24 2f526: ff 92 push r15 2f528: ef 92 push r14 2f52a: 2a e5 ldi r18, 0x5A ; 90 2f52c: 39 ea ldi r19, 0xA9 ; 169 2f52e: 3f 93 push r19 2f530: 2f 93 push r18 2f532: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 2f536: 0f 90 pop r0 2f538: 0f 90 pop r0 2f53a: 0f 90 pop r0 2f53c: 0f 90 pop r0 2f53e: 0f 90 pop r0 2f540: 0f 90 pop r0 2f542: 1c a2 std Y+36, r1 ; 0x24 2f544: 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); 2f546: 21 e0 ldi r18, 0x01 ; 1 2f548: a5 01 movw r20, r10 2f54a: b6 01 movw r22, r12 2f54c: ce 01 movw r24, r28 2f54e: 84 96 adiw r24, 0x24 ; 36 2f550: 0f 94 3e d7 call 0x3ae7c ; 0x3ae7c 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); 2f554: 83 e2 ldi r24, 0x23 ; 35 2f556: fe 01 movw r30, r28 2f558: b4 96 adiw r30, 0x24 ; 36 2f55a: de 01 movw r26, r28 2f55c: 11 96 adiw r26, 0x01 ; 1 2f55e: 01 90 ld r0, Z+ 2f560: 0d 92 st X+, r0 2f562: 8a 95 dec r24 2f564: e1 f7 brne .-8 ; 0x2f55e 2f566: 10 fb bst r17, 0 2f568: 50 f8 bld r5, 0 2f56a: 05 2d mov r16, r5 2f56c: 20 e0 ldi r18, 0x00 ; 0 2f56e: 50 e0 ldi r21, 0x00 ; 0 2f570: 40 e0 ldi r20, 0x00 ; 0 2f572: be 01 movw r22, r28 2f574: 6f 5f subi r22, 0xFF ; 255 2f576: 7f 4f sbci r23, 0xFF ; 255 2f578: c7 01 movw r24, r14 2f57a: 0f 94 33 79 call 0x2f266 ; 0x2f266 2f57e: ce 01 movw r24, r28 2f580: 01 96 adiw r24, 0x01 ; 1 2f582: 0e 94 bc 78 call 0xf178 ; 0xf178 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2f586: 11 23 and r17, r17 2f588: 21 f0 breq .+8 ; 0x2f592 puts_P(PSTR("DIR_EXIT")); 2f58a: 81 e5 ldi r24, 0x51 ; 81 2f58c: 99 ea ldi r25, 0xA9 ; 169 2f58e: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 2f592: ce 01 movw r24, r28 2f594: 84 96 adiw r24, 0x24 ; 36 2f596: 0e 94 bc 78 call 0xf178 ; 0xf178 2f59a: e7 96 adiw r28, 0x37 ; 55 2f59c: ee ad ldd r30, Y+62 ; 0x3e 2f59e: ff ad ldd r31, Y+63 ; 0x3f 2f5a0: e7 97 sbiw r28, 0x37 ; 55 2f5a2: 0f b6 in r0, 0x3f ; 63 2f5a4: f8 94 cli 2f5a6: fe bf out 0x3e, r31 ; 62 2f5a8: 0f be out 0x3f, r0 ; 63 2f5aa: 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()) { 2f5ac: f6 01 movw r30, r12 2f5ae: 80 85 ldd r24, Z+8 ; 0x08 2f5b0: 91 85 ldd r25, Z+9 ; 0x09 2f5b2: a2 85 ldd r26, Z+10 ; 0x0a 2f5b4: b3 85 ldd r27, Z+11 ; 0x0b 2f5b6: 80 93 81 14 sts 0x1481, r24 ; 0x801481 2f5ba: 90 93 82 14 sts 0x1482, r25 ; 0x801482 2f5be: a0 93 83 14 sts 0x1483, r26 ; 0x801483 2f5c2: b0 93 84 14 sts 0x1484, r27 ; 0x801484 2f5c6: 8c ce rjmp .-744 ; 0x2f2e0 // 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; 2f5c8: e1 e0 ldi r30, 0x01 ; 1 2f5ca: f0 e0 ldi r31, 0x00 ; 0 2f5cc: 7d cf rjmp .-262 ; 0x2f4c8 // 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); 2f5ce: 85 e8 ldi r24, 0x85 ; 133 2f5d0: 94 e1 ldi r25, 0x14 ; 20 2f5d2: a7 cf rjmp .-178 ; 0x2f522 else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2f5d4: 80 91 86 17 lds r24, 0x1786 ; 0x801786 2f5d8: 90 91 87 17 lds r25, 0x1787 ; 0x801787 2f5dc: 01 96 adiw r24, 0x01 ; 1 2f5de: 90 93 87 17 sts 0x1787, r25 ; 0x801787 2f5e2: 80 93 86 17 sts 0x1786, r24 ; 0x801786 2f5e6: e2 cf rjmp .-60 ; 0x2f5ac } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2f5e8: 80 e7 ldi r24, 0x70 ; 112 2f5ea: 94 e1 ldi r25, 0x14 ; 20 2f5ec: 45 cf rjmp .-374 ; 0x2f478 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2f5ee: be 01 movw r22, r28 2f5f0: 69 5b subi r22, 0xB9 ; 185 2f5f2: 7f 4f sbci r23, 0xFF ; 255 2f5f4: 80 e7 ldi r24, 0x70 ; 112 2f5f6: 94 e1 ldi r25, 0x14 ; 20 2f5f8: 0e 94 a1 78 call 0xf142 ; 0xf142 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2f5fc: a1 96 adiw r28, 0x21 ; 33 2f5fe: 2e ad ldd r18, Y+62 ; 0x3e 2f600: 3f ad ldd r19, Y+63 ; 0x3f 2f602: a1 97 sbiw r28, 0x21 ; 33 2f604: 30 93 80 14 sts 0x1480, r19 ; 0x801480 2f608: 20 93 7f 14 sts 0x147F, r18 ; 0x80147f crmodTime = p.lastWriteTime; 2f60c: 6f 96 adiw r28, 0x1f ; 31 2f60e: 4e ad ldd r20, Y+62 ; 0x3e 2f610: 5f ad ldd r21, Y+63 ; 0x3f 2f612: 6f 97 sbiw r28, 0x1f ; 31 2f614: 50 93 7e 14 sts 0x147E, r21 ; 0x80147e 2f618: 40 93 7d 14 sts 0x147D, r20 ; 0x80147d // There are scenarios when simple modification time is not enough (on MS Windows) // For example - extract an old g-code from an archive onto the SD card. // In such case the creation time is current time (which is correct), but the modification time // stays the same - i.e. old. // Therefore let's pick the most recent timestamp from both creation and modification timestamps if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2f61c: 69 96 adiw r28, 0x19 ; 25 2f61e: 8e ad ldd r24, Y+62 ; 0x3e 2f620: 9f ad ldd r25, Y+63 ; 0x3f 2f622: 69 97 sbiw r28, 0x19 ; 25 2f624: 28 17 cp r18, r24 2f626: 39 07 cpc r19, r25 2f628: 50 f0 brcs .+20 ; 0x2f63e 2f62a: 28 17 cp r18, r24 2f62c: 39 07 cpc r19, r25 2f62e: 99 f4 brne .+38 ; 0x2f656 2f630: 67 96 adiw r28, 0x17 ; 23 2f632: 2e ad ldd r18, Y+62 ; 0x3e 2f634: 3f ad ldd r19, Y+63 ; 0x3f 2f636: 67 97 sbiw r28, 0x17 ; 23 2f638: 42 17 cp r20, r18 2f63a: 53 07 cpc r21, r19 2f63c: 60 f4 brcc .+24 ; 0x2f656 crmodDate = p.creationDate; 2f63e: 90 93 80 14 sts 0x1480, r25 ; 0x801480 2f642: 80 93 7f 14 sts 0x147F, r24 ; 0x80147f crmodTime = p.creationTime; 2f646: 67 96 adiw r28, 0x17 ; 23 2f648: 8e ad ldd r24, Y+62 ; 0x3e 2f64a: 9f ad ldd r25, Y+63 ; 0x3f 2f64c: 67 97 sbiw r28, 0x17 ; 23 2f64e: 90 93 7e 14 sts 0x147E, r25 ; 0x80147e 2f652: 80 93 7d 14 sts 0x147D, r24 ; 0x80147d } //writeDate = p.lastAccessDate; if (match != NULL) { 2f656: 61 14 cp r6, r1 2f658: 71 04 cpc r7, r1 2f65a: 59 f1 breq .+86 ; 0x2f6b2 if (strcasecmp(match, filename) == 0) return; 2f65c: 60 e7 ldi r22, 0x70 ; 112 2f65e: 74 e1 ldi r23, 0x14 ; 20 2f660: c3 01 movw r24, r6 2f662: 0f 94 ca e3 call 0x3c794 ; 0x3c794 2f666: 89 2b or r24, r25 2f668: 59 f5 brne .+86 ; 0x2f6c0 // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2f66a: 80 91 7a 0e lds r24, 0x0E7A ; 0x800e7a 2f66e: 81 50 subi r24, 0x01 ; 1 2f670: 80 93 7a 0e sts 0x0E7A, r24 ; 0x800e7a cnt++; break; } } } // while readDir } 2f674: 0f b6 in r0, 0x3f ; 63 2f676: f8 94 cli 2f678: 3e be out 0x3e, r3 ; 62 2f67a: 0f be out 0x3f, r0 ; 63 2f67c: 2d be out 0x3d, r2 ; 61 2f67e: ca 58 subi r28, 0x8A ; 138 2f680: df 4f sbci r29, 0xFF ; 255 2f682: 0f b6 in r0, 0x3f ; 63 2f684: f8 94 cli 2f686: de bf out 0x3e, r29 ; 62 2f688: 0f be out 0x3f, r0 ; 63 2f68a: cd bf out 0x3d, r28 ; 61 2f68c: df 91 pop r29 2f68e: cf 91 pop r28 2f690: 1f 91 pop r17 2f692: 0f 91 pop r16 2f694: ff 90 pop r15 2f696: ef 90 pop r14 2f698: df 90 pop r13 2f69a: cf 90 pop r12 2f69c: bf 90 pop r11 2f69e: af 90 pop r10 2f6a0: 9f 90 pop r9 2f6a2: 8f 90 pop r8 2f6a4: 7f 90 pop r7 2f6a6: 6f 90 pop r6 2f6a8: 5f 90 pop r5 2f6aa: 4f 90 pop r4 2f6ac: 3f 90 pop r3 2f6ae: 2f 90 pop r2 2f6b0: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2f6b2: 80 91 86 17 lds r24, 0x1786 ; 0x801786 2f6b6: 90 91 87 17 lds r25, 0x1787 ; 0x801787 2f6ba: 48 16 cp r4, r24 2f6bc: 19 06 cpc r1, r25 2f6be: a9 f2 breq .-86 ; 0x2f66a cnt++; 2f6c0: 43 94 inc r4 2f6c2: 74 cf rjmp .-280 ; 0x2f5ac 0002f6c4 : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2f6c4: cf 92 push r12 2f6c6: df 92 push r13 2f6c8: ef 92 push r14 2f6ca: ff 92 push r15 2f6cc: 0f 93 push r16 2f6ce: cf 93 push r28 2f6d0: df 93 push r29 2f6d2: cd b7 in r28, 0x3d ; 61 2f6d4: de b7 in r29, 0x3e ; 62 2f6d6: a3 97 sbiw r28, 0x23 ; 35 2f6d8: 0f b6 in r0, 0x3f ; 63 2f6da: f8 94 cli 2f6dc: de bf out 0x3e, r29 ; 62 2f6de: 0f be out 0x3f, r0 ; 63 2f6e0: cd bf out 0x3d, r28 ; 61 2f6e2: 6c 01 movw r12, r24 { curDir=&workDir; 2f6e4: 87 e1 ldi r24, 0x17 ; 23 2f6e6: e8 2e mov r14, r24 2f6e8: 85 e1 ldi r24, 0x15 ; 21 2f6ea: f8 2e mov r15, r24 2f6ec: 89 e1 ldi r24, 0x19 ; 25 2f6ee: 95 e1 ldi r25, 0x15 ; 21 2f6f0: d7 01 movw r26, r14 2f6f2: 8d 93 st X+, r24 2f6f4: 9c 93 st X, r25 nrFiles=nr; 2f6f6: 10 92 87 17 sts 0x1787, r1 ; 0x801787 2f6fa: 10 92 86 17 sts 0x1786, r1 ; 0x801786 curDir->rewind(); 2f6fe: 0e 94 b7 78 call 0xf16e ; 0xf16e }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2f702: 00 e0 ldi r16, 0x00 ; 0 2f704: 0e 7f andi r16, 0xFE ; 254 2f706: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2f708: d7 01 movw r26, r14 2f70a: ed 91 ld r30, X+ 2f70c: fc 91 ld r31, X 2f70e: 83 e2 ldi r24, 0x23 ; 35 2f710: de 01 movw r26, r28 2f712: 11 96 adiw r26, 0x01 ; 1 2f714: 01 90 ld r0, Z+ 2f716: 0d 92 st X+, r0 2f718: 8a 95 dec r24 2f71a: e1 f7 brne .-8 ; 0x2f714 2f71c: 22 e0 ldi r18, 0x02 ; 2 2f71e: a6 01 movw r20, r12 2f720: be 01 movw r22, r28 2f722: 6f 5f subi r22, 0xFF ; 255 2f724: 7f 4f sbci r23, 0xFF ; 255 2f726: 84 ef ldi r24, 0xF4 ; 244 2f728: 92 e0 ldi r25, 0x02 ; 2 2f72a: 0f 94 33 79 call 0x2f266 ; 0x2f266 2f72e: ce 01 movw r24, r28 2f730: 01 96 adiw r24, 0x01 ; 1 2f732: 0e 94 bc 78 call 0xf178 ; 0xf178 } 2f736: a3 96 adiw r28, 0x23 ; 35 2f738: 0f b6 in r0, 0x3f ; 63 2f73a: f8 94 cli 2f73c: de bf out 0x3e, r29 ; 62 2f73e: 0f be out 0x3f, r0 ; 63 2f740: cd bf out 0x3d, r28 ; 61 2f742: df 91 pop r29 2f744: cf 91 pop r28 2f746: 0f 91 pop r16 2f748: ff 90 pop r15 2f74a: ef 90 pop r14 2f74c: df 90 pop r13 2f74e: cf 90 pop r12 2f750: 08 95 ret 0002f752 : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2f752: ef 92 push r14 2f754: ff 92 push r15 2f756: 0f 93 push r16 2f758: cf 93 push r28 2f75a: df 93 push r29 2f75c: cd b7 in r28, 0x3d ; 61 2f75e: de b7 in r29, 0x3e ; 62 2f760: a3 97 sbiw r28, 0x23 ; 35 2f762: 0f b6 in r0, 0x3f ; 63 2f764: f8 94 cli 2f766: de bf out 0x3e, r29 ; 62 2f768: 0f be out 0x3f, r0 ; 63 2f76a: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2f76c: 27 e1 ldi r18, 0x17 ; 23 2f76e: e2 2e mov r14, r18 2f770: 25 e1 ldi r18, 0x15 ; 21 2f772: f2 2e mov r15, r18 2f774: 29 e1 ldi r18, 0x19 ; 25 2f776: 35 e1 ldi r19, 0x15 ; 21 2f778: d7 01 movw r26, r14 2f77a: 2d 93 st X+, r18 2f77c: 3c 93 st X, r19 nrFiles = 0; 2f77e: 10 92 87 17 sts 0x1787, r1 ; 0x801787 2f782: 10 92 86 17 sts 0x1786, r1 ; 0x801786 curDir->seekSet((uint32_t)entry << 5); 2f786: b0 e0 ldi r27, 0x00 ; 0 2f788: a0 e0 ldi r26, 0x00 ; 0 2f78a: ac 01 movw r20, r24 2f78c: bd 01 movw r22, r26 2f78e: e5 e0 ldi r30, 0x05 ; 5 2f790: 44 0f add r20, r20 2f792: 55 1f adc r21, r21 2f794: 66 1f adc r22, r22 2f796: 77 1f adc r23, r23 2f798: ea 95 dec r30 2f79a: d1 f7 brne .-12 ; 0x2f790 2f79c: c9 01 movw r24, r18 2f79e: 0f 94 b1 6e call 0x2dd62 ; 0x2dd62 2f7a2: 00 e0 ldi r16, 0x00 ; 0 2f7a4: 0e 7f andi r16, 0xFE ; 254 2f7a6: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2f7a8: d7 01 movw r26, r14 2f7aa: ed 91 ld r30, X+ 2f7ac: fc 91 ld r31, X 2f7ae: 83 e2 ldi r24, 0x23 ; 35 2f7b0: de 01 movw r26, r28 2f7b2: 11 96 adiw r26, 0x01 ; 1 2f7b4: 01 90 ld r0, Z+ 2f7b6: 0d 92 st X+, r0 2f7b8: 8a 95 dec r24 2f7ba: e1 f7 brne .-8 ; 0x2f7b4 2f7bc: 22 e0 ldi r18, 0x02 ; 2 2f7be: 50 e0 ldi r21, 0x00 ; 0 2f7c0: 40 e0 ldi r20, 0x00 ; 0 2f7c2: be 01 movw r22, r28 2f7c4: 6f 5f subi r22, 0xFF ; 255 2f7c6: 7f 4f sbci r23, 0xFF ; 255 2f7c8: 84 ef ldi r24, 0xF4 ; 244 2f7ca: 92 e0 ldi r25, 0x02 ; 2 2f7cc: 0f 94 33 79 call 0x2f266 ; 0x2f266 2f7d0: ce 01 movw r24, r28 2f7d2: 01 96 adiw r24, 0x01 ; 1 2f7d4: 0e 94 bc 78 call 0xf178 ; 0xf178 } 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: 08 95 ret 0002f7f0 : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2f7f0: cf 92 push r12 2f7f2: df 92 push r13 2f7f4: ef 92 push r14 2f7f6: ff 92 push r15 2f7f8: 0f 93 push r16 2f7fa: cf 93 push r28 2f7fc: df 93 push r29 2f7fe: cd b7 in r28, 0x3d ; 61 2f800: de b7 in r29, 0x3e ; 62 2f802: a3 97 sbiw r28, 0x23 ; 35 2f804: 0f b6 in r0, 0x3f ; 63 2f806: f8 94 cli 2f808: de bf out 0x3e, r29 ; 62 2f80a: 0f be out 0x3f, r0 ; 63 2f80c: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2f80e: 87 e1 ldi r24, 0x17 ; 23 2f810: c8 2e mov r12, r24 2f812: 85 e1 ldi r24, 0x15 ; 21 2f814: d8 2e mov r13, r24 2f816: 89 e1 ldi r24, 0x19 ; 25 2f818: 95 e1 ldi r25, 0x15 ; 21 2f81a: d6 01 movw r26, r12 2f81c: 8d 93 st X+, r24 2f81e: 9c 93 st X, r25 nrFiles=0; 2f820: 26 e8 ldi r18, 0x86 ; 134 2f822: e2 2e mov r14, r18 2f824: 27 e1 ldi r18, 0x17 ; 23 2f826: f2 2e mov r15, r18 2f828: f7 01 movw r30, r14 2f82a: 11 82 std Z+1, r1 ; 0x01 2f82c: 10 82 st Z, r1 curDir->rewind(); 2f82e: 0e 94 b7 78 call 0xf16e ; 0xf16e 2f832: 00 e0 ldi r16, 0x00 ; 0 2f834: 0e 7f andi r16, 0xFE ; 254 2f836: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2f838: d6 01 movw r26, r12 2f83a: ed 91 ld r30, X+ 2f83c: fc 91 ld r31, X 2f83e: 83 e2 ldi r24, 0x23 ; 35 2f840: de 01 movw r26, r28 2f842: 11 96 adiw r26, 0x01 ; 1 2f844: 01 90 ld r0, Z+ 2f846: 0d 92 st X+, r0 2f848: 8a 95 dec r24 2f84a: e1 f7 brne .-8 ; 0x2f844 2f84c: 21 e0 ldi r18, 0x01 ; 1 2f84e: 50 e0 ldi r21, 0x00 ; 0 2f850: 40 e0 ldi r20, 0x00 ; 0 2f852: be 01 movw r22, r28 2f854: 6f 5f subi r22, 0xFF ; 255 2f856: 7f 4f sbci r23, 0xFF ; 255 2f858: 84 ef ldi r24, 0xF4 ; 244 2f85a: 92 e0 ldi r25, 0x02 ; 2 2f85c: 0f 94 33 79 call 0x2f266 ; 0x2f266 2f860: ce 01 movw r24, r28 2f862: 01 96 adiw r24, 0x01 ; 1 2f864: 0e 94 bc 78 call 0xf178 ; 0xf178 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2f868: f7 01 movw r30, r14 2f86a: 80 81 ld r24, Z 2f86c: 91 81 ldd r25, Z+1 ; 0x01 2f86e: a3 96 adiw r28, 0x23 ; 35 2f870: 0f b6 in r0, 0x3f ; 63 2f872: f8 94 cli 2f874: de bf out 0x3e, r29 ; 62 2f876: 0f be out 0x3f, r0 ; 63 2f878: cd bf out 0x3d, r28 ; 61 2f87a: df 91 pop r29 2f87c: cf 91 pop r28 2f87e: 0f 91 pop r16 2f880: ff 90 pop r15 2f882: ef 90 pop r14 2f884: df 90 pop r13 2f886: cf 90 pop r12 2f888: 08 95 ret 0002f88a : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2f88a: cf 93 push r28 2f88c: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2f88e: 8f e2 ldi r24, 0x2F ; 47 2f890: 0e 94 c2 78 call 0xf184 ; 0xf184 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f894: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2f896: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f898: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 2f89c: c8 17 cp r28, r24 2f89e: 60 f4 brcc .+24 ; 0x2f8b8 { SERIAL_PROTOCOL(dir_names[i]); 2f8a0: cd 9f mul r28, r29 2f8a2: c0 01 movw r24, r0 2f8a4: 11 24 eor r1, r1 2f8a6: 82 54 subi r24, 0x42 ; 66 2f8a8: 9b 4e sbci r25, 0xEB ; 235 2f8aa: 0e 94 3f 89 call 0x1127e ; 0x1127e 2f8ae: 8f e2 ldi r24, 0x2F ; 47 2f8b0: 0e 94 c2 78 call 0xf184 ; 0xf184 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2f8b4: cf 5f subi r28, 0xFF ; 255 2f8b6: f0 cf rjmp .-32 ; 0x2f898 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f8b8: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2f8bc: 81 11 cpse r24, r1 2f8be: 06 c0 rjmp .+12 ; 0x2f8cc 2f8c0: 80 e7 ldi r24, 0x70 ; 112 2f8c2: 94 e1 ldi r25, 0x14 ; 20 } 2f8c4: df 91 pop r29 2f8c6: cf 91 pop r28 2f8c8: 0c 94 3f 89 jmp 0x1127e ; 0x1127e for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2f8cc: 85 e8 ldi r24, 0x85 ; 133 2f8ce: 94 e1 ldi r25, 0x14 ; 20 2f8d0: f9 cf rjmp .-14 ; 0x2f8c4 0002f8d2 : 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) { 2f8d2: cf 92 push r12 2f8d4: df 92 push r13 2f8d6: ef 92 push r14 2f8d8: ff 92 push r15 2f8da: 6b 01 movw r12, r22 2f8dc: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2f8de: 88 ea ldi r24, 0xA8 ; 168 2f8e0: 9c e0 ldi r25, 0x0C ; 12 2f8e2: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 2f8e6: ab 01 movw r20, r22 2f8e8: bc 01 movw r22, r24 2f8ea: 4c 0d add r20, r12 2f8ec: 5d 1d adc r21, r13 2f8ee: 6e 1d adc r22, r14 2f8f0: 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); 2f8f2: 88 ea ldi r24, 0xA8 ; 168 2f8f4: 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); } 2f8f6: ff 90 pop r15 2f8f8: ef 90 pop r14 2f8fa: df 90 pop r13 2f8fc: 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); 2f8fe: 0d 94 e7 dd jmp 0x3bbce ; 0x3bbce 0002f902 : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2f902: cf 93 push r28 2f904: df 93 push r29 2f906: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2f908: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 if (val == EEPROM_EMPTY_VALUE32) { 2f90c: 6f 3f cpi r22, 0xFF ; 255 2f90e: 2f ef ldi r18, 0xFF ; 255 2f910: 72 07 cpc r23, r18 2f912: 82 07 cpc r24, r18 2f914: 92 07 cpc r25, r18 2f916: 49 f4 brne .+18 ; 0x2f92a 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); 2f918: 40 e0 ldi r20, 0x00 ; 0 2f91a: 50 e0 ldi r21, 0x00 ; 0 2f91c: ba 01 movw r22, r20 2f91e: ce 01 movw r24, r28 2f920: 0f 94 e7 dd call 0x3bbce ; 0x3bbce 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; 2f924: 60 e0 ldi r22, 0x00 ; 0 2f926: 70 e0 ldi r23, 0x00 ; 0 2f928: cb 01 movw r24, r22 } return val; } 2f92a: df 91 pop r29 2f92c: cf 91 pop r28 2f92e: 08 95 ret 0002f930 : } // 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; 2f930: e6 e0 ldi r30, 0x06 ; 6 2f932: f7 e1 ldi r31, 0x17 ; 23 2f934: 40 81 ld r20, Z 2f936: 51 81 ldd r21, Z+1 ; 0x01 2f938: 62 81 ldd r22, Z+2 ; 0x02 2f93a: 73 81 ldd r23, Z+3 ; 0x03 2f93c: 48 0f add r20, r24 2f93e: 59 1f adc r21, r25 2f940: 61 1d adc r22, r1 2f942: 71 1d adc r23, r1 2f944: 40 83 st Z, r20 2f946: 51 83 std Z+1, r21 ; 0x01 2f948: 62 83 std Z+2, r22 ; 0x02 2f94a: 73 83 std Z+3, r23 ; 0x03 } 2f94c: 08 95 ret 0002f94e : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2f94e: 0f 93 push r16 2f950: 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_ ){ 2f952: 60 91 1b 17 lds r22, 0x171B ; 0x80171b 2f956: 70 91 1c 17 lds r23, 0x171C ; 0x80171c 2f95a: 80 91 1d 17 lds r24, 0x171D ; 0x80171d 2f95e: 90 91 1e 17 lds r25, 0x171E ; 0x80171e 2f962: 00 91 6f 0e lds r16, 0x0E6F ; 0x800e6f 2f966: 10 91 70 0e lds r17, 0x0E70 ; 0x800e70 2f96a: 20 91 71 0e lds r18, 0x0E71 ; 0x800e71 2f96e: 30 91 72 0e lds r19, 0x0E72 ; 0x800e72 2f972: 60 17 cp r22, r16 2f974: 71 07 cpc r23, r17 2f976: 82 07 cpc r24, r18 2f978: 93 07 cpc r25, r19 2f97a: 39 f1 breq .+78 ; 0x2f9ca if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2f97c: 40 e0 ldi r20, 0x00 ; 0 2f97e: 0f 94 df 6b call 0x2d7be ; 0x2d7be 2f982: 88 23 and r24, r24 2f984: f9 f0 breq .+62 ; 0x2f9c4 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2f986: 20 91 1f 17 lds r18, 0x171F ; 0x80171f 2f98a: 30 91 20 17 lds r19, 0x1720 ; 0x801720 2f98e: 40 91 0f 17 lds r20, 0x170F ; 0x80170f 2f992: 50 91 10 17 lds r21, 0x1710 ; 0x801710 2f996: 60 91 11 17 lds r22, 0x1711 ; 0x801711 2f99a: 70 91 12 17 lds r23, 0x1712 ; 0x801712 2f99e: 42 1b sub r20, r18 2f9a0: 53 0b sbc r21, r19 2f9a2: 61 09 sbc r22, r1 2f9a4: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2f9a6: 41 30 cpi r20, 0x01 ; 1 2f9a8: 92 e0 ldi r25, 0x02 ; 2 2f9aa: 59 07 cpc r21, r25 2f9ac: 61 05 cpc r22, r1 2f9ae: 71 05 cpc r23, r1 2f9b0: 20 f0 brcs .+8 ; 0x2f9ba 2f9b2: 40 e0 ldi r20, 0x00 ; 0 2f9b4: 52 e0 ldi r21, 0x02 ; 2 2f9b6: 60 e0 ldi r22, 0x00 ; 0 2f9b8: 70 e0 ldi r23, 0x00 ; 0 2f9ba: 45 58 subi r20, 0x85 ; 133 2f9bc: 51 4f sbci r21, 0xF1 ; 241 2f9be: 9a e0 ldi r25, 0x0A ; 10 2f9c0: fa 01 movw r30, r20 2f9c2: 90 83 st Z, r25 } return true; } 2f9c4: 1f 91 pop r17 2f9c6: 0f 91 pop r16 2f9c8: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2f9ca: 81 e0 ldi r24, 0x01 ; 1 2f9cc: fb cf rjmp .-10 ; 0x2f9c4 0002f9ce : voltReady = true; } uint16_t IR_sensor_analog::getVoltRaw() { uint16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = voltRaw; } 2f9ce: 2f b7 in r18, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2f9d0: f8 94 cli 2f9d2: 80 91 93 17 lds r24, 0x1793 ; 0x801793 2f9d6: 90 91 94 17 lds r25, 0x1794 ; 0x801794 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2f9da: 2f bf out 0x3f, r18 ; 63 return ret; } 2f9dc: 08 95 ret 0002f9de : const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { 2f9de: 80 91 91 17 lds r24, 0x1791 ; 0x801791 2f9e2: 88 23 and r24, r24 2f9e4: 29 f0 breq .+10 ; 0x2f9f0 2f9e6: 81 30 cpi r24, 0x01 ; 1 2f9e8: 39 f0 breq .+14 ; 0x2f9f8 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); 2f9ea: 82 e1 ldi r24, 0x12 ; 18 2f9ec: 9d e5 ldi r25, 0x5D ; 93 2f9ee: 02 c0 rjmp .+4 ; 0x2f9f4 } const char *IR_sensor_analog::getIRVersionText() { switch (sensorRevision) { case SensorRevision::_Old: return _T(MSG_IR_03_OR_OLDER); 2f9f0: 82 e3 ldi r24, 0x32 ; 50 2f9f2: 9d e5 ldi r25, 0x5D ; 93 case SensorRevision::_Rev04: return _T(MSG_IR_04_OR_NEWER); default: return _T(MSG_IR_UNKNOWN); 2f9f4: 0c 94 61 73 jmp 0xe6c2 ; 0xe6c2 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); 2f9f8: 82 e2 ldi r24, 0x22 ; 34 2f9fa: 9d e5 ldi r25, 0x5D ; 93 2f9fc: fb cf rjmp .-10 ; 0x2f9f4 0002f9fe : void IR_sensor_analog::clearVoltReady(){ ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ voltReady = false; } } void IR_sensor_analog::IR_ANALOG_Check(SensorRevision isVersion, SensorRevision switchTo) { 2f9fe: cf 93 push r28 bool bTemp = (!CHECK_ALL_HEATERS); 2fa00: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 2fa04: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 2fa08: 23 2b or r18, r19 2fa0a: b9 f4 brne .+46 ; 0x2fa3a 2fa0c: 20 91 6b 0e lds r18, 0x0E6B ; 0x800e6b 2fa10: 30 91 6c 0e lds r19, 0x0E6C ; 0x800e6c 2fa14: 23 2b or r18, r19 2fa16: 89 f4 brne .+34 ; 0x2fa3a bTemp = bTemp && (menu_menu == lcd_status_screen); 2fa18: 20 91 69 0e lds r18, 0x0E69 ; 0x800e69 2fa1c: 30 91 6a 0e lds r19, 0x0E6A ; 0x800e6a 2fa20: 2c 53 subi r18, 0x3C ; 60 2fa22: 3a 43 sbci r19, 0x3A ; 58 2fa24: 51 f4 brne .+20 ; 0x2fa3a bTemp = bTemp && ((sensorRevision == isVersion) || (sensorRevision == SensorRevision::_Undef)); 2fa26: 90 91 91 17 lds r25, 0x1791 ; 0x801791 2fa2a: 98 17 cp r25, r24 2fa2c: 11 f0 breq .+4 ; 0x2fa32 2fa2e: 9f 3f cpi r25, 0xFF ; 255 2fa30: 21 f4 brne .+8 ; 0x2fa3a bTemp = bTemp && (state == State::ready); 2fa32: 80 91 88 17 lds r24, 0x1788 ; 0x801788 2fa36: 82 30 cpi r24, 0x02 ; 2 2fa38: 31 f0 breq .+12 ; 0x2fa46 default: break; } } } else { nFSCheckCount = 0; 2fa3a: 10 92 9a 17 sts 0x179A, r1 ; 0x80179a 2fa3e: 10 92 99 17 sts 0x1799, r1 ; 0x801799 } } 2fa42: cf 91 pop r28 2fa44: 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++; 2fa46: 80 91 99 17 lds r24, 0x1799 ; 0x801799 2fa4a: 90 91 9a 17 lds r25, 0x179A ; 0x80179a 2fa4e: 01 96 adiw r24, 0x01 ; 1 if (nFSCheckCount > FS_CHECK_COUNT) { 2fa50: 85 30 cpi r24, 0x05 ; 5 2fa52: 91 05 cpc r25, r1 2fa54: 28 f4 brcc .+10 ; 0x2fa60 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++; 2fa56: 90 93 9a 17 sts 0x179A, r25 ; 0x80179a 2fa5a: 80 93 99 17 sts 0x1799, r24 ; 0x801799 2fa5e: f1 cf rjmp .-30 ; 0x2fa42 2fa60: c6 2f mov r28, r22 if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary 2fa62: 10 92 9a 17 sts 0x179A, r1 ; 0x80179a 2fa66: 10 92 99 17 sts 0x1799, r1 ; 0x801799 return _T(MSG_IR_UNKNOWN); } } void IR_sensor_analog::setSensorRevision(SensorRevision rev, bool updateEEPROM) { sensorRevision = rev; 2fa6a: 60 93 91 17 sts 0x1791, r22 ; 0x801791 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 2fa6e: 88 e4 ldi r24, 0x48 ; 72 2fa70: 9d e0 ldi r25, 0x0D ; 13 2fa72: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a if (bTemp) { nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); 2fa76: 0f 94 67 15 call 0x22ace ; 0x22ace switch (switchTo) { case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); 2fa7a: 82 e3 ldi r24, 0x32 ; 50 2fa7c: 9d e5 ldi r25, 0x5D ; 93 nFSCheckCount++; if (nFSCheckCount > FS_CHECK_COUNT) { nFSCheckCount = 0; // not necessary setSensorRevision(switchTo, true); printf_IRSensorAnalogBoardChange(); switch (switchTo) { 2fa7e: c1 30 cpi r28, 0x01 ; 1 2fa80: 11 f4 brne .+4 ; 0x2fa86 case SensorRevision::_Old: lcd_setstatuspgm(_T(MSG_IR_03_OR_OLDER)); break; case SensorRevision::_Rev04: lcd_setstatuspgm(_T(MSG_IR_04_OR_NEWER)); 2fa82: 82 e2 ldi r24, 0x22 ; 34 2fa84: 9d e5 ldi r25, 0x5D ; 93 2fa86: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 } } } else { nFSCheckCount = 0; } } 2fa8a: 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)); 2fa8c: 0d 94 ea 0b jmp 0x217d4 ; 0x217d4 0002fa90 : * 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() { 2fa90: 2f 92 push r2 2fa92: 3f 92 push r3 2fa94: 4f 92 push r4 2fa96: 5f 92 push r5 2fa98: 6f 92 push r6 2fa9a: 7f 92 push r7 2fa9c: 8f 92 push r8 2fa9e: 9f 92 push r9 2faa0: af 92 push r10 2faa2: bf 92 push r11 2faa4: cf 92 push r12 2faa6: df 92 push r13 2faa8: ef 92 push r14 2faaa: ff 92 push r15 2faac: 0f 93 push r16 2faae: 1f 93 push r17 2fab0: cf 93 push r28 2fab2: df 93 push r29 2fab4: cd b7 in r28, 0x3d ; 61 2fab6: de b7 in r29, 0x3e ; 62 2fab8: ed 97 sbiw r28, 0x3d ; 61 2faba: 0f b6 in r0, 0x3f ; 63 2fabc: f8 94 cli 2fabe: de bf out 0x3e, r29 ; 62 2fac0: 0f be out 0x3f, r0 ; 63 2fac2: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2fac4: 10 92 10 16 sts 0x1610, r1 ; 0x801610 2fac8: 10 92 0f 16 sts 0x160F, r1 ; 0x80160f lastSortedFilePosition = 0; 2facc: 10 92 da 16 sts 0x16DA, r1 ; 0x8016da 2fad0: 10 92 d9 16 sts 0x16D9, r1 ; 0x8016d9 */ void CardReader::presort() { // Throw away old sort index flush_presort(); if (IS_SD_INSERTED == false) return; //sorting is not used in farm mode 2fad4: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fad8: 80 fd sbrc r24, 0 2fada: ef c0 rjmp .+478 ; 0x2fcba uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2fadc: 89 e0 ldi r24, 0x09 ; 9 2fade: 9f e0 ldi r25, 0x0F ; 15 2fae0: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 2fae4: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2fae6: 82 e0 ldi r24, 0x02 ; 2 2fae8: 80 93 96 02 sts 0x0296, r24 ; 0x800296 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2faec: 0f 94 f8 7b call 0x2f7f0 ; 0x2f7f0 2faf0: 6c 01 movw r12, r24 if (fileCnt > 0) { 2faf2: 00 97 sbiw r24, 0x00 ; 0 2faf4: 09 f4 brne .+2 ; 0x2faf8 2faf6: de c0 rjmp .+444 ; 0x2fcb4 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2faf8: 85 36 cpi r24, 0x65 ; 101 2fafa: 91 05 cpc r25, r1 2fafc: 60 f0 brcs .+24 ; 0x2fb16 if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2fafe: 32 e0 ldi r19, 0x02 ; 2 2fb00: 33 16 cp r3, r19 2fb02: 31 f0 breq .+12 ; 0x2fb10 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2fb04: 8f eb ldi r24, 0xBF ; 191 2fb06: 9c e5 ldi r25, 0x5C ; 92 2fb08: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2fb0c: 0f 94 0c 36 call 0x26c18 ; 0x26c18 } fileCnt = SDSORT_LIMIT; 2fb10: f4 e6 ldi r31, 0x64 ; 100 2fb12: cf 2e mov r12, r31 2fb14: d1 2c mov r13, r1 } sort_count = fileCnt; 2fb16: d0 92 10 16 sts 0x1610, r13 ; 0x801610 2fb1a: c0 92 0f 16 sts 0x160F, r12 ; 0x80160f 2fb1e: 61 e1 ldi r22, 0x11 ; 17 2fb20: 66 2e mov r6, r22 2fb22: 66 e1 ldi r22, 0x16 ; 22 2fb24: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fb26: f1 2c mov r15, r1 2fb28: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fb2a: 79 e1 ldi r23, 0x19 ; 25 2fb2c: a7 2e mov r10, r23 2fb2e: 75 e1 ldi r23, 0x15 ; 21 2fb30: b7 2e mov r11, r23 nrFiles = 1; 2fb32: 88 24 eor r8, r8 2fb34: 83 94 inc r8 2fb36: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2fb38: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fb3c: 80 fd sbrc r24, 0 2fb3e: bd c0 rjmp .+378 ; 0x2fcba manage_heater(); 2fb40: 0f 94 a0 4e call 0x29d40 ; 0x29d40 if (i == 0) 2fb44: e1 14 cp r14, r1 2fb46: f1 04 cpc r15, r1 2fb48: 09 f0 breq .+2 ; 0x2fb4c 2fb4a: d0 c0 rjmp .+416 ; 0x2fcec getfilename(0); 2fb4c: 90 e0 ldi r25, 0x00 ; 0 2fb4e: 80 e0 ldi r24, 0x00 ; 0 2fb50: 0f 94 62 7b call 0x2f6c4 ; 0x2f6c4 else getfilename_next(position); sort_entries[i] = position >> 5; 2fb54: 80 91 81 14 lds r24, 0x1481 ; 0x801481 2fb58: 90 91 82 14 lds r25, 0x1482 ; 0x801482 2fb5c: a0 91 83 14 lds r26, 0x1483 ; 0x801483 2fb60: b0 91 84 14 lds r27, 0x1484 ; 0x801484 2fb64: 55 e0 ldi r21, 0x05 ; 5 2fb66: b6 95 lsr r27 2fb68: a7 95 ror r26 2fb6a: 97 95 ror r25 2fb6c: 87 95 ror r24 2fb6e: 5a 95 dec r21 2fb70: d1 f7 brne .-12 ; 0x2fb66 2fb72: f3 01 movw r30, r6 2fb74: 81 93 st Z+, r24 2fb76: 91 93 st Z+, r25 2fb78: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2fb7a: ff ef ldi r31, 0xFF ; 255 2fb7c: ef 1a sub r14, r31 2fb7e: ff 0a sbc r15, r31 2fb80: ce 14 cp r12, r14 2fb82: df 04 cpc r13, r15 2fb84: c9 f6 brne .-78 ; 0x2fb38 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2fb86: 21 e0 ldi r18, 0x01 ; 1 2fb88: e2 16 cp r14, r18 2fb8a: f1 04 cpc r15, r1 2fb8c: 09 f4 brne .+2 ; 0x2fb90 2fb8e: 92 c0 rjmp .+292 ; 0x2fcb4 2fb90: 32 e0 ldi r19, 0x02 ; 2 2fb92: 33 16 cp r3, r19 2fb94: 09 f4 brne .+2 ; 0x2fb98 2fb96: 8e c0 rjmp .+284 ; 0x2fcb4 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2fb98: 90 93 da 16 sts 0x16DA, r25 ; 0x8016da 2fb9c: 80 93 d9 16 sts 0x16D9, r24 ; 0x8016d9 #define _SORT_CMP_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_NODIR() : (fs < 0 ? dir1 : !dir1)) #define _SORT_CMP_TIME_DIR(fs) ((dir1 == filenameIsDir) ? _SORT_CMP_TIME_NODIR() : (fs < 0 ? dir1 : !dir1)) #endif uint16_t counter = 0; menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); 2fba0: 8f ea ldi r24, 0xAF ; 175 2fba2: 9c e5 ldi r25, 0x5C ; 92 2fba4: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 2fba8: ee 9c mul r14, r14 2fbaa: 90 01 movw r18, r0 2fbac: ef 9c mul r14, r15 2fbae: 30 0d add r19, r0 2fbb0: 30 0d add r19, r0 2fbb2: 11 24 eor r1, r1 2fbb4: bc 01 movw r22, r24 2fbb6: c9 01 movw r24, r18 2fbb8: 96 95 lsr r25 2fbba: 87 95 ror r24 2fbbc: 0f 94 72 cd call 0x39ae4 ; 0x39ae4 2fbc0: 33 e1 ldi r19, 0x13 ; 19 2fbc2: a3 2e mov r10, r19 2fbc4: 36 e1 ldi r19, 0x16 ; 22 2fbc6: 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; 2fbc8: 91 2c mov r9, r1 2fbca: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2fbcc: cc 24 eor r12, r12 2fbce: c3 94 inc r12 2fbd0: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2fbd2: c4 01 movw r24, r8 2fbd4: 0f 94 43 cd call 0x39a86 ; 0x39a86 counter += i; 2fbd8: 8c 0c add r8, r12 2fbda: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2fbdc: f5 01 movw r30, r10 2fbde: 01 90 ld r0, Z+ 2fbe0: f0 81 ld r31, Z 2fbe2: e0 2d mov r30, r0 2fbe4: f9 af std Y+57, r31 ; 0x39 2fbe6: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2fbe8: cf 01 movw r24, r30 2fbea: 0f 94 a9 7b call 0x2f752 ; 0x2f752 strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2fbee: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2fbf2: 60 e7 ldi r22, 0x70 ; 112 2fbf4: 74 e1 ldi r23, 0x14 ; 20 2fbf6: 88 23 and r24, r24 2fbf8: 11 f0 breq .+4 ; 0x2fbfe 2fbfa: 65 e8 ldi r22, 0x85 ; 133 2fbfc: 74 e1 ldi r23, 0x14 ; 20 2fbfe: ce 01 movw r24, r28 2fc00: 01 96 adiw r24, 0x01 ; 1 2fc02: 0f 94 fc e3 call 0x3c7f8 ; 0x3c7f8 crmod_date_bckp = crmodDate; 2fc06: 60 90 7f 14 lds r6, 0x147F ; 0x80147f 2fc0a: 70 90 80 14 lds r7, 0x1480 ; 0x801480 crmod_time_bckp = crmodTime; 2fc0e: 20 91 7d 14 lds r18, 0x147D ; 0x80147d 2fc12: 30 91 7e 14 lds r19, 0x147E ; 0x80147e 2fc16: 3b af std Y+59, r19 ; 0x3b 2fc18: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2fc1a: 20 90 ba 14 lds r2, 0x14BA ; 0x8014ba 2fc1e: bf aa std Y+55, r11 ; 0x37 2fc20: ae aa std Y+54, r10 ; 0x36 2fc22: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2fc24: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2fc28: 80 fd sbrc r24, 0 2fc2a: 47 c0 rjmp .+142 ; 0x2fcba printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2fc2c: 0f 94 a0 4e call 0x29d40 ; 0x29d40 const uint16_t o2 = sort_entries[j - 1]; 2fc30: c8 01 movw r24, r16 2fc32: 01 97 sbiw r24, 0x01 ; 1 2fc34: 9d af std Y+61, r25 ; 0x3d 2fc36: 8c af std Y+60, r24 ; 0x3c 2fc38: ee a9 ldd r30, Y+54 ; 0x36 2fc3a: ff a9 ldd r31, Y+55 ; 0x37 2fc3c: 52 90 ld r5, -Z 2fc3e: 42 90 ld r4, -Z 2fc40: ff ab std Y+55, r31 ; 0x37 2fc42: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2fc44: c2 01 movw r24, r4 2fc46: 0f 94 a9 7b call 0x2f752 ; 0x2f752 char *name2 = LONGEST_FILENAME; // use the string in-place 2fc4a: 80 91 85 14 lds r24, 0x1485 ; 0x801485 2fc4e: 60 e7 ldi r22, 0x70 ; 112 2fc50: 74 e1 ldi r23, 0x14 ; 20 2fc52: 88 23 and r24, r24 2fc54: 11 f0 breq .+4 ; 0x2fc5a 2fc56: 65 e8 ldi r22, 0x85 ; 133 2fc58: 74 e1 ldi r23, 0x14 ; 20 // Sort the current pair according to settings. if ( 2fc5a: 31 10 cpse r3, r1 2fc5c: 8a c0 rjmp .+276 ; 0x2fd72 2fc5e: 80 91 ba 14 lds r24, 0x14BA ; 0x8014ba 2fc62: 28 12 cpse r2, r24 2fc64: 83 c0 rjmp .+262 ; 0x2fd6c #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fc66: 80 91 7f 14 lds r24, 0x147F ; 0x80147f 2fc6a: 90 91 80 14 lds r25, 0x1480 ; 0x801480 2fc6e: 68 16 cp r6, r24 2fc70: 79 06 cpc r7, r25 2fc72: 09 f0 breq .+2 ; 0x2fc76 2fc74: 6c c0 rjmp .+216 ; 0x2fd4e 2fc76: 80 91 7d 14 lds r24, 0x147D ; 0x80147d 2fc7a: 90 91 7e 14 lds r25, 0x147E ; 0x80147e 2fc7e: 2a ad ldd r18, Y+58 ; 0x3a 2fc80: 3b ad ldd r19, Y+59 ; 0x3b 2fc82: 82 17 cp r24, r18 2fc84: 93 07 cpc r25, r19 2fc86: 08 f0 brcs .+2 ; 0x2fc8a 2fc88: 66 c0 rjmp .+204 ; 0x2fd56 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2fc8a: 00 0f add r16, r16 2fc8c: 11 1f adc r17, r17 2fc8e: f8 01 movw r30, r16 2fc90: ef 5e subi r30, 0xEF ; 239 2fc92: f9 4e sbci r31, 0xE9 ; 233 2fc94: 28 ad ldd r18, Y+56 ; 0x38 2fc96: 39 ad ldd r19, Y+57 ; 0x39 2fc98: 31 83 std Z+1, r19 ; 0x01 2fc9a: 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){ 2fc9c: 3f ef ldi r19, 0xFF ; 255 2fc9e: c3 1a sub r12, r19 2fca0: d3 0a sbc r13, r19 2fca2: 82 e0 ldi r24, 0x02 ; 2 2fca4: a8 0e add r10, r24 2fca6: b1 1c adc r11, r1 2fca8: ec 14 cp r14, r12 2fcaa: fd 04 cpc r15, r13 2fcac: 09 f0 breq .+2 ; 0x2fcb0 2fcae: 91 cf rjmp .-222 ; 0x2fbd2 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2fcb0: 0f 94 64 cd call 0x39ac8 ; 0x39ac8 } } KEEPALIVE_STATE(NOT_BUSY); 2fcb4: 81 e0 ldi r24, 0x01 ; 1 2fcb6: 80 93 96 02 sts 0x0296, r24 ; 0x800296 } 2fcba: ed 96 adiw r28, 0x3d ; 61 2fcbc: 0f b6 in r0, 0x3f ; 63 2fcbe: f8 94 cli 2fcc0: de bf out 0x3e, r29 ; 62 2fcc2: 0f be out 0x3f, r0 ; 63 2fcc4: cd bf out 0x3d, r28 ; 61 2fcc6: df 91 pop r29 2fcc8: cf 91 pop r28 2fcca: 1f 91 pop r17 2fccc: 0f 91 pop r16 2fcce: ff 90 pop r15 2fcd0: ef 90 pop r14 2fcd2: df 90 pop r13 2fcd4: cf 90 pop r12 2fcd6: bf 90 pop r11 2fcd8: af 90 pop r10 2fcda: 9f 90 pop r9 2fcdc: 8f 90 pop r8 2fcde: 7f 90 pop r7 2fce0: 6f 90 pop r6 2fce2: 5f 90 pop r5 2fce4: 4f 90 pop r4 2fce6: 3f 90 pop r3 2fce8: 2f 90 pop r2 2fcea: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2fcec: 40 91 81 14 lds r20, 0x1481 ; 0x801481 2fcf0: 50 91 82 14 lds r21, 0x1482 ; 0x801482 2fcf4: 60 91 83 14 lds r22, 0x1483 ; 0x801483 2fcf8: 70 91 84 14 lds r23, 0x1484 ; 0x801484 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2fcfc: b0 92 18 15 sts 0x1518, r11 ; 0x801518 2fd00: a0 92 17 15 sts 0x1517, r10 ; 0x801517 nrFiles = 1; 2fd04: 90 92 87 17 sts 0x1787, r9 ; 0x801787 2fd08: 80 92 86 17 sts 0x1786, r8 ; 0x801786 curDir->seekSet(position); 2fd0c: 89 e1 ldi r24, 0x19 ; 25 2fd0e: 95 e1 ldi r25, 0x15 ; 21 2fd10: 0f 94 b1 6e call 0x2dd62 ; 0x2dd62 2fd14: 1e 7f andi r17, 0xFE ; 254 2fd16: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2fd18: e0 91 17 15 lds r30, 0x1517 ; 0x801517 2fd1c: f0 91 18 15 lds r31, 0x1518 ; 0x801518 2fd20: 83 e2 ldi r24, 0x23 ; 35 2fd22: de 01 movw r26, r28 2fd24: 11 96 adiw r26, 0x01 ; 1 2fd26: 01 90 ld r0, Z+ 2fd28: 0d 92 st X+, r0 2fd2a: 8a 95 dec r24 2fd2c: e1 f7 brne .-8 ; 0x2fd26 2fd2e: 01 2f mov r16, r17 2fd30: 22 e0 ldi r18, 0x02 ; 2 2fd32: 50 e0 ldi r21, 0x00 ; 0 2fd34: 40 e0 ldi r20, 0x00 ; 0 2fd36: be 01 movw r22, r28 2fd38: 6f 5f subi r22, 0xFF ; 255 2fd3a: 7f 4f sbci r23, 0xFF ; 255 2fd3c: 84 ef ldi r24, 0xF4 ; 244 2fd3e: 92 e0 ldi r25, 0x02 ; 2 2fd40: 0f 94 33 79 call 0x2f266 ; 0x2f266 2fd44: ce 01 movw r24, r28 2fd46: 01 96 adiw r24, 0x01 ; 1 2fd48: 0e 94 bc 78 call 0xf178 ; 0xf178 2fd4c: 03 cf rjmp .-506 ; 0x2fb54 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)) 2fd4e: 86 15 cp r24, r6 2fd50: 97 05 cpc r25, r7 2fd52: 08 f4 brcc .+2 ; 0x2fd56 2fd54: 9a cf rjmp .-204 ; 0x2fc8a break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2fd56: ee a9 ldd r30, Y+54 ; 0x36 2fd58: ff a9 ldd r31, Y+55 ; 0x37 2fd5a: 53 82 std Z+3, r5 ; 0x03 2fd5c: 42 82 std Z+2, r4 ; 0x02 2fd5e: 0c ad ldd r16, Y+60 ; 0x3c 2fd60: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2fd62: 01 15 cp r16, r1 2fd64: 11 05 cpc r17, r1 2fd66: 09 f0 breq .+2 ; 0x2fd6a 2fd68: 5d cf rjmp .-326 ; 0x2fc24 2fd6a: 8f cf rjmp .-226 ; 0x2fc8a 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)) 2fd6c: 22 20 and r2, r2 2fd6e: 99 f3 breq .-26 ; 0x2fd56 2fd70: 8c cf rjmp .-232 ; 0x2fc8a 2fd72: 31 e0 ldi r19, 0x01 ; 1 2fd74: 33 12 cpse r3, r19 2fd76: ef cf rjmp .-34 ; 0x2fd56 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2fd78: 80 91 ba 14 lds r24, 0x14BA ; 0x8014ba 2fd7c: 28 12 cpse r2, r24 2fd7e: 07 c0 rjmp .+14 ; 0x2fd8e #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2fd80: ce 01 movw r24, r28 2fd82: 01 96 adiw r24, 0x01 ; 1 2fd84: 0f 94 ca e3 call 0x3c794 ; 0x3c794 2fd88: 97 fd sbrc r25, 7 2fd8a: e5 cf rjmp .-54 ; 0x2fd56 2fd8c: 7e cf rjmp .-260 ; 0x2fc8a 2fd8e: 21 10 cpse r2, r1 2fd90: e2 cf rjmp .-60 ; 0x2fd56 2fd92: 7b cf rjmp .-266 ; 0x2fc8a 0002fd94 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2fd94: cf 92 push r12 2fd96: df 92 push r13 2fd98: ef 92 push r14 2fd9a: ff 92 push r15 2fd9c: 0f 93 push r16 2fd9e: 1f 93 push r17 2fda0: cf 93 push r28 2fda2: df 93 push r29 2fda4: cd b7 in r28, 0x3d ; 61 2fda6: de b7 in r29, 0x3e ; 62 2fda8: a3 97 sbiw r28, 0x23 ; 35 2fdaa: 0f b6 in r0, 0x3f ; 63 2fdac: f8 94 cli 2fdae: de bf out 0x3e, r29 ; 62 2fdb0: 0f be out 0x3f, r0 ; 63 2fdb2: cd bf out 0x3d, r28 ; 61 2fdb4: 7c 01 movw r14, r24 2fdb6: 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) {} 2fdb8: 19 82 std Y+1, r1 ; 0x01 2fdba: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fdbc: 80 91 1c 15 lds r24, 0x151C ; 0x80151c parent=&workDir; 2fdc0: 99 e1 ldi r25, 0x19 ; 25 2fdc2: c9 2e mov r12, r25 2fdc4: 95 e1 ldi r25, 0x15 ; 21 2fdc6: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2fdc8: 81 11 cpse r24, r1 2fdca: 04 c0 rjmp .+8 ; 0x2fdd4 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2fdcc: 84 ef ldi r24, 0xF4 ; 244 2fdce: c8 2e mov r12, r24 2fdd0: 84 e1 ldi r24, 0x14 ; 20 2fdd2: 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); 2fdd4: 21 e0 ldi r18, 0x01 ; 1 2fdd6: a7 01 movw r20, r14 2fdd8: b6 01 movw r22, r12 2fdda: ce 01 movw r24, r28 2fddc: 01 96 adiw r24, 0x01 ; 1 2fdde: 0f 94 3e d7 call 0x3ae7c ; 0x3ae7c 2fde2: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2fde4: 88 23 and r24, r24 2fde6: 21 f1 breq .+72 ; 0x2fe30 2fde8: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 2fdec: 85 30 cpi r24, 0x05 ; 5 2fdee: 00 f5 brcc .+64 ; 0x2fe30 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2fdf0: 29 e0 ldi r18, 0x09 ; 9 2fdf2: 82 9f mul r24, r18 2fdf4: c0 01 movw r24, r0 2fdf6: 11 24 eor r1, r1 2fdf8: b7 01 movw r22, r14 2fdfa: 82 54 subi r24, 0x42 ; 66 2fdfc: 9b 4e sbci r25, 0xEB ; 235 2fdfe: 0f 94 fc e3 call 0x3c7f8 ; 0x3c7f8 puts(relpath); 2fe02: c7 01 movw r24, r14 2fe04: 0f 94 20 e4 call 0x3c840 ; 0x3c840 if (workDirDepth < MAX_DIR_DEPTH) { 2fe08: 80 91 0e 16 lds r24, 0x160E ; 0x80160e 2fe0c: 86 30 cpi r24, 0x06 ; 6 2fe0e: 80 f1 brcs .+96 ; 0x2fe70 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2fe10: 83 e2 ldi r24, 0x23 ; 35 2fe12: fe 01 movw r30, r28 2fe14: 31 96 adiw r30, 0x01 ; 1 2fe16: a9 e1 ldi r26, 0x19 ; 25 2fe18: b5 e1 ldi r27, 0x15 ; 21 2fe1a: 01 90 ld r0, Z+ 2fe1c: 0d 92 st X+, r0 2fe1e: 8a 95 dec r24 2fe20: e1 f7 brne .-8 ; 0x2fe1a #ifdef SDCARD_SORT_ALPHA if (doPresort) 2fe22: 00 23 and r16, r16 2fe24: 09 f4 brne .+2 ; 0x2fe28 2fe26: 4c c0 rjmp .+152 ; 0x2fec0 presort(); 2fe28: 0f 94 48 7d call 0x2fa90 ; 0x2fa90 else presort_flag = true; #endif return 1; 2fe2c: 10 2f mov r17, r16 2fe2e: 0c c0 rjmp .+24 ; 0x2fe48 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2fe30: 82 ef ldi r24, 0xF2 ; 242 2fe32: 99 ea ldi r25, 0xA9 ; 169 2fe34: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2fe38: 83 ed ldi r24, 0xD3 ; 211 2fe3a: 90 e7 ldi r25, 0x70 ; 112 2fe3c: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(relpath); 2fe40: c7 01 movw r24, r14 2fe42: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c return 0; 2fe46: 10 e0 ldi r17, 0x00 ; 0 2fe48: ce 01 movw r24, r28 2fe4a: 01 96 adiw r24, 0x01 ; 1 2fe4c: 0e 94 bc 78 call 0xf178 ; 0xf178 else presort_flag = true; #endif return 1; } } 2fe50: 81 2f mov r24, r17 2fe52: a3 96 adiw r28, 0x23 ; 35 2fe54: 0f b6 in r0, 0x3f ; 63 2fe56: f8 94 cli 2fe58: de bf out 0x3e, r29 ; 62 2fe5a: 0f be out 0x3f, r0 ; 63 2fe5c: cd bf out 0x3d, r28 ; 61 2fe5e: df 91 pop r29 2fe60: cf 91 pop r28 2fe62: 1f 91 pop r17 2fe64: 0f 91 pop r16 2fe66: ff 90 pop r15 2fe68: ef 90 pop r14 2fe6a: df 90 pop r13 2fe6c: cf 90 pop r12 2fe6e: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fe70: 8f 5f subi r24, 0xFF ; 255 2fe72: 80 93 0e 16 sts 0x160E, r24 ; 0x80160e workDirParents[d+1] = workDirParents[d]; 2fe76: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2fe78: 81 50 subi r24, 0x01 ; 1 2fe7a: c8 f0 brcs .+50 ; 0x2feae workDirParents[d+1] = workDirParents[d]; 2fe7c: 28 2f mov r18, r24 2fe7e: 30 e0 ldi r19, 0x00 ; 0 2fe80: a9 01 movw r20, r18 2fe82: 4f 5f subi r20, 0xFF ; 255 2fe84: 5f 4f sbci r21, 0xFF ; 255 2fe86: 94 9f mul r25, r20 2fe88: d0 01 movw r26, r0 2fe8a: 95 9f mul r25, r21 2fe8c: b0 0d add r27, r0 2fe8e: 11 24 eor r1, r1 2fe90: a4 5c subi r26, 0xC4 ; 196 2fe92: ba 4e sbci r27, 0xEA ; 234 2fe94: 92 9f mul r25, r18 2fe96: f0 01 movw r30, r0 2fe98: 93 9f mul r25, r19 2fe9a: f0 0d add r31, r0 2fe9c: 11 24 eor r1, r1 2fe9e: e4 5c subi r30, 0xC4 ; 196 2fea0: fa 4e sbci r31, 0xEA ; 234 2fea2: 29 2f mov r18, r25 2fea4: 01 90 ld r0, Z+ 2fea6: 0d 92 st X+, r0 2fea8: 2a 95 dec r18 2feaa: e1 f7 brne .-8 ; 0x2fea4 2feac: e5 cf rjmp .-54 ; 0x2fe78 workDirParents[0]=*parent; 2feae: 83 e2 ldi r24, 0x23 ; 35 2feb0: f6 01 movw r30, r12 2feb2: ac e3 ldi r26, 0x3C ; 60 2feb4: b5 e1 ldi r27, 0x15 ; 21 2feb6: 01 90 ld r0, Z+ 2feb8: 0d 92 st X+, r0 2feba: 8a 95 dec r24 2febc: e1 f7 brne .-8 ; 0x2feb6 2febe: a8 cf rjmp .-176 ; 0x2fe10 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2fec0: 81 e0 ldi r24, 0x01 ; 1 2fec2: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd 2fec6: c0 cf rjmp .-128 ; 0x2fe48 0002fec8 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2fec8: 93 e2 ldi r25, 0x23 ; 35 2feca: e4 ef ldi r30, 0xF4 ; 244 2fecc: f4 e1 ldi r31, 0x14 ; 20 2fece: a9 e1 ldi r26, 0x19 ; 25 2fed0: b5 e1 ldi r27, 0x15 ; 21 2fed2: 01 90 ld r0, Z+ 2fed4: 0d 92 st X+, r0 2fed6: 9a 95 dec r25 2fed8: e1 f7 brne .-8 ; 0x2fed2 workDirDepth = 0; 2feda: 10 92 0e 16 sts 0x160E, r1 ; 0x80160e curDir=&workDir; 2fede: 29 e1 ldi r18, 0x19 ; 25 2fee0: 35 e1 ldi r19, 0x15 ; 21 2fee2: 30 93 18 15 sts 0x1518, r19 ; 0x801518 2fee6: 20 93 17 15 sts 0x1517, r18 ; 0x801517 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2feea: 81 11 cpse r24, r1 presort(); 2feec: 0d 94 48 7d jmp 0x2fa90 ; 0x2fa90 else presort_flag = true; 2fef0: 81 e0 ldi r24, 0x01 ; 1 2fef2: 80 93 bd 14 sts 0x14BD, r24 ; 0x8014bd #endif } 2fef6: 08 95 ret 0002fef8 : * * @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) 2fef8: 8f 92 push r8 2fefa: 9f 92 push r9 2fefc: af 92 push r10 2fefe: bf 92 push r11 2ff00: cf 92 push r12 2ff02: df 92 push r13 2ff04: ef 92 push r14 2ff06: ff 92 push r15 2ff08: 0f 93 push r16 2ff0a: 1f 93 push r17 2ff0c: cf 93 push r28 2ff0e: df 93 push r29 2ff10: cd b7 in r28, 0x3d ; 61 2ff12: de b7 in r29, 0x3e ; 62 2ff14: 2d 97 sbiw r28, 0x0d ; 13 2ff16: 0f b6 in r0, 0x3f ; 63 2ff18: f8 94 cli 2ff1a: de bf out 0x3e, r29 ; 62 2ff1c: 0f be out 0x3f, r0 ; 63 2ff1e: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2ff20: 24 ef ldi r18, 0xF4 ; 244 2ff22: 34 e1 ldi r19, 0x14 ; 20 2ff24: 30 93 18 15 sts 0x1518, r19 ; 0x801518 2ff28: 20 93 17 15 sts 0x1517, r18 ; 0x801517 if (!fileName) 2ff2c: dc 01 movw r26, r24 2ff2e: ed 91 ld r30, X+ 2ff30: fc 91 ld r31, X 2ff32: 30 97 sbiw r30, 0x00 ; 0 2ff34: a1 f4 brne .+40 ; 0x2ff5e } else //relative path { curDir = &workDir; } return 1; 2ff36: 81 e0 ldi r24, 0x01 ; 1 } 2ff38: 2d 96 adiw r28, 0x0d ; 13 2ff3a: 0f b6 in r0, 0x3f ; 63 2ff3c: f8 94 cli 2ff3e: de bf out 0x3e, r29 ; 62 2ff40: 0f be out 0x3f, r0 ; 63 2ff42: cd bf out 0x3d, r28 ; 61 2ff44: df 91 pop r29 2ff46: cf 91 pop r28 2ff48: 1f 91 pop r17 2ff4a: 0f 91 pop r16 2ff4c: ff 90 pop r15 2ff4e: ef 90 pop r14 2ff50: df 90 pop r13 2ff52: cf 90 pop r12 2ff54: bf 90 pop r11 2ff56: af 90 pop r10 2ff58: 9f 90 pop r9 2ff5a: 8f 90 pop r8 2ff5c: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2ff5e: 20 81 ld r18, Z 2ff60: 2f 32 cpi r18, 0x2F ; 47 2ff62: 09 f0 breq .+2 ; 0x2ff66 2ff64: 47 c0 rjmp .+142 ; 0x2fff4 2ff66: 6c 01 movw r12, r24 { cdroot(false); 2ff68: 80 e0 ldi r24, 0x00 ; 0 2ff6a: 0f 94 64 7f call 0x2fec8 ; 0x2fec8 dirname_start = fileName + 1; 2ff6e: f6 01 movw r30, r12 2ff70: 00 81 ld r16, Z 2ff72: 11 81 ldd r17, Z+1 ; 0x01 2ff74: 0f 5f subi r16, 0xFF ; 255 2ff76: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2ff78: 99 e1 ldi r25, 0x19 ; 25 2ff7a: 89 2e mov r8, r25 2ff7c: 95 e1 ldi r25, 0x15 ; 21 2ff7e: 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) 2ff80: d8 01 movw r26, r16 2ff82: 8c 91 ld r24, X 2ff84: 88 23 and r24, r24 2ff86: b9 f2 breq .-82 ; 0x2ff36 { dirname_end = strchr(dirname_start, '/'); 2ff88: 6f e2 ldi r22, 0x2F ; 47 2ff8a: 70 e0 ldi r23, 0x00 ; 0 2ff8c: c8 01 movw r24, r16 2ff8e: 0f 94 e8 e3 call 0x3c7d0 ; 0x3c7d0 2ff92: 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) 2ff94: 00 97 sbiw r24, 0x00 ; 0 2ff96: 51 f1 breq .+84 ; 0x2ffec 2ff98: 08 17 cp r16, r24 2ff9a: 19 07 cpc r17, r25 2ff9c: 38 f5 brcc .+78 ; 0x2ffec { 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); 2ff9e: 7c 01 movw r14, r24 2ffa0: e0 1a sub r14, r16 2ffa2: f1 0a sbc r15, r17 2ffa4: bd e0 ldi r27, 0x0D ; 13 2ffa6: eb 16 cp r14, r27 2ffa8: f1 04 cpc r15, r1 2ffaa: 18 f0 brcs .+6 ; 0x2ffb2 2ffac: 8c e0 ldi r24, 0x0C ; 12 2ffae: e8 2e mov r14, r24 2ffb0: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2ffb2: a7 01 movw r20, r14 2ffb4: b8 01 movw r22, r16 2ffb6: ce 01 movw r24, r28 2ffb8: 01 96 adiw r24, 0x01 ; 1 2ffba: 0f 94 11 e4 call 0x3c822 ; 0x3c822 subdirname[len] = 0; 2ffbe: e1 e0 ldi r30, 0x01 ; 1 2ffc0: f0 e0 ldi r31, 0x00 ; 0 2ffc2: ec 0f add r30, r28 2ffc4: fd 1f adc r31, r29 2ffc6: ee 0d add r30, r14 2ffc8: ff 1d adc r31, r15 2ffca: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2ffcc: 60 e0 ldi r22, 0x00 ; 0 2ffce: ce 01 movw r24, r28 2ffd0: 01 96 adiw r24, 0x01 ; 1 2ffd2: 0f 94 ca 7e call 0x2fd94 ; 0x2fd94 2ffd6: 88 23 and r24, r24 2ffd8: 09 f4 brne .+2 ; 0x2ffdc 2ffda: ae cf rjmp .-164 ; 0x2ff38 return 0; curDir = &workDir; 2ffdc: 90 92 18 15 sts 0x1518, r9 ; 0x801518 2ffe0: 80 92 17 15 sts 0x1517, r8 ; 0x801517 dirname_start = dirname_end + 1; 2ffe4: 85 01 movw r16, r10 2ffe6: 0f 5f subi r16, 0xFF ; 255 2ffe8: 1f 4f sbci r17, 0xFF ; 255 2ffea: ca cf rjmp .-108 ; 0x2ff80 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2ffec: f6 01 movw r30, r12 2ffee: 11 83 std Z+1, r17 ; 0x01 2fff0: 00 83 st Z, r16 2fff2: a1 cf rjmp .-190 ; 0x2ff36 } } else //relative path { curDir = &workDir; 2fff4: 89 e1 ldi r24, 0x19 ; 25 2fff6: 95 e1 ldi r25, 0x15 ; 21 2fff8: 90 93 18 15 sts 0x1518, r25 ; 0x801518 2fffc: 80 93 17 15 sts 0x1517, r24 ; 0x801517 30000: 9a cf rjmp .-204 ; 0x2ff36 00030002 : 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*/){ 30002: bf 92 push r11 30004: cf 92 push r12 30006: df 92 push r13 30008: ef 92 push r14 3000a: ff 92 push r15 3000c: 0f 93 push r16 3000e: 1f 93 push r17 30010: cf 93 push r28 30012: df 93 push r29 30014: 1f 92 push r1 30016: 1f 92 push r1 30018: cd b7 in r28, 0x3d ; 61 3001a: de b7 in r29, 0x3e ; 62 if(!mounted) 3001c: 20 91 6f 14 lds r18, 0x146F ; 0x80146f 30020: 22 23 and r18, r18 30022: 09 f4 brne .+2 ; 0x30026 30024: ef c0 rjmp .+478 ; 0x30204 30026: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30028: 80 91 01 17 lds r24, 0x1701 ; 0x801701 3002c: 88 23 and r24, r24 3002e: 09 f4 brne .+2 ; 0x30032 30030: 04 c1 rjmp .+520 ; 0x3023a if(!replace_current){ 30032: 61 11 cpse r22, r1 30034: f6 c0 rjmp .+492 ; 0x30222 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 30036: d0 90 21 17 lds r13, 0x1721 ; 0x801721 3003a: dd 20 and r13, r13 3003c: 21 f0 breq .+8 ; 0x30046 // 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); 3003e: 80 e1 ldi r24, 0x10 ; 16 30040: 99 ea ldi r25, 0xA9 ; 169 30042: 0e 94 95 7b call 0xf72a ; 0xf72a return; } SERIAL_ECHO_START; 30046: 82 ef ldi r24, 0xF2 ; 242 30048: 99 ea ldi r25, 0xA9 ; 169 3004a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(ofSubroutineCallTgt); 3004e: 87 ef ldi r24, 0xF7 ; 247 30050: 98 ea ldi r25, 0xA8 ; 168 30052: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 30056: c7 01 movw r24, r14 30058: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 3005c: 8c ee ldi r24, 0xEC ; 236 3005e: 98 ea ldi r25, 0xA8 ; 168 30060: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 30064: 00 91 21 17 lds r16, 0x1721 ; 0x801721 30068: 25 e5 ldi r18, 0x55 ; 85 3006a: 02 9f mul r16, r18 3006c: 80 01 movw r16, r0 3006e: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 30070: 0a 5d subi r16, 0xDA ; 218 30072: 18 4e sbci r17, 0xE8 ; 232 30074: 8f e2 ldi r24, 0x2F ; 47 30076: f8 01 movw r30, r16 30078: 81 93 st Z+, r24 3007a: 8f 01 movw r16, r30 3007c: cc 24 eor r12, r12 3007e: c3 94 inc r12 for(uint8_t i=0;i 30088: d8 16 cp r13, r24 3008a: b0 f4 brcc .+44 ; 0x300b8 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 3008c: db 9c mul r13, r11 3008e: c0 01 movw r24, r0 30090: 11 24 eor r1, r1 30092: b8 01 movw r22, r16 30094: 84 5c subi r24, 0xC4 ; 196 30096: 9a 4e sbci r25, 0xEA ; 234 30098: 0f 94 97 a4 call 0x3492e ; 0x3492e 3009c: c8 01 movw r24, r16 3009e: 8c 01 movw r16, r24 300a0: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 300a2: f8 01 movw r30, r16 300a4: 20 81 ld r18, Z 300a6: 22 23 and r18, r18 300a8: 29 f0 breq .+10 ; 0x300b4 300aa: f4 e5 ldi r31, 0x54 ; 84 300ac: fc 15 cp r31, r12 300ae: 10 f0 brcs .+4 ; 0x300b4 {t++;cnt++;} //crawl counter forward. 300b0: c3 94 inc r12 300b2: f5 cf rjmp .-22 ; 0x3009e 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) 300b8: 27 e4 ldi r18, 0x47 ; 71 300ba: 2c 15 cp r18, r12 300bc: 08 f4 brcc .+2 ; 0x300c0 300be: ae c0 rjmp .+348 ; 0x3021c file.getFilename(t); 300c0: b8 01 movw r22, r16 300c2: 8e ef ldi r24, 0xFE ; 254 300c4: 96 e1 ldi r25, 0x16 ; 22 300c6: 0f 94 97 a4 call 0x3492e ; 0x3492e SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 300ca: 80 91 21 17 lds r24, 0x1721 ; 0x801721 300ce: f5 e5 ldi r31, 0x55 ; 85 300d0: 8f 9f mul r24, r31 300d2: c0 01 movw r24, r0 300d4: 11 24 eor r1, r1 300d6: 8a 5d subi r24, 0xDA ; 218 300d8: 98 4e sbci r25, 0xE8 ; 232 300da: 0e 94 3f 89 call 0x1127e ; 0x1127e SERIAL_ECHORPGM(ofPos); 300de: 86 ee ldi r24, 0xE6 ; 230 300e0: 98 ea ldi r25, 0xA8 ; 168 300e2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 300e6: 60 91 82 17 lds r22, 0x1782 ; 0x801782 300ea: 70 91 83 17 lds r23, 0x1783 ; 0x801783 300ee: 80 91 84 17 lds r24, 0x1784 ; 0x801784 300f2: 90 91 85 17 lds r25, 0x1785 ; 0x801785 300f6: 4a e0 ldi r20, 0x0A ; 10 300f8: 0f 94 80 d2 call 0x3a500 ; 0x3a500 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 300fc: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 30100: 80 91 21 17 lds r24, 0x1721 ; 0x801721 30104: 24 e0 ldi r18, 0x04 ; 4 30106: 82 9f mul r24, r18 30108: f0 01 movw r30, r0 3010a: 11 24 eor r1, r1 3010c: ee 5d subi r30, 0xDE ; 222 3010e: f8 4e sbci r31, 0xE8 ; 232 30110: 40 91 82 17 lds r20, 0x1782 ; 0x801782 30114: 50 91 83 17 lds r21, 0x1783 ; 0x801783 30118: 60 91 84 17 lds r22, 0x1784 ; 0x801784 3011c: 70 91 85 17 lds r23, 0x1785 ; 0x801785 30120: 40 83 st Z, r20 30122: 51 83 std Z+1, r21 ; 0x01 30124: 62 83 std Z+2, r22 ; 0x02 30126: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 30128: 8f 5f subi r24, 0xFF ; 255 3012a: 80 93 21 17 sts 0x1721, r24 ; 0x801721 } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 3012e: 8e ef ldi r24, 0xFE ; 254 30130: 96 e1 ldi r25, 0x16 ; 22 30132: 0f 94 74 a4 call 0x348e8 ; 0x348e8 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; 30136: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e const char *fname=name; 3013a: fa 82 std Y+2, r15 ; 0x02 3013c: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 3013e: ce 01 movw r24, r28 30140: 01 96 adiw r24, 0x01 ; 1 30142: 0f 94 7c 7f call 0x2fef8 ; 0x2fef8 30146: 88 23 and r24, r24 30148: 09 f4 brne .+2 ; 0x3014c 3014a: 5c c0 rjmp .+184 ; 0x30204 */ 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) ){ 3014c: 49 81 ldd r20, Y+1 ; 0x01 3014e: 5a 81 ldd r21, Y+2 ; 0x02 30150: 60 91 17 15 lds r22, 0x1517 ; 0x801517 30154: 70 91 18 15 lds r23, 0x1518 ; 0x801518 30158: 21 e0 ldi r18, 0x01 ; 1 3015a: 8e ef ldi r24, 0xFE ; 254 3015c: 96 e1 ldi r25, 0x16 ; 22 3015e: 0f 94 3e d7 call 0x3ae7c ; 0x3ae7c 30162: 88 23 and r24, r24 30164: 09 f4 brne .+2 ; 0x30168 30166: 77 c0 rjmp .+238 ; 0x30256 // compute the block to start with if( ! gfComputeNextFileBlock() ) 30168: 8e ef ldi r24, 0xFE ; 254 3016a: 96 e1 ldi r25, 0x16 ; 22 3016c: 0f 94 9b 6d call 0x2db36 ; 0x2db36 30170: 88 23 and r24, r24 30172: 09 f4 brne .+2 ; 0x30176 30174: 70 c0 rjmp .+224 ; 0x30256 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; 30176: 80 91 1f 17 lds r24, 0x171F ; 0x80171f 3017a: 90 91 20 17 lds r25, 0x1720 ; 0x801720 3017e: 85 58 subi r24, 0x85 ; 133 30180: 91 4f sbci r25, 0xF1 ; 241 30182: 90 93 1a 17 sts 0x171A, r25 ; 0x80171a 30186: 80 93 19 17 sts 0x1719, r24 ; 0x801719 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 3018a: 89 81 ldd r24, Y+1 ; 0x01 3018c: 9a 81 ldd r25, Y+2 ; 0x02 3018e: 0f 94 62 7b call 0x2f6c4 ; 0x2f6c4 filesize = file.fileSize(); 30192: 80 91 0f 17 lds r24, 0x170F ; 0x80170f 30196: 90 91 10 17 lds r25, 0x1710 ; 0x801710 3019a: a0 91 11 17 lds r26, 0x1711 ; 0x801711 3019e: b0 91 12 17 lds r27, 0x1712 ; 0x801712 301a2: 80 93 7b 17 sts 0x177B, r24 ; 0x80177b 301a6: 90 93 7c 17 sts 0x177C, r25 ; 0x80177c 301aa: a0 93 7d 17 sts 0x177D, r26 ; 0x80177d 301ae: b0 93 7e 17 sts 0x177E, r27 ; 0x80177e SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 301b2: 86 eb ldi r24, 0xB6 ; 182 301b4: 98 ea ldi r25, 0xA8 ; 168 301b6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 printAbsFilenameFast(); 301ba: 0f 94 45 7c call 0x2f88a ; 0x2f88a SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 301be: 8e ea ldi r24, 0xAE ; 174 301c0: 98 ea ldi r25, 0xA8 ; 168 301c2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 301c6: 60 91 7b 17 lds r22, 0x177B ; 0x80177b 301ca: 70 91 7c 17 lds r23, 0x177C ; 0x80177c 301ce: 80 91 7d 17 lds r24, 0x177D ; 0x80177d 301d2: 90 91 7e 17 lds r25, 0x177E ; 0x80177e 301d6: 4a e0 ldi r20, 0x0A ; 10 301d8: 0f 94 80 d2 call 0x3a500 ; 0x3a500 } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 301dc: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 SERIAL_PROTOCOLLN(filesize); sdpos = 0; 301e0: 10 92 82 17 sts 0x1782, r1 ; 0x801782 301e4: 10 92 83 17 sts 0x1783, r1 ; 0x801783 301e8: 10 92 84 17 sts 0x1784, r1 ; 0x801784 301ec: 10 92 85 17 sts 0x1785, r1 ; 0x801785 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 301f0: 80 ea ldi r24, 0xA0 ; 160 301f2: 98 ea ldi r25, 0xA8 ; 168 301f4: 0e 94 06 7b call 0xf60c ; 0xf60c lcd_setstatuspgm(ofFileSelected); 301f8: 80 ea ldi r24, 0xA0 ; 160 301fa: 98 ea ldi r25, 0xA8 ; 168 301fc: 0f 94 ea 0b call 0x217d4 ; 0x217d4 scrollstuff = 0; 30200: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 30204: 0f 90 pop r0 30206: 0f 90 pop r0 30208: df 91 pop r29 3020a: cf 91 pop r28 3020c: 1f 91 pop r17 3020e: 0f 91 pop r16 30210: ff 90 pop r15 30212: ef 90 pop r14 30214: df 90 pop r13 30216: cf 90 pop r12 30218: bf 90 pop r11 3021a: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 3021c: f8 01 movw r30, r16 3021e: 10 82 st Z, r1 30220: 54 cf rjmp .-344 ; 0x300ca SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 30222: 82 ef ldi r24, 0xF2 ; 242 30224: 99 ea ldi r25, 0xA9 ; 169 30226: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(ofNowDoingFile); 3022a: 85 ed ldi r24, 0xD5 ; 213 3022c: 98 ea ldi r25, 0xA8 ; 168 3022e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(name); 30232: c7 01 movw r24, r14 30234: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c 30238: 7a cf rjmp .-268 ; 0x3012e } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 3023a: 10 92 21 17 sts 0x1721, r1 ; 0x801721 SERIAL_ECHO_START; 3023e: 82 ef ldi r24, 0xF2 ; 242 30240: 99 ea ldi r25, 0xA9 ; 169 30242: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(ofNowFreshFile); 30246: 84 ec ldi r24, 0xC4 ; 196 30248: 98 ea ldi r25, 0xA8 ; 168 3024a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(name); 3024e: c7 01 movw r24, r14 30250: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c 30254: 70 cf rjmp .-288 ; 0x30136 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30256: 8f eb ldi r24, 0xBF ; 191 30258: 90 e7 ldi r25, 0x70 ; 112 3025a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 3025e: 89 81 ldd r24, Y+1 ; 0x01 30260: 9a 81 ldd r25, Y+2 ; 0x02 30262: 0e 94 3f 89 call 0x1127e ; 0x1127e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 30266: 8e e2 ldi r24, 0x2E ; 46 30268: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 3026c: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 30270: c9 cf rjmp .-110 ; 0x30204 00030272 : void CardReader::printingHasFinished() { st_synchronize(); 30272: 0f 94 2c 59 call 0x2b258 ; 0x2b258 file.close(); 30276: 8e ef ldi r24, 0xFE ; 254 30278: 96 e1 ldi r25, 0x16 ; 22 3027a: 0f 94 74 a4 call 0x348e8 ; 0x348e8 if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 3027e: 80 91 21 17 lds r24, 0x1721 ; 0x801721 30282: 88 23 and r24, r24 30284: 69 f1 breq .+90 ; 0x302e0 { file_subcall_ctr--; 30286: 81 50 subi r24, 0x01 ; 1 30288: 80 93 21 17 sts 0x1721, r24 ; 0x801721 openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 3028c: 25 e5 ldi r18, 0x55 ; 85 3028e: 82 9f mul r24, r18 30290: c0 01 movw r24, r0 30292: 11 24 eor r1, r1 30294: 61 e0 ldi r22, 0x01 ; 1 30296: 8a 5d subi r24, 0xDA ; 218 30298: 98 4e sbci r25, 0xE8 ; 232 3029a: 0f 94 01 80 call 0x30002 ; 0x30002 setIndex(filespos[file_subcall_ctr]); 3029e: e0 91 21 17 lds r30, 0x1721 ; 0x801721 302a2: 84 e0 ldi r24, 0x04 ; 4 302a4: e8 9f mul r30, r24 302a6: f0 01 movw r30, r0 302a8: 11 24 eor r1, r1 302aa: ee 5d subi r30, 0xDE ; 222 302ac: f8 4e sbci r31, 0xE8 ; 232 302ae: 60 81 ld r22, Z 302b0: 71 81 ldd r23, Z+1 ; 0x01 302b2: 82 81 ldd r24, Z+2 ; 0x02 302b4: 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);}; 302b6: 60 93 82 17 sts 0x1782, r22 ; 0x801782 302ba: 70 93 83 17 sts 0x1783, r23 ; 0x801783 302be: 80 93 84 17 sts 0x1784, r24 ; 0x801784 302c2: 90 93 85 17 sts 0x1785, r25 ; 0x801785 302c6: 0f 94 c0 77 call 0x2ef80 ; 0x2ef80 SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 302ca: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 302ce: 88 23 and r24, r24 302d0: 71 f0 breq .+28 ; 0x302ee { sdprinting = true; 302d2: 81 e0 ldi r24, 0x01 ; 1 302d4: 80 93 6e 14 sts 0x146E, r24 ; 0x80146e 302d8: 85 e0 ldi r24, 0x05 ; 5 302da: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> 302de: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 302e0: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e 302e4: 83 e0 ldi r24, 0x03 ; 3 302e6: 80 93 67 0e sts 0x0E67, r24 ; 0x800e67 <_ZL13printer_state.lto_priv.397> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 302ea: 0c 94 93 83 jmp 0x10726 ; 0x10726 autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 302ee: 08 95 ret 000302f0 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 302f0: cf 92 push r12 302f2: df 92 push r13 302f4: ef 92 push r14 302f6: ff 92 push r15 302f8: 0f 93 push r16 302fa: 1f 93 push r17 302fc: cf 93 push r28 302fe: df 93 push r29 30300: 08 2f mov r16, r24 { mounted = false; 30302: 10 92 6f 14 sts 0x146F, r1 ; 0x80146f if(root.isOpen()) 30306: 80 91 f7 14 lds r24, 0x14F7 ; 0x8014f7 3030a: 88 23 and r24, r24 3030c: 21 f0 breq .+8 ; 0x30316 root.close(); 3030e: 84 ef ldi r24, 0xF4 ; 244 30310: 94 e1 ldi r25, 0x14 ; 20 30312: 0f 94 74 a4 call 0x348e8 ; 0x348e8 * \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; 30316: 10 92 de 16 sts 0x16DE, r1 ; 0x8016de 3031a: 10 92 db 16 sts 0x16DB, r1 ; 0x8016db // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 3031e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 30322: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 30324: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 SET_OUTPUT(SDSS); 30328: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 3032c: 80 64 ori r24, 0x40 ; 64 3032e: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(MISO); 30332: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 30334: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 30336: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 30338: 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); 3033a: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 3033c: 85 e0 ldi r24, 0x05 ; 5 3033e: 80 93 dc 16 sts 0x16DC, r24 ; 0x8016dc * Initialize hardware SPI * Set SCK rate to F_CPU/pow(2, 1 + spiRate) for spiRate [0,6] */ static void spiInit(uint8_t spiRate) { // See avr processor documentation SPCR = (1 << SPE) | (1 << MSTR) | (spiRate >> 1); 30342: 82 e5 ldi r24, 0x52 ; 82 30344: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 30346: 1d bc out 0x2d, r1 ; 45 30348: 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); 3034a: 8f ef ldi r24, 0xFF ; 255 3034c: 0f 94 cc a5 call 0x34b98 ; 0x34b98 30350: 11 50 subi r17, 0x01 ; 1 30352: d9 f7 brne .-10 ; 0x3034a WRITE(MISO, 1); // temporarily enable the MISO line pullup 30354: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 30356: 20 e0 ldi r18, 0x00 ; 0 30358: 30 e0 ldi r19, 0x00 ; 0 3035a: a9 01 movw r20, r18 3035c: 60 e0 ldi r22, 0x00 ; 0 3035e: 8b ed ldi r24, 0xDB ; 219 30360: 96 e1 ldi r25, 0x16 ; 22 30362: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 30366: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 3036a: 81 30 cpi r24, 0x01 ; 1 3036c: 61 f0 breq .+24 ; 0x30386 if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 3036e: 0f 94 8b 3f call 0x27f16 ; 0x27f16 30372: 6c 1b sub r22, r28 30374: 7d 0b sbc r23, r29 30376: 61 3d cpi r22, 0xD1 ; 209 30378: 77 40 sbci r23, 0x07 ; 7 3037a: 68 f3 brcs .-38 ; 0x30356 WRITE(MISO, 0); // disable the MISO line pullup 3037c: 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;} 3037e: 81 e0 ldi r24, 0x01 ; 1 30380: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db 30384: 22 c0 rjmp .+68 ; 0x303ca error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 30386: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 30388: 0f 94 8b 3f call 0x27f16 ; 0x27f16 3038c: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 3038e: 83 e9 ldi r24, 0x93 ; 147 30390: 98 ea ldi r25, 0xA8 ; 168 30392: 0e 94 06 7b call 0xf60c ; 0xf60c spiSend(0XFF); 30396: 8f ef ldi r24, 0xFF ; 255 30398: 0f 94 cc a5 call 0x34b98 ; 0x34b98 while ((status_ = spiRec()) != 0xFF) 3039c: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 303a0: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 303a4: 8f 3f cpi r24, 0xFF ; 255 303a6: 59 f1 breq .+86 ; 0x303fe { spiSend(0XFF); 303a8: 8f ef ldi r24, 0xFF ; 255 303aa: 0f 94 cc a5 call 0x34b98 ; 0x34b98 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 303ae: 0f 94 8b 3f call 0x27f16 ; 0x27f16 303b2: 6c 1b sub r22, r28 303b4: 7d 0b sbc r23, r29 303b6: 62 32 cpi r22, 0x22 ; 34 303b8: 71 05 cpc r23, r1 303ba: 80 f3 brcs .-32 ; 0x3039c 303bc: 82 e0 ldi r24, 0x02 ; 2 303be: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 303c2: 82 e8 ldi r24, 0x82 ; 130 303c4: 98 ea ldi r25, 0xA8 ; 168 303c6: 0e 94 06 7b call 0xf60c ; 0xf60c #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 303ca: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 303ce: 82 ef ldi r24, 0xF2 ; 242 303d0: 99 ea ldi r25, 0xA9 ; 169 303d2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 303d6: 82 eb ldi r24, 0xB2 ; 178 303d8: 90 e7 ldi r25, 0x70 ; 112 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 303da: 0e 94 06 7b call 0xf60c ; 0xf60c } if (mounted) 303de: 80 91 6f 14 lds r24, 0x146F ; 0x80146f 303e2: 88 23 and r24, r24 303e4: 09 f4 brne .+2 ; 0x303e8 303e6: 9a c0 rjmp .+308 ; 0x3051c { cdroot(doPresort); 303e8: 80 2f mov r24, r16 } } 303ea: df 91 pop r29 303ec: cf 91 pop r28 303ee: 1f 91 pop r17 303f0: 0f 91 pop r16 303f2: ff 90 pop r15 303f4: ef 90 pop r14 303f6: df 90 pop r13 303f8: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 303fa: 0d 94 64 7f jmp 0x2fec8 ; 0x2fec8 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 303fe: 2a ea ldi r18, 0xAA ; 170 30400: 31 e0 ldi r19, 0x01 ; 1 30402: 40 e0 ldi r20, 0x00 ; 0 30404: 50 e0 ldi r21, 0x00 ; 0 30406: 68 e0 ldi r22, 0x08 ; 8 30408: 8b ed ldi r24, 0xDB ; 219 3040a: 96 e1 ldi r25, 0x16 ; 22 3040c: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 30410: 82 ff sbrs r24, 2 30412: 2b c0 rjmp .+86 ; 0x3046a 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;} 30414: 81 e0 ldi r24, 0x01 ; 1 30416: 80 93 de 16 sts 0x16DE, r24 ; 0x8016de goto fail; } type(SD_CARD_TYPE_SD2); } // initialize card and send host supports SDHC if SD2 arg = type() == SD_CARD_TYPE_SD2 ? 0X40000000 : 0; 3041a: 80 91 de 16 lds r24, 0x16DE ; 0x8016de 3041e: c1 2c mov r12, r1 30420: d1 2c mov r13, r1 30422: 76 01 movw r14, r12 30424: 82 30 cpi r24, 0x02 ; 2 30426: 29 f4 brne .+10 ; 0x30432 30428: c1 2c mov r12, r1 3042a: d1 2c mov r13, r1 3042c: e1 2c mov r14, r1 3042e: 80 e4 ldi r24, 0x40 ; 64 30430: 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); 30432: 20 e0 ldi r18, 0x00 ; 0 30434: 30 e0 ldi r19, 0x00 ; 0 30436: a9 01 movw r20, r18 30438: 67 e3 ldi r22, 0x37 ; 55 3043a: 8b ed ldi r24, 0xDB ; 219 3043c: 96 e1 ldi r25, 0x16 ; 22 3043e: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 return cardCommand(cmd, arg); 30442: a7 01 movw r20, r14 30444: 96 01 movw r18, r12 30446: 69 e2 ldi r22, 0x29 ; 41 30448: 8b ed ldi r24, 0xDB ; 219 3044a: 96 e1 ldi r25, 0x16 ; 22 3044c: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 30450: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 30454: 88 23 and r24, r24 30456: b1 f0 breq .+44 ; 0x30484 // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 30458: 0f 94 8b 3f call 0x27f16 ; 0x27f16 3045c: 6c 1b sub r22, r28 3045e: 7d 0b sbc r23, r29 30460: 61 3d cpi r22, 0xD1 ; 209 30462: 77 40 sbci r23, 0x07 ; 7 30464: 30 f3 brcs .-52 ; 0x30432 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30466: 8a e0 ldi r24, 0x0A ; 10 30468: 8b cf rjmp .-234 ; 0x30380 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 3046a: 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(); 3046c: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 30470: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 30474: 11 50 subi r17, 0x01 ; 1 30476: d1 f7 brne .-12 ; 0x3046c if (status_ != 0XAA) { 30478: 8a 3a cpi r24, 0xAA ; 170 3047a: 11 f0 breq .+4 ; 0x30480 3047c: 82 e0 ldi r24, 0x02 ; 2 3047e: 80 cf rjmp .-256 ; 0x30380 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;} 30480: 82 e0 ldi r24, 0x02 ; 2 30482: c9 cf rjmp .-110 ; 0x30416 error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 30484: 80 91 de 16 lds r24, 0x16DE ; 0x8016de 30488: 82 30 cpi r24, 0x02 ; 2 3048a: d1 f4 brne .+52 ; 0x304c0 if (cardCommand(CMD58, 0)) { 3048c: 20 e0 ldi r18, 0x00 ; 0 3048e: 30 e0 ldi r19, 0x00 ; 0 30490: a9 01 movw r20, r18 30492: 6a e3 ldi r22, 0x3A ; 58 30494: 8b ed ldi r24, 0xDB ; 219 30496: 96 e1 ldi r25, 0x16 ; 22 30498: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 3049c: 88 23 and r24, r24 3049e: 11 f0 breq .+4 ; 0x304a4 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 304a0: 88 e0 ldi r24, 0x08 ; 8 304a2: 6e cf rjmp .-292 ; 0x30380 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 304a4: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 304a8: 80 7c andi r24, 0xC0 ; 192 304aa: 80 3c cpi r24, 0xC0 ; 192 304ac: 19 f4 brne .+6 ; 0x304b4 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;} 304ae: 83 e0 ldi r24, 0x03 ; 3 304b0: 80 93 de 16 sts 0x16DE, r24 ; 0x8016de // discard rest of ocr - contains allowed voltage range for (uint8_t i = 0; i < 3; i++) spiRec(); 304b4: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 304b8: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 304bc: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 } chipSelectHigh(); 304c0: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 304c4: 10 92 dc 16 sts 0x16DC, r1 ; 0x8016dc * \return The value one, true, is returned for success and * the value zero, false, is returned for failure. Reasons for * failure include not finding a valid partition, not finding a valid * FAT file system or an I/O error. */ bool init(Sd2Card* dev) { return init(dev, 1) ? true : init(dev, 0);} 304c8: 81 e0 ldi r24, 0x01 ; 1 304ca: 0f 94 db 72 call 0x2e5b6 ; 0x2e5b6 304ce: 81 11 cpse r24, r1 304d0: 0c c0 rjmp .+24 ; 0x304ea 304d2: 80 e0 ldi r24, 0x00 ; 0 304d4: 0f 94 db 72 call 0x2e5b6 ; 0x2e5b6 #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 304d8: 81 11 cpse r24, r1 304da: 07 c0 rjmp .+14 ; 0x304ea { SERIAL_ERROR_START; 304dc: 8a ec ldi r24, 0xCA ; 202 304de: 99 ea ldi r25, 0xA9 ; 169 304e0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 304e4: 8f e9 ldi r24, 0x9F ; 159 304e6: 90 e7 ldi r25, 0x70 ; 112 304e8: 78 cf rjmp .-272 ; 0x303da } else if (!root.openRoot(&volume)) 304ea: 60 ee ldi r22, 0xE0 ; 224 304ec: 76 e1 ldi r23, 0x16 ; 22 304ee: 84 ef ldi r24, 0xF4 ; 244 304f0: 94 e1 ldi r25, 0x14 ; 20 304f2: 0f 94 24 a4 call 0x34848 ; 0x34848 304f6: 81 11 cpse r24, r1 304f8: 07 c0 rjmp .+14 ; 0x30508 { SERIAL_ERROR_START; 304fa: 8a ec ldi r24, 0xCA ; 202 304fc: 99 ea ldi r25, 0xA9 ; 169 304fe: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 30502: 8f e8 ldi r24, 0x8F ; 143 30504: 90 e7 ldi r25, 0x70 ; 112 30506: 69 cf rjmp .-302 ; 0x303da } else { mounted = true; 30508: 81 e0 ldi r24, 0x01 ; 1 3050a: 80 93 6f 14 sts 0x146F, r24 ; 0x80146f SERIAL_ECHO_START; 3050e: 82 ef ldi r24, 0xF2 ; 242 30510: 99 ea ldi r25, 0xA9 ; 169 30512: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 30516: 84 e8 ldi r24, 0x84 ; 132 30518: 90 e7 ldi r25, 0x70 ; 112 3051a: 5f cf rjmp .-322 ; 0x303da if (mounted) { cdroot(doPresort); } } 3051c: df 91 pop r29 3051e: cf 91 pop r28 30520: 1f 91 pop r17 30522: 0f 91 pop r16 30524: ff 90 pop r15 30526: ef 90 pop r14 30528: df 90 pop r13 3052a: cf 90 pop r12 3052c: 08 95 ret 0003052e : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 3052e: 4f 92 push r4 30530: 5f 92 push r5 30532: 6f 92 push r6 30534: 7f 92 push r7 30536: 8f 92 push r8 30538: 9f 92 push r9 3053a: af 92 push r10 3053c: bf 92 push r11 3053e: cf 92 push r12 30540: df 92 push r13 30542: ef 92 push r14 30544: ff 92 push r15 30546: 4b 01 movw r8, r22 30548: 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]; 3054a: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 3054e: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 30552: 07 2e mov r0, r23 30554: 00 0c add r0, r0 30556: 88 0b sbc r24, r24 30558: 99 0b sbc r25, r25 3055a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> if (!degTargetHotend(extruder)) 3055e: 20 e0 ldi r18, 0x00 ; 0 30560: 30 e0 ldi r19, 0x00 ; 0 30562: a9 01 movw r20, r18 30564: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 30568: 88 23 and r24, r24 3056a: d1 f0 breq .+52 ; 0x305a0 #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; 3056c: 10 92 66 0e sts 0x0E66, r1 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.404> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 30570: cc 24 eor r12, r12 30572: ca 94 dec r12 30574: dc 2c mov r13, r12 30576: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30578: 98 ee ldi r25, 0xE8 ; 232 3057a: 49 2e mov r4, r25 3057c: 93 e0 ldi r25, 0x03 ; 3 3057e: 59 2e mov r5, r25 30580: 61 2c mov r6, r1 30582: 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) || 30584: 80 91 66 0e lds r24, 0x0E66 ; 0x800e66 <_ZL13cancel_heatup.lto_priv.404> 30588: 81 11 cpse r24, r1 3058a: 0a c0 rjmp .+20 ; 0x305a0 3058c: 2f ef ldi r18, 0xFF ; 255 3058e: c2 16 cp r12, r18 30590: d2 06 cpc r13, r18 30592: e2 06 cpc r14, r18 30594: f2 06 cpc r15, r18 30596: 89 f4 brne .+34 ; 0x305ba (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) { 30598: 80 91 65 0e lds r24, 0x0E65 ; 0x800e65 3059c: 82 30 cpi r24, 0x02 ; 2 3059e: b9 f4 brne .+46 ; 0x305ce { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 305a0: ff 90 pop r15 305a2: ef 90 pop r14 305a4: df 90 pop r13 305a6: cf 90 pop r12 305a8: bf 90 pop r11 305aa: af 90 pop r10 305ac: 9f 90 pop r9 305ae: 8f 90 pop r8 305b0: 7f 90 pop r7 305b2: 6f 90 pop r6 305b4: 5f 90 pop r5 305b6: 4f 90 pop r4 305b8: 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) || 305ba: f7 fc sbrc r15, 7 305bc: f1 cf rjmp .-30 ; 0x305a0 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 305be: 0f 94 8b 3f call 0x27f16 ; 0x27f16 305c2: 6c 19 sub r22, r12 305c4: 7d 09 sbc r23, r13 305c6: 68 3b cpi r22, 0xB8 ; 184 305c8: 7b 40 sbci r23, 0x0B ; 11 305ca: 30 f3 brcs .-52 ; 0x30598 305cc: e9 cf rjmp .-46 ; 0x305a0 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) 305ce: 0f 94 8b 3f call 0x27f16 ; 0x27f16 305d2: 68 19 sub r22, r8 305d4: 79 09 sbc r23, r9 305d6: 8a 09 sbc r24, r10 305d8: 9b 09 sbc r25, r11 305da: 69 3e cpi r22, 0xE9 ; 233 305dc: 73 40 sbci r23, 0x03 ; 3 305de: 81 05 cpc r24, r1 305e0: 91 05 cpc r25, r1 305e2: f0 f1 brcs .+124 ; 0x30660 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { SERIAL_PROTOCOLPGM("T:"); 305e4: 8f e7 ldi r24, 0x7F ; 127 305e6: 98 ea ldi r25, 0xA8 ; 168 305e8: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 305ec: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 305f0: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 305f4: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 305f8: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 305fc: 41 e0 ldi r20, 0x01 ; 1 305fe: 0f 94 1d d6 call 0x3ac3a ; 0x3ac3a SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 30602: 8b e7 ldi r24, 0x7B ; 123 30604: 98 ea ldi r25, 0xA8 ; 168 30606: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 3060a: 60 e0 ldi r22, 0x00 ; 0 3060c: 70 e0 ldi r23, 0x00 ; 0 3060e: cb 01 movw r24, r22 30610: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 30614: 87 e7 ldi r24, 0x77 ; 119 30616: 98 ea ldi r25, 0xA8 ; 168 30618: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 if (residencyStart > -1) 3061c: f7 fc sbrc r15, 7 3061e: 52 c0 rjmp .+164 ; 0x306c4 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 30620: 0f 94 8b 3f call 0x27f16 ; 0x27f16 30624: 46 01 movw r8, r12 30626: 57 01 movw r10, r14 30628: 58 eb ldi r21, 0xB8 ; 184 3062a: 85 0e add r8, r21 3062c: 5b e0 ldi r21, 0x0B ; 11 3062e: 95 1e adc r9, r21 30630: a1 1c adc r10, r1 30632: b1 1c adc r11, r1 30634: a5 01 movw r20, r10 30636: 94 01 movw r18, r8 30638: 26 1b sub r18, r22 3063a: 37 0b sbc r19, r23 3063c: 48 0b sbc r20, r24 3063e: 59 0b sbc r21, r25 30640: ca 01 movw r24, r20 30642: b9 01 movw r22, r18 30644: a3 01 movw r20, r6 30646: 92 01 movw r18, r4 30648: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 3064c: ca 01 movw r24, r20 3064e: b9 01 movw r22, r18 30650: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30654: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 30658: 0f 94 8b 3f call 0x27f16 ; 0x27f16 3065c: 4b 01 movw r8, r22 3065e: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 30660: 90 e0 ldi r25, 0x00 ; 0 30662: 80 e0 ldi r24, 0x00 ; 0 30664: 0e 94 87 8e call 0x11d0e ; 0x11d0e #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))) || 30668: 3f ef ldi r19, 0xFF ; 255 3066a: c3 16 cp r12, r19 3066c: d3 06 cpc r13, r19 3066e: e3 06 cpc r14, r19 30670: f3 06 cpc r15, r19 30672: 09 f0 breq .+2 ; 0x30676 30674: 46 c0 rjmp .+140 ; 0x30702 } 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))) || 30676: 80 91 60 0e lds r24, 0x0E60 ; 0x800e60 <_ZL16target_direction.lto_priv.553> 3067a: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 3067e: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 30682: 88 23 and r24, r24 30684: 19 f1 breq .+70 ; 0x306cc 30686: 07 2e mov r0, r23 30688: 00 0c add r0, r0 3068a: 88 0b sbc r24, r24 3068c: 99 0b sbc r25, r25 3068e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 30692: 20 e0 ldi r18, 0x00 ; 0 30694: 30 e0 ldi r19, 0x00 ; 0 30696: 40 e8 ldi r20, 0x80 ; 128 30698: 5f e3 ldi r21, 0x3F ; 63 3069a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 3069e: 9b 01 movw r18, r22 306a0: ac 01 movw r20, r24 306a2: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 306a6: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 306aa: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 306ae: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 306b2: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 306b6: 87 fd sbrc r24, 7 306b8: 65 cf rjmp .-310 ; 0x30584 (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 306ba: 0f 94 8b 3f call 0x27f16 ; 0x27f16 306be: 6b 01 movw r12, r22 306c0: 7c 01 movw r14, r24 306c2: 60 cf rjmp .-320 ; 0x30584 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 306c4: 8f e3 ldi r24, 0x3F ; 63 306c6: 0e 94 c2 78 call 0xf184 ; 0xf184 306ca: c4 cf rjmp .-120 ; 0x30654 306cc: 07 2e mov r0, r23 306ce: 00 0c add r0, r0 306d0: 88 0b sbc r24, r24 306d2: 99 0b sbc r25, r25 306d4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__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))) || 306d8: 20 e0 ldi r18, 0x00 ; 0 306da: 30 e0 ldi r19, 0x00 ; 0 306dc: 40 e8 ldi r20, 0x80 ; 128 306de: 5f e3 ldi r21, 0x3F ; 63 306e0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 306e4: 9b 01 movw r18, r22 306e6: ac 01 movw r20, r24 306e8: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 306ec: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 306f0: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 306f4: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 306f8: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 306fc: 18 16 cp r1, r24 306fe: ec f6 brge .-70 ; 0x306ba 30700: 41 cf rjmp .-382 ; 0x30584 30702: f7 fc sbrc r15, 7 30704: 3f cf rjmp .-386 ; 0x30584 30706: 60 91 6d 0e lds r22, 0x0E6D ; 0x800e6d 3070a: 70 91 6e 0e lds r23, 0x0E6E ; 0x800e6e 3070e: 07 2e mov r0, r23 30710: 00 0c add r0, r0 30712: 88 0b sbc r24, r24 30714: 99 0b sbc r25, r25 30716: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3071a: 9b 01 movw r18, r22 3071c: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 3071e: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 30722: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 30726: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 3072a: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 3072e: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 30732: 9f 77 andi r25, 0x7F ; 127 30734: 20 e0 ldi r18, 0x00 ; 0 30736: 30 e0 ldi r19, 0x00 ; 0 30738: 40 ea ldi r20, 0xA0 ; 160 3073a: 50 e4 ldi r21, 0x40 ; 64 3073c: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 30740: 18 16 cp r1, r24 30742: 0c f0 brlt .+2 ; 0x30746 30744: 1f cf rjmp .-450 ; 0x30584 30746: b9 cf rjmp .-142 ; 0x306ba 00030748 : // 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) { 30748: 1f 93 push r17 3074a: cf 93 push r28 3074c: df 93 push r29 3074e: ec 01 movw r28, r24 30750: 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()) { 30752: 80 91 6b 13 lds r24, 0x136B ; 0x80136b 30756: 83 30 cpi r24, 0x03 ; 3 30758: 09 f4 brne .+2 ; 0x3075c 3075a: 4e c0 rjmp .+156 ; 0x307f8 3075c: 8c 31 cpi r24, 0x1C ; 28 3075e: 09 f4 brne .+2 ; 0x30762 30760: 52 c0 rjmp .+164 ; 0x30806 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 30762: 80 91 90 13 lds r24, 0x1390 ; 0x801390 30766: 90 91 91 13 lds r25, 0x1391 ; 0x801391 3076a: 8c 17 cp r24, r28 3076c: 9d 07 cpc r25, r29 3076e: 79 f1 breq .+94 ; 0x307ce lastErrorCode = ec; 30770: d0 93 91 13 sts 0x1391, r29 ; 0x801391 30774: c0 93 90 13 sts 0x1390, r28 ; 0x801390 lastErrorSource = res; 30778: 10 93 92 13 sts 0x1392, r17 ; 0x801392 LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 3077c: ce 01 movw r24, r28 3077e: 0f 94 66 c3 call 0x386cc ; 0x386cc 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); 30782: e8 2f mov r30, r24 30784: f0 e0 ldi r31, 0x00 ; 0 30786: ee 0f add r30, r30 30788: ff 1f adc r31, r31 3078a: e5 55 subi r30, 0x55 ; 85 3078c: f8 45 sbci r31, 0x58 ; 88 3078e: 85 91 lpm r24, Z+ 30790: 94 91 lpm r25, Z 30792: 02 96 adiw r24, 0x02 ; 2 30794: 0f 94 54 c3 call 0x386a8 ; 0x386a8 if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 30798: c1 30 cpi r28, 0x01 ; 1 3079a: d1 05 cpc r29, r1 3079c: c1 f0 breq .+48 ; 0x307ce 3079e: cc 30 cpi r28, 0x0C ; 12 307a0: 80 e8 ldi r24, 0x80 ; 128 307a2: d8 07 cpc r29, r24 307a4: a1 f0 breq .+40 ; 0x307ce 307a6: c9 32 cpi r28, 0x29 ; 41 307a8: 80 e8 ldi r24, 0x80 ; 128 307aa: d8 07 cpc r29, r24 307ac: 81 f0 breq .+32 ; 0x307ce IncrementMMUFails(); 307ae: 0f 94 70 c2 call 0x384e0 ; 0x384e0 | (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 307b2: ce 01 movw r24, r28 307b4: 88 27 eor r24, r24 307b6: 9e 77 andi r25, 0x7E ; 126 307b8: 89 2b or r24, r25 307ba: 49 f0 breq .+18 ; 0x307ce /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 307bc: 80 91 9e 13 lds r24, 0x139E ; 0x80139e 307c0: 90 91 9f 13 lds r25, 0x139F ; 0x80139f 307c4: 01 96 adiw r24, 0x01 ; 1 307c6: 90 93 9f 13 sts 0x139F, r25 ; 0x80139f 307ca: 80 93 9e 13 sts 0x139E, r24 ; 0x80139e return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 307ce: 80 91 7d 13 lds r24, 0x137D ; 0x80137d 307d2: 88 23 and r24, r24 307d4: d9 f0 breq .+54 ; 0x3080c return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 307d6: 11 e0 ldi r17, 0x01 ; 1 307d8: 10 93 5f 0e sts 0x0E5F, r17 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 307dc: ce 01 movw r24, r28 307de: 0f 94 f1 c5 call 0x38be2 ; 0x38be2 307e2: 8f 3f cpi r24, 0xFF ; 255 307e4: 99 f0 breq .+38 ; 0x3080c void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 307e6: 10 93 7e 13 sts 0x137E, r17 ; 0x80137e logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 307ea: 88 e9 ldi r24, 0x98 ; 152 307ec: 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"); } 307ee: df 91 pop r29 307f0: cf 91 pop r28 307f2: 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"); 307f4: 0c 94 06 7b jmp 0xf60c ; 0xf60c // 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; 307f8: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 307fc: 0f 94 0d bc call 0x3781a ; 0x3781a // 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; 30800: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d 30804: ae cf rjmp .-164 ; 0x30762 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; 30806: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a 3080a: f8 cf rjmp .-16 ; 0x307fc 3080c: 10 92 7e 13 sts 0x137E, r1 ; 0x80137e bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 30810: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> 30814: 81 11 cpse r24, r1 30816: 06 c0 rjmp .+12 ; 0x30824 30818: 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"); } 3081a: df 91 pop r29 3081c: cf 91 pop r28 3081e: 1f 91 pop r17 30820: 0d 94 b7 c4 jmp 0x3896e ; 0x3896e 30824: df 91 pop r29 30826: cf 91 pop r28 30828: 1f 91 pop r17 3082a: 08 95 ret 0003082c : * \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) { 3082c: 2f 92 push r2 3082e: 3f 92 push r3 30830: 4f 92 push r4 30832: 5f 92 push r5 30834: 6f 92 push r6 30836: 7f 92 push r7 30838: 8f 92 push r8 3083a: 9f 92 push r9 3083c: af 92 push r10 3083e: bf 92 push r11 30840: cf 92 push r12 30842: df 92 push r13 30844: ef 92 push r14 30846: ff 92 push r15 30848: 0f 93 push r16 3084a: 1f 93 push r17 3084c: cf 93 push r28 3084e: df 93 push r29 30850: 00 d0 rcall .+0 ; 0x30852 30852: 1f 92 push r1 30854: cd b7 in r28, 0x3d ; 61 30856: de b7 in r29, 0x3e ; 62 30858: 5c 01 movw r10, r24 3085a: 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; 3085c: 80 91 01 17 lds r24, 0x1701 ; 0x801701 30860: 81 30 cpi r24, 0x01 ; 1 30862: 09 f0 breq .+2 ; 0x30866 30864: de c0 rjmp .+444 ; 0x30a22 30866: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 3086a: 81 ff sbrs r24, 1 3086c: da c0 rjmp .+436 ; 0x30a22 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 3086e: 82 fd sbrc r24, 2 30870: bc c0 rjmp .+376 ; 0x309ea * \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) { 30872: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30874: 21 2c mov r2, r1 30876: 32 e0 ldi r19, 0x02 ; 2 30878: 33 2e mov r3, r19 3087a: 00 91 06 17 lds r16, 0x1706 ; 0x801706 3087e: 10 91 07 17 lds r17, 0x1707 ; 0x801707 30882: 20 91 08 17 lds r18, 0x1708 ; 0x801708 30886: 30 91 09 17 lds r19, 0x1709 ; 0x801709 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { if (!seekEnd()) goto fail; } while (nToWrite > 0) { 3088a: e1 14 cp r14, r1 3088c: f1 04 cpc r15, r1 3088e: 09 f4 brne .+2 ; 0x30892 30890: 30 c1 rjmp .+608 ; 0x30af2 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 30892: 80 91 17 17 lds r24, 0x1717 ; 0x801717 30896: 90 91 18 17 lds r25, 0x1718 ; 0x801718 uint16_t rootDirEntryCount_; // number of entries in FAT16 root dir uint32_t rootDirStart_; // root start block for FAT16, cluster for FAT32 //---------------------------------------------------------------------------- bool allocContiguous(uint32_t count, uint32_t* curCluster); uint8_t blockOfCluster(uint32_t position) const { return (position >> 9) & (blocksPerCluster_ - 1);} 3089a: dc 01 movw r26, r24 3089c: 14 96 adiw r26, 0x04 ; 4 3089e: 7c 90 ld r7, X 308a0: 7a 94 dec r7 308a2: b9 01 movw r22, r18 308a4: a8 01 movw r20, r16 308a6: 29 e0 ldi r18, 0x09 ; 9 308a8: 76 95 lsr r23 308aa: 67 95 ror r22 308ac: 57 95 ror r21 308ae: 47 95 ror r20 308b0: 2a 95 dec r18 308b2: d1 f7 brne .-12 ; 0x308a8 308b4: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 308b6: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 308b8: 71 10 cpse r7, r1 308ba: 25 c0 rjmp .+74 ; 0x30906 308bc: 01 15 cp r16, r1 308be: 11 05 cpc r17, r1 308c0: 11 f5 brne .+68 ; 0x30906 308c2: 40 91 02 17 lds r20, 0x1702 ; 0x801702 308c6: 50 91 03 17 lds r21, 0x1703 ; 0x801703 308ca: 60 91 04 17 lds r22, 0x1704 ; 0x801704 308ce: 70 91 05 17 lds r23, 0x1705 ; 0x801705 // start of new cluster if (curCluster_ == 0) { 308d2: 41 15 cp r20, r1 308d4: 51 05 cpc r21, r1 308d6: 61 05 cpc r22, r1 308d8: 71 05 cpc r23, r1 308da: 09 f0 breq .+2 ; 0x308de 308dc: a8 c0 rjmp .+336 ; 0x30a2e if (firstCluster_ == 0) { 308de: 80 91 13 17 lds r24, 0x1713 ; 0x801713 308e2: 90 91 14 17 lds r25, 0x1714 ; 0x801714 308e6: a0 91 15 17 lds r26, 0x1715 ; 0x801715 308ea: b0 91 16 17 lds r27, 0x1716 ; 0x801716 308ee: 00 97 sbiw r24, 0x00 ; 0 308f0: a1 05 cpc r26, r1 308f2: b1 05 cpc r27, r1 308f4: 09 f0 breq .+2 ; 0x308f8 308f6: b4 c0 rjmp .+360 ; 0x30a60 } 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; 308f8: 8e ef ldi r24, 0xFE ; 254 308fa: 96 e1 ldi r25, 0x16 ; 22 308fc: 0f 94 d1 a4 call 0x349a2 ; 0x349a2 30900: 88 23 and r24, r24 30902: 09 f4 brne .+2 ; 0x30906 30904: 8e c0 rjmp .+284 ; 0x30a22 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 30906: c1 01 movw r24, r2 30908: 80 1b sub r24, r16 3090a: 91 0b sbc r25, r17 3090c: 67 01 movw r12, r14 3090e: 8e 15 cp r24, r14 30910: 9f 05 cpc r25, r15 30912: 08 f4 brcc .+2 ; 0x30916 30914: 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; 30916: e0 91 17 17 lds r30, 0x1717 ; 0x801717 3091a: f0 91 18 17 lds r31, 0x1718 ; 0x801718 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 3091e: 80 91 02 17 lds r24, 0x1702 ; 0x801702 30922: 90 91 03 17 lds r25, 0x1703 ; 0x801703 30926: a0 91 04 17 lds r26, 0x1704 ; 0x801704 3092a: b0 91 05 17 lds r27, 0x1705 ; 0x801705 3092e: 02 97 sbiw r24, 0x02 ; 2 30930: a1 09 sbc r26, r1 30932: b1 09 sbc r27, r1 30934: 25 85 ldd r18, Z+13 ; 0x0d 30936: 04 c0 rjmp .+8 ; 0x30940 30938: 88 0f add r24, r24 3093a: 99 1f adc r25, r25 3093c: aa 1f adc r26, r26 3093e: bb 1f adc r27, r27 30940: 2a 95 dec r18 30942: d2 f7 brpl .-12 ; 0x30938 30944: 46 85 ldd r20, Z+14 ; 0x0e 30946: 57 85 ldd r21, Z+15 ; 0x0f 30948: 60 89 ldd r22, Z+16 ; 0x10 3094a: 71 89 ldd r23, Z+17 ; 0x11 3094c: 84 0f add r24, r20 3094e: 95 1f adc r25, r21 30950: a6 1f adc r26, r22 30952: b7 1f adc r27, r23 30954: 9c 01 movw r18, r24 30956: ad 01 movw r20, r26 30958: 27 0d add r18, r7 3095a: 31 1d adc r19, r1 3095c: 41 1d adc r20, r1 3095e: 51 1d adc r21, r1 30960: 29 01 movw r4, r18 30962: 3a 01 movw r6, r20 if (n == 512) { 30964: c1 14 cp r12, r1 30966: 32 e0 ldi r19, 0x02 ; 2 30968: d3 06 cpc r13, r19 3096a: 09 f0 breq .+2 ; 0x3096e 3096c: 8a c0 rjmp .+276 ; 0x30a82 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 3096e: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 30972: 90 91 70 0e lds r25, 0x0E70 ; 0x800e70 30976: a0 91 71 0e lds r26, 0x0E71 ; 0x800e71 3097a: b0 91 72 0e lds r27, 0x0E72 ; 0x800e72 3097e: 48 16 cp r4, r24 30980: 59 06 cpc r5, r25 30982: 6a 06 cpc r6, r26 30984: 7b 06 cpc r7, r27 30986: 69 f4 brne .+26 ; 0x309a2 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; 30988: 10 92 77 0e sts 0x0E77, r1 ; 0x800e77 cacheBlockNumber_ = blockNumber; 3098c: 8f ef ldi r24, 0xFF ; 255 3098e: 9f ef ldi r25, 0xFF ; 255 30990: dc 01 movw r26, r24 30992: 80 93 6f 0e sts 0x0E6F, r24 ; 0x800e6f 30996: 90 93 70 0e sts 0x0E70, r25 ; 0x800e70 3099a: a0 93 71 0e sts 0x0E71, r26 ; 0x800e71 3099e: b0 93 72 0e sts 0x0E72, r27 ; 0x800e72 return cluster >= FAT32EOC_MIN; } bool readBlock(uint32_t block, uint8_t* dst) { return sdCard_->readBlock(block, dst);} bool writeBlock(uint32_t block, const uint8_t* dst) { return sdCard_->writeBlock(block, dst); 309a2: 95 01 movw r18, r10 309a4: b3 01 movw r22, r6 309a6: a2 01 movw r20, r4 309a8: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 309ac: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 309b0: 0f 94 38 a6 call 0x34c70 ; 0x34c70 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 309b4: 88 23 and r24, r24 309b6: a9 f1 breq .+106 ; 0x30a22 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 309b8: 80 91 06 17 lds r24, 0x1706 ; 0x801706 309bc: 90 91 07 17 lds r25, 0x1707 ; 0x801707 309c0: a0 91 08 17 lds r26, 0x1708 ; 0x801708 309c4: b0 91 09 17 lds r27, 0x1709 ; 0x801709 309c8: 8c 0d add r24, r12 309ca: 9d 1d adc r25, r13 309cc: a1 1d adc r26, r1 309ce: b1 1d adc r27, r1 309d0: 80 93 06 17 sts 0x1706, r24 ; 0x801706 309d4: 90 93 07 17 sts 0x1707, r25 ; 0x801707 309d8: a0 93 08 17 sts 0x1708, r26 ; 0x801708 309dc: b0 93 09 17 sts 0x1709, r27 ; 0x801709 src += n; 309e0: ac 0c add r10, r12 309e2: bd 1c adc r11, r13 nToWrite -= n; 309e4: ec 18 sub r14, r12 309e6: fd 08 sbc r15, r13 309e8: 48 cf rjmp .-368 ; 0x3087a // 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_) { 309ea: 40 91 0f 17 lds r20, 0x170F ; 0x80170f 309ee: 50 91 10 17 lds r21, 0x1710 ; 0x801710 309f2: 60 91 11 17 lds r22, 0x1711 ; 0x801711 309f6: 70 91 12 17 lds r23, 0x1712 ; 0x801712 309fa: 80 91 06 17 lds r24, 0x1706 ; 0x801706 309fe: 90 91 07 17 lds r25, 0x1707 ; 0x801707 30a02: a0 91 08 17 lds r26, 0x1708 ; 0x801708 30a06: b0 91 09 17 lds r27, 0x1709 ; 0x801709 30a0a: 48 17 cp r20, r24 30a0c: 59 07 cpc r21, r25 30a0e: 6a 07 cpc r22, r26 30a10: 7b 07 cpc r23, r27 30a12: 09 f4 brne .+2 ; 0x30a16 30a14: 2e cf rjmp .-420 ; 0x30872 } /** 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);} 30a16: 8e ef ldi r24, 0xFE ; 254 30a18: 96 e1 ldi r25, 0x16 ; 22 30a1a: 0f 94 b1 6e call 0x2dd62 ; 0x2dd62 if (!seekEnd()) goto fail; 30a1e: 81 11 cpse r24, r1 30a20: 28 cf rjmp .-432 ; 0x30872 } return nbyte; fail: // return for write error writeError = true; 30a22: 81 e0 ldi r24, 0x01 ; 1 30a24: 80 93 fe 16 sts 0x16FE, r24 ; 0x8016fe return -1; 30a28: 8f ef ldi r24, 0xFF ; 255 30a2a: 9f ef ldi r25, 0xFF ; 255 30a2c: 81 c0 rjmp .+258 ; 0x30b30 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 30a2e: 9e 01 movw r18, r28 30a30: 2f 5f subi r18, 0xFF ; 255 30a32: 3f 4f sbci r19, 0xFF ; 255 30a34: 0f 94 ae 6c call 0x2d95c ; 0x2d95c 30a38: 88 23 and r24, r24 30a3a: 99 f3 breq .-26 ; 0x30a22 if (vol_->isEOC(next)) { 30a3c: 89 81 ldd r24, Y+1 ; 0x01 30a3e: 9a 81 ldd r25, Y+2 ; 0x02 30a40: ab 81 ldd r26, Y+3 ; 0x03 30a42: 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; 30a44: e0 91 17 17 lds r30, 0x1717 ; 0x801717 30a48: f0 91 18 17 lds r31, 0x1718 ; 0x801718 30a4c: 27 89 ldd r18, Z+23 ; 0x17 30a4e: 20 31 cpi r18, 0x10 ; 16 30a50: 81 f4 brne .+32 ; 0x30a72 30a52: 88 3f cpi r24, 0xF8 ; 248 30a54: ef ef ldi r30, 0xFF ; 255 30a56: 9e 07 cpc r25, r30 30a58: a1 05 cpc r26, r1 30a5a: b1 05 cpc r27, r1 30a5c: 08 f0 brcs .+2 ; 0x30a60 30a5e: 4c cf rjmp .-360 ; 0x308f8 // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 30a60: 80 93 02 17 sts 0x1702, r24 ; 0x801702 30a64: 90 93 03 17 sts 0x1703, r25 ; 0x801703 30a68: a0 93 04 17 sts 0x1704, r26 ; 0x801704 30a6c: b0 93 05 17 sts 0x1705, r27 ; 0x801705 30a70: 4a cf rjmp .-364 ; 0x30906 return cluster >= FAT32EOC_MIN; 30a72: 88 3f cpi r24, 0xF8 ; 248 30a74: ff ef ldi r31, 0xFF ; 255 30a76: 9f 07 cpc r25, r31 30a78: af 07 cpc r26, r31 30a7a: ff e0 ldi r31, 0x0F ; 15 30a7c: bf 07 cpc r27, r31 30a7e: 80 f3 brcs .-32 ; 0x30a60 30a80: 3b cf rjmp .-394 ; 0x308f8 // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 30a82: 01 15 cp r16, r1 30a84: 11 05 cpc r17, r1 30a86: 69 f5 brne .+90 ; 0x30ae2 30a88: 40 91 06 17 lds r20, 0x1706 ; 0x801706 30a8c: 50 91 07 17 lds r21, 0x1707 ; 0x801707 30a90: 60 91 08 17 lds r22, 0x1708 ; 0x801708 30a94: 70 91 09 17 lds r23, 0x1709 ; 0x801709 30a98: 80 91 0f 17 lds r24, 0x170F ; 0x80170f 30a9c: 90 91 10 17 lds r25, 0x1710 ; 0x801710 30aa0: a0 91 11 17 lds r26, 0x1711 ; 0x801711 30aa4: b0 91 12 17 lds r27, 0x1712 ; 0x801712 30aa8: 48 17 cp r20, r24 30aaa: 59 07 cpc r21, r25 30aac: 6a 07 cpc r22, r26 30aae: 7b 07 cpc r23, r27 30ab0: c0 f0 brcs .+48 ; 0x30ae2 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 30ab2: 0f 94 a0 6b call 0x2d740 ; 0x2d740 30ab6: 88 23 and r24, r24 30ab8: 09 f4 brne .+2 ; 0x30abc 30aba: b3 cf rjmp .-154 ; 0x30a22 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; 30abc: 81 e0 ldi r24, 0x01 ; 1 30abe: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 cacheBlockNumber_ = blockNumber; 30ac2: 40 92 6f 0e sts 0x0E6F, r4 ; 0x800e6f 30ac6: 50 92 70 0e sts 0x0E70, r5 ; 0x800e70 30aca: 60 92 71 0e sts 0x0E71, r6 ; 0x800e71 30ace: 70 92 72 0e sts 0x0E72, r7 ; 0x800e72 } else { // rewrite part of block if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); 30ad2: a6 01 movw r20, r12 30ad4: b5 01 movw r22, r10 30ad6: c8 01 movw r24, r16 30ad8: 85 58 subi r24, 0x85 ; 133 30ada: 91 4f sbci r25, 0xF1 ; 241 30adc: 0f 94 ba e3 call 0x3c774 ; 0x3c774 30ae0: 6b cf rjmp .-298 ; 0x309b8 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; 30ae2: 41 e0 ldi r20, 0x01 ; 1 30ae4: c3 01 movw r24, r6 30ae6: b2 01 movw r22, r4 30ae8: 0f 94 df 6b call 0x2d7be ; 0x2d7be 30aec: 81 11 cpse r24, r1 30aee: f1 cf rjmp .-30 ; 0x30ad2 30af0: 98 cf rjmp .-208 ; 0x30a22 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 30af2: 80 91 0f 17 lds r24, 0x170F ; 0x80170f 30af6: 90 91 10 17 lds r25, 0x1710 ; 0x801710 30afa: a0 91 11 17 lds r26, 0x1711 ; 0x801711 30afe: b0 91 12 17 lds r27, 0x1712 ; 0x801712 30b02: 80 17 cp r24, r16 30b04: 91 07 cpc r25, r17 30b06: a2 07 cpc r26, r18 30b08: b3 07 cpc r27, r19 30b0a: 68 f4 brcc .+26 ; 0x30b26 30b0c: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 30b10: 00 93 0f 17 sts 0x170F, r16 ; 0x80170f 30b14: 10 93 10 17 sts 0x1710, r17 ; 0x801710 30b18: 20 93 11 17 sts 0x1711, r18 ; 0x801711 30b1c: 30 93 12 17 sts 0x1712, r19 ; 0x801712 flags_ |= F_FILE_DIR_DIRTY; 30b20: 80 68 ori r24, 0x80 ; 128 30b22: 80 93 ff 16 sts 0x16FF, r24 ; 0x8016ff } else if (dateTime_ && nbyte) { // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { 30b26: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 30b2a: 83 fd sbrc r24, 3 30b2c: 18 c0 rjmp .+48 ; 0x30b5e if (!sync()) goto fail; } return nbyte; 30b2e: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 30b30: 0f 90 pop r0 30b32: 0f 90 pop r0 30b34: 0f 90 pop r0 30b36: 0f 90 pop r0 30b38: df 91 pop r29 30b3a: cf 91 pop r28 30b3c: 1f 91 pop r17 30b3e: 0f 91 pop r16 30b40: ff 90 pop r15 30b42: ef 90 pop r14 30b44: df 90 pop r13 30b46: cf 90 pop r12 30b48: bf 90 pop r11 30b4a: af 90 pop r10 30b4c: 9f 90 pop r9 30b4e: 8f 90 pop r8 30b50: 7f 90 pop r7 30b52: 6f 90 pop r6 30b54: 5f 90 pop r5 30b56: 4f 90 pop r4 30b58: 3f 90 pop r3 30b5a: 2f 90 pop r2 30b5c: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 30b5e: 8e ef ldi r24, 0xFE ; 254 30b60: 96 e1 ldi r25, 0x16 ; 22 30b62: 0f 94 7c 6e call 0x2dcf8 ; 0x2dcf8 30b66: 81 11 cpse r24, r1 30b68: e2 cf rjmp .-60 ; 0x30b2e 30b6a: 5b cf rjmp .-330 ; 0x30a22 00030b6c : #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) { 30b6c: 0f 93 push r16 30b6e: cf 93 push r28 30b70: df 93 push r29 30b72: cd b7 in r28, 0x3d ; 61 30b74: de b7 in r29, 0x3e ; 62 30b76: a3 97 sbiw r28, 0x23 ; 35 30b78: 0f b6 in r0, 0x3f ; 63 30b7a: f8 94 cli 30b7c: de bf out 0x3e, r29 ; 62 30b7e: 0f be out 0x3f, r0 ; 63 30b80: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 30b82: 20 91 0f 16 lds r18, 0x160F ; 0x80160f 30b86: 30 91 10 16 lds r19, 0x1610 ; 0x801610 30b8a: 82 17 cp r24, r18 30b8c: 93 07 cpc r25, r19 30b8e: d8 f4 brcc .+54 ; 0x30bc6 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 30b90: 61 30 cpi r22, 0x01 ; 1 30b92: 31 f4 brne .+12 ; 0x30ba0 30b94: 21 50 subi r18, 0x01 ; 1 30b96: 31 09 sbc r19, r1 30b98: a9 01 movw r20, r18 30b9a: 48 1b sub r20, r24 30b9c: 59 0b sbc r21, r25 30b9e: ca 01 movw r24, r20 30ba0: 88 0f add r24, r24 30ba2: 99 1f adc r25, r25 30ba4: fc 01 movw r30, r24 30ba6: ef 5e subi r30, 0xEF ; 239 30ba8: f9 4e sbci r31, 0xE9 ; 233 30baa: 80 81 ld r24, Z 30bac: 91 81 ldd r25, Z+1 ; 0x01 30bae: 0f 94 a9 7b call 0x2f752 ; 0x2f752 else getfilename_afterMaxSorting(nr); } 30bb2: a3 96 adiw r28, 0x23 ; 35 30bb4: 0f b6 in r0, 0x3f ; 63 30bb6: f8 94 cli 30bb8: de bf out 0x3e, r29 ; 62 30bba: 0f be out 0x3f, r0 ; 63 30bbc: cd bf out 0x3d, r28 ; 61 30bbe: df 91 pop r29 30bc0: cf 91 pop r28 30bc2: 0f 91 pop r16 30bc4: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 30bc6: 49 e1 ldi r20, 0x19 ; 25 30bc8: 55 e1 ldi r21, 0x15 ; 21 30bca: 50 93 18 15 sts 0x1518, r21 ; 0x801518 30bce: 40 93 17 15 sts 0x1517, r20 ; 0x801517 nrFiles = entry - sort_count + 1; 30bd2: 82 1b sub r24, r18 30bd4: 93 0b sbc r25, r19 30bd6: 01 96 adiw r24, 0x01 ; 1 30bd8: 90 93 87 17 sts 0x1787, r25 ; 0x801787 30bdc: 80 93 86 17 sts 0x1786, r24 ; 0x801786 curDir->seekSet(lastSortedFilePosition << 5); 30be0: 40 91 d9 16 lds r20, 0x16D9 ; 0x8016d9 30be4: 50 91 da 16 lds r21, 0x16DA ; 0x8016da 30be8: 85 e0 ldi r24, 0x05 ; 5 30bea: 44 0f add r20, r20 30bec: 55 1f adc r21, r21 30bee: 8a 95 dec r24 30bf0: e1 f7 brne .-8 ; 0x30bea 30bf2: 70 e0 ldi r23, 0x00 ; 0 30bf4: 60 e0 ldi r22, 0x00 ; 0 30bf6: 89 e1 ldi r24, 0x19 ; 25 30bf8: 95 e1 ldi r25, 0x15 ; 21 30bfa: 0f 94 b1 6e call 0x2dd62 ; 0x2dd62 }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 30bfe: 00 e0 ldi r16, 0x00 ; 0 30c00: 0e 7f andi r16, 0xFE ; 254 30c02: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 30c04: e0 91 17 15 lds r30, 0x1517 ; 0x801517 30c08: f0 91 18 15 lds r31, 0x1518 ; 0x801518 30c0c: 83 e2 ldi r24, 0x23 ; 35 30c0e: de 01 movw r26, r28 30c10: 11 96 adiw r26, 0x01 ; 1 30c12: 01 90 ld r0, Z+ 30c14: 0d 92 st X+, r0 30c16: 8a 95 dec r24 30c18: e1 f7 brne .-8 ; 0x30c12 30c1a: 22 e0 ldi r18, 0x02 ; 2 30c1c: 50 e0 ldi r21, 0x00 ; 0 30c1e: 40 e0 ldi r20, 0x00 ; 0 30c20: be 01 movw r22, r28 30c22: 6f 5f subi r22, 0xFF ; 255 30c24: 7f 4f sbci r23, 0xFF ; 255 30c26: 84 ef ldi r24, 0xF4 ; 244 30c28: 92 e0 ldi r25, 0x02 ; 2 30c2a: 0f 94 33 79 call 0x2f266 ; 0x2f266 30c2e: ce 01 movw r24, r28 30c30: 01 96 adiw r24, 0x01 ; 1 30c32: 0e 94 bc 78 call 0xf178 ; 0xf178 30c36: bd cf rjmp .-134 ; 0x30bb2 00030c38 : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 30c38: 0f 93 push r16 30c3a: 1f 93 push r17 30c3c: cf 93 push r28 30c3e: df 93 push r29 30c40: 1f 92 push r1 30c42: 1f 92 push r1 30c44: cd b7 in r28, 0x3d ; 61 30c46: de b7 in r29, 0x3e ; 62 { if(!mounted) 30c48: 20 91 6f 14 lds r18, 0x146F ; 0x80146f 30c4c: 22 23 and r18, r18 30c4e: 69 f1 breq .+90 ; 0x30caa 30c50: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 30c52: 80 91 01 17 lds r24, 0x1701 ; 0x801701 30c56: 88 23 and r24, r24 30c58: 79 f1 breq .+94 ; 0x30cb8 SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 30c5a: 8f eb ldi r24, 0xBF ; 191 30c5c: 96 ea ldi r25, 0xA6 ; 166 30c5e: 0e 94 06 7b call 0xf60c ; 0xf60c 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; 30c62: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e const char *fname=name; 30c66: 1a 83 std Y+2, r17 ; 0x02 30c68: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 30c6a: ce 01 movw r24, r28 30c6c: 01 96 adiw r24, 0x01 ; 1 30c6e: 0f 94 7c 7f call 0x2fef8 ; 0x2fef8 30c72: 88 23 and r24, r24 30c74: d1 f0 breq .+52 ; 0x30caa return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 30c76: 49 81 ldd r20, Y+1 ; 0x01 30c78: 5a 81 ldd r21, Y+2 ; 0x02 30c7a: 60 91 17 15 lds r22, 0x1517 ; 0x801517 30c7e: 70 91 18 15 lds r23, 0x1518 ; 0x801518 30c82: 26 e5 ldi r18, 0x56 ; 86 30c84: 8e ef ldi r24, 0xFE ; 254 30c86: 96 e1 ldi r25, 0x16 ; 22 30c88: 0f 94 3e d7 call 0x3ae7c ; 0x3ae7c 30c8c: 81 11 cpse r24, r1 30c8e: 22 c0 rjmp .+68 ; 0x30cd4 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 30c90: 8f eb ldi r24, 0xBF ; 191 30c92: 90 e7 ldi r25, 0x70 ; 112 30c94: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 30c98: 89 81 ldd r24, Y+1 ; 0x01 30c9a: 9a 81 ldd r25, Y+2 ; 0x02 30c9c: 0e 94 3f 89 call 0x1127e ; 0x1127e 30ca0: 8e e2 ldi r24, 0x2E ; 46 30ca2: 0e 94 c2 78 call 0xf184 ; 0xf184 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 30ca6: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 30caa: 0f 90 pop r0 30cac: 0f 90 pop r0 30cae: df 91 pop r29 30cb0: cf 91 pop r28 30cb2: 1f 91 pop r17 30cb4: 0f 91 pop r16 30cb6: 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 30cb8: 10 92 21 17 sts 0x1721, r1 ; 0x801721 SERIAL_ECHO_START; 30cbc: 82 ef ldi r24, 0xF2 ; 242 30cbe: 99 ea ldi r25, 0xA9 ; 169 30cc0: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHORPGM(ofNowFreshFile); 30cc4: 84 ec ldi r24, 0xC4 ; 196 30cc6: 98 ea ldi r25, 0xA8 ; 168 30cc8: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN(name); 30ccc: c8 01 movw r24, r16 30cce: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c 30cd2: c7 cf rjmp .-114 ; 0x30c62 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; 30cd4: 81 e0 ldi r24, 0x01 ; 1 30cd6: 80 93 6c 14 sts 0x146C, r24 ; 0x80146c getfilename(0, fname); 30cda: 89 81 ldd r24, Y+1 ; 0x01 30cdc: 9a 81 ldd r25, Y+2 ; 0x02 30cde: 0f 94 62 7b call 0x2f6c4 ; 0x2f6c4 SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 30ce2: 8d ea ldi r24, 0xAD ; 173 30ce4: 96 ea ldi r25, 0xA6 ; 166 30ce6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 printAbsFilenameFast(); 30cea: 0f 94 45 7c call 0x2f88a ; 0x2f88a SERIAL_PROTOCOLLN(); 30cee: 0f 94 93 d6 call 0x3ad26 ; 0x3ad26 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 30cf2: 80 ea ldi r24, 0xA0 ; 160 30cf4: 98 ea ldi r25, 0xA8 ; 168 30cf6: 0e 94 06 7b call 0xf60c ; 0xf60c lcd_setstatuspgm(ofFileSelected); 30cfa: 80 ea ldi r24, 0xA0 ; 160 30cfc: 98 ea ldi r25, 0xA8 ; 168 30cfe: 0f 94 ea 0b call 0x217d4 ; 0x217d4 scrollstuff = 0; 30d02: 10 92 68 0e sts 0x0E68, r1 ; 0x800e68 30d06: d1 cf rjmp .-94 ; 0x30caa 00030d08 : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 30d08: 0f 93 push r16 30d0a: 1f 93 push r17 30d0c: cf 93 push r28 30d0e: df 93 push r29 30d10: ec 01 movw r28, r24 { memset(ip, 0, 4); 30d12: 84 e0 ldi r24, 0x04 ; 4 30d14: fe 01 movw r30, r28 30d16: 11 92 st Z+, r1 30d18: 8a 95 dec r24 30d1a: e9 f7 brne .-6 ; 0x30d16 /** 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 30d1c: 23 e0 ldi r18, 0x03 ; 3 30d1e: 30 ea ldi r19, 0xA0 ; 160 30d20: 4a e0 ldi r20, 0x0A ; 10 30d22: 50 e9 ldi r21, 0x90 ; 144 30d24: 60 e3 ldi r22, 0x30 ; 48 30d26: 8b ed ldi r24, 0xDB ; 219 30d28: 96 e1 ldi r25, 0x16 ; 22 30d2a: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 30d2e: 88 23 and r24, r24 30d30: 91 f0 breq .+36 ; 0x30d56 30d32: 23 e0 ldi r18, 0x03 ; 3 30d34: 30 ea ldi r19, 0xA0 ; 160 30d36: 4a e0 ldi r20, 0x0A ; 10 30d38: 50 e9 ldi r21, 0x90 ; 144 30d3a: 61 e1 ldi r22, 0x11 ; 17 30d3c: 8b ed ldi r24, 0xDB ; 219 30d3e: 96 e1 ldi r25, 0x16 ; 22 30d40: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 30d44: 88 23 and r24, r24 30d46: 39 f0 breq .+14 ; 0x30d56 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 30d48: 80 e8 ldi r24, 0x80 ; 128 30d4a: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 30d4e: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 return false; 30d52: 80 e0 ldi r24, 0x00 ; 0 30d54: 2f c0 rjmp .+94 ; 0x30db4 //------------------------------------------------------------------------------ /** 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(); 30d56: 0f 94 8b 3f call 0x27f16 ; 0x27f16 30d5a: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 30d5c: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 30d60: 80 93 dd 16 sts 0x16DD, r24 ; 0x8016dd 30d64: 8f 3f cpi r24, 0xFF ; 255 30d66: 69 f4 brne .+26 ; 0x30d82 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 30d68: 0f 94 8b 3f call 0x27f16 ; 0x27f16 30d6c: 60 1b sub r22, r16 30d6e: 71 0b sbc r23, r17 30d70: 6d 32 cpi r22, 0x2D ; 45 30d72: 71 40 sbci r23, 0x01 ; 1 30d74: 98 f3 brcs .-26 ; 0x30d5c 30d76: 81 e1 ldi r24, 0x11 ; 17 30d78: 80 93 db 16 sts 0x16DB, r24 ; 0x8016db goto fail; } return true; fail: chipSelectHigh(); 30d7c: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 30d80: e6 cf rjmp .-52 ; 0x30d4e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 30d82: 8e 3f cpi r24, 0xFE ; 254 30d84: 11 f0 breq .+4 ; 0x30d8a 30d86: 8f e0 ldi r24, 0x0F ; 15 30d88: f7 cf rjmp .-18 ; 0x30d78 30d8a: 8e 01 movw r16, r28 30d8c: 0c 5f subi r16, 0xFC ; 252 30d8e: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 30d90: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 30d94: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 30d96: c0 17 cp r28, r16 30d98: d1 07 cpc r29, r17 30d9a: d1 f7 brne .-12 ; 0x30d90 30d9c: ce ef ldi r28, 0xFE ; 254 30d9e: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 30da0: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 30da4: 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) { 30da6: e1 f7 brne .-8 ; 0x30da0 spiRec(); } chipSelectHigh(); 30da8: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 30dac: 8f ef ldi r24, 0xFF ; 255 30dae: 0f 94 cc a5 call 0x34b98 ; 0x34b98 30db2: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 30db4: df 91 pop r29 30db6: cf 91 pop r28 30db8: 1f 91 pop r17 30dba: 0f 91 pop r16 30dbc: 08 95 ret 00030dbe : } 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) 30dbe: 8f 92 push r8 30dc0: 9f 92 push r9 30dc2: af 92 push r10 30dc4: bf 92 push r11 30dc6: cf 92 push r12 30dc8: df 92 push r13 30dca: ef 92 push r14 30dcc: ff 92 push r15 30dce: 0f 93 push r16 30dd0: 1f 93 push r17 30dd2: cf 93 push r28 30dd4: df 93 push r29 30dd6: 1f 92 push r1 30dd8: cd b7 in r28, 0x3d ; 61 30dda: de b7 in r29, 0x3e ; 62 30ddc: 6b 01 movw r12, r22 30dde: 7c 01 movw r14, r24 30de0: 49 01 movw r8, r18 30de2: 5a 01 movw r10, r20 { #if defined(DEBUG_DCODE6) || defined(DEBUG_DCODES) || defined(XFLASH_DUMP) if(type == dcode_mem_t::xflash) 30de4: 03 30 cpi r16, 0x03 ; 3 30de6: 19 f4 brne .+6 ; 0x30dee SPSR = 0x00; } static inline void spi_setup(uint8_t spcr, uint8_t spsr) { SPCR = spcr; 30de8: 8c e5 ldi r24, 0x5C ; 92 30dea: 8c bd out 0x2c, r24 ; 44 SPSR = spsr; 30dec: 1d bc out 0x2d, r1 ; 45 XFLASH_SPI_ENTER(); #endif while (count) 30dee: 81 14 cp r8, r1 30df0: 91 04 cpc r9, r1 30df2: a1 04 cpc r10, r1 30df4: b1 04 cpc r11, r1 30df6: 09 f4 brne .+2 ; 0x30dfa 30df8: 59 c0 rjmp .+178 ; 0x30eac #endif void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); 30dfa: 8e 2d mov r24, r14 30dfc: 0e 94 3c 78 call 0xf078 ; 0xf078 #endif print_hex_byte((val >> 8) & 0xFF); 30e00: 8d 2d mov r24, r13 30e02: 0e 94 3c 78 call 0xf078 ; 0xf078 print_hex_byte(val & 0xFF); 30e06: 8c 2d mov r24, r12 30e08: 0e 94 3c 78 call 0xf078 ; 0xf078 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 30e0c: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 30e10: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 30e14: 80 e2 ldi r24, 0x20 ; 32 30e16: 90 e0 ldi r25, 0x00 ; 0 30e18: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 uint8_t count_line = countperline; 30e1c: 10 e1 ldi r17, 0x10 ; 16 while (count && count_line) { uint8_t data = 0; 30e1e: 19 82 std Y+1, r1 ; 0x01 switch (type) 30e20: 01 30 cpi r16, 0x01 ; 1 30e22: b1 f1 breq .+108 ; 0x30e90 30e24: 88 f1 brcs .+98 ; 0x30e88 30e26: 03 30 cpi r16, 0x03 ; 3 30e28: b9 f1 breq .+110 ; 0x30e98 case dcode_mem_t::xflash: xflash_rd_data(address, &data, 1); break; #else case dcode_mem_t::xflash: break; #endif } ++address; 30e2a: 8f ef ldi r24, 0xFF ; 255 30e2c: c8 1a sub r12, r24 30e2e: d8 0a sbc r13, r24 30e30: e8 0a sbc r14, r24 30e32: f8 0a sbc r15, r24 putchar(' '); 30e34: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 30e38: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 30e3c: 80 e2 ldi r24, 0x20 ; 32 30e3e: 90 e0 ldi r25, 0x00 ; 0 30e40: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 print_hex_byte(data); 30e44: 89 81 ldd r24, Y+1 ; 0x01 30e46: 0e 94 3c 78 call 0xf078 ; 0xf078 count_line--; 30e4a: 11 50 subi r17, 0x01 ; 1 count--; 30e4c: 81 e0 ldi r24, 0x01 ; 1 30e4e: 88 1a sub r8, r24 30e50: 91 08 sbc r9, r1 30e52: a1 08 sbc r10, r1 30e54: 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)) 30e56: 0f b6 in r0, 0x3f ; 63 30e58: 07 fe sbrs r0, 7 30e5a: 06 c0 rjmp .+12 ; 0x30e68 30e5c: c4 01 movw r24, r8 30e5e: 9f 71 andi r25, 0x1F ; 31 30e60: 89 2b or r24, r25 30e62: 11 f4 brne .+4 ; 0x30e68 manage_heater(); 30e64: 0f 94 a0 4e call 0x29d40 ; 0x29d40 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 30e68: 81 14 cp r8, r1 30e6a: 91 04 cpc r9, r1 30e6c: a1 04 cpc r10, r1 30e6e: b1 04 cpc r11, r1 30e70: 11 f0 breq .+4 ; 0x30e76 30e72: 11 11 cpse r17, r1 30e74: d4 cf rjmp .-88 ; 0x30e1e // 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'); 30e76: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 30e7a: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 30e7e: 8a e0 ldi r24, 0x0A ; 10 30e80: 90 e0 ldi r25, 0x00 ; 0 30e82: 0f 94 f9 db call 0x3b7f2 ; 0x3b7f2 30e86: b3 cf rjmp .-154 ; 0x30dee while (count && count_line) { uint8_t data = 0; switch (type) { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 30e88: f6 01 movw r30, r12 30e8a: 80 81 ld r24, Z case dcode_mem_t::eeprom: data = eeprom_read_byte((uint8_t*)address); break; 30e8c: 89 83 std Y+1, r24 ; 0x01 30e8e: cd cf rjmp .-102 ; 0x30e2a 30e90: c6 01 movw r24, r12 30e92: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 30e96: fa cf rjmp .-12 ; 0x30e8c 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; 30e98: 21 e0 ldi r18, 0x01 ; 1 30e9a: 30 e0 ldi r19, 0x00 ; 0 30e9c: ae 01 movw r20, r28 30e9e: 4f 5f subi r20, 0xFF ; 255 30ea0: 5f 4f sbci r21, 0xFF ; 255 30ea2: c7 01 movw r24, r14 30ea4: b6 01 movw r22, r12 30ea6: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc 30eaa: bf cf rjmp .-130 ; 0x30e2a if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 30eac: 0f 90 pop r0 30eae: df 91 pop r29 30eb0: cf 91 pop r28 30eb2: 1f 91 pop r17 30eb4: 0f 91 pop r16 30eb6: ff 90 pop r15 30eb8: ef 90 pop r14 30eba: df 90 pop r13 30ebc: cf 90 pop r12 30ebe: bf 90 pop r11 30ec0: af 90 pop r10 30ec2: 9f 90 pop r9 30ec4: 8f 90 pop r8 30ec6: 08 95 ret 00030ec8 : 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 30ec8: e7 e0 ldi r30, 0x07 ; 7 30eca: f1 e0 ldi r31, 0x01 ; 1 30ecc: 80 81 ld r24, Z 30ece: 8e 7f andi r24, 0xFE ; 254 30ed0: 80 83 st Z, r24 WRITE(IR_SENSOR_PIN, 0); // no pullup 30ed2: 9f b7 in r25, 0x3f ; 63 30ed4: f8 94 cli 30ed6: e8 e0 ldi r30, 0x08 ; 8 30ed8: f1 e0 ldi r31, 0x01 ; 1 30eda: 80 81 ld r24, Z 30edc: 8e 7f andi r24, 0xFE ; 254 30ede: 80 83 st Z, r24 30ee0: 9f bf out 0x3f, r25 ; 63 state = State::disabled; 30ee2: 10 92 88 17 sts 0x1788, r1 ; 0x801788 } 30ee6: 08 95 ret 00030ee8 : ; // } #if (FILAMENT_SENSOR_TYPE == FSENSOR_IR) || (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) void IR_sensor::init() { if (state == State::error) { 30ee8: 80 91 88 17 lds r24, 0x1788 ; 0x801788 30eec: 83 30 cpi r24, 0x03 ; 3 30eee: 11 f4 brne .+4 ; 0x30ef4 fsensor.deinit(); // deinit first if there was an error. 30ef0: 0f 94 64 87 call 0x30ec8 ; 0x30ec8 } // puts_P(PSTR("fsensor::init()")); SET_INPUT(IR_SENSOR_PIN); // input mode 30ef4: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 30ef8: 8e 7f andi r24, 0xFE ; 254 30efa: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> WRITE(IR_SENSOR_PIN, 1); // pullup 30efe: 9f b7 in r25, 0x3f ; 63 30f00: f8 94 cli 30f02: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30f06: 81 60 ori r24, 0x01 ; 1 30f08: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 30f0c: 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(); } 30f0e: 88 e8 ldi r24, 0x88 ; 136 30f10: 97 e1 ldi r25, 0x17 ; 23 30f12: 0e 94 84 75 call 0xeb08 ; 0xeb08 30f16: 88 e8 ldi r24, 0x88 ; 136 30f18: 97 e1 ldi r25, 0x17 ; 23 30f1a: 0e 94 84 75 call 0xeb08 ; 0xeb08 #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); 30f1e: 88 e4 ldi r24, 0x48 ; 72 30f20: 9d e0 ldi r25, 0x0D ; 13 30f22: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 30f26: 80 93 91 17 sts 0x1791, r24 ; 0x801791 } 30f2a: 08 95 ret 00030f2c : //! //! @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) 30f2c: cf 92 push r12 30f2e: df 92 push r13 30f30: ef 92 push r14 30f32: ff 92 push r15 30f34: 69 01 movw r12, r18 30f36: 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); 30f38: 2d ec ldi r18, 0xCD ; 205 30f3a: 3c ec ldi r19, 0xCC ; 204 30f3c: 4c e4 ldi r20, 0x4C ; 76 30f3e: 5e e3 ldi r21, 0x3E ; 62 30f40: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 30f44: 2d ec ldi r18, 0xCD ; 205 30f46: 3c ec ldi r19, 0xCC ; 204 30f48: 4c e4 ldi r20, 0x4C ; 76 30f4a: 5e e3 ldi r21, 0x3E ; 62 30f4c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 30f50: 2d ef ldi r18, 0xFD ; 253 30f52: 3d ea ldi r19, 0xAD ; 173 30f54: 40 e0 ldi r20, 0x00 ; 0 30f56: 5d e3 ldi r21, 0x3D ; 61 30f58: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 30f5c: a7 01 movw r20, r14 30f5e: 96 01 movw r18, r12 30f60: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 30f64: 24 e2 ldi r18, 0x24 ; 36 30f66: 30 ef ldi r19, 0xF0 ; 240 30f68: 49 e1 ldi r20, 0x19 ; 25 30f6a: 50 e4 ldi r21, 0x40 ; 64 30f6c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> } 30f70: ff 90 pop r15 30f72: ef 90 pop r14 30f74: df 90 pop r13 30f76: cf 90 pop r12 30f78: 08 95 ret 00030f7a : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 30f7a: 9f b7 in r25, 0x3f ; 63 30f7c: 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)); 30f7e: 80 e1 ldi r24, 0x10 ; 16 30f80: e4 e5 ldi r30, 0x54 ; 84 30f82: f7 e0 ldi r31, 0x07 ; 7 30f84: a4 e6 ldi r26, 0x64 ; 100 30f86: b7 e0 ldi r27, 0x07 ; 7 30f88: 01 90 ld r0, Z+ 30f8a: 0d 92 st X+, r0 30f8c: 8a 95 dec r24 30f8e: e1 f7 brne .-8 ; 0x30f88 CRITICAL_SECTION_END; 30f90: 9f bf out 0x3f, r25 ; 63 } 30f92: 08 95 ret 00030f94 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 30f94: 89 e0 ldi r24, 0x09 ; 9 30f96: 80 93 75 07 sts 0x0775, r24 ; 0x800775 }; const char *ProgressCodeToText(ProgressCode pc) { // @@TODO ?? a better fallback option? return ((uint16_t)pc <= (sizeof(progressTexts) / sizeof(progressTexts[0]))) ? static_cast(pgm_read_ptr(&progressTexts[(uint16_t)pc])) 30f9a: e5 ed ldi r30, 0xD5 ; 213 30f9c: f6 ea ldi r31, 0xA6 ; 166 30f9e: 85 91 lpm r24, Z+ 30fa0: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 30fa2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 30fa6: 0d 94 ea 0b jmp 0x217d4 ; 0x217d4 00030faa : 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){ 30faa: cf 93 push r28 30fac: c8 2f mov r28, r24 extruder = ex; 30fae: 80 93 7f 13 sts 0x137F, r24 ; 0x80137f MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 30fb2: 82 ef ldi r24, 0xF2 ; 242 30fb4: 99 ea ldi r25, 0xA9 ; 169 30fb6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 30fba: 87 ea ldi r24, 0xA7 ; 167 30fbc: 96 ea ldi r25, 0xA6 ; 166 30fbe: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 30fc2: 8d e9 ldi r24, 0x9D ; 157 30fc4: 96 ea ldi r25, 0xA6 ; 166 30fc6: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN((int)ex); 30fca: 8c 2f mov r24, r28 30fcc: 90 e0 ldi r25, 0x00 ; 0 } 30fce: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 30fd0: 0d 94 19 77 jmp 0x2ee32 ; 0x2ee32 00030fd4 : tmc2130_sg_measure = 0xff; return tmc2130_sg_measure_val / tmc2130_sg_measure_cnt; } bool tmc2130_wait_standstill_xy(int timeout) 30fd4: 0f 93 push r16 30fd6: 1f 93 push r17 30fd8: cf 93 push r28 30fda: df 93 push r29 30fdc: 00 d0 rcall .+0 ; 0x30fde 30fde: 00 d0 rcall .+0 ; 0x30fe0 30fe0: 1f 92 push r1 30fe2: 1f 92 push r1 30fe4: cd b7 in r28, 0x3d ; 61 30fe6: de b7 in r29, 0x3e ; 62 30fe8: 08 ee ldi r16, 0xE8 ; 232 30fea: 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; 30fec: 1d 82 std Y+5, r1 ; 0x05 30fee: 1e 82 std Y+6, r1 ; 0x06 30ff0: 1f 82 std Y+7, r1 ; 0x07 30ff2: 18 86 std Y+8, r1 ; 0x08 uint32_t drv_status_y = 0; 30ff4: 19 82 std Y+1, r1 ; 0x01 30ff6: 1a 82 std Y+2, r1 ; 0x02 30ff8: 1b 82 std Y+3, r1 ; 0x03 30ffa: 1c 82 std Y+4, r1 ; 0x04 tmc2130_rd(X_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_x); 30ffc: ae 01 movw r20, r28 30ffe: 4b 5f subi r20, 0xFB ; 251 31000: 5f 4f sbci r21, 0xFF ; 255 31002: 6f e6 ldi r22, 0x6F ; 111 31004: 80 e0 ldi r24, 0x00 ; 0 31006: 0f 94 ac 39 call 0x27358 ; 0x27358 tmc2130_rd(Y_AXIS, TMC2130_REG_DRV_STATUS, &drv_status_y); 3100a: ae 01 movw r20, r28 3100c: 4f 5f subi r20, 0xFF ; 255 3100e: 5f 4f sbci r21, 0xFF ; 255 31010: 6f e6 ldi r22, 0x6F ; 111 31012: 81 e0 ldi r24, 0x01 ; 1 31014: 0f 94 ac 39 call 0x27358 ; 0x27358 // 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); 31018: 8d 81 ldd r24, Y+5 ; 0x05 3101a: 9e 81 ldd r25, Y+6 ; 0x06 3101c: af 81 ldd r26, Y+7 ; 0x07 3101e: b8 85 ldd r27, Y+8 ; 0x08 31020: b7 fd sbrc r27, 7 31022: 07 c0 rjmp .+14 ; 0x31032 tmc2130_check_overtemp(); 31024: 0f 94 26 40 call 0x2804c ; 0x2804c 31028: 01 50 subi r16, 0x01 ; 1 3102a: 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)) 3102c: f9 f6 brne .-66 ; 0x30fec 3102e: 80 e0 ldi r24, 0x00 ; 0 31030: 09 c0 rjmp .+18 ; 0x31044 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); 31032: 89 81 ldd r24, Y+1 ; 0x01 31034: 9a 81 ldd r25, Y+2 ; 0x02 31036: ab 81 ldd r26, Y+3 ; 0x03 31038: bc 81 ldd r27, Y+4 ; 0x04 3103a: b7 ff sbrs r27, 7 3103c: f3 cf rjmp .-26 ; 0x31024 tmc2130_check_overtemp(); 3103e: 0f 94 26 40 call 0x2804c ; 0x2804c 31042: 81 e0 ldi r24, 0x01 ; 1 timeout--; } return standstill; } 31044: 28 96 adiw r28, 0x08 ; 8 31046: 0f b6 in r0, 0x3f ; 63 31048: f8 94 cli 3104a: de bf out 0x3e, r29 ; 62 3104c: 0f be out 0x3f, r0 ; 63 3104e: cd bf out 0x3d, r28 ; 61 31050: df 91 pop r29 31052: cf 91 pop r28 31054: 1f 91 pop r17 31056: 0f 91 pop r16 31058: 08 95 ret 0003105a : 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) { 3105a: 1f 93 push r17 3105c: cf 93 push r28 3105e: df 93 push r29 31060: ec 01 movw r28, r24 31062: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 31064: 0f 94 2c 59 call 0x2b258 ; 0x2b258 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))); 31068: fe 01 movw r30, r28 3106a: 34 96 adiw r30, 0x04 ; 4 3106c: 25 91 lpm r18, Z+ 3106e: 35 91 lpm r19, Z+ 31070: 45 91 lpm r20, Z+ 31072: 54 91 lpm r21, Z 31074: fe 01 movw r30, r28 31076: 65 91 lpm r22, Z+ 31078: 75 91 lpm r23, Z+ 3107a: 85 91 lpm r24, Z+ 3107c: 94 91 lpm r25, Z 3107e: 0f 94 30 c3 call 0x38660 ; 0x38660 step++; 31082: 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) { 31084: 11 50 subi r17, 0x01 ; 1 31086: 81 f7 brne .-32 ; 0x31068 31088: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // 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(); } 3108c: df 91 pop r29 3108e: cf 91 pop r28 31090: 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(); 31092: 0d 94 2e c3 jmp 0x3865c ; 0x3865c 00031096 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 31096: 0e 94 45 68 call 0xd08a ; 0xd08a 3109a: 81 11 cpse r24, r1 3109c: 04 c0 rjmp .+8 ; 0x310a6 lcd_setstatuspgm(MSG_WELCOME); 3109e: 8a e6 ldi r24, 0x6A ; 106 310a0: 90 e7 ldi r25, 0x70 ; 112 310a2: 0f 94 ea 0b call 0x217d4 ; 0x217d4 } custom_message_type = CustomMsg::Status; 310a6: 10 92 75 07 sts 0x0775, r1 ; 0x800775 } 310aa: 08 95 ret 000310ac : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 310ac: 80 91 98 13 lds r24, 0x1398 ; 0x801398 310b0: 88 23 and r24, r24 310b2: 11 f0 breq .+4 ; 0x310b8 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; 310b4: 81 e0 ldi r24, 0x01 ; 1 310b6: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 310b8: 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; } } 310ba: 08 95 ret 000310bc : } 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) 310bc: 2f 92 push r2 310be: 3f 92 push r3 310c0: 4f 92 push r4 310c2: 5f 92 push r5 310c4: 6f 92 push r6 310c6: 7f 92 push r7 310c8: 8f 92 push r8 310ca: 9f 92 push r9 310cc: af 92 push r10 310ce: bf 92 push r11 310d0: cf 92 push r12 310d2: df 92 push r13 310d4: ef 92 push r14 310d6: ff 92 push r15 310d8: 0f 93 push r16 310da: 1f 93 push r17 310dc: cf 93 push r28 310de: df 93 push r29 310e0: cd b7 in r28, 0x3d ; 61 310e2: de b7 in r29, 0x3e ; 62 310e4: 2d 97 sbiw r28, 0x0d ; 13 310e6: 0f b6 in r0, 0x3f ; 63 310e8: f8 94 cli 310ea: de bf out 0x3e, r29 ; 62 310ec: 0f be out 0x3f, r0 ; 63 310ee: cd bf out 0x3d, r28 ; 61 310f0: 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; 310f2: 41 2c mov r4, r1 310f4: 51 2c mov r5, r1 310f6: 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; 310f8: 6e 31 cpi r22, 0x1E ; 30 310fa: 90 f0 brcs .+36 ; 0x31120 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 310fc: 69 3c cpi r22, 0xC9 ; 201 310fe: 08 f0 brcs .+2 ; 0x31102 31100: 68 ec ldi r22, 0xC8 ; 200 31102: 70 e0 ldi r23, 0x00 ; 0 31104: 68 51 subi r22, 0x18 ; 24 31106: 7c 4f sbci r23, 0xFC ; 252 31108: 90 e0 ldi r25, 0x00 ; 0 3110a: 80 e0 ldi r24, 0x00 ; 0 3110c: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 31110: 20 e0 ldi r18, 0x00 ; 0 31112: 30 e0 ldi r19, 0x00 ; 0 31114: 4a e7 ldi r20, 0x7A ; 122 31116: 54 e4 ldi r21, 0x44 ; 68 31118: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 3111c: 2b 01 movw r4, r22 3111e: 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) 31120: 80 91 bf 02 lds r24, 0x02BF ; 0x8002bf 31124: 90 91 c0 02 lds r25, 0x02C0 ; 0x8002c0 31128: a0 91 c1 02 lds r26, 0x02C1 ; 0x8002c1 3112c: b0 91 c2 02 lds r27, 0x02C2 ; 0x8002c2 31130: 89 83 std Y+1, r24 ; 0x01 31132: 9a 83 std Y+2, r25 ; 0x02 31134: ab 83 std Y+3, r26 ; 0x03 31136: bc 83 std Y+4, r27 ; 0x04 uint8_t x[3] = {255,255,255}; //X segment bounds (MSLUTSEL) 31138: 80 91 c3 02 lds r24, 0x02C3 ; 0x8002c3 3113c: 90 91 c4 02 lds r25, 0x02C4 ; 0x8002c4 31140: a0 91 c5 02 lds r26, 0x02C5 ; 0x8002c5 31144: 8d 83 std Y+5, r24 ; 0x05 31146: 9e 83 std Y+6, r25 ; 0x06 31148: 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); 3114a: 20 e0 ldi r18, 0x00 ; 0 3114c: 30 e0 ldi r19, 0x00 ; 0 3114e: 47 ef ldi r20, 0xF7 ; 247 31150: 50 e0 ldi r21, 0x00 ; 0 31152: 69 ee ldi r22, 0xE9 ; 233 31154: 8e 2d mov r24, r14 31156: 0f 94 06 3a call 0x2740c ; 0x2740c 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 3115a: 81 2c mov r8, r1 3115c: 91 2c mov r9, r1 3115e: 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 31160: 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 31162: 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 31164: 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 31166: 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 31168: 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) 3116a: 2f 2c mov r2, r15 3116c: 31 2c mov r3, r1 3116e: 8f 2d mov r24, r15 31170: 8f 71 andi r24, 0x1F ; 31 31172: 88 87 std Y+8, r24 ; 0x08 31174: 81 11 cpse r24, r1 31176: 03 c0 rjmp .+6 ; 0x3117e reg = 0; 31178: 81 2c mov r8, r1 3117a: 91 2c mov r9, r1 3117c: 54 01 movw r10, r8 3117e: b1 01 movw r22, r2 31180: 03 2c mov r0, r3 31182: 00 0c add r0, r0 31184: 88 0b sbc r24, r24 31186: 99 0b sbc r25, r25 31188: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3118c: 2b ed ldi r18, 0xDB ; 219 3118e: 3f e0 ldi r19, 0x0F ; 15 31190: 49 ec ldi r20, 0xC9 ; 201 31192: 50 e4 ldi r21, 0x40 ; 64 31194: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31198: 6a 87 std Y+10, r22 ; 0x0a 3119a: 7b 87 std Y+11, r23 ; 0x0b 3119c: 8c 87 std Y+12, r24 ; 0x0c 3119e: 9d 87 std Y+13, r25 ; 0x0d // calculate value if (fac == 0) // default TMC wave 311a0: 20 e0 ldi r18, 0x00 ; 0 311a2: 30 e0 ldi r19, 0x00 ; 0 311a4: a9 01 movw r20, r18 311a6: c3 01 movw r24, r6 311a8: b2 01 movw r22, r4 311aa: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 311ae: 81 11 cpse r24, r1 311b0: 4d c0 rjmp .+154 ; 0x3124c vA = (uint8_t)((amp+1) * sin((2*PI*i + PI)/1024) + 0.5) - 1; 311b2: 2b ed ldi r18, 0xDB ; 219 311b4: 3f e0 ldi r19, 0x0F ; 15 311b6: 49 e4 ldi r20, 0x49 ; 73 311b8: 50 e4 ldi r21, 0x40 ; 64 311ba: 6a 85 ldd r22, Y+10 ; 0x0a 311bc: 7b 85 ldd r23, Y+11 ; 0x0b 311be: 8c 85 ldd r24, Y+12 ; 0x0c 311c0: 9d 85 ldd r25, Y+13 ; 0x0d 311c2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 311c6: 20 e0 ldi r18, 0x00 ; 0 311c8: 30 e0 ldi r19, 0x00 ; 0 311ca: 40 e8 ldi r20, 0x80 ; 128 311cc: 5a e3 ldi r21, 0x3A ; 58 311ce: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 311d2: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 311d6: 20 e0 ldi r18, 0x00 ; 0 311d8: 30 e0 ldi r19, 0x00 ; 0 311da: 48 e7 ldi r20, 0x78 ; 120 311dc: 53 e4 ldi r21, 0x43 ; 67 311de: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 311ee: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 311f2: cc 24 eor r12, r12 311f4: ca 94 dec r12 311f6: 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 311f8: 8c 2d mov r24, r12 311fa: 99 85 ldd r25, Y+9 ; 0x09 311fc: 89 1b sub r24, r25 va = vA; b = -1; if (dA == d0) b = 0; //delta == delta0 => bit=0 311fe: 8d 15 cp r24, r13 31200: f9 f0 breq .+62 ; 0x31240 else if (dA == d1) b = 1; //delta == delta1 => bit=1 31202: 80 17 cp r24, r16 31204: 09 f4 brne .+2 ; 0x31208 31206: 71 c0 rjmp .+226 ; 0x312ea else { if (dA < d0) // delta < delta0 => switch wbit down 31208: 8d 15 cp r24, r13 3120a: 0c f0 brlt .+2 ; 0x3120e 3120c: 53 c0 rjmp .+166 ; 0x312b4 { //printf("dn\n"); b = 0; switch (dA) 3120e: 88 23 and r24, r24 31210: e9 f1 breq .+122 ; 0x3128c 31212: 81 30 cpi r24, 0x01 ; 1 31214: 09 f4 brne .+2 ; 0x31218 31216: 44 c0 rjmp .+136 ; 0x312a0 31218: 8f 3f cpi r24, 0xFF ; 255 3121a: 09 f0 breq .+2 ; 0x3121e 3121c: 81 c0 rjmp .+258 ; 0x31320 { case -1: d0 = -1; d1 = 0; w[s+1] = 0; break; 3121e: e2 e0 ldi r30, 0x02 ; 2 31220: f0 e0 ldi r31, 0x00 ; 0 31222: ec 0f add r30, r28 31224: fd 1f adc r31, r29 31226: e1 0f add r30, r17 31228: f1 1d adc r31, r1 3122a: 10 82 st Z, r1 3122c: 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++; } 3122e: e5 e0 ldi r30, 0x05 ; 5 31230: f0 e0 ldi r31, 0x00 ; 0 31232: ec 0f add r30, r28 31234: fd 1f adc r31, r29 31236: e1 0f add r30, r17 31238: f1 1d adc r31, r1 3123a: f0 82 st Z, r15 3123c: 1f 5f subi r17, 0xFF ; 255 3123e: 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) 31240: 14 30 cpi r17, 0x04 ; 4 31242: 08 f4 brcc .+2 ; 0x31246 31244: 56 c0 rjmp .+172 ; 0x312f2 31246: 6c c0 rjmp .+216 ; 0x31320 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); 31248: f8 2e mov r15, r24 3124a: 8f cf rjmp .-226 ; 0x3116a 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); 3124c: 20 e0 ldi r18, 0x00 ; 0 3124e: 30 e0 ldi r19, 0x00 ; 0 31250: 40 e8 ldi r20, 0x80 ; 128 31252: 5a e3 ldi r21, 0x3A ; 58 31254: 6a 85 ldd r22, Y+10 ; 0x0a 31256: 7b 85 ldd r23, Y+11 ; 0x0b 31258: 8c 85 ldd r24, Y+12 ; 0x0c 3125a: 9d 85 ldd r25, Y+13 ; 0x0d 3125c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31260: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 31264: a3 01 movw r20, r6 31266: 92 01 movw r18, r4 31268: 0f 94 29 e2 call 0x3c452 ; 0x3c452 3126c: 20 e0 ldi r18, 0x00 ; 0 3126e: 30 e0 ldi r19, 0x00 ; 0 31270: 47 e7 ldi r20, 0x77 ; 119 31272: 53 e4 ldi r21, 0x43 ; 67 31274: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31278: 20 e0 ldi r18, 0x00 ; 0 3127a: 30 e0 ldi r19, 0x00 ; 0 3127c: 40 e0 ldi r20, 0x00 ; 0 3127e: 5f e3 ldi r21, 0x3F ; 63 31280: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31284: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 31288: c6 2e mov r12, r22 3128a: b6 cf rjmp .-148 ; 0x311f8 //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; 3128c: e2 e0 ldi r30, 0x02 ; 2 3128e: f0 e0 ldi r31, 0x00 ; 0 31290: ec 0f add r30, r28 31292: fd 1f adc r31, r29 31294: e1 0f add r30, r17 31296: f1 1d adc r31, r1 31298: 91 e0 ldi r25, 0x01 ; 1 3129a: 90 83 st Z, r25 3129c: 01 e0 ldi r16, 0x01 ; 1 3129e: c7 cf rjmp .-114 ; 0x3122e case 1: d0 = 1; d1 = 2; w[s+1] = 2; break; 312a0: e2 e0 ldi r30, 0x02 ; 2 312a2: f0 e0 ldi r31, 0x00 ; 0 312a4: ec 0f add r30, r28 312a6: fd 1f adc r31, r29 312a8: e1 0f add r30, r17 312aa: f1 1d adc r31, r1 312ac: 92 e0 ldi r25, 0x02 ; 2 312ae: 90 83 st Z, r25 312b0: 02 e0 ldi r16, 0x02 ; 2 312b2: bd cf rjmp .-134 ; 0x3122e default: b = -1; break; } if (b >= 0) { x[s] = i; s++; } } else if (dA > d1) // delta > delta0 => switch wbit up 312b4: 08 17 cp r16, r24 312b6: a4 f5 brge .+104 ; 0x31320 { //printf("up\n"); b = 1; switch (dA) 312b8: 82 30 cpi r24, 0x02 ; 2 312ba: 09 f4 brne .+2 ; 0x312be 312bc: 80 c0 rjmp .+256 ; 0x313be 312be: 83 30 cpi r24, 0x03 ; 3 312c0: 09 f4 brne .+2 ; 0x312c4 312c2: 88 c0 rjmp .+272 ; 0x313d4 312c4: 81 30 cpi r24, 0x01 ; 1 312c6: 61 f5 brne .+88 ; 0x31320 { case 1: d0 = 0; d1 = 1; w[s+1] = 1; break; 312c8: e2 e0 ldi r30, 0x02 ; 2 312ca: f0 e0 ldi r31, 0x00 ; 0 312cc: ec 0f add r30, r28 312ce: fd 1f adc r31, r29 312d0: e1 0f add r30, r17 312d2: f1 1d adc r31, r1 312d4: 80 83 st Z, r24 312d6: 01 e0 ldi r16, 0x01 ; 1 312d8: 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++; } 312da: e5 e0 ldi r30, 0x05 ; 5 312dc: f0 e0 ldi r31, 0x00 ; 0 312de: ec 0f add r30, r28 312e0: fd 1f adc r31, r29 312e2: e1 0f add r30, r17 312e4: f1 1d adc r31, r1 312e6: f0 82 st Z, r15 312e8: 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) 312ea: 14 30 cpi r17, 0x04 ; 4 312ec: c8 f4 brcc .+50 ; 0x31320 //printf("%d\n", vA); if (b == 1) reg |= 0x80000000; 312ee: 68 94 set 312f0: b7 f8 bld r11, 7 if ((i & 31) == 31) 312f2: 88 85 ldd r24, Y+8 ; 0x08 312f4: 8f 31 cpi r24, 0x1F ; 31 312f6: 09 f0 breq .+2 ; 0x312fa 312f8: 78 c0 rjmp .+240 ; 0x313ea tmc2130_wr_MSLUT(axis, (uint8_t)(i >> 5), reg); 312fa: b1 01 movw r22, r2 312fc: e5 e0 ldi r30, 0x05 ; 5 312fe: 75 95 asr r23 31300: 67 95 ror r22 31302: ea 95 dec r30 31304: e1 f7 brne .-8 ; 0x312fe //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); 31306: 60 5a subi r22, 0xA0 ; 160 31308: 60 68 ori r22, 0x80 ; 128 3130a: a5 01 movw r20, r10 3130c: 94 01 movw r18, r8 3130e: 8e 2d mov r24, r14 31310: 0f 94 06 3a call 0x2740c ; 0x2740c 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); 31314: 81 e0 ldi r24, 0x01 ; 1 31316: 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; 31318: 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); 3131a: 9f ef ldi r25, 0xFF ; 255 3131c: f9 12 cpse r15, r25 3131e: 94 cf rjmp .-216 ; 0x31248 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; 31320: 2a 81 ldd r18, Y+2 ; 0x02 31322: 30 e0 ldi r19, 0x00 ; 0 31324: 50 e0 ldi r21, 0x00 ; 0 31326: 40 e0 ldi r20, 0x00 ; 0 31328: 82 e0 ldi r24, 0x02 ; 2 3132a: 22 0f add r18, r18 3132c: 33 1f adc r19, r19 3132e: 44 1f adc r20, r20 31330: 55 1f adc r21, r21 31332: 8a 95 dec r24 31334: d1 f7 brne .-12 ; 0x3132a val |= ((uint32_t)w2) << 4; 31336: 8b 80 ldd r8, Y+3 ; 0x03 31338: 91 2c mov r9, r1 3133a: b1 2c mov r11, r1 3133c: a1 2c mov r10, r1 3133e: 94 e0 ldi r25, 0x04 ; 4 31340: 88 0c add r8, r8 31342: 99 1c adc r9, r9 31344: aa 1c adc r10, r10 31346: bb 1c adc r11, r11 31348: 9a 95 dec r25 3134a: d1 f7 brne .-12 ; 0x31340 3134c: 82 2a or r8, r18 3134e: 93 2a or r9, r19 31350: a4 2a or r10, r20 31352: 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); 31354: 89 81 ldd r24, Y+1 ; 0x01 val |= ((uint32_t)w1) << 2; val |= ((uint32_t)w2) << 4; 31356: 88 2a or r8, r24 val |= ((uint32_t)w3) << 6; 31358: 8c 81 ldd r24, Y+4 ; 0x04 3135a: 90 e0 ldi r25, 0x00 ; 0 3135c: b0 e0 ldi r27, 0x00 ; 0 3135e: a0 e0 ldi r26, 0x00 ; 0 31360: 9c 01 movw r18, r24 31362: ad 01 movw r20, r26 31364: 66 e0 ldi r22, 0x06 ; 6 31366: 22 0f add r18, r18 31368: 33 1f adc r19, r19 3136a: 44 1f adc r20, r20 3136c: 55 1f adc r21, r21 3136e: 6a 95 dec r22 31370: d1 f7 brne .-12 ; 0x31366 31372: 28 29 or r18, r8 31374: 39 29 or r19, r9 31376: 4a 29 or r20, r10 31378: 5b 29 or r21, r11 val |= ((uint32_t)x1) << 8; 3137a: 8d 81 ldd r24, Y+5 ; 0x05 3137c: 38 2b or r19, r24 val |= ((uint32_t)x2) << 16; 3137e: 8e 81 ldd r24, Y+6 ; 0x06 31380: 48 2b or r20, r24 val |= ((uint32_t)x3) << 24; 31382: 8f 81 ldd r24, Y+7 ; 0x07 31384: 58 2b or r21, r24 tmc2130_wr(axis, TMC2130_REG_MSLUTSEL, val); 31386: 68 ee ldi r22, 0xE8 ; 232 31388: 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]); } 3138a: 2d 96 adiw r28, 0x0d ; 13 3138c: 0f b6 in r0, 0x3f ; 63 3138e: f8 94 cli 31390: de bf out 0x3e, r29 ; 62 31392: 0f be out 0x3f, r0 ; 63 31394: cd bf out 0x3d, r28 ; 61 31396: df 91 pop r29 31398: cf 91 pop r28 3139a: 1f 91 pop r17 3139c: 0f 91 pop r16 3139e: ff 90 pop r15 313a0: ef 90 pop r14 313a2: df 90 pop r13 313a4: cf 90 pop r12 313a6: bf 90 pop r11 313a8: af 90 pop r10 313aa: 9f 90 pop r9 313ac: 8f 90 pop r8 313ae: 7f 90 pop r7 313b0: 6f 90 pop r6 313b2: 5f 90 pop r5 313b4: 4f 90 pop r4 313b6: 3f 90 pop r3 313b8: 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); 313ba: 0d 94 06 3a jmp 0x2740c ; 0x2740c //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; 313be: e2 e0 ldi r30, 0x02 ; 2 313c0: f0 e0 ldi r31, 0x00 ; 0 313c2: ec 0f add r30, r28 313c4: fd 1f adc r31, r29 313c6: e1 0f add r30, r17 313c8: f1 1d adc r31, r1 313ca: 80 83 st Z, r24 313cc: 02 e0 ldi r16, 0x02 ; 2 313ce: dd 24 eor r13, r13 313d0: d3 94 inc r13 313d2: 83 cf rjmp .-250 ; 0x312da case 3: d0 = 2; d1 = 3; w[s+1] = 3; break; 313d4: e2 e0 ldi r30, 0x02 ; 2 313d6: f0 e0 ldi r31, 0x00 ; 0 313d8: ec 0f add r30, r28 313da: fd 1f adc r31, r29 313dc: e1 0f add r30, r17 313de: f1 1d adc r31, r1 313e0: 80 83 st Z, r24 313e2: 03 e0 ldi r16, 0x03 ; 3 313e4: f2 e0 ldi r31, 0x02 ; 2 313e6: df 2e mov r13, r31 313e8: 78 cf rjmp .-272 ; 0x312da //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; 313ea: b6 94 lsr r11 313ec: a7 94 ror r10 313ee: 97 94 ror r9 313f0: 87 94 ror r8 313f2: 90 cf rjmp .-224 ; 0x31314 000313f4 : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 313f4: 8f 92 push r8 313f6: 9f 92 push r9 313f8: af 92 push r10 313fa: bf 92 push r11 313fc: cf 92 push r12 313fe: df 92 push r13 31400: ef 92 push r14 31402: ff 92 push r15 31404: 90 91 3f 07 lds r25, 0x073F ; 0x80073f // Perform FW retraction, just if needed, but behave as if the move has never took place in // order to keep E/Z coordinates unchanged. This is done by manipulating the internal planner // position, which requires a sync if(retracting && !retracted[active_extruder]) { 31408: 88 23 and r24, r24 3140a: 09 f4 brne .+2 ; 0x3140e 3140c: 9d c0 rjmp .+314 ; 0x31548 3140e: 91 11 cpse r25, r1 31410: 92 c0 rjmp .+292 ; 0x31536 st_synchronize(); 31412: 0f 94 2c 59 call 0x2b258 ; 0x2b258 set_destination_to_current(); 31416: 0e 94 ef 68 call 0xd1de ; 0xd1de current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 3141a: 60 91 94 02 lds r22, 0x0294 ; 0x800294 3141e: 70 91 95 02 lds r23, 0x0295 ; 0x800295 31422: 07 2e mov r0, r23 31424: 00 0c add r0, r0 31426: 88 0b sbc r24, r24 31428: 99 0b sbc r25, r25 3142a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3142e: 20 91 f1 06 lds r18, 0x06F1 ; 0x8006f1 31432: 30 91 f2 06 lds r19, 0x06F2 ; 0x8006f2 31436: 40 91 f3 06 lds r20, 0x06F3 ; 0x8006f3 3143a: 50 91 f4 06 lds r21, 0x06F4 ; 0x8006f4 3143e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31442: 2a e0 ldi r18, 0x0A ; 10 31444: 37 ed ldi r19, 0xD7 ; 215 31446: 43 e2 ldi r20, 0x23 ; 35 31448: 5c e3 ldi r21, 0x3C ; 60 3144a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3144e: 20 91 4f 07 lds r18, 0x074F ; 0x80074f 31452: 30 91 50 07 lds r19, 0x0750 ; 0x800750 31456: 40 91 51 07 lds r20, 0x0751 ; 0x800751 3145a: 50 91 52 07 lds r21, 0x0752 ; 0x800752 3145e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31462: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 31466: 70 93 50 07 sts 0x0750, r23 ; 0x800750 3146a: 80 93 51 07 sts 0x0751, r24 ; 0x800751 3146e: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_set_e_position(current_position[E_AXIS]); 31472: 8f e4 ldi r24, 0x4F ; 79 31474: 97 e0 ldi r25, 0x07 ; 7 31476: 0f 94 e4 aa call 0x355c8 ; 0x355c8 float oldFeedrate = feedrate; 3147a: c0 90 90 02 lds r12, 0x0290 ; 0x800290 3147e: d0 90 91 02 lds r13, 0x0291 ; 0x800291 31482: e0 90 92 02 lds r14, 0x0292 ; 0x800292 31486: f0 90 93 02 lds r15, 0x0293 ; 0x800293 feedrate=cs.retract_feedrate*60; 3148a: 20 e0 ldi r18, 0x00 ; 0 3148c: 30 e0 ldi r19, 0x00 ; 0 3148e: 40 e7 ldi r20, 0x70 ; 112 31490: 52 e4 ldi r21, 0x42 ; 66 31492: 60 91 f5 06 lds r22, 0x06F5 ; 0x8006f5 31496: 70 91 f6 06 lds r23, 0x06F6 ; 0x8006f6 3149a: 80 91 f7 06 lds r24, 0x06F7 ; 0x8006f7 3149e: 90 91 f8 06 lds r25, 0x06F8 ; 0x8006f8 314a2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 314a6: 60 93 90 02 sts 0x0290, r22 ; 0x800290 314aa: 70 93 91 02 sts 0x0291, r23 ; 0x800291 314ae: 80 93 92 02 sts 0x0292, r24 ; 0x800292 314b2: 90 93 93 02 sts 0x0293, r25 ; 0x800293 retracted[active_extruder]=true; 314b6: 81 e0 ldi r24, 0x01 ; 1 314b8: 80 93 3f 07 sts 0x073F, r24 ; 0x80073f prepare_move(); 314bc: 90 e0 ldi r25, 0x00 ; 0 314be: 80 e0 ldi r24, 0x00 ; 0 314c0: 0e 94 bd 6c call 0xd97a ; 0xd97a if(cs.retract_zlift) { 314c4: 20 e0 ldi r18, 0x00 ; 0 314c6: 30 e0 ldi r19, 0x00 ; 0 314c8: a9 01 movw r20, r18 314ca: 60 91 f9 06 lds r22, 0x06F9 ; 0x8006f9 314ce: 70 91 fa 06 lds r23, 0x06FA ; 0x8006fa 314d2: 80 91 fb 06 lds r24, 0x06FB ; 0x8006fb 314d6: 90 91 fc 06 lds r25, 0x06FC ; 0x8006fc 314da: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 314de: 88 23 and r24, r24 314e0: 11 f1 breq .+68 ; 0x31526 st_synchronize(); 314e2: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[Z_AXIS]-=cs.retract_zlift; 314e6: 20 91 f9 06 lds r18, 0x06F9 ; 0x8006f9 314ea: 30 91 fa 06 lds r19, 0x06FA ; 0x8006fa 314ee: 40 91 fb 06 lds r20, 0x06FB ; 0x8006fb 314f2: 50 91 fc 06 lds r21, 0x06FC ; 0x8006fc 314f6: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 314fa: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 314fe: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 31502: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 31506: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 3150a: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 3150e: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 31512: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 31516: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_set_position_curposXYZE(); 3151a: 0f 94 53 b9 call 0x372a6 ; 0x372a6 prepare_move(); 3151e: 90 e0 ldi r25, 0x00 ; 0 31520: 80 e0 ldi r24, 0x00 ; 0 31522: 0e 94 bd 6c call 0xd97a ; 0xd97a } feedrate = oldFeedrate; 31526: c0 92 90 02 sts 0x0290, r12 ; 0x800290 3152a: d0 92 91 02 sts 0x0291, r13 ; 0x800291 3152e: e0 92 92 02 sts 0x0292, r14 ; 0x800292 31532: 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 31536: ff 90 pop r15 31538: ef 90 pop r14 3153a: df 90 pop r13 3153c: cf 90 pop r12 3153e: bf 90 pop r11 31540: af 90 pop r10 31542: 9f 90 pop r9 31544: 8f 90 pop r8 31546: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 31548: 99 23 and r25, r25 3154a: a9 f3 breq .-22 ; 0x31536 st_synchronize(); 3154c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 set_destination_to_current(); 31550: 0e 94 ef 68 call 0xd1de ; 0xd1de float oldFeedrate = feedrate; 31554: 80 90 90 02 lds r8, 0x0290 ; 0x800290 31558: 90 90 91 02 lds r9, 0x0291 ; 0x800291 3155c: a0 90 92 02 lds r10, 0x0292 ; 0x800292 31560: b0 90 93 02 lds r11, 0x0293 ; 0x800293 feedrate=cs.retract_recover_feedrate*60; 31564: 20 e0 ldi r18, 0x00 ; 0 31566: 30 e0 ldi r19, 0x00 ; 0 31568: 40 e7 ldi r20, 0x70 ; 112 3156a: 52 e4 ldi r21, 0x42 ; 66 3156c: 60 91 01 07 lds r22, 0x0701 ; 0x800701 31570: 70 91 02 07 lds r23, 0x0702 ; 0x800702 31574: 80 91 03 07 lds r24, 0x0703 ; 0x800703 31578: 90 91 04 07 lds r25, 0x0704 ; 0x800704 3157c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31580: 60 93 90 02 sts 0x0290, r22 ; 0x800290 31584: 70 93 91 02 sts 0x0291, r23 ; 0x800291 31588: 80 93 92 02 sts 0x0292, r24 ; 0x800292 3158c: 90 93 93 02 sts 0x0293, r25 ; 0x800293 if(cs.retract_zlift) { 31590: c0 90 f9 06 lds r12, 0x06F9 ; 0x8006f9 31594: d0 90 fa 06 lds r13, 0x06FA ; 0x8006fa 31598: e0 90 fb 06 lds r14, 0x06FB ; 0x8006fb 3159c: f0 90 fc 06 lds r15, 0x06FC ; 0x8006fc 315a0: 20 e0 ldi r18, 0x00 ; 0 315a2: 30 e0 ldi r19, 0x00 ; 0 315a4: a9 01 movw r20, r18 315a6: c7 01 movw r24, r14 315a8: b6 01 movw r22, r12 315aa: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 315ae: 88 23 and r24, r24 315b0: e1 f0 breq .+56 ; 0x315ea current_position[Z_AXIS]+=cs.retract_zlift; 315b2: a7 01 movw r20, r14 315b4: 96 01 movw r18, r12 315b6: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 315ba: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 315be: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 315c2: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 315c6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 315ca: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 315ce: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 315d2: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 315d6: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_set_position_curposXYZE(); 315da: 0f 94 53 b9 call 0x372a6 ; 0x372a6 prepare_move(); 315de: 90 e0 ldi r25, 0x00 ; 0 315e0: 80 e0 ldi r24, 0x00 ; 0 315e2: 0e 94 bd 6c call 0xd97a ; 0xd97a st_synchronize(); 315e6: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 315ea: 20 91 fd 06 lds r18, 0x06FD ; 0x8006fd 315ee: 30 91 fe 06 lds r19, 0x06FE ; 0x8006fe 315f2: 40 91 ff 06 lds r20, 0x06FF ; 0x8006ff 315f6: 50 91 00 07 lds r21, 0x0700 ; 0x800700 315fa: 60 91 f1 06 lds r22, 0x06F1 ; 0x8006f1 315fe: 70 91 f2 06 lds r23, 0x06F2 ; 0x8006f2 31602: 80 91 f3 06 lds r24, 0x06F3 ; 0x8006f3 31606: 90 91 f4 06 lds r25, 0x06F4 ; 0x8006f4 3160a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3160e: 6b 01 movw r12, r22 31610: 7c 01 movw r14, r24 31612: 60 91 94 02 lds r22, 0x0294 ; 0x800294 31616: 70 91 95 02 lds r23, 0x0295 ; 0x800295 3161a: 07 2e mov r0, r23 3161c: 00 0c add r0, r0 3161e: 88 0b sbc r24, r24 31620: 99 0b sbc r25, r25 31622: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 31626: 9b 01 movw r18, r22 31628: ac 01 movw r20, r24 3162a: c7 01 movw r24, r14 3162c: b6 01 movw r22, r12 3162e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31632: 2a e0 ldi r18, 0x0A ; 10 31634: 37 ed ldi r19, 0xD7 ; 215 31636: 43 e2 ldi r20, 0x23 ; 35 31638: 5c e3 ldi r21, 0x3C ; 60 3163a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3163e: 9b 01 movw r18, r22 31640: ac 01 movw r20, r24 31642: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 31646: 70 91 50 07 lds r23, 0x0750 ; 0x800750 3164a: 80 91 51 07 lds r24, 0x0751 ; 0x800751 3164e: 90 91 52 07 lds r25, 0x0752 ; 0x800752 31652: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31656: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 3165a: 70 93 50 07 sts 0x0750, r23 ; 0x800750 3165e: 80 93 51 07 sts 0x0751, r24 ; 0x800751 31662: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_set_e_position(current_position[E_AXIS]); 31666: 8f e4 ldi r24, 0x4F ; 79 31668: 97 e0 ldi r25, 0x07 ; 7 3166a: 0f 94 e4 aa call 0x355c8 ; 0x355c8 retracted[active_extruder]=false; 3166e: 10 92 3f 07 sts 0x073F, r1 ; 0x80073f prepare_move(); 31672: 90 e0 ldi r25, 0x00 ; 0 31674: 80 e0 ldi r24, 0x00 ; 0 31676: 0e 94 bd 6c call 0xd97a ; 0xd97a feedrate = oldFeedrate; 3167a: 80 92 90 02 sts 0x0290, r8 ; 0x800290 3167e: 90 92 91 02 sts 0x0291, r9 ; 0x800291 31682: a0 92 92 02 sts 0x0292, r10 ; 0x800292 31686: b0 92 93 02 sts 0x0293, r11 ; 0x800293 3168a: 55 cf rjmp .-342 ; 0x31536 0003168c : 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) 3168c: ef 92 push r14 3168e: ff 92 push r15 31690: 0f 93 push r16 31692: 1f 93 push r17 31694: cf 93 push r28 31696: c8 2f mov r28, r24 31698: 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; 3169a: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> return 0; } uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) 3169e: c1 30 cpi r28, 0x01 ; 1 316a0: b9 f0 breq .+46 ; 0x316d0 316a2: c2 30 cpi r28, 0x02 ; 2 316a4: c1 f0 breq .+48 ; 0x316d6 { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 316a6: 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) 316a8: 48 17 cp r20, r24 316aa: 21 f0 breq .+8 ; 0x316b4 tmc2130_set_dir(axis, dir); 316ac: 64 2f mov r22, r20 316ae: 8c 2f mov r24, r28 316b0: 0f 94 69 39 call 0x272d2 ; 0x272d2 316b4: 8b e9 ldi r24, 0x9B ; 155 316b6: e8 2e mov r14, r24 316b8: 8f e0 ldi r24, 0x0F ; 15 316ba: f8 2e mov r15, r24 while (steps--) 316bc: 01 50 subi r16, 0x01 ; 1 316be: 11 09 sbc r17, r1 316c0: 70 f0 brcs .+28 ; 0x316de { tmc2130_do_step(axis); 316c2: 8c 2f mov r24, r28 316c4: 0f 94 58 39 call 0x272b0 ; 0x272b0 316c8: c7 01 movw r24, r14 316ca: 01 97 sbiw r24, 0x01 ; 1 316cc: f1 f7 brne .-4 ; 0x316ca 316ce: f6 cf rjmp .-20 ; 0x316bc uint8_t tmc2130_get_dir(uint8_t axis) { switch (axis) { case X_AXIS: return _GET_DIR_X; case Y_AXIS: return _GET_DIR_Y; 316d0: 86 95 lsr r24 316d2: 8c 27 eor r24, r28 316d4: e8 cf rjmp .-48 ; 0x316a6 case Z_AXIS: return _GET_DIR_Z; 316d6: 82 fb bst r24, 2 316d8: 88 27 eor r24, r24 316da: 80 f9 bld r24, 0 316dc: e5 cf rjmp .-54 ; 0x316a8 while (steps--) { tmc2130_do_step(axis); delayMicroseconds(delay_us); } } 316de: cf 91 pop r28 316e0: 1f 91 pop r17 316e2: 0f 91 pop r16 316e4: ff 90 pop r15 316e6: ef 90 pop r14 316e8: 08 95 ret 000316ea : void tmc2130_goto_step(uint8_t axis, uint8_t step, uint8_t dir, uint16_t delay_us, uint16_t microstep_resolution) 316ea: 8f 92 push r8 316ec: 9f 92 push r9 316ee: af 92 push r10 316f0: bf 92 push r11 316f2: cf 92 push r12 316f4: df 92 push r13 316f6: ef 92 push r14 316f8: ff 92 push r15 316fa: 0f 93 push r16 316fc: 1f 93 push r17 316fe: cf 93 push r28 31700: c8 2f mov r28, r24 31702: 8a 01 movw r16, r20 { printf_P(PSTR("tmc2130_goto_step %d %d %d %d \n"), axis, step, dir, delay_us, microstep_resolution); 31704: c6 2e mov r12, r22 31706: d1 2c mov r13, r1 31708: 1f 93 push r17 3170a: 4f 93 push r20 3170c: 83 e0 ldi r24, 0x03 ; 3 3170e: 8f 93 push r24 31710: 88 ee ldi r24, 0xE8 ; 232 31712: 8f 93 push r24 31714: 1f 92 push r1 31716: 82 e0 ldi r24, 0x02 ; 2 31718: 8f 93 push r24 3171a: 1f 92 push r1 3171c: 6f 93 push r22 3171e: 1f 92 push r1 31720: cf 93 push r28 31722: 84 e6 ldi r24, 0x64 ; 100 31724: 95 ea ldi r25, 0xA5 ; 165 31726: 9f 93 push r25 31728: 8f 93 push r24 3172a: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 3172e: 8d b7 in r24, 0x3d ; 61 31730: 9e b7 in r25, 0x3e ; 62 31732: 0c 96 adiw r24, 0x0c ; 12 31734: 0f b6 in r0, 0x3f ; 63 31736: f8 94 cli 31738: 9e bf out 0x3e, r25 ; 62 3173a: 0f be out 0x3f, r0 ; 63 3173c: 8d bf out 0x3d, r24 ; 61 3173e: 90 e0 ldi r25, 0x00 ; 0 31740: 80 e0 ldi r24, 0x00 ; 0 uint8_t shift; for (shift = 0; shift < 8; shift++) if (microstep_resolution == (256u >> shift)) break; 31742: 40 e0 ldi r20, 0x00 ; 0 31744: 51 e0 ldi r21, 0x01 ; 1 31746: 28 2f mov r18, r24 31748: ba 01 movw r22, r20 3174a: 08 2e mov r0, r24 3174c: 02 c0 rjmp .+4 ; 0x31752 3174e: 76 95 lsr r23 31750: 67 95 ror r22 31752: 0a 94 dec r0 31754: e2 f7 brpl .-8 ; 0x3174e 31756: 06 17 cp r16, r22 31758: 17 07 cpc r17, r23 3175a: 29 f0 breq .+10 ; 0x31766 3175c: 01 96 adiw r24, 0x01 ; 1 3175e: 88 30 cpi r24, 0x08 ; 8 31760: 91 05 cpc r25, r1 31762: 89 f7 brne .-30 ; 0x31746 31764: 28 e0 ldi r18, 0x08 ; 8 uint16_t cnt = 4 * (1 << (8 - shift)); 31766: e2 2e mov r14, r18 31768: f1 2c mov r15, r1 3176a: 88 e0 ldi r24, 0x08 ; 8 3176c: 90 e0 ldi r25, 0x00 ; 0 3176e: 8e 19 sub r24, r14 31770: 9f 09 sbc r25, r15 31772: 24 e0 ldi r18, 0x04 ; 4 31774: 30 e0 ldi r19, 0x00 ; 0 31776: 59 01 movw r10, r18 31778: 02 c0 rjmp .+4 ; 0x3177e 3177a: aa 0c add r10, r10 3177c: bb 1c adc r11, r11 3177e: 8a 95 dec r24 31780: e2 f7 brpl .-8 ; 0x3177a uint16_t mscnt = tmc2130_rd_MSCNT(axis); 31782: 8c 2f mov r24, r28 31784: 0f 94 30 3a call 0x27460 ; 0x27460 31788: 9c 01 movw r18, r24 3178a: 90 e0 ldi r25, 0x00 ; 0 3178c: c4 30 cpi r28, 0x04 ; 4 3178e: 28 f4 brcc .+10 ; 0x3179a 31790: ec 2f mov r30, r28 31792: f0 e0 ldi r31, 0x00 ; 0 31794: ef 5d subi r30, 0xDF ; 223 31796: fc 4f sbci r31, 0xFC ; 252 31798: 90 81 ld r25, Z if (dir == 2) { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); 3179a: 0e 2c mov r0, r14 3179c: 02 c0 rjmp .+4 ; 0x317a2 3179e: 36 95 lsr r19 317a0: 27 95 ror r18 317a2: 0a 94 dec r0 317a4: e2 f7 brpl .-8 ; 0x3179e 317a6: 86 01 movw r16, r12 317a8: 02 1b sub r16, r18 317aa: 13 0b sbc r17, r19 if (steps > static_cast(cnt / 2)) 317ac: 95 01 movw r18, r10 317ae: 36 95 lsr r19 317b0: 27 95 ror r18 { dir ^= 1; 317b2: 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)) 317b4: 20 17 cp r18, r16 317b6: 31 07 cpc r19, r17 317b8: 74 f1 brlt .+92 ; 0x31816 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; 317ba: 91 11 cpse r25, r1 317bc: 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) 317be: 17 ff sbrs r17, 7 317c0: 05 c0 rjmp .+10 ; 0x317cc { dir ^= 1; 317c2: 81 e0 ldi r24, 0x01 ; 1 317c4: 68 27 eor r22, r24 steps = -steps; 317c6: 11 95 neg r17 317c8: 01 95 neg r16 317ca: 11 09 sbc r17, r1 } cnt = steps; } tmc2130_set_dir(axis, dir); 317cc: 8c 2f mov r24, r28 317ce: 0f 94 69 39 call 0x272d2 ; 0x272d2 mscnt = tmc2130_rd_MSCNT(axis); 317d2: 8c 2f mov r24, r28 317d4: 0f 94 30 3a call 0x27460 ; 0x27460 317d8: b1 2c mov r11, r1 317da: a1 2c mov r10, r1 317dc: 2b e9 ldi r18, 0x9B ; 155 317de: 82 2e mov r8, r18 317e0: 2f e0 ldi r18, 0x0F ; 15 317e2: 92 2e mov r9, r18 while ((cnt--) && ((mscnt >> shift) != step)) 317e4: 0a 15 cp r16, r10 317e6: 1b 05 cpc r17, r11 317e8: f1 f0 breq .+60 ; 0x31826 317ea: 2f ef ldi r18, 0xFF ; 255 317ec: a2 1a sub r10, r18 317ee: b2 0a sbc r11, r18 317f0: 0e 2c mov r0, r14 317f2: 02 c0 rjmp .+4 ; 0x317f8 317f4: 96 95 lsr r25 317f6: 87 95 ror r24 317f8: 0a 94 dec r0 317fa: e2 f7 brpl .-8 ; 0x317f4 317fc: 8c 15 cp r24, r12 317fe: 9d 05 cpc r25, r13 31800: 91 f0 breq .+36 ; 0x31826 { tmc2130_do_step(axis); 31802: 8c 2f mov r24, r28 31804: 0f 94 58 39 call 0x272b0 ; 0x272b0 31808: c4 01 movw r24, r8 3180a: 01 97 sbiw r24, 0x01 ; 1 3180c: f1 f7 brne .-4 ; 0x3180a delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); 3180e: 8c 2f mov r24, r28 31810: 0f 94 30 3a call 0x27460 ; 0x27460 31814: e7 cf rjmp .-50 ; 0x317e4 { dir = tmc2130_get_inv(axis)?0:1; int steps = (int)step - (int)(mscnt >> shift); if (steps > static_cast(cnt / 2)) { dir ^= 1; 31816: 91 11 cpse r25, r1 31818: 01 c0 rjmp .+2 ; 0x3181c 3181a: 60 e0 ldi r22, 0x00 ; 0 steps = cnt - steps; // This can create a negative step value 3181c: c5 01 movw r24, r10 3181e: 80 1b sub r24, r16 31820: 91 0b sbc r25, r17 31822: 8c 01 movw r16, r24 31824: cc cf rjmp .-104 ; 0x317be { tmc2130_do_step(axis); delayMicroseconds(delay_us); mscnt = tmc2130_rd_MSCNT(axis); } } 31826: cf 91 pop r28 31828: 1f 91 pop r17 3182a: 0f 91 pop r16 3182c: ff 90 pop r15 3182e: ef 90 pop r14 31830: df 90 pop r13 31832: cf 90 pop r12 31834: bf 90 pop r11 31836: af 90 pop r10 31838: 9f 90 pop r9 3183a: 8f 90 pop r8 3183c: 08 95 ret 0003183e : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 3183e: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 memset(z_values, 0, sizeof(z_values)); 31842: e1 ea ldi r30, 0xA1 ; 161 31844: f3 e1 ldi r31, 0x13 ; 19 31846: 84 ec ldi r24, 0xC4 ; 196 31848: df 01 movw r26, r30 3184a: 1d 92 st X+, r1 3184c: 8a 95 dec r24 3184e: e9 f7 brne .-6 ; 0x3184a } 31850: 08 95 ret 00031852 : 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 31852: 2f 92 push r2 31854: 3f 92 push r3 31856: 4f 92 push r4 31858: 5f 92 push r5 3185a: 6f 92 push r6 3185c: 7f 92 push r7 3185e: 8f 92 push r8 31860: 9f 92 push r9 31862: af 92 push r10 31864: bf 92 push r11 31866: cf 92 push r12 31868: df 92 push r13 3186a: ef 92 push r14 3186c: ff 92 push r15 3186e: 0f 93 push r16 31870: 1f 93 push r17 31872: cf 93 push r28 31874: df 93 push r29 31876: 00 d0 rcall .+0 ; 0x31878 31878: 1f 92 push r1 3187a: cd b7 in r28, 0x3d ; 61 3187c: de b7 in r29, 0x3e ; 62 3187e: 4b 01 movw r8, r22 31880: 5c 01 movw r10, r24 31882: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 31884: 81 e0 ldi r24, 0x01 ; 1 31886: 80 93 6d 06 sts 0x066D, r24 ; 0x80066d #ifdef TMC2130 bool bHighPowerForced = false; if (tmc2130_mode == TMC2130_MODE_SILENT) 3188a: 80 91 6c 06 lds r24, 0x066C ; 0x80066c ) { bool high_deviation_occured = false; bedPWMDisabled = 1; #ifdef TMC2130 bool bHighPowerForced = false; 3188e: 10 e0 ldi r17, 0x00 ; 0 if (tmc2130_mode == TMC2130_MODE_SILENT) 31890: 81 30 cpi r24, 0x01 ; 1 31892: 19 f4 brne .+6 ; 0x3189a { FORCE_HIGH_POWER_START; 31894: 0e 94 65 67 call 0xceca ; 0xceca bHighPowerForced = true; 31898: 11 e0 ldi r17, 0x01 ; 1 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 3189a: 20 91 8f 02 lds r18, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 3189e: 2a 83 std Y+2, r18 ; 0x02 check_endstops = check; 318a0: 81 e0 ldi r24, 0x01 ; 1 318a2: 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); 318a6: 80 e0 ldi r24, 0x00 ; 0 318a8: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 318ac: 89 83 std Y+1, r24 ; 0x01 float z = 0.f; endstop_z_hit_on_purpose(); 318ae: 0f 94 68 64 call 0x2c8d0 ; 0x2c8d0 // move down until you find the bed current_position[Z_AXIS] = minimum_z; 318b2: 80 92 4b 07 sts 0x074B, r8 ; 0x80074b 318b6: 90 92 4c 07 sts 0x074C, r9 ; 0x80074c 318ba: a0 92 4d 07 sts 0x074D, r10 ; 0x80074d 318be: b0 92 4e 07 sts 0x074E, r11 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/60); 318c2: 65 e5 ldi r22, 0x55 ; 85 318c4: 75 e5 ldi r23, 0x55 ; 85 318c6: 85 e5 ldi r24, 0x55 ; 85 318c8: 91 e4 ldi r25, 0x41 ; 65 318ca: 0f 94 50 c3 call 0x386a0 ; 0x386a0 // 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(); 318ce: 0f 94 a4 c9 call 0x39348 ; 0x39348 if (! endstop_z_hit_on_purpose()) 318d2: 0f 94 68 64 call 0x2c8d0 ; 0x2c8d0 318d6: 8c 83 std Y+4, r24 ; 0x04 318d8: 88 23 and r24, r24 318da: 09 f4 brne .+2 ; 0x318de 318dc: f9 c0 rjmp .+498 ; 0x31ad0 { //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)) 318de: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 318e2: 86 ff sbrs r24, 6 318e4: f5 c0 rjmp .+490 ; 0x31ad0 { //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) 318e6: 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; 318e8: c1 2c mov r12, r1 318ea: d1 2c mov r13, r1 318ec: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 318ee: 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) 318f0: 8b 81 ldd r24, Y+3 ; 0x03 318f2: 80 17 cp r24, r16 318f4: 08 f0 brcs .+2 ; 0x318f8 318f6: a8 c0 rjmp .+336 ; 0x31a48 { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 318f8: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 318fc: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 31900: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 31904: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 31908: 20 e0 ldi r18, 0x00 ; 0 3190a: 30 e0 ldi r19, 0x00 ; 0 3190c: 40 e0 ldi r20, 0x00 ; 0 3190e: 5f e3 ldi r21, 0x3F ; 63 31910: 31 10 cpse r3, r1 31912: 04 c0 rjmp .+8 ; 0x3191c 31914: 2d ec ldi r18, 0xCD ; 205 31916: 3c ec ldi r19, 0xCC ; 204 31918: 4c e4 ldi r20, 0x4C ; 76 3191a: 5e e3 ldi r21, 0x3E ; 62 3191c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31920: 2b 01 movw r4, r22 31922: 3c 01 movw r6, r24 31924: 40 92 4b 07 sts 0x074B, r4 ; 0x80074b 31928: 50 92 4c 07 sts 0x074C, r5 ; 0x80074c 3192c: 60 92 4d 07 sts 0x074D, r6 ; 0x80074d 31930: 70 92 4e 07 sts 0x074E, r7 ; 0x80074e float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 31934: 65 e5 ldi r22, 0x55 ; 85 31936: 75 e5 ldi r23, 0x55 ; 85 31938: 85 e5 ldi r24, 0x55 ; 85 3193a: 91 e4 ldi r25, 0x41 ; 65 3193c: 0f 94 50 c3 call 0x386a0 ; 0x386a0 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 31940: 80 92 4b 07 sts 0x074B, r8 ; 0x80074b 31944: 90 92 4c 07 sts 0x074C, r9 ; 0x80074c 31948: a0 92 4d 07 sts 0x074D, r10 ; 0x80074d 3194c: b0 92 4e 07 sts 0x074E, r11 ; 0x80074e //printf_P(PSTR("init Z = %f, min_z = %f, i = %d\n"), z_bckp, minimum_z, i); go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 31950: 65 e5 ldi r22, 0x55 ; 85 31952: 75 e5 ldi r23, 0x55 ; 85 31954: 85 e5 ldi r24, 0x55 ; 85 31956: 90 e4 ldi r25, 0x40 ; 64 31958: 0f 94 50 c3 call 0x386a0 ; 0x386a0 // 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(); 3195c: 0f 94 a4 c9 call 0x39348 ; 0x39348 //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) { 31960: a3 01 movw r20, r6 31962: 92 01 movw r18, r4 31964: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 31968: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 3196c: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 31970: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 31974: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31978: 9f 77 andi r25, 0x7F ; 127 3197a: 2d ec ldi r18, 0xCD ; 205 3197c: 3c ec ldi r19, 0xCC ; 204 3197e: 4c ec ldi r20, 0xCC ; 204 31980: 5c e3 ldi r21, 0x3C ; 60 31982: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 31986: 87 ff sbrs r24, 7 31988: 16 c0 rjmp .+44 ; 0x319b6 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 3198a: 60 e0 ldi r22, 0x00 ; 0 3198c: 70 e0 ldi r23, 0x00 ; 0 3198e: 80 e0 ldi r24, 0x00 ; 0 31990: 9f e3 ldi r25, 0x3F ; 63 31992: 0e 94 96 6e call 0xdd2c ; 0xdd2c current_position[Z_AXIS] = minimum_z; 31996: 80 92 4b 07 sts 0x074B, r8 ; 0x80074b 3199a: 90 92 4c 07 sts 0x074C, r9 ; 0x80074c 3199e: a0 92 4d 07 sts 0x074D, r10 ; 0x80074d 319a2: b0 92 4e 07 sts 0x074E, r11 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 319a6: 65 e5 ldi r22, 0x55 ; 85 319a8: 75 e5 ldi r23, 0x55 ; 85 319aa: 85 e5 ldi r24, 0x55 ; 85 319ac: 90 e4 ldi r25, 0x40 ; 64 319ae: 0f 94 50 c3 call 0x386a0 ; 0x386a0 // 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(); 319b2: 0f 94 a4 c9 call 0x39348 ; 0x39348 } if (!endstop_z_hit_on_purpose()) 319b6: 0f 94 68 64 call 0x2c8d0 ; 0x2c8d0 319ba: 28 2e mov r2, r24 319bc: 88 23 and r24, r24 319be: 09 f4 brne .+2 ; 0x319c2 319c0: 87 c0 rjmp .+270 ; 0x31ad0 { //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)) { 319c2: 80 91 06 01 lds r24, 0x0106 ; 0x800106 <__TEXT_REGION_LENGTH__+0x7c2106> 319c6: 86 ff sbrs r24, 6 319c8: 83 c0 rjmp .+262 ; 0x31ad0 319ca: 40 90 4b 07 lds r4, 0x074B ; 0x80074b 319ce: 50 90 4c 07 lds r5, 0x074C ; 0x80074c 319d2: 60 90 4d 07 lds r6, 0x074D ; 0x80074d 319d6: 70 90 4e 07 lds r7, 0x074E ; 0x80074e } #endif //TMC2130 // SERIAL_ECHOPGM("Bed find_bed_induction_sensor_point_z low, height: "); // MYSERIAL.print(current_position[Z_AXIS], 5); // SERIAL_ECHOLNPGM(""); float dz = i?fabs(current_position[Z_AXIS] - (z / i)):0; 319da: 2b 81 ldd r18, Y+3 ; 0x03 319dc: 22 23 and r18, r18 319de: d9 f0 breq .+54 ; 0x31a16 319e0: 62 2f mov r22, r18 319e2: 70 e0 ldi r23, 0x00 ; 0 319e4: 90 e0 ldi r25, 0x00 ; 0 319e6: 80 e0 ldi r24, 0x00 ; 0 319e8: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 319ec: 9b 01 movw r18, r22 319ee: ac 01 movw r20, r24 319f0: c7 01 movw r24, r14 319f2: b6 01 movw r22, r12 319f4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 319f8: 9b 01 movw r18, r22 319fa: ac 01 movw r20, r24 319fc: c3 01 movw r24, r6 319fe: b2 01 movw r22, r4 31a00: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31a04: 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 31a06: 2d ec ldi r18, 0xCD ; 205 31a08: 3c ec ldi r19, 0xCC ; 204 31a0a: 4c e4 ldi r20, 0x4C ; 76 31a0c: 5d e3 ldi r21, 0x3D ; 61 31a0e: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 31a12: 18 16 cp r1, r24 31a14: 64 f0 brlt .+24 ; 0x31a2e #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]; 31a16: a3 01 movw r20, r6 31a18: 92 01 movw r18, r4 31a1a: c7 01 movw r24, r14 31a1c: b6 01 movw r22, r12 31a1e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31a22: 6b 01 movw r12, r22 31a24: 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) 31a26: 2b 81 ldd r18, Y+3 ; 0x03 31a28: 2f 5f subi r18, 0xFF ; 255 31a2a: 2b 83 std Y+3, r18 ; 0x03 31a2c: 61 cf rjmp .-318 ; 0x318f0 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 31a2e: 31 10 cpse r3, r1 31a30: 4f c0 rjmp .+158 ; 0x31ad0 //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 31a32: 84 ef ldi r24, 0xF4 ; 244 31a34: 91 e0 ldi r25, 0x01 ; 1 31a36: 0e 94 87 8e call 0x11d0e ; 0x11d0e //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; 31a3a: 32 2c mov r3, r2 i = -1; 31a3c: 8f ef ldi r24, 0xFF ; 255 31a3e: 8b 83 std Y+3, r24 ; 0x03 z = 0; 31a40: c1 2c mov r12, r1 31a42: d1 2c mov r13, r1 31a44: 76 01 movw r14, r12 31a46: ef cf rjmp .-34 ; 0x31a26 } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 31a48: 02 30 cpi r16, 0x02 ; 2 31a4a: 68 f5 brcc .+90 ; 0x31aa6 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 31a4c: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 31a50: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 31a54: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 31a58: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e 31a5c: 8a 81 ldd r24, Y+2 ; 0x02 31a5e: 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); 31a62: 89 81 ldd r24, Y+1 ; 0x01 31a64: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31a68: 11 23 and r17, r17 31a6a: 19 f0 breq .+6 ; 0x31a72 31a6c: 80 e0 ldi r24, 0x00 ; 0 31a6e: 0e 94 65 67 call 0xceca ; 0xceca #endif bedPWMDisabled = 0; 31a72: 10 92 6d 06 sts 0x066D, r1 ; 0x80066d #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 31a76: 8c 81 ldd r24, Y+4 ; 0x04 31a78: 0f 90 pop r0 31a7a: 0f 90 pop r0 31a7c: 0f 90 pop r0 31a7e: 0f 90 pop r0 31a80: df 91 pop r29 31a82: cf 91 pop r28 31a84: 1f 91 pop r17 31a86: 0f 91 pop r16 31a88: ff 90 pop r15 31a8a: ef 90 pop r14 31a8c: df 90 pop r13 31a8e: cf 90 pop r12 31a90: bf 90 pop r11 31a92: af 90 pop r10 31a94: 9f 90 pop r9 31a96: 8f 90 pop r8 31a98: 7f 90 pop r7 31a9a: 6f 90 pop r6 31a9c: 5f 90 pop r5 31a9e: 4f 90 pop r4 31aa0: 3f 90 pop r3 31aa2: 2f 90 pop r2 31aa4: 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); 31aa6: 60 2f mov r22, r16 31aa8: 70 e0 ldi r23, 0x00 ; 0 31aaa: 90 e0 ldi r25, 0x00 ; 0 31aac: 80 e0 ldi r24, 0x00 ; 0 31aae: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 31ab2: 9b 01 movw r18, r22 31ab4: ac 01 movw r20, r24 31ab6: c7 01 movw r24, r14 31ab8: b6 01 movw r22, r12 31aba: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 31abe: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 31ac2: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 31ac6: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 31aca: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e 31ace: c6 cf rjmp .-116 ; 0x31a5c 31ad0: 2a 81 ldd r18, Y+2 ; 0x02 31ad2: 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); 31ad6: 89 81 ldd r24, Y+1 ; 0x01 31ad8: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; 31adc: 11 23 and r17, r17 31ade: 19 f0 breq .+6 ; 0x31ae6 31ae0: 80 e0 ldi r24, 0x00 ; 0 31ae2: 0e 94 65 67 call 0xceca ; 0xceca #endif bedPWMDisabled = 0; 31ae6: 10 92 6d 06 sts 0x066D, r1 ; 0x80066d return false; 31aea: 1c 82 std Y+4, r1 ; 0x04 31aec: c4 cf rjmp .-120 ; 0x31a76 00031aee : /// 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){ 31aee: 2f 92 push r2 31af0: 3f 92 push r3 31af2: 4f 92 push r4 31af4: 5f 92 push r5 31af6: 6f 92 push r6 31af8: 7f 92 push r7 31afa: 8f 92 push r8 31afc: 9f 92 push r9 31afe: af 92 push r10 31b00: bf 92 push r11 31b02: cf 92 push r12 31b04: df 92 push r13 31b06: ef 92 push r14 31b08: ff 92 push r15 31b0a: 0f 93 push r16 31b0c: 1f 93 push r17 31b0e: cf 93 push r28 31b10: df 93 push r29 31b12: cd b7 in r28, 0x3d ; 61 31b14: de b7 in r29, 0x3e ; 62 31b16: cd 5b subi r28, 0xBD ; 189 31b18: d1 40 sbci r29, 0x01 ; 1 31b1a: 0f b6 in r0, 0x3f ; 63 31b1c: f8 94 cli 31b1e: de bf out 0x3e, r29 ; 62 31b20: 0f be out 0x3f, r0 ; 63 31b22: cd bf out 0x3d, r28 ; 61 31b24: c3 57 subi r28, 0x73 ; 115 31b26: de 4f sbci r29, 0xFE ; 254 31b28: 99 83 std Y+1, r25 ; 0x01 31b2a: 88 83 st Y, r24 31b2c: cd 58 subi r28, 0x8D ; 141 31b2e: d1 40 sbci r29, 0x01 ; 1 31b30: c1 57 subi r28, 0x71 ; 113 31b32: de 4f sbci r29, 0xFE ; 254 31b34: 79 83 std Y+1, r23 ; 0x01 31b36: 68 83 st Y, r22 31b38: cf 58 subi r28, 0x8F ; 143 31b3a: d1 40 sbci r29, 0x01 ; 1 31b3c: ce 56 subi r28, 0x6E ; 110 31b3e: de 4f sbci r29, 0xFE ; 254 31b40: 59 83 std Y+1, r21 ; 0x01 31b42: 48 83 st Y, r20 31b44: c2 59 subi r28, 0x92 ; 146 31b46: d1 40 sbci r29, 0x01 ; 1 31b48: 84 e1 ldi r24, 0x14 ; 20 31b4a: cf 56 subi r28, 0x6F ; 111 31b4c: de 4f sbci r29, 0xFE ; 254 31b4e: 88 83 st Y, r24 31b50: c1 59 subi r28, 0x91 ; 145 31b52: 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; 31b54: ce 56 subi r28, 0x6E ; 110 31b56: de 4f sbci r29, 0xFE ; 254 31b58: a8 81 ld r26, Y 31b5a: b9 81 ldd r27, Y+1 ; 0x01 31b5c: c2 59 subi r28, 0x92 ; 146 31b5e: d1 40 sbci r29, 0x01 ; 1 31b60: 8d 91 ld r24, X+ 31b62: 9d 91 ld r25, X+ 31b64: 0d 90 ld r0, X+ 31b66: bc 91 ld r27, X 31b68: a0 2d mov r26, r0 31b6a: c6 56 subi r28, 0x66 ; 102 31b6c: de 4f sbci r29, 0xFE ; 254 31b6e: 88 83 st Y, r24 31b70: 99 83 std Y+1, r25 ; 0x01 31b72: aa 83 std Y+2, r26 ; 0x02 31b74: bb 83 std Y+3, r27 ; 0x03 31b76: ca 59 subi r28, 0x9A ; 154 31b78: d1 40 sbci r29, 0x01 ; 1 31b7a: c1 57 subi r28, 0x71 ; 113 31b7c: de 4f sbci r29, 0xFE ; 254 31b7e: a8 81 ld r26, Y 31b80: b9 81 ldd r27, Y+1 ; 0x01 31b82: cf 58 subi r28, 0x8F ; 143 31b84: d1 40 sbci r29, 0x01 ; 1 31b86: 8d 91 ld r24, X+ 31b88: 9d 91 ld r25, X+ 31b8a: 0d 90 ld r0, X+ 31b8c: bc 91 ld r27, X 31b8e: a0 2d mov r26, r0 31b90: ca 54 subi r28, 0x4A ; 74 31b92: de 4f sbci r29, 0xFE ; 254 31b94: 88 83 st Y, r24 31b96: 99 83 std Y+1, r25 ; 0x01 31b98: aa 83 std Y+2, r26 ; 0x02 31b9a: bb 83 std Y+3, r27 ; 0x03 31b9c: c6 5b subi r28, 0xB6 ; 182 31b9e: d1 40 sbci r29, 0x01 ; 1 31ba0: c3 57 subi r28, 0x73 ; 115 31ba2: de 4f sbci r29, 0xFE ; 254 31ba4: a8 81 ld r26, Y 31ba6: b9 81 ldd r27, Y+1 ; 0x01 31ba8: cd 58 subi r28, 0x8D ; 141 31baa: d1 40 sbci r29, 0x01 ; 1 31bac: 8d 91 ld r24, X+ 31bae: 9d 91 ld r25, X+ 31bb0: 0d 90 ld r0, X+ 31bb2: bc 91 ld r27, X 31bb4: a0 2d mov r26, r0 31bb6: c6 54 subi r28, 0x46 ; 70 31bb8: de 4f sbci r29, 0xFE ; 254 31bba: 88 83 st Y, r24 31bbc: 99 83 std Y+1, r25 ; 0x01 31bbe: aa 83 std Y+2, r26 ; 0x02 31bc0: bb 83 std Y+3, r27 ; 0x03 31bc2: ca 5b subi r28, 0xBA ; 186 31bc4: d1 40 sbci r29, 0x01 ; 1 31bc6: fe 01 movw r30, r28 31bc8: e7 5f subi r30, 0xF7 ; 247 31bca: fe 4f sbci r31, 0xFE ; 254 31bcc: c8 55 subi r28, 0x58 ; 88 31bce: de 4f sbci r29, 0xFE ; 254 31bd0: f9 83 std Y+1, r31 ; 0x01 31bd2: e8 83 st Y, r30 31bd4: c8 5a subi r28, 0xA8 ; 168 31bd6: d1 40 sbci r29, 0x01 ; 1 31bd8: ce 01 movw r24, r28 31bda: 8b 57 subi r24, 0x7B ; 123 31bdc: 9f 4f sbci r25, 0xFF ; 255 31bde: ca 55 subi r28, 0x5A ; 90 31be0: de 4f sbci r29, 0xFE ; 254 31be2: 99 83 std Y+1, r25 ; 0x01 31be4: 88 83 st Y, r24 31be6: c6 5a subi r28, 0xA6 ; 166 31be8: d1 40 sbci r29, 0x01 ; 1 31bea: de 01 movw r26, r28 31bec: 11 96 adiw r26, 0x01 ; 1 31bee: c8 56 subi r28, 0x68 ; 104 31bf0: de 4f sbci r29, 0xFE ; 254 31bf2: b9 83 std Y+1, r27 ; 0x01 31bf4: a8 83 st Y, r26 31bf6: c8 59 subi r28, 0x98 ; 152 31bf8: d1 40 sbci r29, 0x01 ; 1 31bfa: 31 2c mov r3, r1 31bfc: 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; 31bfe: b1 01 movw r22, r2 31c00: 03 2c mov r0, r3 31c02: 00 0c add r0, r0 31c04: 88 0b sbc r24, r24 31c06: 99 0b sbc r25, r25 31c08: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 31c0c: 2a e1 ldi r18, 0x1A ; 26 31c0e: 38 ef ldi r19, 0xF8 ; 248 31c10: 42 e4 ldi r20, 0x42 ; 66 31c12: 5e e3 ldi r21, 0x3E ; 62 31c14: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31c18: 6b 01 movw r12, r22 31c1a: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 31c1c: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 31c20: c2 56 subi r28, 0x62 ; 98 31c22: de 4f sbci r29, 0xFE ; 254 31c24: 68 83 st Y, r22 31c26: 79 83 std Y+1, r23 ; 0x01 31c28: 8a 83 std Y+2, r24 ; 0x02 31c2a: 9b 83 std Y+3, r25 ; 0x03 31c2c: ce 59 subi r28, 0x9E ; 158 31c2e: d1 40 sbci r29, 0x01 ; 1 31c30: c7 01 movw r24, r14 31c32: b6 01 movw r22, r12 31c34: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 31c38: ce 55 subi r28, 0x5E ; 94 31c3a: de 4f sbci r29, 0xFE ; 254 31c3c: 68 83 st Y, r22 31c3e: 79 83 std Y+1, r23 ; 0x01 31c40: 8a 83 std Y+2, r24 ; 0x02 31c42: 9b 83 std Y+3, r25 ; 0x03 31c44: c2 5a subi r28, 0xA2 ; 162 31c46: d1 40 sbci r29, 0x01 ; 1 31c48: 9b 01 movw r18, r22 31c4a: ac 01 movw r20, r24 31c4c: c6 56 subi r28, 0x66 ; 102 31c4e: de 4f sbci r29, 0xFE ; 254 31c50: 68 81 ld r22, Y 31c52: 79 81 ldd r23, Y+1 ; 0x01 31c54: 8a 81 ldd r24, Y+2 ; 0x02 31c56: 9b 81 ldd r25, Y+3 ; 0x03 31c58: ca 59 subi r28, 0x9A ; 154 31c5a: d1 40 sbci r29, 0x01 ; 1 31c5c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31c60: c6 54 subi r28, 0x46 ; 70 31c62: de 4f sbci r29, 0xFE ; 254 31c64: 28 81 ld r18, Y 31c66: 39 81 ldd r19, Y+1 ; 0x01 31c68: 4a 81 ldd r20, Y+2 ; 0x02 31c6a: 5b 81 ldd r21, Y+3 ; 0x03 31c6c: ca 5b subi r28, 0xBA ; 186 31c6e: d1 40 sbci r29, 0x01 ; 1 31c70: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31c74: 6b 01 movw r12, r22 31c76: 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) 31c78: 20 e0 ldi r18, 0x00 ; 0 31c7a: 30 e0 ldi r19, 0x00 ; 0 31c7c: a9 01 movw r20, r18 31c7e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 31c82: 18 16 cp r1, r24 31c84: 0c f0 brlt .+2 ; 0x31c88 31c86: 7a c2 rjmp .+1268 ; 0x3217c // 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; 31c88: c2 56 subi r28, 0x62 ; 98 31c8a: de 4f sbci r29, 0xFE ; 254 31c8c: 28 81 ld r18, Y 31c8e: 39 81 ldd r19, Y+1 ; 0x01 31c90: 4a 81 ldd r20, Y+2 ; 0x02 31c92: 5b 81 ldd r21, Y+3 ; 0x03 31c94: ce 59 subi r28, 0x9E ; 158 31c96: d1 40 sbci r29, 0x01 ; 1 31c98: c6 56 subi r28, 0x66 ; 102 31c9a: de 4f sbci r29, 0xFE ; 254 31c9c: 68 81 ld r22, Y 31c9e: 79 81 ldd r23, Y+1 ; 0x01 31ca0: 8a 81 ldd r24, Y+2 ; 0x02 31ca2: 9b 81 ldd r25, Y+3 ; 0x03 31ca4: ca 59 subi r28, 0x9A ; 154 31ca6: d1 40 sbci r29, 0x01 ; 1 31ca8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31cac: ca 54 subi r28, 0x4A ; 74 31cae: de 4f sbci r29, 0xFE ; 254 31cb0: 28 81 ld r18, Y 31cb2: 39 81 ldd r19, Y+1 ; 0x01 31cb4: 4a 81 ldd r20, Y+2 ; 0x02 31cb6: 5b 81 ldd r21, Y+3 ; 0x03 31cb8: c6 5b subi r28, 0xB6 ; 182 31cba: d1 40 sbci r29, 0x01 ; 1 31cbc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31cc0: 4b 01 movw r8, r22 31cc2: 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) 31cc4: 20 e0 ldi r18, 0x00 ; 0 31cc6: 30 e0 ldi r19, 0x00 ; 0 31cc8: a9 01 movw r20, r18 31cca: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 31cce: 18 16 cp r1, r24 31cd0: 0c f0 brlt .+2 ; 0x31cd4 31cd2: 54 c2 rjmp .+1192 ; 0x3217c 31cd4: 20 e0 ldi r18, 0x00 ; 0 31cd6: 30 e0 ldi r19, 0x00 ; 0 31cd8: 48 ef ldi r20, 0xF8 ; 248 31cda: 51 e4 ldi r21, 0x41 ; 65 31cdc: c7 01 movw r24, r14 31cde: b6 01 movw r22, r12 31ce0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 31ce4: 87 ff sbrs r24, 7 31ce6: 4a c2 rjmp .+1172 ; 0x3217c 31ce8: 20 e0 ldi r18, 0x00 ; 0 31cea: 30 e0 ldi r19, 0x00 ; 0 31cec: 48 ef ldi r20, 0xF8 ; 248 31cee: 51 e4 ldi r21, 0x41 ; 65 31cf0: c5 01 movw r24, r10 31cf2: b4 01 movw r22, r8 31cf4: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 31cf8: 87 ff sbrs r24, 7 31cfa: 40 c2 rjmp .+1152 ; 0x3217c return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 31cfc: c7 01 movw r24, r14 31cfe: b6 01 movw r22, r12 31d00: 0f 94 60 e0 call 0x3c0c0 ; 0x3c0c0 31d04: 9b 01 movw r18, r22 31d06: ac 01 movw r20, r24 31d08: c7 01 movw r24, r14 31d0a: b6 01 movw r22, r12 31d0c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31d10: 2b 01 movw r4, r22 31d12: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 31d14: c5 01 movw r24, r10 31d16: b4 01 movw r22, r8 31d18: 0f 94 60 e0 call 0x3c0c0 ; 0x3c0c0 31d1c: 9b 01 movw r18, r22 31d1e: ac 01 movw r20, r24 31d20: c5 01 movw r24, r10 31d22: b4 01 movw r22, r8 31d24: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31d28: cc 56 subi r28, 0x6C ; 108 31d2a: de 4f sbci r29, 0xFE ; 254 31d2c: 68 83 st Y, r22 31d2e: 79 83 std Y+1, r23 ; 0x01 31d30: 8a 83 std Y+2, r24 ; 0x02 31d32: 9b 83 std Y+3, r25 ; 0x03 31d34: c4 59 subi r28, 0x94 ; 148 31d36: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 31d38: a3 01 movw r20, r6 31d3a: 92 01 movw r18, r4 31d3c: 60 e0 ldi r22, 0x00 ; 0 31d3e: 70 e0 ldi r23, 0x00 ; 0 31d40: 80 e8 ldi r24, 0x80 ; 128 31d42: 9f e3 ldi r25, 0x3F ; 63 31d44: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31d48: c2 55 subi r28, 0x52 ; 82 31d4a: de 4f sbci r29, 0xFE ; 254 31d4c: 68 83 st Y, r22 31d4e: 79 83 std Y+1, r23 ; 0x01 31d50: 8a 83 std Y+2, r24 ; 0x02 31d52: 9b 83 std Y+3, r25 ; 0x03 31d54: ce 5a subi r28, 0xAE ; 174 31d56: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 31d58: cc 56 subi r28, 0x6C ; 108 31d5a: de 4f sbci r29, 0xFE ; 254 31d5c: 28 81 ld r18, Y 31d5e: 39 81 ldd r19, Y+1 ; 0x01 31d60: 4a 81 ldd r20, Y+2 ; 0x02 31d62: 5b 81 ldd r21, Y+3 ; 0x03 31d64: c4 59 subi r28, 0x94 ; 148 31d66: d1 40 sbci r29, 0x01 ; 1 31d68: 60 e0 ldi r22, 0x00 ; 0 31d6a: 70 e0 ldi r23, 0x00 ; 0 31d6c: 80 e8 ldi r24, 0x80 ; 128 31d6e: 9f e3 ldi r25, 0x3F ; 63 31d70: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31d74: ce 54 subi r28, 0x4E ; 78 31d76: de 4f sbci r29, 0xFE ; 254 31d78: 68 83 st Y, r22 31d7a: 79 83 std Y+1, r23 ; 0x01 31d7c: 8a 83 std Y+2, r24 ; 0x02 31d7e: 9b 83 std Y+3, r25 ; 0x03 31d80: c2 5b subi r28, 0xB2 ; 178 31d82: 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; 31d84: c7 01 movw r24, r14 31d86: b6 01 movw r22, r12 31d88: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 31d8c: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 31d8e: fb 01 movw r30, r22 31d90: 31 96 adiw r30, 0x01 ; 1 31d92: c6 55 subi r28, 0x56 ; 86 31d94: de 4f sbci r29, 0xFE ; 254 31d96: f9 83 std Y+1, r31 ; 0x01 31d98: e8 83 st Y, r30 31d9a: ca 5a subi r28, 0xAA ; 170 31d9c: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 31d9e: c5 01 movw r24, r10 31da0: b4 01 movw r22, r8 31da2: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 31da6: 8b 01 movw r16, r22 31da8: 95 e0 ldi r25, 0x05 ; 5 31daa: 00 0f add r16, r16 31dac: 11 1f adc r17, r17 31dae: 9a 95 dec r25 31db0: e1 f7 brne .-8 ; 0x31daa const uint16_t idx01 = c0 + 32 * r1; 31db2: c8 01 movw r24, r16 31db4: 80 96 adiw r24, 0x20 ; 32 31db6: c4 55 subi r28, 0x54 ; 84 31db8: de 4f sbci r29, 0xFE ; 254 31dba: 99 83 std Y+1, r25 ; 0x01 31dbc: 88 83 st Y, r24 31dbe: cc 5a subi r28, 0xAC ; 172 31dc0: 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]; 31dc2: f8 01 movw r30, r16 31dc4: ec 0d add r30, r12 31dc6: fd 1d adc r31, r13 31dc8: ea 58 subi r30, 0x8A ; 138 31dca: f8 4f sbci r31, 0xF8 ; 248 31dcc: 60 81 ld r22, Z 31dce: 70 e0 ldi r23, 0x00 ; 0 31dd0: 90 e0 ldi r25, 0x00 ; 0 31dd2: 80 e0 ldi r24, 0x00 ; 0 31dd4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 31dd8: 4b 01 movw r8, r22 31dda: 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; 31ddc: ce 54 subi r28, 0x4E ; 78 31dde: de 4f sbci r29, 0xFE ; 254 31de0: 28 81 ld r18, Y 31de2: 39 81 ldd r19, Y+1 ; 0x01 31de4: 4a 81 ldd r20, Y+2 ; 0x02 31de6: 5b 81 ldd r21, Y+3 ; 0x03 31de8: c2 5b subi r28, 0xB2 ; 178 31dea: d1 40 sbci r29, 0x01 ; 1 31dec: c2 55 subi r28, 0x52 ; 82 31dee: de 4f sbci r29, 0xFE ; 254 31df0: 68 81 ld r22, Y 31df2: 79 81 ldd r23, Y+1 ; 0x01 31df4: 8a 81 ldd r24, Y+2 ; 0x02 31df6: 9b 81 ldd r25, Y+3 ; 0x03 31df8: ce 5a subi r28, 0xAE ; 174 31dfa: d1 40 sbci r29, 0x01 ; 1 31dfc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31e00: 9b 01 movw r18, r22 31e02: 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]; 31e04: c5 01 movw r24, r10 31e06: b4 01 movw r22, r8 31e08: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31e0c: 4b 01 movw r8, r22 31e0e: 5c 01 movw r10, r24 31e10: c4 55 subi r28, 0x54 ; 84 31e12: de 4f sbci r29, 0xFE ; 254 31e14: e8 81 ld r30, Y 31e16: f9 81 ldd r31, Y+1 ; 0x01 31e18: cc 5a subi r28, 0xAC ; 172 31e1a: d1 40 sbci r29, 0x01 ; 1 31e1c: ec 0d add r30, r12 31e1e: fd 1d adc r31, r13 31e20: ea 58 subi r30, 0x8A ; 138 31e22: f8 4f sbci r31, 0xF8 ; 248 31e24: 60 81 ld r22, Z 31e26: 70 e0 ldi r23, 0x00 ; 0 31e28: 90 e0 ldi r25, 0x00 ; 0 31e2a: 80 e0 ldi r24, 0x00 ; 0 31e2c: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 31e30: 6b 01 movw r12, r22 31e32: 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; 31e34: c2 55 subi r28, 0x52 ; 82 31e36: de 4f sbci r29, 0xFE ; 254 31e38: 28 81 ld r18, Y 31e3a: 39 81 ldd r19, Y+1 ; 0x01 31e3c: 4a 81 ldd r20, Y+2 ; 0x02 31e3e: 5b 81 ldd r21, Y+3 ; 0x03 31e40: ce 5a subi r28, 0xAE ; 174 31e42: d1 40 sbci r29, 0x01 ; 1 31e44: cc 56 subi r28, 0x6C ; 108 31e46: de 4f sbci r29, 0xFE ; 254 31e48: 68 81 ld r22, Y 31e4a: 79 81 ldd r23, Y+1 ; 0x01 31e4c: 8a 81 ldd r24, Y+2 ; 0x02 31e4e: 9b 81 ldd r25, Y+3 ; 0x03 31e50: c4 59 subi r28, 0x94 ; 148 31e52: d1 40 sbci r29, 0x01 ; 1 31e54: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31e58: 9b 01 movw r18, r22 31e5a: 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]; 31e5c: c7 01 movw r24, r14 31e5e: b6 01 movw r22, r12 31e60: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31e64: 9b 01 movw r18, r22 31e66: ac 01 movw r20, r24 31e68: c5 01 movw r24, r10 31e6a: b4 01 movw r22, r8 31e6c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31e70: 6b 01 movw r12, r22 31e72: 7c 01 movw r14, r24 31e74: c6 55 subi r28, 0x56 ; 86 31e76: de 4f sbci r29, 0xFE ; 254 31e78: a8 81 ld r26, Y 31e7a: b9 81 ldd r27, Y+1 ; 0x01 31e7c: ca 5a subi r28, 0xAA ; 170 31e7e: d1 40 sbci r29, 0x01 ; 1 31e80: 0a 0f add r16, r26 31e82: 1b 1f adc r17, r27 31e84: f8 01 movw r30, r16 31e86: ea 58 subi r30, 0x8A ; 138 31e88: f8 4f sbci r31, 0xF8 ; 248 31e8a: 60 81 ld r22, Z 31e8c: 70 e0 ldi r23, 0x00 ; 0 31e8e: 90 e0 ldi r25, 0x00 ; 0 31e90: 80 e0 ldi r24, 0x00 ; 0 31e92: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 31e96: 4b 01 movw r8, r22 31e98: 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; 31e9a: ce 54 subi r28, 0x4E ; 78 31e9c: de 4f sbci r29, 0xFE ; 254 31e9e: 28 81 ld r18, Y 31ea0: 39 81 ldd r19, Y+1 ; 0x01 31ea2: 4a 81 ldd r20, Y+2 ; 0x02 31ea4: 5b 81 ldd r21, Y+3 ; 0x03 31ea6: c2 5b subi r28, 0xB2 ; 178 31ea8: d1 40 sbci r29, 0x01 ; 1 31eaa: c3 01 movw r24, r6 31eac: b2 01 movw r22, r4 31eae: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31eb2: 9b 01 movw r18, r22 31eb4: 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]; 31eb6: c5 01 movw r24, r10 31eb8: b4 01 movw r22, r8 31eba: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31ebe: 9b 01 movw r18, r22 31ec0: ac 01 movw r20, r24 31ec2: c7 01 movw r24, r14 31ec4: b6 01 movw r22, r12 31ec6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 31eca: 6b 01 movw r12, r22 31ecc: 7c 01 movw r14, r24 31ece: c6 55 subi r28, 0x56 ; 86 31ed0: de 4f sbci r29, 0xFE ; 254 31ed2: e8 81 ld r30, Y 31ed4: f9 81 ldd r31, Y+1 ; 0x01 31ed6: ca 5a subi r28, 0xAA ; 170 31ed8: d1 40 sbci r29, 0x01 ; 1 31eda: c4 55 subi r28, 0x54 ; 84 31edc: de 4f sbci r29, 0xFE ; 254 31ede: 88 81 ld r24, Y 31ee0: 99 81 ldd r25, Y+1 ; 0x01 31ee2: cc 5a subi r28, 0xAC ; 172 31ee4: d1 40 sbci r29, 0x01 ; 1 31ee6: e8 0f add r30, r24 31ee8: f9 1f adc r31, r25 31eea: ea 58 subi r30, 0x8A ; 138 31eec: f8 4f sbci r31, 0xF8 ; 248 31eee: 60 81 ld r22, Z 31ef0: 70 e0 ldi r23, 0x00 ; 0 31ef2: 90 e0 ldi r25, 0x00 ; 0 31ef4: 80 e0 ldi r24, 0x00 ; 0 31ef6: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 31efa: 4b 01 movw r8, r22 31efc: 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; 31efe: cc 56 subi r28, 0x6C ; 108 31f00: de 4f sbci r29, 0xFE ; 254 31f02: 28 81 ld r18, Y 31f04: 39 81 ldd r19, Y+1 ; 0x01 31f06: 4a 81 ldd r20, Y+2 ; 0x02 31f08: 5b 81 ldd r21, Y+3 ; 0x03 31f0a: c4 59 subi r28, 0x94 ; 148 31f0c: d1 40 sbci r29, 0x01 ; 1 31f0e: c3 01 movw r24, r6 31f10: b2 01 movw r22, r4 31f12: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31f16: 9b 01 movw r18, r22 31f18: 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]; 31f1a: c5 01 movw r24, r10 31f1c: b4 01 movw r22, r8 31f1e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31f22: 9b 01 movw r18, r22 31f24: ac 01 movw r20, r24 31f26: c7 01 movw r24, r14 31f28: b6 01 movw r22, r12 31f2a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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; 31f2e: 20 e0 ldi r18, 0x00 ; 0 31f30: 30 e0 ldi r19, 0x00 ; 0 31f32: 40 e0 ldi r20, 0x00 ; 0 31f34: 52 e4 ldi r21, 0x42 ; 66 31f36: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 31f3a: 6b 01 movw r12, r22 31f3c: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 31f3e: ac 01 movw r20, r24 31f40: 9b 01 movw r18, r22 31f42: ce 55 subi r28, 0x5E ; 94 31f44: de 4f sbci r29, 0xFE ; 254 31f46: 68 81 ld r22, Y 31f48: 79 81 ldd r23, Y+1 ; 0x01 31f4a: 8a 81 ldd r24, Y+2 ; 0x02 31f4c: 9b 81 ldd r25, Y+3 ; 0x03 31f4e: c2 5a subi r28, 0xA2 ; 162 31f50: d1 40 sbci r29, 0x01 ; 1 31f52: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31f56: c8 55 subi r28, 0x58 ; 88 31f58: de 4f sbci r29, 0xFE ; 254 31f5a: a8 81 ld r26, Y 31f5c: b9 81 ldd r27, Y+1 ; 0x01 31f5e: c8 5a subi r28, 0xA8 ; 168 31f60: d1 40 sbci r29, 0x01 ; 1 31f62: 6d 93 st X+, r22 31f64: 7d 93 st X+, r23 31f66: 8d 93 st X+, r24 31f68: 9d 93 st X+, r25 31f6a: c8 55 subi r28, 0x58 ; 88 31f6c: de 4f sbci r29, 0xFE ; 254 31f6e: b9 83 std Y+1, r27 ; 0x01 31f70: a8 83 st Y, r26 31f72: c8 5a subi r28, 0xA8 ; 168 31f74: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 31f76: a7 01 movw r20, r14 31f78: 96 01 movw r18, r12 31f7a: c2 56 subi r28, 0x62 ; 98 31f7c: de 4f sbci r29, 0xFE ; 254 31f7e: 68 81 ld r22, Y 31f80: 79 81 ldd r23, Y+1 ; 0x01 31f82: 8a 81 ldd r24, Y+2 ; 0x02 31f84: 9b 81 ldd r25, Y+3 ; 0x03 31f86: ce 59 subi r28, 0x9E ; 158 31f88: d1 40 sbci r29, 0x01 ; 1 31f8a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 31f8e: ca 55 subi r28, 0x5A ; 90 31f90: de 4f sbci r29, 0xFE ; 254 31f92: e8 81 ld r30, Y 31f94: f9 81 ldd r31, Y+1 ; 0x01 31f96: c6 5a subi r28, 0xA6 ; 166 31f98: d1 40 sbci r29, 0x01 ; 1 31f9a: 61 93 st Z+, r22 31f9c: 71 93 st Z+, r23 31f9e: 81 93 st Z+, r24 31fa0: 91 93 st Z+, r25 31fa2: ca 55 subi r28, 0x5A ; 90 31fa4: de 4f sbci r29, 0xFE ; 254 31fa6: f9 83 std Y+1, r31 ; 0x01 31fa8: e8 83 st Y, r30 31faa: c6 5a subi r28, 0xA6 ; 166 31fac: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 31fae: c8 56 subi r28, 0x68 ; 104 31fb0: de 4f sbci r29, 0xFE ; 254 31fb2: a8 81 ld r26, Y 31fb4: b9 81 ldd r27, Y+1 ; 0x01 31fb6: c8 59 subi r28, 0x98 ; 152 31fb8: d1 40 sbci r29, 0x01 ; 1 31fba: cd 92 st X+, r12 31fbc: dd 92 st X+, r13 31fbe: ed 92 st X+, r14 31fc0: fd 92 st X+, r15 31fc2: c8 56 subi r28, 0x68 ; 104 31fc4: de 4f sbci r29, 0xFE ; 254 31fc6: b9 83 std Y+1, r27 ; 0x01 31fc8: a8 83 st Y, r26 31fca: c8 59 subi r28, 0x98 ; 152 31fcc: d1 40 sbci r29, 0x01 ; 1 31fce: bf ef ldi r27, 0xFF ; 255 31fd0: 2b 1a sub r2, r27 31fd2: 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){ 31fd4: e1 e2 ldi r30, 0x21 ; 33 31fd6: 2e 16 cp r2, r30 31fd8: 31 04 cpc r3, r1 31fda: 09 f0 breq .+2 ; 0x31fde 31fdc: 10 ce rjmp .-992 ; 0x31bfe 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); 31fde: 40 e0 ldi r20, 0x00 ; 0 31fe0: 50 e0 ldi r21, 0x00 ; 0 31fe2: 60 e0 ldi r22, 0x00 ; 0 31fe4: 7d e3 ldi r23, 0x3D ; 61 31fe6: ce 01 movw r24, r28 31fe8: 87 5f subi r24, 0xF7 ; 247 31fea: 9e 4f sbci r25, 0xFE ; 254 31fec: 0f 94 f4 6f call 0x2dfe8 ; 0x2dfe8 31ff0: 9b 01 movw r18, r22 31ff2: ac 01 movw r20, r24 31ff4: c3 57 subi r28, 0x73 ; 115 31ff6: de 4f sbci r29, 0xFE ; 254 31ff8: a8 81 ld r26, Y 31ffa: b9 81 ldd r27, Y+1 ; 0x01 31ffc: cd 58 subi r28, 0x8D ; 141 31ffe: d1 40 sbci r29, 0x01 ; 1 32000: 6d 91 ld r22, X+ 32002: 7d 91 ld r23, X+ 32004: 8d 91 ld r24, X+ 32006: 9c 91 ld r25, X 32008: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3200c: c3 57 subi r28, 0x73 ; 115 3200e: de 4f sbci r29, 0xFE ; 254 32010: e8 81 ld r30, Y 32012: f9 81 ldd r31, Y+1 ; 0x01 32014: cd 58 subi r28, 0x8D ; 141 32016: d1 40 sbci r29, 0x01 ; 1 32018: 60 83 st Z, r22 3201a: 71 83 std Z+1, r23 ; 0x01 3201c: 82 83 std Z+2, r24 ; 0x02 3201e: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 32020: 40 e0 ldi r20, 0x00 ; 0 32022: 50 e0 ldi r21, 0x00 ; 0 32024: 60 e0 ldi r22, 0x00 ; 0 32026: 7d e3 ldi r23, 0x3D ; 61 32028: ce 01 movw r24, r28 3202a: 8b 57 subi r24, 0x7B ; 123 3202c: 9f 4f sbci r25, 0xFF ; 255 3202e: 0f 94 f4 6f call 0x2dfe8 ; 0x2dfe8 32032: 9b 01 movw r18, r22 32034: ac 01 movw r20, r24 32036: c1 57 subi r28, 0x71 ; 113 32038: de 4f sbci r29, 0xFE ; 254 3203a: a8 81 ld r26, Y 3203c: b9 81 ldd r27, Y+1 ; 0x01 3203e: cf 58 subi r28, 0x8F ; 143 32040: d1 40 sbci r29, 0x01 ; 1 32042: 6d 91 ld r22, X+ 32044: 7d 91 ld r23, X+ 32046: 8d 91 ld r24, X+ 32048: 9c 91 ld r25, X 3204a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3204e: c1 57 subi r28, 0x71 ; 113 32050: de 4f sbci r29, 0xFE ; 254 32052: e8 81 ld r30, Y 32054: f9 81 ldd r31, Y+1 ; 0x01 32056: cf 58 subi r28, 0x8F ; 143 32058: d1 40 sbci r29, 0x01 ; 1 3205a: 60 83 st Z, r22 3205c: 71 83 std Z+1, r23 ; 0x01 3205e: 82 83 std Z+2, r24 ; 0x02 32060: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 32062: 40 e0 ldi r20, 0x00 ; 0 32064: 50 e0 ldi r21, 0x00 ; 0 32066: 60 e8 ldi r22, 0x80 ; 128 32068: 7c e3 ldi r23, 0x3C ; 60 3206a: ce 01 movw r24, r28 3206c: 01 96 adiw r24, 0x01 ; 1 3206e: 0f 94 f4 6f call 0x2dfe8 ; 0x2dfe8 32072: ce 56 subi r28, 0x6E ; 110 32074: de 4f sbci r29, 0xFE ; 254 32076: a8 81 ld r26, Y 32078: b9 81 ldd r27, Y+1 ; 0x01 3207a: c2 59 subi r28, 0x92 ; 146 3207c: d1 40 sbci r29, 0x01 ; 1 3207e: 2d 91 ld r18, X+ 32080: 3d 91 ld r19, X+ 32082: 4d 91 ld r20, X+ 32084: 5c 91 ld r21, X 32086: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3208a: 16 2f mov r17, r22 3208c: 07 2f mov r16, r23 3208e: f8 2e mov r15, r24 32090: e9 2e mov r14, r25 r = MAX(2, r); 32092: 20 e0 ldi r18, 0x00 ; 0 32094: 30 e0 ldi r19, 0x00 ; 0 32096: 40 e0 ldi r20, 0x00 ; 0 32098: 50 e4 ldi r21, 0x40 ; 64 3209a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3209e: 18 16 cp r1, r24 320a0: 2c f0 brlt .+10 ; 0x320ac 320a2: 10 e0 ldi r17, 0x00 ; 0 320a4: 00 e0 ldi r16, 0x00 ; 0 320a6: f1 2c mov r15, r1 320a8: 80 e4 ldi r24, 0x40 ; 64 320aa: e8 2e mov r14, r24 320ac: a8 01 movw r20, r16 320ae: 97 01 movw r18, r14 320b0: 85 2f mov r24, r21 320b2: 90 2f mov r25, r16 320b4: a3 2f mov r26, r19 320b6: be 2d mov r27, r14 320b8: ce 56 subi r28, 0x6E ; 110 320ba: de 4f sbci r29, 0xFE ; 254 320bc: e8 81 ld r30, Y 320be: f9 81 ldd r31, Y+1 ; 0x01 320c0: c2 59 subi r28, 0x92 ; 146 320c2: d1 40 sbci r29, 0x01 ; 1 320c4: 80 83 st Z, r24 320c6: 91 83 std Z+1, r25 ; 0x01 320c8: a2 83 std Z+2, r26 ; 0x02 320ca: b3 83 std Z+3, r27 ; 0x03 320cc: cf 56 subi r28, 0x6F ; 111 320ce: de 4f sbci r29, 0xFE ; 254 320d0: f8 81 ld r31, Y 320d2: c1 59 subi r28, 0x91 ; 145 320d4: d1 40 sbci r29, 0x01 ; 1 320d6: f1 50 subi r31, 0x01 ; 1 320d8: cf 56 subi r28, 0x6F ; 111 320da: de 4f sbci r29, 0xFE ; 254 320dc: f8 83 st Y, r31 320de: c1 59 subi r28, 0x91 ; 145 320e0: 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){ 320e2: f1 11 cpse r31, r1 320e4: 37 cd rjmp .-1426 ; 0x31b54 r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 320e6: ef 92 push r14 320e8: ff 92 push r15 320ea: 0f 93 push r16 320ec: 1f 93 push r17 320ee: c1 57 subi r28, 0x71 ; 113 320f0: de 4f sbci r29, 0xFE ; 254 320f2: a8 81 ld r26, Y 320f4: b9 81 ldd r27, Y+1 ; 0x01 320f6: cf 58 subi r28, 0x8F ; 143 320f8: d1 40 sbci r29, 0x01 ; 1 320fa: 13 96 adiw r26, 0x03 ; 3 320fc: 8c 91 ld r24, X 320fe: 13 97 sbiw r26, 0x03 ; 3 32100: 8f 93 push r24 32102: 12 96 adiw r26, 0x02 ; 2 32104: 8c 91 ld r24, X 32106: 12 97 sbiw r26, 0x02 ; 2 32108: 8f 93 push r24 3210a: 11 96 adiw r26, 0x01 ; 1 3210c: 8c 91 ld r24, X 3210e: 11 97 sbiw r26, 0x01 ; 1 32110: 8f 93 push r24 32112: 8c 91 ld r24, X 32114: 8f 93 push r24 32116: c3 57 subi r28, 0x73 ; 115 32118: de 4f sbci r29, 0xFE ; 254 3211a: e8 81 ld r30, Y 3211c: f9 81 ldd r31, Y+1 ; 0x01 3211e: cd 58 subi r28, 0x8D ; 141 32120: d1 40 sbci r29, 0x01 ; 1 32122: 83 81 ldd r24, Z+3 ; 0x03 32124: 8f 93 push r24 32126: 82 81 ldd r24, Z+2 ; 0x02 32128: 8f 93 push r24 3212a: 81 81 ldd r24, Z+1 ; 0x01 3212c: 8f 93 push r24 3212e: 80 81 ld r24, Z 32130: 8f 93 push r24 32132: 88 e4 ldi r24, 0x48 ; 72 32134: 95 ea ldi r25, 0xA5 ; 165 32136: 9f 93 push r25 32138: 8f 93 push r24 3213a: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 3213e: 0f b6 in r0, 0x3f ; 63 32140: f8 94 cli 32142: de bf out 0x3e, r29 ; 62 32144: 0f be out 0x3f, r0 ; 63 32146: cd bf out 0x3d, r28 ; 61 } 32148: c3 54 subi r28, 0x43 ; 67 3214a: de 4f sbci r29, 0xFE ; 254 3214c: 0f b6 in r0, 0x3f ; 63 3214e: f8 94 cli 32150: de bf out 0x3e, r29 ; 62 32152: 0f be out 0x3f, r0 ; 63 32154: cd bf out 0x3d, r28 ; 61 32156: df 91 pop r29 32158: cf 91 pop r28 3215a: 1f 91 pop r17 3215c: 0f 91 pop r16 3215e: ff 90 pop r15 32160: ef 90 pop r14 32162: df 90 pop r13 32164: cf 90 pop r12 32166: bf 90 pop r11 32168: af 90 pop r10 3216a: 9f 90 pop r9 3216c: 8f 90 pop r8 3216e: 7f 90 pop r7 32170: 6f 90 pop r6 32172: 5f 90 pop r5 32174: 4f 90 pop r4 32176: 3f 90 pop r3 32178: 2f 90 pop r2 3217a: 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; 3217c: 60 e0 ldi r22, 0x00 ; 0 3217e: 70 e0 ldi r23, 0x00 ; 0 32180: cb 01 movw r24, r22 32182: d5 ce rjmp .-598 ; 0x31f2e 00032184 : } /// 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){ 32184: 2f 92 push r2 32186: 3f 92 push r3 32188: 4f 92 push r4 3218a: 5f 92 push r5 3218c: 6f 92 push r6 3218e: 7f 92 push r7 32190: 8f 92 push r8 32192: 9f 92 push r9 32194: af 92 push r10 32196: bf 92 push r11 32198: cf 92 push r12 3219a: df 92 push r13 3219c: ef 92 push r14 3219e: ff 92 push r15 321a0: 0f 93 push r16 321a2: 1f 93 push r17 321a4: cf 93 push r28 321a6: df 93 push r29 321a8: 00 d0 rcall .+0 ; 0x321aa 321aa: 1f 92 push r1 321ac: 1f 92 push r1 321ae: cd b7 in r28, 0x3d ; 61 321b0: de b7 in r29, 0x3e ; 62 321b2: 2b 01 movw r4, r22 321b4: 1a 01 movw r2, r20 321b6: f1 2c mov r15, r1 321b8: 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; 321ba: 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; 321bc: 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; 321be: 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){ 321c0: 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); 321c2: 66 24 eor r6, r6 321c4: 63 94 inc r6 321c6: 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){ 321c8: 70 e0 ldi r23, 0x00 ; 0 321ca: 60 e0 ldi r22, 0x00 ; 0 321cc: 97 01 movw r18, r14 321ce: 2a 58 subi r18, 0x8A ; 138 321d0: 38 4f sbci r19, 0xF8 ; 248 321d2: 3a 83 std Y+2, r19 ; 0x02 321d4: 29 83 std Y+1, r18 ; 0x01 321d6: 86 2e mov r8, r22 321d8: c9 80 ldd r12, Y+1 ; 0x01 321da: da 80 ldd r13, Y+2 ; 0x02 321dc: c6 0e add r12, r22 321de: d7 1e adc r13, r23 321e0: 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; 321e2: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 321e4: 40 e0 ldi r20, 0x00 ; 0 321e6: 30 e0 ldi r19, 0x00 ; 0 321e8: 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; 321ea: ae ef ldi r26, 0xFE ; 254 321ec: a4 0f add r26, r20 321ee: 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; 321f0: 44 23 and r20, r20 321f2: 19 f0 breq .+6 ; 0x321fa 321f4: 4b 30 cpi r20, 0x0B ; 11 321f6: 09 f0 breq .+2 ; 0x321fa 321f8: 7d c0 rjmp .+250 ; 0x322f4 321fa: ae ef ldi r26, 0xFE ; 254 321fc: a2 0f add r26, r18 321fe: a8 30 cpi r26, 0x08 ; 8 32200: 08 f4 brcc .+2 ; 0x32204 32202: 7a c0 rjmp .+244 ; 0x322f8 32204: 2f 5f subi r18, 0xFF ; 255 32206: 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){ 32208: 2c 30 cpi r18, 0x0C ; 12 3220a: 31 05 cpc r19, r1 3220c: 89 f7 brne .-30 ; 0x321f0 /// 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){ 3220e: 4f 5f subi r20, 0xFF ; 255 32210: 20 e2 ldi r18, 0x20 ; 32 32212: c2 0e add r12, r18 32214: d1 1c adc r13, r1 32216: 32 96 adiw r30, 0x02 ; 2 32218: 4c 30 cpi r20, 0x0C ; 12 3221a: 29 f7 brne .-54 ; 0x321e6 // 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){ 3221c: 3c 81 ldd r19, Y+4 ; 0x04 3221e: 30 17 cp r19, r16 32220: 18 f4 brcc .+6 ; 0x32228 32222: 0c 83 std Y+4, r16 ; 0x04 32224: 5d 83 std Y+5, r21 ; 0x05 32226: 18 2d mov r17, r8 32228: 6f 5f subi r22, 0xFF ; 255 3222a: 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){ 3222c: 64 31 cpi r22, 0x14 ; 20 3222e: 71 05 cpc r23, r1 32230: 91 f6 brne .-92 ; 0x321d6 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){ 32232: 5f 5f subi r21, 0xFF ; 255 32234: a0 e2 ldi r26, 0x20 ; 32 32236: ea 0e add r14, r26 32238: f1 1c adc r15, r1 3223a: 54 31 cpi r21, 0x14 ; 20 3223c: 29 f6 brne .-118 ; 0x321c8 // 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); 3223e: ec 81 ldd r30, Y+4 ; 0x04 32240: 6e 2f mov r22, r30 32242: 70 e0 ldi r23, 0x00 ; 0 32244: 90 e0 ldi r25, 0x00 ; 0 32246: 80 e0 ldi r24, 0x00 ; 0 32248: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3224c: 23 ec ldi r18, 0xC3 ; 195 3224e: 35 ef ldi r19, 0xF5 ; 245 32250: 48 ea ldi r20, 0xA8 ; 168 32252: 5f e3 ldi r21, 0x3F ; 63 32254: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 32258: 9f 93 push r25 3225a: 8f 93 push r24 3225c: 7f 93 push r23 3225e: 6f 93 push r22 32260: fd 81 ldd r31, Y+5 ; 0x05 32262: 6f 2f mov r22, r31 32264: 70 e0 ldi r23, 0x00 ; 0 32266: 90 e0 ldi r25, 0x00 ; 0 32268: 80 e0 ldi r24, 0x00 ; 0 3226a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3226e: 20 e0 ldi r18, 0x00 ; 0 32270: 30 e0 ldi r19, 0x00 ; 0 32272: 40 eb ldi r20, 0xB0 ; 176 32274: 50 e4 ldi r21, 0x40 ; 64 32276: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3227a: 9f 93 push r25 3227c: 8f 93 push r24 3227e: 7f 93 push r23 32280: 6f 93 push r22 32282: 61 2f mov r22, r17 32284: 70 e0 ldi r23, 0x00 ; 0 32286: 90 e0 ldi r25, 0x00 ; 0 32288: 80 e0 ldi r24, 0x00 ; 0 3228a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3228e: 20 e0 ldi r18, 0x00 ; 0 32290: 30 e0 ldi r19, 0x00 ; 0 32292: 40 eb ldi r20, 0xB0 ; 176 32294: 50 e4 ldi r21, 0x40 ; 64 32296: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3229a: 9f 93 push r25 3229c: 8f 93 push r24 3229e: 7f 93 push r23 322a0: 6f 93 push r22 322a2: 84 e2 ldi r24, 0x24 ; 36 322a4: 95 ea ldi r25, 0xA5 ; 165 322a6: 9f 93 push r25 322a8: 8f 93 push r24 322aa: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 *pc = max_c; 322ae: f2 01 movw r30, r4 322b0: 10 83 st Z, r17 *pr = max_r; 322b2: 2d 81 ldd r18, Y+5 ; 0x05 322b4: f1 01 movw r30, r2 322b6: 20 83 st Z, r18 322b8: 0f b6 in r0, 0x3f ; 63 322ba: f8 94 cli 322bc: de bf out 0x3e, r29 ; 62 322be: 0f be out 0x3f, r0 ; 63 322c0: cd bf out 0x3d, r28 ; 61 return max_match; } 322c2: 8c 81 ldd r24, Y+4 ; 0x04 322c4: 0f 90 pop r0 322c6: 0f 90 pop r0 322c8: 0f 90 pop r0 322ca: 0f 90 pop r0 322cc: 0f 90 pop r0 322ce: df 91 pop r29 322d0: cf 91 pop r28 322d2: 1f 91 pop r17 322d4: 0f 91 pop r16 322d6: ff 90 pop r15 322d8: ef 90 pop r14 322da: df 90 pop r13 322dc: cf 90 pop r12 322de: bf 90 pop r11 322e0: af 90 pop r10 322e2: 9f 90 pop r9 322e4: 8f 90 pop r8 322e6: 7f 90 pop r7 322e8: 6f 90 pop r6 322ea: 5f 90 pop r5 322ec: 4f 90 pop r4 322ee: 3f 90 pop r3 322f0: 2f 90 pop r2 322f2: 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; 322f4: 22 23 and r18, r18 322f6: 11 f0 breq .+4 ; 0x322fc 322f8: 2b 30 cpi r18, 0x0B ; 11 322fa: 21 f4 brne .+8 ; 0x32304 322fc: ab 81 ldd r26, Y+3 ; 0x03 322fe: a8 30 cpi r26, 0x08 ; 8 32300: 08 f0 brcs .+2 ; 0x32304 32302: 80 cf rjmp .-256 ; 0x32204 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 32304: 99 24 eor r9, r9 32306: 93 94 inc r9 32308: d6 01 movw r26, r12 3230a: a2 0f add r26, r18 3230c: b3 1f adc r27, r19 3230e: ac 91 ld r26, X 32310: a1 31 cpi r26, 0x11 ; 17 32312: 08 f4 brcc .+2 ; 0x32316 32314: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 32316: a0 80 ld r10, Z 32318: b1 80 ldd r11, Z+1 ; 0x01 3231a: d3 01 movw r26, r6 3231c: 02 2e mov r0, r18 3231e: 02 c0 rjmp .+4 ; 0x32324 32320: aa 0f add r26, r26 32322: bb 1f adc r27, r27 32324: 0a 94 dec r0 32326: e2 f7 brpl .-8 ; 0x32320 32328: aa 21 and r26, r10 3232a: bb 21 and r27, r11 3232c: bb 24 eor r11, r11 3232e: b3 94 inc r11 32330: ab 2b or r26, r27 32332: 09 f4 brne .+2 ; 0x32336 32334: b1 2c mov r11, r1 if (high_pix == high_pat) 32336: 9b 10 cpse r9, r11 32338: 65 cf rjmp .-310 ; 0x32204 match++; 3233a: 0f 5f subi r16, 0xFF ; 255 3233c: 63 cf rjmp .-314 ; 0x32204 0003233e : 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){ 3233e: 2f 92 push r2 32340: 3f 92 push r3 32342: 4f 92 push r4 32344: 5f 92 push r5 32346: 6f 92 push r6 32348: 7f 92 push r7 3234a: 8f 92 push r8 3234c: 9f 92 push r9 3234e: af 92 push r10 32350: bf 92 push r11 32352: cf 92 push r12 32354: df 92 push r13 32356: ef 92 push r14 32358: ff 92 push r15 3235a: 0f 93 push r16 3235c: 1f 93 push r17 3235e: cf 93 push r28 32360: df 93 push r29 32362: cd b7 in r28, 0x3d ; 61 32364: de b7 in r29, 0x3e ; 62 32366: ca 55 subi r28, 0x5A ; 90 32368: d1 09 sbc r29, r1 3236a: 0f b6 in r0, 0x3f ; 63 3236c: f8 94 cli 3236e: de bf out 0x3e, r29 ; 62 32370: 0f be out 0x3f, r0 ; 63 32372: cd bf out 0x3d, r28 ; 61 32374: 63 96 adiw r28, 0x13 ; 19 32376: 9f af std Y+63, r25 ; 0x3f 32378: 8e af std Y+62, r24 ; 0x3e 3237a: 63 97 sbiw r28, 0x13 ; 19 3237c: 8b 01 movw r16, r22 3237e: 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 32380: 7e 01 movw r14, r28 32382: 25 e4 ldi r18, 0x45 ; 69 32384: e2 0e add r14, r18 32386: f1 1c adc r15, r1 32388: 80 e1 ldi r24, 0x10 ; 16 3238a: 97 e2 ldi r25, 0x27 ; 39 3238c: f7 01 movw r30, r14 3238e: 91 83 std Z+1, r25 ; 0x01 32390: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 32392: 83 e1 ldi r24, 0x13 ; 19 32394: 95 ea ldi r25, 0xA5 ; 165 32396: 9f 93 push r25 32398: 8f 93 push r24 3239a: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 3239e: 26 e7 ldi r18, 0x76 ; 118 323a0: 37 e0 ldi r19, 0x07 ; 7 323a2: 61 96 adiw r28, 0x11 ; 17 323a4: 3f af std Y+63, r19 ; 0x3f 323a6: 2e af std Y+62, r18 ; 0x3e 323a8: 61 97 sbiw r28, 0x11 ; 17 323aa: c8 01 movw r24, r16 323ac: 80 5e subi r24, 0xE0 ; 224 323ae: 93 40 sbci r25, 0x03 ; 3 323b0: 2b 96 adiw r28, 0x0b ; 11 323b2: 9f af std Y+63, r25 ; 0x3f 323b4: 8e af std Y+62, r24 ; 0x3e 323b6: 2b 97 sbiw r28, 0x0b ; 11 323b8: 0f 90 pop r0 323ba: 0f 90 pop r0 323bc: e0 e4 ldi r30, 0x40 ; 64 323be: f0 e0 ldi r31, 0x00 ; 0 323c0: 29 96 adiw r28, 0x09 ; 9 323c2: ff af std Y+63, r31 ; 0x3f 323c4: ee af std Y+62, r30 ; 0x3e 323c6: 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); 323c8: 63 96 adiw r28, 0x13 ; 19 323ca: 2e ad ldd r18, Y+62 ; 0x3e 323cc: 3f ad ldd r19, Y+63 ; 0x3f 323ce: 63 97 sbiw r28, 0x13 ; 19 323d0: 20 5e subi r18, 0xE0 ; 224 323d2: 33 40 sbci r19, 0x03 ; 3 323d4: 69 96 adiw r28, 0x19 ; 25 323d6: 3f af std Y+63, r19 ; 0x3f 323d8: 2e af std Y+62, r18 ; 0x3e 323da: 69 97 sbiw r28, 0x19 ; 25 323dc: 29 96 adiw r28, 0x09 ; 9 323de: 4e ac ldd r4, Y+62 ; 0x3e 323e0: 5f ac ldd r5, Y+63 ; 0x3f 323e2: 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){ 323e4: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 323e6: 63 96 adiw r28, 0x13 ; 19 323e8: 8e ad ldd r24, Y+62 ; 0x3e 323ea: 9f ad ldd r25, Y+63 ; 0x3f 323ec: 63 97 sbiw r28, 0x13 ; 19 323ee: 80 52 subi r24, 0x20 ; 32 323f0: 9c 4f sbci r25, 0xFC ; 252 323f2: 6b 96 adiw r28, 0x1b ; 27 323f4: 9f af std Y+63, r25 ; 0x3f 323f6: 8e af std Y+62, r24 ; 0x3e 323f8: 6b 97 sbiw r28, 0x1b ; 27 323fa: 60 90 6c 07 lds r6, 0x076C ; 0x80076c 323fe: 70 90 6d 07 lds r7, 0x076D ; 0x80076d 32402: 80 90 6e 07 lds r8, 0x076E ; 0x80076e 32406: 90 90 6f 07 lds r9, 0x076F ; 0x80076f 3240a: 6b 96 adiw r28, 0x1b ; 27 3240c: ae ac ldd r10, Y+62 ; 0x3e 3240e: bf ac ldd r11, Y+63 ; 0x3f 32410: 6b 97 sbiw r28, 0x1b ; 27 32412: 31 10 cpse r3, r1 32414: 04 c0 rjmp .+8 ; 0x3241e 32416: 69 96 adiw r28, 0x19 ; 25 32418: ae ac ldd r10, Y+62 ; 0x3e 3241a: bf ac ldd r11, Y+63 ; 0x3f 3241c: 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; 3241e: 80 91 64 07 lds r24, 0x0764 ; 0x800764 32422: 90 91 65 07 lds r25, 0x0765 ; 0x800765 32426: a0 91 66 07 lds r26, 0x0766 ; 0x800766 3242a: b0 91 67 07 lds r27, 0x0767 ; 0x800767 3242e: f5 01 movw r30, r10 32430: e8 1b sub r30, r24 32432: f9 0b sbc r31, r25 32434: 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) 32436: 71 f0 breq .+28 ; 0x32454 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)); 32438: af 01 movw r20, r30 3243a: f7 ff sbrs r31, 7 3243c: 04 c0 rjmp .+8 ; 0x32446 3243e: 44 27 eor r20, r20 32440: 55 27 eor r21, r21 32442: 4e 1b sub r20, r30 32444: 5f 0b sbc r21, r31 32446: 69 2f mov r22, r25 32448: 66 1f adc r22, r22 3244a: 66 27 eor r22, r22 3244c: 66 1f adc r22, r22 3244e: 81 e0 ldi r24, 0x01 ; 1 32450: 0f 94 1b 75 call 0x2ea36 ; 0x2ea36 // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 32454: 80 91 68 07 lds r24, 0x0768 ; 0x800768 32458: 90 91 69 07 lds r25, 0x0769 ; 0x800769 3245c: a0 91 6a 07 lds r26, 0x076A ; 0x80076a 32460: b0 91 6b 07 lds r27, 0x076B ; 0x80076b 32464: 2b 96 adiw r28, 0x0b ; 11 32466: 4e ad ldd r20, Y+62 ; 0x3e 32468: 5f ad ldd r21, Y+63 ; 0x3f 3246a: 2b 97 sbiw r28, 0x0b ; 11 3246c: 48 1b sub r20, r24 3246e: 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)); 32470: 57 fd sbrc r21, 7 32472: b2 c0 rjmp .+356 ; 0x325d8 32474: 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) 32476: 41 15 cp r20, r1 32478: 51 05 cpc r21, r1 3247a: 09 f0 breq .+2 ; 0x3247e 3247c: ae c0 rjmp .+348 ; 0x325da // 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; 3247e: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32482: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32486: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3248a: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3248e: 68 1a sub r6, r24 32490: 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)); 32492: 77 fc sbrc r7, 7 32494: ab c0 rjmp .+342 ; 0x325ec 32496: 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) 32498: 61 14 cp r6, r1 3249a: 71 04 cpc r7, r1 3249c: 09 f0 breq .+2 ; 0x324a0 3249e: a7 c0 rjmp .+334 ; 0x325ee 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); 324a0: 40 91 6c 07 lds r20, 0x076C ; 0x80076c 324a4: 50 91 6d 07 lds r21, 0x076D ; 0x80076d 324a8: 60 91 6e 07 lds r22, 0x076E ; 0x80076e 324ac: 70 91 6f 07 lds r23, 0x076F ; 0x80076f 324b0: 00 e0 ldi r16, 0x00 ; 0 324b2: 28 ec ldi r18, 0xC8 ; 200 324b4: 30 e0 ldi r19, 0x00 ; 0 324b6: 2b 96 adiw r28, 0x0b ; 11 324b8: 6e ad ldd r22, Y+62 ; 0x3e 324ba: 7f ad ldd r23, Y+63 ; 0x3f 324bc: 2b 97 sbiw r28, 0x0b ; 11 324be: c5 01 movw r24, r10 324c0: 0e 94 f4 e1 call 0x1c3e8 ; 0x1c3e8 sm4_set_dir(X_AXIS, d); 324c4: 63 2d mov r22, r3 324c6: 80 e0 ldi r24, 0x00 ; 0 324c8: 0f 94 77 6b call 0x2d6ee ; 0x2d6ee //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 324cc: 5f 92 push r5 324ce: 4f 92 push r4 324d0: 8f e0 ldi r24, 0x0F ; 15 324d2: 95 ea ldi r25, 0xA5 ; 165 324d4: 9f 93 push r25 324d6: 8f 93 push r24 324d8: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 lcd_set_cursor(4,3); 324dc: 63 e0 ldi r22, 0x03 ; 3 324de: 84 e0 ldi r24, 0x04 ; 4 324e0: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 324e4: 5f 92 push r5 324e6: 4f 92 push r4 324e8: 80 e0 ldi r24, 0x00 ; 0 324ea: 95 ea ldi r25, 0xA5 ; 165 324ec: 9f 93 push r25 324ee: 8f 93 push r24 324f0: 0e 94 6e 6f call 0xdedc ; 0xdedc 324f4: 0f b6 in r0, 0x3f ; 63 324f6: f8 94 cli 324f8: de bf out 0x3e, r29 ; 62 324fa: 0f be out 0x3f, r0 ; 63 324fc: cd bf out 0x3d, r28 ; 61 324fe: 21 e0 ldi r18, 0x01 ; 1 32500: 30 e0 ldi r19, 0x00 ; 0 32502: 31 10 cpse r3, r1 32504: 02 c0 rjmp .+4 ; 0x3250a 32506: 2f ef ldi r18, 0xFF ; 255 32508: 3f ef ldi r19, 0xFF ; 255 3250a: 40 ec ldi r20, 0xC0 ; 192 3250c: 42 03 mulsu r20, r18 3250e: c0 01 movw r24, r0 32510: 43 9f mul r20, r19 32512: 90 0d add r25, r0 32514: 11 24 eor r1, r1 32516: 67 96 adiw r28, 0x17 ; 23 32518: 9f af std Y+63, r25 ; 0x3f 3251a: 8e af std Y+62, r24 ; 0x3e 3251c: 67 97 sbiw r28, 0x17 ; 23 3251e: 40 ee ldi r20, 0xE0 ; 224 32520: 53 e0 ldi r21, 0x03 ; 3 32522: 24 9f mul r18, r20 32524: 40 01 movw r8, r0 32526: 25 9f mul r18, r21 32528: 90 0c add r9, r0 3252a: 34 9f mul r19, r20 3252c: 90 0c add r9, r0 3252e: 11 24 eor r1, r1 32530: 63 96 adiw r28, 0x13 ; 19 32532: ee ad ldd r30, Y+62 ; 0x3e 32534: ff ad ldd r31, Y+63 ; 0x3f 32536: 63 97 sbiw r28, 0x13 ; 19 32538: 8e 0e add r8, r30 3253a: 9f 1e adc r9, r31 3253c: 9e 01 movw r18, r28 3253e: 2f 5f subi r18, 0xFF ; 255 32540: 3f 4f sbci r19, 0xFF ; 255 32542: 2d 96 adiw r28, 0x0d ; 13 32544: 3f af std Y+63, r19 ; 0x3f 32546: 2e af std Y+62, r18 ; 0x3e 32548: 2d 97 sbiw r28, 0x0d ; 13 3254a: 61 96 adiw r28, 0x11 ; 17 3254c: 8e ad ldd r24, Y+62 ; 0x3e 3254e: 9f ad ldd r25, Y+63 ; 0x3f 32550: 61 97 sbiw r28, 0x11 ; 17 32552: 2f 96 adiw r28, 0x0f ; 15 32554: 9f af std Y+63, r25 ; 0x3f 32556: 8e af std Y+62, r24 ; 0x3e 32558: 2f 97 sbiw r28, 0x0f ; 15 3255a: 71 2c mov r7, r1 3255c: 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; 3255e: e0 e1 ldi r30, 0x10 ; 16 32560: f7 e2 ldi r31, 0x27 ; 39 32562: 27 96 adiw r28, 0x07 ; 7 32564: ff af std Y+63, r31 ; 0x3f 32566: ee af std Y+62, r30 ; 0x3e 32568: 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); 3256a: 80 91 64 07 lds r24, 0x0764 ; 0x800764 3256e: 90 91 65 07 lds r25, 0x0765 ; 0x800765 32572: a0 91 66 07 lds r26, 0x0766 ; 0x800766 32576: b0 91 67 07 lds r27, 0x0767 ; 0x800767 3257a: 84 01 movw r16, r8 3257c: 08 1b sub r16, r24 3257e: 19 0b sbc r17, r25 32580: 17 ff sbrs r17, 7 32582: 03 c0 rjmp .+6 ; 0x3258a 32584: 11 95 neg r17 32586: 01 95 neg r16 32588: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 3258a: 98 01 movw r18, r16 3258c: 35 95 asr r19 3258e: 27 95 ror r18 32590: 65 96 adiw r28, 0x15 ; 21 32592: 3f af std Y+63, r19 ; 0x3f 32594: 2e af std Y+62, r18 ; 0x3e 32596: 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; 32598: 1c 9b sbis 0x03, 4 ; 3 3259a: 33 c0 rjmp .+102 ; 0x32602 3259c: 45 e0 ldi r20, 0x05 ; 5 3259e: 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); 325a0: 65 96 adiw r28, 0x15 ; 21 325a2: ae ac ldd r10, Y+62 ; 0x3e 325a4: bf ac ldd r11, Y+63 ; 0x3f 325a6: 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); 325a8: 63 2d mov r22, r3 325aa: 82 2d mov r24, r2 325ac: 0e 94 9b e1 call 0x1c336 ; 0x1c336 while (steps--){ 325b0: 31 e0 ldi r19, 0x01 ; 1 325b2: a3 1a sub r10, r19 325b4: b1 08 sbc r11, r1 325b6: 40 f1 brcs .+80 ; 0x32608 accelerate_1_step(axes, acc, delay_us, min_delay_us); 325b8: 28 ec ldi r18, 0xC8 ; 200 325ba: 30 e0 ldi r19, 0x00 ; 0 325bc: a7 01 movw r20, r14 325be: 68 ee ldi r22, 0xE8 ; 232 325c0: 73 e0 ldi r23, 0x03 ; 3 325c2: 82 2d mov r24, r2 325c4: 0e 94 6c e0 call 0x1c0d8 ; 0x1c0d8 update_position_1_step(axes, dir); 325c8: 63 2d mov r22, r3 325ca: 82 2d mov r24, r2 325cc: 0e 94 b4 e1 call 0x1c368 ; 0x1c368 325d0: ef cf rjmp .-34 ; 0x325b0 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){ 325d2: 33 24 eor r3, r3 325d4: 33 94 inc r3 325d6: 11 cf rjmp .-478 ; 0x323fa 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)); 325d8: 62 e0 ldi r22, 0x02 ; 2 325da: 57 ff sbrs r21, 7 325dc: 03 c0 rjmp .+6 ; 0x325e4 325de: 51 95 neg r21 325e0: 41 95 neg r20 325e2: 51 09 sbc r21, r1 325e4: 82 e0 ldi r24, 0x02 ; 2 325e6: 0f 94 1b 75 call 0x2ea36 ; 0x2ea36 325ea: 49 cf rjmp .-366 ; 0x3247e // 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)); 325ec: 64 e0 ldi r22, 0x04 ; 4 325ee: a3 01 movw r20, r6 325f0: 77 fe sbrs r7, 7 325f2: 03 c0 rjmp .+6 ; 0x325fa 325f4: 51 95 neg r21 325f6: 41 95 neg r20 325f8: 51 09 sbc r21, r1 325fa: 84 e0 ldi r24, 0x04 ; 4 325fc: 0f 94 1b 75 call 0x2ea36 ; 0x2ea36 32600: 4f cf rjmp .-354 ; 0x324a0 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; 32602: 22 24 eor r2, r2 32604: 23 94 inc r2 32606: cc cf rjmp .-104 ; 0x325a0 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); 32608: 65 96 adiw r28, 0x15 ; 21 3260a: ee ad ldd r30, Y+62 ; 0x3e 3260c: ff ad ldd r31, Y+63 ; 0x3f 3260e: 65 97 sbiw r28, 0x15 ; 21 32610: 0e 1b sub r16, r30 32612: 1f 0b sbc r17, r31 32614: 23 96 adiw r28, 0x03 ; 3 32616: 1f af std Y+63, r17 ; 0x3f 32618: 0e af std Y+62, r16 ; 0x3e 3261a: 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); 3261c: 63 2d mov r22, r3 3261e: 82 2d mov r24, r2 32620: 0e 94 9b e1 call 0x1c336 ; 0x1c336 while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 32624: 9e 01 movw r18, r28 32626: 2f 5b subi r18, 0xBF ; 191 32628: 3f 4f sbci r19, 0xFF ; 255 3262a: a7 01 movw r20, r14 3262c: 68 ee ldi r22, 0xE8 ; 232 3262e: 73 e0 ldi r23, 0x03 ; 3 32630: 82 2d mov r24, r2 32632: 0e 94 12 e1 call 0x1c224 ; 0x1c224 32636: 88 23 and r24, r24 32638: 29 f0 breq .+10 ; 0x32644 update_position_1_step(axes, dir); 3263a: 63 2d mov r22, r3 3263c: 82 2d mov r24, r2 3263e: 0e 94 b4 e1 call 0x1c368 ; 0x1c368 32642: f0 cf rjmp .-32 ; 0x32624 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 32644: 60 e0 ldi r22, 0x00 ; 0 32646: 82 e0 ldi r24, 0x02 ; 2 32648: 0f 94 77 6b call 0x2d6ee ; 0x2d6ee /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 3264c: 20 e1 ldi r18, 0x10 ; 16 3264e: 37 e2 ldi r19, 0x27 ; 39 32650: 27 96 adiw r28, 0x07 ; 7 32652: 3f af std Y+63, r19 ; 0x3f 32654: 2e af std Y+62, r18 ; 0x3e 32656: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 32658: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 3265c: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 32660: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 32664: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 32668: 00 5a subi r16, 0xA0 ; 160 3266a: 16 4f sbci r17, 0xF6 ; 246 3266c: 17 ff sbrs r17, 7 3266e: 02 c0 rjmp .+4 ; 0x32674 32670: 0f 5f subi r16, 0xFF ; 255 32672: 1f 4f sbci r17, 0xFF ; 255 32674: 15 95 asr r17 32676: 07 95 ror r16 32678: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 3267c: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32680: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32684: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 32688: 80 17 cp r24, r16 3268a: 91 07 cpc r25, r17 3268c: f4 f4 brge .+60 ; 0x326ca if (!_PINDA){ 3268e: 1c 9b sbis 0x03, 4 ; 3 32690: 1c c0 rjmp .+56 ; 0x326ca break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 32692: 28 ec ldi r18, 0xC8 ; 200 32694: 30 e0 ldi r19, 0x00 ; 0 32696: a7 01 movw r20, r14 32698: 68 ee ldi r22, 0xE8 ; 232 3269a: 73 e0 ldi r23, 0x03 ; 3 3269c: 84 e0 ldi r24, 0x04 ; 4 3269e: 0e 94 6c e0 call 0x1c0d8 ; 0x1c0d8 /// 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_){ 326a2: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 326a6: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 326aa: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 326ae: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 326b2: 01 96 adiw r24, 0x01 ; 1 326b4: a1 1d adc r26, r1 326b6: b1 1d adc r27, r1 326b8: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 326bc: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 326c0: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 326c4: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 326c8: d7 cf rjmp .-82 ; 0x32678 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 326ca: 1c 9b sbis 0x03, 4 ; 3 326cc: 3f c0 rjmp .+126 ; 0x3274c steps_to_go = MAX(0, max_z - _Z); 326ce: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 326d2: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 326d6: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 326da: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 326de: e0 e6 ldi r30, 0x60 ; 96 326e0: f9 e0 ldi r31, 0x09 ; 9 326e2: e8 1b sub r30, r24 326e4: f9 0b sbc r31, r25 326e6: cf 01 movw r24, r30 326e8: f7 ff sbrs r31, 7 326ea: 02 c0 rjmp .+4 ; 0x326f0 326ec: 90 e0 ldi r25, 0x00 ; 0 326ee: 80 e0 ldi r24, 0x00 ; 0 326f0: 25 96 adiw r28, 0x05 ; 5 326f2: 9f af std Y+63, r25 ; 0x3f 326f4: 8e af std Y+62, r24 ; 0x3e 326f6: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 326f8: 1c 9b sbis 0x03, 4 ; 3 326fa: 28 c0 rjmp .+80 ; 0x3274c 326fc: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32700: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32704: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32708: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3270c: 80 36 cpi r24, 0x60 ; 96 3270e: 99 40 sbci r25, 0x09 ; 9 32710: ec f4 brge .+58 ; 0x3274c go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 32712: 9e 01 movw r18, r28 32714: 2d 5b subi r18, 0xBD ; 189 32716: 3f 4f sbci r19, 0xFF ; 255 32718: a7 01 movw r20, r14 3271a: 68 ee ldi r22, 0xE8 ; 232 3271c: 73 e0 ldi r23, 0x03 ; 3 3271e: 84 e0 ldi r24, 0x04 ; 4 32720: 0e 94 12 e1 call 0x1c224 ; 0x1c224 ++_Z_; 32724: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32728: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 3272c: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32730: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 32734: 01 96 adiw r24, 0x01 ; 1 32736: a1 1d adc r26, r1 32738: b1 1d adc r27, r1 3273a: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 3273e: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 32742: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 32746: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 3274a: d6 cf rjmp .-84 ; 0x326f8 /// \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); 3274c: 60 e0 ldi r22, 0x00 ; 0 3274e: 84 e0 ldi r24, 0x04 ; 4 32750: 0e 94 9b e1 call 0x1c336 ; 0x1c336 while (delay_us < MAX_DELAY){ 32754: f7 01 movw r30, r14 32756: 20 81 ld r18, Z 32758: 31 81 ldd r19, Z+1 ; 0x01 3275a: 20 31 cpi r18, 0x10 ; 16 3275c: f7 e2 ldi r31, 0x27 ; 39 3275e: 3f 07 cpc r19, r31 32760: 58 f4 brcc .+22 ; 0x32778 accelerate_1_step(axes, -dec, delay_us, delay_us); 32762: a7 01 movw r20, r14 32764: 68 e1 ldi r22, 0x18 ; 24 32766: 7c ef ldi r23, 0xFC ; 252 32768: 84 e0 ldi r24, 0x04 ; 4 3276a: 0e 94 6c e0 call 0x1c0d8 ; 0x1c0d8 update_position_1_step(axes, dir); 3276e: 60 e0 ldi r22, 0x00 ; 0 32770: 84 e0 ldi r24, 0x04 ; 4 32772: 0e 94 b4 e1 call 0x1c368 ; 0x1c368 32776: ee cf rjmp .-36 ; 0x32754 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 32778: 61 e0 ldi r22, 0x01 ; 1 3277a: 82 e0 ldi r24, 0x02 ; 2 3277c: 0f 94 77 6b call 0x2d6ee ; 0x2d6ee /// speed up current_delay_us = MAX_DELAY; 32780: 20 e1 ldi r18, 0x10 ; 16 32782: 37 e2 ldi r19, 0x27 ; 39 32784: f7 01 movw r30, r14 32786: 31 83 std Z+1, r19 ; 0x01 32788: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 3278a: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 3278e: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 32792: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 32796: 30 91 6f 07 lds r19, 0x076F ; 0x80076f 3279a: 0c 0d add r16, r12 3279c: 1d 1d adc r17, r13 3279e: 17 ff sbrs r17, 7 327a0: 02 c0 rjmp .+4 ; 0x327a6 327a2: 0f 5f subi r16, 0xFF ; 255 327a4: 1f 4f sbci r17, 0xFF ; 255 327a6: 15 95 asr r17 327a8: 07 95 ror r16 327aa: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 327ae: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 327b2: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 327b6: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 327ba: 08 17 cp r16, r24 327bc: 19 07 cpc r17, r25 327be: 0c f0 brlt .+2 ; 0x327c2 327c0: d9 c0 rjmp .+434 ; 0x32974 if (_PINDA){ 327c2: 1c 9b sbis 0x03, 4 ; 3 327c4: bb c0 rjmp .+374 ; 0x3293c z_trig = _Z; 327c6: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 327ca: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 327ce: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 327d2: 30 91 6f 07 lds r19, 0x076F ; 0x80076f break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } /// slow down if (!_PINDA){ 327d6: 1c 99 sbic 0x03, 4 ; 3 327d8: 28 c0 rjmp .+80 ; 0x3282a steps_to_go = MAX(0, _Z - min_z); 327da: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 327de: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 327e2: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 327e6: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 327ea: 8c 19 sub r24, r12 327ec: 9d 09 sbc r25, r13 327ee: 97 ff sbrs r25, 7 327f0: 02 c0 rjmp .+4 ; 0x327f6 327f2: 90 e0 ldi r25, 0x00 ; 0 327f4: 80 e0 ldi r24, 0x00 ; 0 327f6: 25 96 adiw r28, 0x05 ; 5 327f8: 9f af std Y+63, r25 ; 0x3f 327fa: 8e af std Y+62, r24 ; 0x3e 327fc: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 327fe: 1c 99 sbic 0x03, 4 ; 3 32800: 0c c0 rjmp .+24 ; 0x3281a 32802: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32806: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 3280a: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 3280e: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 32812: c8 16 cp r12, r24 32814: d9 06 cpc r13, r25 32816: 0c f4 brge .+2 ; 0x3281a 32818: af c0 rjmp .+350 ; 0x32978 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 3281a: 00 91 6c 07 lds r16, 0x076C ; 0x80076c 3281e: 10 91 6d 07 lds r17, 0x076D ; 0x80076d 32822: 20 91 6e 07 lds r18, 0x076E ; 0x80076e 32826: 30 91 6f 07 lds r19, 0x076F ; 0x80076f } /// slow down to stop but not lower than min_z while (_Z > min_z && current_delay_us < MAX_DELAY){ 3282a: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 3282e: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32832: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32836: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3283a: c8 16 cp r12, r24 3283c: d9 06 cpc r13, r25 3283e: 3c f4 brge .+14 ; 0x3284e 32840: f7 01 movw r30, r14 32842: 80 81 ld r24, Z 32844: 91 81 ldd r25, Z+1 ; 0x01 32846: 80 31 cpi r24, 0x10 ; 16 32848: 97 42 sbci r25, 0x27 ; 39 3284a: 08 f4 brcc .+2 ; 0x3284e 3284c: b2 c0 rjmp .+356 ; 0x329b2 3284e: 0c 19 sub r16, r12 32850: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 32852: 31 10 cpse r3, r1 32854: ca c0 rjmp .+404 ; 0x329ea line_buffer[c] = (uint16_t)(z_trig - min_z); 32856: f3 01 movw r30, r6 32858: ee 0f add r30, r30 3285a: ff 1f adc r31, r31 3285c: 21 e0 ldi r18, 0x01 ; 1 3285e: 30 e0 ldi r19, 0x00 ; 0 32860: 2c 0f add r18, r28 32862: 3d 1f adc r19, r29 32864: e2 0f add r30, r18 32866: f3 1f adc r31, r19 32868: 11 83 std Z+1, r17 ; 0x01 3286a: 00 83 st Z, r16 3286c: ff ef ldi r31, 0xFF ; 255 3286e: 6f 1a sub r6, r31 32870: 7f 0a sbc r7, r31 32872: 67 96 adiw r28, 0x17 ; 23 32874: 2e ad ldd r18, Y+62 ; 0x3e 32876: 3f ad ldd r19, Y+63 ; 0x3f 32878: 67 97 sbiw r28, 0x17 ; 23 3287a: 82 0e add r8, r18 3287c: 93 1e adc r9, r19 3287e: 2d 96 adiw r28, 0x0d ; 13 32880: 8e ad ldd r24, Y+62 ; 0x3e 32882: 9f ad ldd r25, Y+63 ; 0x3f 32884: 2d 97 sbiw r28, 0x0d ; 13 32886: 02 97 sbiw r24, 0x02 ; 2 32888: 2d 96 adiw r28, 0x0d ; 13 3288a: 9f af std Y+63, r25 ; 0x3f 3288c: 8e af std Y+62, r24 ; 0x3e 3288e: 2d 97 sbiw r28, 0x0d ; 13 32890: 2f 96 adiw r28, 0x0f ; 15 32892: ee ad ldd r30, Y+62 ; 0x3e 32894: ff ad ldd r31, Y+63 ; 0x3f 32896: 2f 97 sbiw r28, 0x0f ; 15 32898: 31 97 sbiw r30, 0x01 ; 1 3289a: 2f 96 adiw r28, 0x0f ; 15 3289c: ff af std Y+63, r31 ; 0x3f 3289e: ee af std Y+62, r30 ; 0x3e 328a0: 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 328a2: f0 e2 ldi r31, 0x20 ; 32 328a4: 6f 16 cp r6, r31 328a6: 71 04 cpc r7, r1 328a8: 09 f0 breq .+2 ; 0x328ac 328aa: 59 ce rjmp .-846 ; 0x3255e 328ac: 21 e0 ldi r18, 0x01 ; 1 328ae: 42 1a sub r4, r18 328b0: 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){ 328b2: 31 e0 ldi r19, 0x01 ; 1 328b4: 33 12 cpse r3, r19 328b6: 8d ce rjmp .-742 ; 0x325d2 328b8: 61 96 adiw r28, 0x11 ; 17 328ba: 8e ad ldd r24, Y+62 ; 0x3e 328bc: 9f ad ldd r25, Y+63 ; 0x3f 328be: 61 97 sbiw r28, 0x11 ; 17 328c0: 80 96 adiw r24, 0x20 ; 32 328c2: 61 96 adiw r28, 0x11 ; 17 328c4: 9f af std Y+63, r25 ; 0x3f 328c6: 8e af std Y+62, r24 ; 0x3e 328c8: 61 97 sbiw r28, 0x11 ; 17 328ca: 2b 96 adiw r28, 0x0b ; 11 328cc: ee ad ldd r30, Y+62 ; 0x3e 328ce: ff ad ldd r31, Y+63 ; 0x3f 328d0: 2b 97 sbiw r28, 0x0b ; 11 328d2: e0 5c subi r30, 0xC0 ; 192 328d4: ff 4f sbci r31, 0xFF ; 255 328d6: 2b 96 adiw r28, 0x0b ; 11 328d8: ff af std Y+63, r31 ; 0x3f 328da: ee af std Y+62, r30 ; 0x3e 328dc: 2b 97 sbiw r28, 0x0b ; 11 328de: 29 96 adiw r28, 0x09 ; 9 328e0: 2e ad ldd r18, Y+62 ; 0x3e 328e2: 3f ad ldd r19, Y+63 ; 0x3f 328e4: 29 97 sbiw r28, 0x09 ; 9 328e6: 22 50 subi r18, 0x02 ; 2 328e8: 31 09 sbc r19, r1 328ea: 29 96 adiw r28, 0x09 ; 9 328ec: 3f af std Y+63, r19 ; 0x3f 328ee: 2e af std Y+62, r18 ; 0x3e 328f0: 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 328f2: 23 2b or r18, r19 328f4: 09 f0 breq .+2 ; 0x328f8 328f6: 72 cd rjmp .-1308 ; 0x323dc 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); 328f8: 8e ef ldi r24, 0xFE ; 254 328fa: 94 ea ldi r25, 0xA4 ; 164 328fc: 9f 93 push r25 328fe: 8f 93 push r24 32900: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 32904: 0f 90 pop r0 32906: 0f 90 pop r0 } 32908: c6 5a subi r28, 0xA6 ; 166 3290a: df 4f sbci r29, 0xFF ; 255 3290c: 0f b6 in r0, 0x3f ; 63 3290e: f8 94 cli 32910: de bf out 0x3e, r29 ; 62 32912: 0f be out 0x3f, r0 ; 63 32914: cd bf out 0x3d, r28 ; 61 32916: df 91 pop r29 32918: cf 91 pop r28 3291a: 1f 91 pop r17 3291c: 0f 91 pop r16 3291e: ff 90 pop r15 32920: ef 90 pop r14 32922: df 90 pop r13 32924: cf 90 pop r12 32926: bf 90 pop r11 32928: af 90 pop r10 3292a: 9f 90 pop r9 3292c: 8f 90 pop r8 3292e: 7f 90 pop r7 32930: 6f 90 pop r6 32932: 5f 90 pop r5 32934: 4f 90 pop r4 32936: 3f 90 pop r3 32938: 2f 90 pop r2 3293a: 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); 3293c: 28 ec ldi r18, 0xC8 ; 200 3293e: 30 e0 ldi r19, 0x00 ; 0 32940: a7 01 movw r20, r14 32942: 68 ee ldi r22, 0xE8 ; 232 32944: 73 e0 ldi r23, 0x03 ; 3 32946: 84 e0 ldi r24, 0x04 ; 4 32948: 0e 94 6c e0 call 0x1c0d8 ; 0x1c0d8 /// 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_){ 3294c: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 32950: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32954: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32958: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3295c: 01 97 sbiw r24, 0x01 ; 1 3295e: a1 09 sbc r26, r1 32960: b1 09 sbc r27, r1 32962: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 32966: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 3296a: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 3296e: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 32972: 1b cf rjmp .-458 ; 0x327aa 32974: 86 01 movw r16, r12 32976: 2f cf rjmp .-418 ; 0x327d6 } /// 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); 32978: 9e 01 movw r18, r28 3297a: 2d 5b subi r18, 0xBD ; 189 3297c: 3f 4f sbci r19, 0xFF ; 255 3297e: a7 01 movw r20, r14 32980: 68 ee ldi r22, 0xE8 ; 232 32982: 73 e0 ldi r23, 0x03 ; 3 32984: 84 e0 ldi r24, 0x04 ; 4 32986: 0e 94 12 e1 call 0x1c224 ; 0x1c224 --_Z_; 3298a: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 3298e: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 32992: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 32996: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 3299a: 01 97 sbiw r24, 0x01 ; 1 3299c: a1 09 sbc r26, r1 3299e: b1 09 sbc r27, r1 329a0: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 329a4: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 329a8: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 329ac: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 329b0: 26 cf rjmp .-436 ; 0x327fe } 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); 329b2: 28 ec ldi r18, 0xC8 ; 200 329b4: 30 e0 ldi r19, 0x00 ; 0 329b6: a7 01 movw r20, r14 329b8: 68 e1 ldi r22, 0x18 ; 24 329ba: 7c ef ldi r23, 0xFC ; 252 329bc: 84 e0 ldi r24, 0x04 ; 4 329be: 0e 94 6c e0 call 0x1c0d8 ; 0x1c0d8 --_Z_; 329c2: 80 91 6c 07 lds r24, 0x076C ; 0x80076c 329c6: 90 91 6d 07 lds r25, 0x076D ; 0x80076d 329ca: a0 91 6e 07 lds r26, 0x076E ; 0x80076e 329ce: b0 91 6f 07 lds r27, 0x076F ; 0x80076f 329d2: 01 97 sbiw r24, 0x01 ; 1 329d4: a1 09 sbc r26, r1 329d6: b1 09 sbc r27, r1 329d8: 80 93 6c 07 sts 0x076C, r24 ; 0x80076c 329dc: 90 93 6d 07 sts 0x076D, r25 ; 0x80076d 329e0: a0 93 6e 07 sts 0x076E, r26 ; 0x80076e 329e4: b0 93 6f 07 sts 0x076F, r27 ; 0x80076f 329e8: 20 cf rjmp .-448 ; 0x3282a 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); 329ea: 2d 96 adiw r28, 0x0d ; 13 329ec: ee ad ldd r30, Y+62 ; 0x3e 329ee: ff ad ldd r31, Y+63 ; 0x3f 329f0: 2d 97 sbiw r28, 0x0d ; 13 329f2: 86 ad ldd r24, Z+62 ; 0x3e 329f4: 97 ad ldd r25, Z+63 ; 0x3f 329f6: 01 2e mov r0, r17 329f8: 00 0c add r0, r0 329fa: 22 0b sbc r18, r18 329fc: 33 0b sbc r19, r19 329fe: 08 0f add r16, r24 32a00: 19 1f adc r17, r25 32a02: 21 1d adc r18, r1 32a04: 31 1d adc r19, r1 32a06: 36 95 lsr r19 32a08: 27 95 ror r18 32a0a: 17 95 ror r17 32a0c: 07 95 ror r16 32a0e: 0f 3f cpi r16, 0xFF ; 255 32a10: 11 05 cpc r17, r1 32a12: 21 05 cpc r18, r1 32a14: 31 05 cpc r19, r1 32a16: 29 f0 breq .+10 ; 0x32a22 32a18: 20 f0 brcs .+8 ; 0x32a22 32a1a: 0f ef ldi r16, 0xFF ; 255 32a1c: 10 e0 ldi r17, 0x00 ; 0 32a1e: 20 e0 ldi r18, 0x00 ; 0 32a20: 30 e0 ldi r19, 0x00 ; 0 32a22: 2f 96 adiw r28, 0x0f ; 15 32a24: ee ad ldd r30, Y+62 ; 0x3e 32a26: ff ad ldd r31, Y+63 ; 0x3f 32a28: 2f 97 sbiw r28, 0x0f ; 15 32a2a: 07 8f std Z+31, r16 ; 0x1f 32a2c: 1f cf rjmp .-450 ; 0x3286c 00032a2e : /// 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) 32a2e: 2f 92 push r2 32a30: 3f 92 push r3 32a32: 4f 92 push r4 32a34: 5f 92 push r5 32a36: 6f 92 push r6 32a38: 7f 92 push r7 32a3a: 8f 92 push r8 32a3c: 9f 92 push r9 32a3e: af 92 push r10 32a40: bf 92 push r11 32a42: cf 92 push r12 32a44: df 92 push r13 32a46: ef 92 push r14 32a48: ff 92 push r15 32a4a: 0f 93 push r16 32a4c: 1f 93 push r17 32a4e: cf 93 push r28 32a50: df 93 push r29 32a52: cd b7 in r28, 0x3d ; 61 32a54: de b7 in r29, 0x3e ; 62 32a56: 6c 97 sbiw r28, 0x1c ; 28 32a58: 0f b6 in r0, 0x3f ; 63 32a5a: f8 94 cli 32a5c: de bf out 0x3e, r29 ; 62 32a5e: 0f be out 0x3f, r0 ; 63 32a60: cd bf out 0x3d, r28 ; 61 32a62: 6c 01 movw r12, r24 32a64: 5b 01 movw r10, r22 32a66: 4a 01 movw r8, r20 32a68: 19 01 movw r2, r18 32a6a: 18 87 std Y+8, r17 ; 0x08 32a6c: 0f 83 std Y+7, r16 ; 0x07 32a6e: fa 82 std Y+2, r15 ; 0x02 32a70: 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; 32a72: d7 01 movw r26, r14 32a74: 8d 91 ld r24, X+ 32a76: 9c 91 ld r25, X 32a78: 60 ed ldi r22, 0xD0 ; 208 32a7a: 72 e0 ldi r23, 0x02 ; 2 32a7c: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 32a80: 9c 8f std Y+28, r25 ; 0x1c 32a82: 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); 32a84: 9f 93 push r25 32a86: 8f 93 push r24 32a88: 3f 92 push r3 32a8a: 2f 93 push r18 32a8c: 1f 92 push r1 32a8e: 84 e6 ldi r24, 0x64 ; 100 32a90: 8f 93 push r24 32a92: 9f 92 push r9 32a94: 8f 92 push r8 32a96: bf 92 push r11 32a98: af 92 push r10 32a9a: df 92 push r13 32a9c: cf 92 push r12 32a9e: 86 ec ldi r24, 0xC6 ; 198 32aa0: 94 ea ldi r25, 0xA4 ; 164 32aa2: 9f 93 push r25 32aa4: 8f 93 push r24 32aa6: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 32aaa: 0f b6 in r0, 0x3f ; 63 32aac: f8 94 cli 32aae: de bf out 0x3e, r29 ; 62 32ab0: 0f be out 0x3f, r0 ; 63 32ab2: 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; 32ab4: 22 27 eor r18, r18 32ab6: 33 27 eor r19, r19 32ab8: 22 19 sub r18, r2 32aba: 33 09 sbc r19, r3 32abc: 3a 8f std Y+26, r19 ; 0x1a 32abe: 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)); 32ac0: c4 01 movw r24, r8 32ac2: 99 0c add r9, r9 32ac4: aa 0b sbc r26, r26 32ac6: bb 0b sbc r27, r27 32ac8: 89 87 std Y+9, r24 ; 0x09 32aca: 9a 87 std Y+10, r25 ; 0x0a 32acc: ab 87 std Y+11, r26 ; 0x0b 32ace: 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)); 32ad0: 95 01 movw r18, r10 32ad2: bb 0c add r11, r11 32ad4: 44 0b sbc r20, r20 32ad6: 55 0b sbc r21, r21 32ad8: 29 8b std Y+17, r18 ; 0x11 32ada: 3a 8b std Y+18, r19 ; 0x12 32adc: 4b 8b std Y+19, r20 ; 0x13 32ade: 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)); 32ae0: c6 01 movw r24, r12 32ae2: dd 0c add r13, r13 32ae4: aa 0b sbc r26, r26 32ae6: bb 0b sbc r27, r27 32ae8: 8d 8b std Y+21, r24 ; 0x15 32aea: 9e 8b std Y+22, r25 ; 0x16 32aec: af 8b std Y+23, r26 ; 0x17 32aee: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 32af0: 12 14 cp r1, r2 32af2: 13 04 cpc r1, r3 32af4: 0c f0 brlt .+2 ; 0x32af8 32af6: ba c0 rjmp .+372 ; 0x32c6c { dad = dad_max - (ad / k); 32af8: 8b 8d ldd r24, Y+27 ; 0x1b 32afa: 9c 8d ldd r25, Y+28 ; 0x1c 32afc: 6c e3 ldi r22, 0x3C ; 60 32afe: 70 e0 ldi r23, 0x00 ; 0 32b00: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 32b04: 10 e1 ldi r17, 0x10 ; 16 32b06: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 32b08: 2b 8d ldd r18, Y+27 ; 0x1b 32b0a: 3c 8d ldd r19, Y+28 ; 0x1c 32b0c: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32b0e: 0f 94 b1 de call 0x3bd62 ; 0x3bd62 <__usmulhisi3> 32b12: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 32b16: 20 e0 ldi r18, 0x00 ; 0 32b18: 30 e0 ldi r19, 0x00 ; 0 32b1a: 44 e3 ldi r20, 0x34 ; 52 32b1c: 54 e4 ldi r21, 0x44 ; 68 32b1e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 32b22: 6b 01 movw r12, r22 32b24: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 32b26: 6f 81 ldd r22, Y+7 ; 0x07 32b28: 78 85 ldd r23, Y+8 ; 0x08 32b2a: eb 8d ldd r30, Y+27 ; 0x1b 32b2c: fc 8d ldd r31, Y+28 ; 0x1c 32b2e: 6e 0f add r22, r30 32b30: 7f 1f adc r23, r31 32b32: 90 e0 ldi r25, 0x00 ; 0 32b34: 80 e0 ldi r24, 0x00 ; 0 32b36: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 32b3a: 25 e3 ldi r18, 0x35 ; 53 32b3c: 3a ef ldi r19, 0xFA ; 250 32b3e: 4e e8 ldi r20, 0x8E ; 142 32b40: 5c e3 ldi r21, 0x3C ; 60 32b42: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32b46: 4b 01 movw r8, r22 32b48: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 32b4a: 0f 94 b3 df call 0x3bf66 ; 0x3bf66 32b4e: 6b 83 std Y+3, r22 ; 0x03 32b50: 7c 83 std Y+4, r23 ; 0x04 32b52: 8d 83 std Y+5, r24 ; 0x05 32b54: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 32b56: c5 01 movw r24, r10 32b58: b4 01 movw r22, r8 32b5a: 0f 94 79 e2 call 0x3c4f2 ; 0x3c4f2 32b5e: 2b 01 movw r4, r22 32b60: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 32b62: 69 85 ldd r22, Y+9 ; 0x09 32b64: 7a 85 ldd r23, Y+10 ; 0x0a 32b66: 8b 85 ldd r24, Y+11 ; 0x0b 32b68: 9c 85 ldd r25, Y+12 ; 0x0c 32b6a: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 32b6e: 4b 01 movw r8, r22 32b70: 5c 01 movw r10, r24 32b72: 2b 8d ldd r18, Y+27 ; 0x1b 32b74: 3c 8d ldd r19, Y+28 ; 0x1c 32b76: a4 e6 ldi r26, 0x64 ; 100 32b78: b0 e0 ldi r27, 0x00 ; 0 32b7a: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 32b7e: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 32b82: 20 e0 ldi r18, 0x00 ; 0 32b84: 30 e0 ldi r19, 0x00 ; 0 32b86: 44 e3 ldi r20, 0x34 ; 52 32b88: 54 e4 ldi r21, 0x44 ; 68 32b8a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 32b8e: 9b 01 movw r18, r22 32b90: ac 01 movw r20, r24 32b92: c5 01 movw r24, r10 32b94: b4 01 movw r22, r8 32b96: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 32b9a: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 32b9e: 6d 87 std Y+13, r22 ; 0x0d 32ba0: 7e 87 std Y+14, r23 ; 0x0e 32ba2: 8f 87 std Y+15, r24 ; 0x0f 32ba4: 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)); 32ba6: 69 89 ldd r22, Y+17 ; 0x11 32ba8: 7a 89 ldd r23, Y+18 ; 0x12 32baa: 8b 89 ldd r24, Y+19 ; 0x13 32bac: 9c 89 ldd r25, Y+20 ; 0x14 32bae: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 32bb2: 4b 01 movw r8, r22 32bb4: 5c 01 movw r10, r24 32bb6: a3 01 movw r20, r6 32bb8: 92 01 movw r18, r4 32bba: c7 01 movw r24, r14 32bbc: b6 01 movw r22, r12 32bbe: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32bc2: 9b 01 movw r18, r22 32bc4: ac 01 movw r20, r24 32bc6: c5 01 movw r24, r10 32bc8: b4 01 movw r22, r8 32bca: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 32bce: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 32bd2: 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)); 32bd4: 6d 89 ldd r22, Y+21 ; 0x15 32bd6: 7e 89 ldd r23, Y+22 ; 0x16 32bd8: 8f 89 ldd r24, Y+23 ; 0x17 32bda: 98 8d ldd r25, Y+24 ; 0x18 32bdc: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 32be0: 2b 01 movw r4, r22 32be2: 3c 01 movw r6, r24 32be4: a7 01 movw r20, r14 32be6: 96 01 movw r18, r12 32be8: 6b 81 ldd r22, Y+3 ; 0x03 32bea: 7c 81 ldd r23, Y+4 ; 0x04 32bec: 8d 81 ldd r24, Y+5 ; 0x05 32bee: 9e 81 ldd r25, Y+6 ; 0x06 32bf0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32bf4: 9b 01 movw r18, r22 32bf6: ac 01 movw r20, r24 32bf8: c3 01 movw r24, r6 32bfa: b2 01 movw r22, r4 32bfc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 32c00: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 32c04: 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)) 32c06: 01 e0 ldi r16, 0x01 ; 1 32c08: 20 e4 ldi r18, 0x40 ; 64 32c0a: 31 e0 ldi r19, 0x01 ; 1 32c0c: 4d 85 ldd r20, Y+13 ; 0x0d 32c0e: 5e 85 ldd r21, Y+14 ; 0x0e 32c10: b4 01 movw r22, r8 32c12: 0e 94 f4 e1 call 0x1c3e8 ; 0x1c3e8 32c16: 21 2f mov r18, r17 32c18: 30 e0 ldi r19, 0x00 ; 0 32c1a: 88 23 and r24, r24 32c1c: b9 f1 breq .+110 ; 0x32c8c 32c1e: 4b 8d ldd r20, Y+27 ; 0x1b 32c20: 5c 8d ldd r21, Y+28 ; 0x1c 32c22: 42 0f add r20, r18 32c24: 53 1f adc r21, r19 { ad += dad + 1; 32c26: 4f 5f subi r20, 0xFF ; 255 32c28: 5f 4f sbci r21, 0xFF ; 255 32c2a: 5c 8f std Y+28, r21 ; 0x1c 32c2c: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 32c2e: eb 8d ldd r30, Y+27 ; 0x1b 32c30: fc 8d ldd r31, Y+28 ; 0x1c 32c32: a9 81 ldd r26, Y+1 ; 0x01 32c34: ba 81 ldd r27, Y+2 ; 0x02 32c36: ed 93 st X+, r30 32c38: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 32c3a: 6c 96 adiw r28, 0x1c ; 28 32c3c: 0f b6 in r0, 0x3f ; 63 32c3e: f8 94 cli 32c40: de bf out 0x3e, r29 ; 62 32c42: 0f be out 0x3f, r0 ; 63 32c44: cd bf out 0x3d, r28 ; 61 32c46: df 91 pop r29 32c48: cf 91 pop r28 32c4a: 1f 91 pop r17 32c4c: 0f 91 pop r16 32c4e: ff 90 pop r15 32c50: ef 90 pop r14 32c52: df 90 pop r13 32c54: cf 90 pop r12 32c56: bf 90 pop r11 32c58: af 90 pop r10 32c5a: 9f 90 pop r9 32c5c: 8f 90 pop r8 32c5e: 7f 90 pop r7 32c60: 6f 90 pop r6 32c62: 5f 90 pop r5 32c64: 4f 90 pop r4 32c66: 3f 90 pop r3 32c68: 2f 90 pop r2 32c6a: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 32c6c: 2f ec ldi r18, 0xCF ; 207 32c6e: 32 e0 ldi r19, 0x02 ; 2 32c70: ab 8d ldd r26, Y+27 ; 0x1b 32c72: bc 8d ldd r27, Y+28 ; 0x1c 32c74: 2a 1b sub r18, r26 32c76: 3b 0b sbc r19, r27 32c78: c9 01 movw r24, r18 32c7a: 6c e3 ldi r22, 0x3C ; 60 32c7c: 70 e0 ldi r23, 0x00 ; 0 32c7e: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 32c82: 10 e1 ldi r17, 0x10 ; 16 32c84: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 32c86: a9 8d ldd r26, Y+25 ; 0x19 32c88: ba 8d ldd r27, Y+26 ; 0x1a 32c8a: 41 cf rjmp .-382 ; 0x32b0e // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 32c8c: 2f 5f subi r18, 0xFF ; 255 32c8e: 3f 4f sbci r19, 0xFF ; 255 32c90: ab 8d ldd r26, Y+27 ; 0x1b 32c92: bc 8d ldd r27, Y+28 ; 0x1c 32c94: a2 0f add r26, r18 32c96: b3 1f adc r27, r19 32c98: bc 8f std Y+28, r27 ; 0x1c 32c9a: ab 8f std Y+27, r26 ; 0x1b 32c9c: a0 3d cpi r26, 0xD0 ; 208 32c9e: b2 40 sbci r27, 0x02 ; 2 32ca0: 08 f4 brcc .+2 ; 0x32ca4 32ca2: 26 cf rjmp .-436 ; 0x32af0 32ca4: c4 cf rjmp .-120 ; 0x32c2e 00032ca6 : float mesh_bed_leveling::get_z(float x, float y) { 32ca6: 2f 92 push r2 32ca8: 3f 92 push r3 32caa: 4f 92 push r4 32cac: 5f 92 push r5 32cae: 6f 92 push r6 32cb0: 7f 92 push r7 32cb2: 8f 92 push r8 32cb4: 9f 92 push r9 32cb6: af 92 push r10 32cb8: bf 92 push r11 32cba: cf 92 push r12 32cbc: df 92 push r13 32cbe: ef 92 push r14 32cc0: ff 92 push r15 32cc2: 0f 93 push r16 32cc4: 1f 93 push r17 32cc6: cf 93 push r28 32cc8: df 93 push r29 32cca: 00 d0 rcall .+0 ; 0x32ccc 32ccc: 00 d0 rcall .+0 ; 0x32cce 32cce: 00 d0 rcall .+0 ; 0x32cd0 32cd0: 1f 92 push r1 32cd2: cd b7 in r28, 0x3d ; 61 32cd4: de b7 in r29, 0x3e ; 62 32cd6: 2b 01 movw r4, r22 32cd8: 3c 01 movw r6, r24 32cda: 49 01 movw r8, r18 32cdc: 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)); 32cde: 20 e0 ldi r18, 0x00 ; 0 32ce0: 30 e0 ldi r19, 0x00 ; 0 32ce2: 40 ec ldi r20, 0xC0 ; 192 32ce4: 51 e4 ldi r21, 0x41 ; 65 32ce6: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 32cea: 20 e0 ldi r18, 0x00 ; 0 32cec: 30 e0 ldi r19, 0x00 ; 0 32cee: 48 e0 ldi r20, 0x08 ; 8 32cf0: 52 e4 ldi r21, 0x42 ; 66 32cf2: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 32cf6: 6b 01 movw r12, r22 32cf8: 7c 01 movw r14, r24 32cfa: 0f 94 60 e0 call 0x3c0c0 ; 0x3c0c0 32cfe: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> if (i < 0) { i = 0; 32d02: 31 2c mov r3, r1 32d04: 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) { 32d06: 77 fd sbrc r23, 7 32d08: 1e c0 rjmp .+60 ; 0x32d46 32d0a: 1b 01 movw r2, r22 32d0c: 66 30 cpi r22, 0x06 ; 6 32d0e: 71 05 cpc r23, r1 32d10: 1c f0 brlt .+6 ; 0x32d18 32d12: 45 e0 ldi r20, 0x05 ; 5 32d14: 24 2e mov r2, r20 32d16: 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; } 32d18: 82 2d mov r24, r2 32d1a: 0f 94 af c7 call 0x38f5e ; 0x38f5e 32d1e: 20 e0 ldi r18, 0x00 ; 0 32d20: 30 e0 ldi r19, 0x00 ; 0 32d22: 48 eb ldi r20, 0xB8 ; 184 32d24: 51 e4 ldi r21, 0x41 ; 65 32d26: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 32d2a: 9b 01 movw r18, r22 32d2c: 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; 32d2e: c3 01 movw r24, r6 32d30: b2 01 movw r22, r4 32d32: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 32d36: 20 e0 ldi r18, 0x00 ; 0 32d38: 30 e0 ldi r19, 0x00 ; 0 32d3a: 48 e0 ldi r20, 0x08 ; 8 32d3c: 52 e4 ldi r21, 0x42 ; 66 32d3e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 32d42: 6b 01 movw r12, r22 32d44: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 32d46: 20 e0 ldi r18, 0x00 ; 0 32d48: 30 e0 ldi r19, 0x00 ; 0 32d4a: 40 ec ldi r20, 0xC0 ; 192 32d4c: 50 e4 ldi r21, 0x40 ; 64 32d4e: c5 01 movw r24, r10 32d50: b4 01 movw r22, r8 32d52: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 32d56: 20 e0 ldi r18, 0x00 ; 0 32d58: 30 e0 ldi r19, 0x00 ; 0 32d5a: 48 e0 ldi r20, 0x08 ; 8 32d5c: 52 e4 ldi r21, 0x42 ; 66 32d5e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 32d62: 69 83 std Y+1, r22 ; 0x01 32d64: 7a 83 std Y+2, r23 ; 0x02 32d66: 8b 83 std Y+3, r24 ; 0x03 32d68: 9c 83 std Y+4, r25 ; 0x04 32d6a: 0f 94 60 e0 call 0x3c0c0 ; 0x3c0c0 32d6e: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> if (j < 0) { 32d72: 77 fd sbrc r23, 7 32d74: da c0 rjmp .+436 ; 0x32f2a 32d76: 7a 87 std Y+10, r23 ; 0x0a 32d78: 69 87 std Y+9, r22 ; 0x09 32d7a: 66 30 cpi r22, 0x06 ; 6 32d7c: 71 05 cpc r23, r1 32d7e: 24 f0 brlt .+8 ; 0x32d88 32d80: e5 e0 ldi r30, 0x05 ; 5 32d82: f0 e0 ldi r31, 0x00 ; 0 32d84: fa 87 std Y+10, r31 ; 0x0a 32d86: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32d88: 89 85 ldd r24, Y+9 ; 0x09 32d8a: 0f 94 af c7 call 0x38f5e ; 0x38f5e 32d8e: 20 e0 ldi r18, 0x00 ; 0 32d90: 30 e0 ldi r19, 0x00 ; 0 32d92: 40 ea ldi r20, 0xA0 ; 160 32d94: 50 e4 ldi r21, 0x40 ; 64 32d96: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 32d9a: 9b 01 movw r18, r22 32d9c: 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; 32d9e: c5 01 movw r24, r10 32da0: b4 01 movw r22, r8 32da2: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 32da6: 20 e0 ldi r18, 0x00 ; 0 32da8: 30 e0 ldi r19, 0x00 ; 0 32daa: 48 e0 ldi r20, 0x08 ; 8 32dac: 52 e4 ldi r21, 0x42 ; 66 32dae: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 32db2: 69 83 std Y+1, r22 ; 0x01 32db4: 7a 83 std Y+2, r23 ; 0x02 32db6: 8b 83 std Y+3, r24 ; 0x03 32db8: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 32dba: a7 01 movw r20, r14 32dbc: 96 01 movw r18, r12 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 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 32dca: 2b 01 movw r4, r22 32dcc: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 32dce: 91 01 movw r18, r2 32dd0: 2f 5f subi r18, 0xFF ; 255 32dd2: 3f 4f sbci r19, 0xFF ; 255 32dd4: 3e 83 std Y+6, r19 ; 0x06 32dd6: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 32dd8: 89 85 ldd r24, Y+9 ; 0x09 32dda: 9a 85 ldd r25, Y+10 ; 0x0a 32ddc: 01 96 adiw r24, 0x01 ; 1 32dde: 98 87 std Y+8, r25 ; 0x08 32de0: 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]; 32de2: 27 e0 ldi r18, 0x07 ; 7 32de4: e9 85 ldd r30, Y+9 ; 0x09 32de6: fa 85 ldd r31, Y+10 ; 0x0a 32de8: 2e 9f mul r18, r30 32dea: 80 01 movw r16, r0 32dec: 2f 9f mul r18, r31 32dee: 10 0d add r17, r0 32df0: 11 24 eor r1, r1 32df2: f8 01 movw r30, r16 32df4: e2 0d add r30, r2 32df6: f3 1d adc r31, r3 32df8: ee 0f add r30, r30 32dfa: ff 1f adc r31, r31 32dfc: ee 0f add r30, r30 32dfe: ff 1f adc r31, r31 32e00: e0 56 subi r30, 0x60 ; 96 32e02: fc 4e sbci r31, 0xEC ; 236 32e04: 21 81 ldd r18, Z+1 ; 0x01 32e06: 32 81 ldd r19, Z+2 ; 0x02 32e08: 43 81 ldd r20, Z+3 ; 0x03 32e0a: 54 81 ldd r21, Z+4 ; 0x04 32e0c: c3 01 movw r24, r6 32e0e: b2 01 movw r22, r4 32e10: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32e14: 4b 01 movw r8, r22 32e16: 5c 01 movw r10, r24 32e18: ed 81 ldd r30, Y+5 ; 0x05 32e1a: fe 81 ldd r31, Y+6 ; 0x06 32e1c: e0 0f add r30, r16 32e1e: f1 1f adc r31, r17 32e20: ee 0f add r30, r30 32e22: ff 1f adc r31, r31 32e24: ee 0f add r30, r30 32e26: ff 1f adc r31, r31 32e28: e0 56 subi r30, 0x60 ; 96 32e2a: fc 4e sbci r31, 0xEC ; 236 32e2c: 21 81 ldd r18, Z+1 ; 0x01 32e2e: 32 81 ldd r19, Z+2 ; 0x02 32e30: 43 81 ldd r20, Z+3 ; 0x03 32e32: 54 81 ldd r21, Z+4 ; 0x04 32e34: c7 01 movw r24, r14 32e36: b6 01 movw r22, r12 32e38: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32e3c: 9b 01 movw r18, r22 32e3e: ac 01 movw r20, r24 32e40: c5 01 movw r24, r10 32e42: b4 01 movw r22, r8 32e44: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 32e48: 4b 01 movw r8, r22 32e4a: 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; 32e4c: 29 81 ldd r18, Y+1 ; 0x01 32e4e: 3a 81 ldd r19, Y+2 ; 0x02 32e50: 4b 81 ldd r20, Y+3 ; 0x03 32e52: 5c 81 ldd r21, Y+4 ; 0x04 32e54: 60 e0 ldi r22, 0x00 ; 0 32e56: 70 e0 ldi r23, 0x00 ; 0 32e58: 80 e8 ldi r24, 0x80 ; 128 32e5a: 9f e3 ldi r25, 0x3F ; 63 32e5c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 32e60: 9b 01 movw r18, r22 32e62: ac 01 movw r20, r24 32e64: c5 01 movw r24, r10 32e66: b4 01 movw r22, r8 32e68: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32e6c: 4b 01 movw r8, r22 32e6e: 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]; 32e70: 27 e0 ldi r18, 0x07 ; 7 32e72: ef 81 ldd r30, Y+7 ; 0x07 32e74: f8 85 ldd r31, Y+8 ; 0x08 32e76: 2e 9f mul r18, r30 32e78: c0 01 movw r24, r0 32e7a: 2f 9f mul r18, r31 32e7c: 90 0d add r25, r0 32e7e: 11 24 eor r1, r1 32e80: 9a 87 std Y+10, r25 ; 0x0a 32e82: 89 87 std Y+9, r24 ; 0x09 32e84: fc 01 movw r30, r24 32e86: e2 0d add r30, r2 32e88: f3 1d adc r31, r3 32e8a: ee 0f add r30, r30 32e8c: ff 1f adc r31, r31 32e8e: ee 0f add r30, r30 32e90: ff 1f adc r31, r31 32e92: e0 56 subi r30, 0x60 ; 96 32e94: fc 4e sbci r31, 0xEC ; 236 32e96: 21 81 ldd r18, Z+1 ; 0x01 32e98: 32 81 ldd r19, Z+2 ; 0x02 32e9a: 43 81 ldd r20, Z+3 ; 0x03 32e9c: 54 81 ldd r21, Z+4 ; 0x04 32e9e: c3 01 movw r24, r6 32ea0: b2 01 movw r22, r4 32ea2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32ea6: 2b 01 movw r4, r22 32ea8: 3c 01 movw r6, r24 32eaa: 89 85 ldd r24, Y+9 ; 0x09 32eac: 9a 85 ldd r25, Y+10 ; 0x0a 32eae: ed 81 ldd r30, Y+5 ; 0x05 32eb0: fe 81 ldd r31, Y+6 ; 0x06 32eb2: 8e 0f add r24, r30 32eb4: 9f 1f adc r25, r31 32eb6: 88 0f add r24, r24 32eb8: 99 1f adc r25, r25 32eba: 88 0f add r24, r24 32ebc: 99 1f adc r25, r25 32ebe: 80 56 subi r24, 0x60 ; 96 32ec0: 9c 4e sbci r25, 0xEC ; 236 32ec2: fc 01 movw r30, r24 32ec4: 21 81 ldd r18, Z+1 ; 0x01 32ec6: 32 81 ldd r19, Z+2 ; 0x02 32ec8: 43 81 ldd r20, Z+3 ; 0x03 32eca: 54 81 ldd r21, Z+4 ; 0x04 32ecc: c7 01 movw r24, r14 32ece: b6 01 movw r22, r12 32ed0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32ed4: 9b 01 movw r18, r22 32ed6: ac 01 movw r20, r24 32ed8: c3 01 movw r24, r6 32eda: b2 01 movw r22, r4 32edc: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> return (1.f-t) * z0 + t * z1; 32ee0: 29 81 ldd r18, Y+1 ; 0x01 32ee2: 3a 81 ldd r19, Y+2 ; 0x02 32ee4: 4b 81 ldd r20, Y+3 ; 0x03 32ee6: 5c 81 ldd r21, Y+4 ; 0x04 32ee8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 32eec: 9b 01 movw r18, r22 32eee: ac 01 movw r20, r24 32ef0: c5 01 movw r24, r10 32ef2: b4 01 movw r22, r8 32ef4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> } 32ef8: 2a 96 adiw r28, 0x0a ; 10 32efa: 0f b6 in r0, 0x3f ; 63 32efc: f8 94 cli 32efe: de bf out 0x3e, r29 ; 62 32f00: 0f be out 0x3f, r0 ; 63 32f02: cd bf out 0x3d, r28 ; 61 32f04: df 91 pop r29 32f06: cf 91 pop r28 32f08: 1f 91 pop r17 32f0a: 0f 91 pop r16 32f0c: ff 90 pop r15 32f0e: ef 90 pop r14 32f10: df 90 pop r13 32f12: cf 90 pop r12 32f14: bf 90 pop r11 32f16: af 90 pop r10 32f18: 9f 90 pop r9 32f1a: 8f 90 pop r8 32f1c: 7f 90 pop r7 32f1e: 6f 90 pop r6 32f20: 5f 90 pop r5 32f22: 4f 90 pop r4 32f24: 3f 90 pop r3 32f26: 2f 90 pop r2 32f28: 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; 32f2a: 1a 86 std Y+10, r1 ; 0x0a 32f2c: 19 86 std Y+9, r1 ; 0x09 32f2e: 45 cf rjmp .-374 ; 0x32dba 00032f30 : 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) { 32f30: 1f 93 push r17 32f32: cf 93 push r28 32f34: df 93 push r29 32f36: 00 d0 rcall .+0 ; 0x32f38 32f38: 1f 92 push r1 32f3a: 1f 92 push r1 32f3c: cd b7 in r28, 0x3d ; 61 32f3e: de b7 in r29, 0x3e ; 62 32f40: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 32f42: 48 2f mov r20, r24 32f44: 62 e5 ldi r22, 0x52 ; 82 32f46: ce 01 movw r24, r28 32f48: 01 96 adiw r24, 0x01 ; 1 32f4a: 0f 94 0c c3 call 0x38618 ; 0x38618 32f4e: 49 81 ldd r20, Y+1 ; 0x01 32f50: 5a 81 ldd r21, Y+2 ; 0x02 32f52: 6b 81 ldd r22, Y+3 ; 0x03 32f54: 7c 81 ldd r23, Y+4 ; 0x04 32f56: 8d 81 ldd r24, Y+5 ; 0x05 32f58: 0f 94 99 71 call 0x2e332 ; 0x2e332 scopeState = nextState; 32f5c: 10 93 2c 13 sts 0x132C, r17 ; 0x80132c } 32f60: 0f 90 pop r0 32f62: 0f 90 pop r0 32f64: 0f 90 pop r0 32f66: 0f 90 pop r0 32f68: 0f 90 pop r0 32f6a: df 91 pop r29 32f6c: cf 91 pop r28 32f6e: 1f 91 pop r17 32f70: 08 95 ret 00032f72 : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 32f72: 10 92 77 13 sts 0x1377, r1 ; 0x801377 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 32f76: e0 e9 ldi r30, 0x90 ; 144 32f78: f9 ea ldi r31, 0xA9 ; 169 32f7a: 84 91 lpm r24, Z 32f7c: 67 e0 ldi r22, 0x07 ; 7 32f7e: 0d 94 98 97 jmp 0x32f30 ; 0x32f30 00032f82 : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 32f82: e0 91 77 13 lds r30, 0x1377 ; 0x801377 32f86: ae 2f mov r26, r30 32f88: b0 e0 ldi r27, 0x00 ; 0 32f8a: aa 0f add r26, r26 32f8c: bb 1f adc r27, r27 32f8e: af 58 subi r26, 0x8F ; 143 32f90: bc 4e sbci r27, 0xEC ; 236 32f92: 20 91 44 13 lds r18, 0x1344 ; 0x801344 32f96: 30 91 45 13 lds r19, 0x1345 ; 0x801345 32f9a: 2d 93 st X+, r18 32f9c: 3c 93 st X, r19 ++regIndex; 32f9e: ef 5f subi r30, 0xFF ; 255 32fa0: e0 93 77 13 sts 0x1377, r30 ; 0x801377 if (regIndex >= regs16Count) { 32fa4: e2 30 cpi r30, 0x02 ; 2 32fa6: 40 f4 brcc .+16 ; 0x32fb8 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32fa8: f0 e0 ldi r31, 0x00 ; 0 32faa: e9 58 subi r30, 0x89 ; 137 32fac: f6 45 sbci r31, 0x56 ; 86 32fae: 84 91 lpm r24, Z 32fb0: 68 e0 ldi r22, 0x08 ; 8 32fb2: 0f 94 98 97 call 0x32f30 ; 0x32f30 } return ScopeState::Reading16bitRegisters; 32fb6: 88 e0 ldi r24, 0x08 ; 8 } 32fb8: 08 95 ret 00032fba : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 32fba: e0 91 77 13 lds r30, 0x1377 ; 0x801377 32fbe: ae 2f mov r26, r30 32fc0: b0 e0 ldi r27, 0x00 ; 0 32fc2: a2 59 subi r26, 0x92 ; 146 32fc4: bc 4e sbci r27, 0xEC ; 236 32fc6: 80 91 44 13 lds r24, 0x1344 ; 0x801344 32fca: 8c 93 st X, r24 ++regIndex; 32fcc: ef 5f subi r30, 0xFF ; 255 32fce: e0 93 77 13 sts 0x1377, r30 ; 0x801377 if (regIndex >= regs8Count) { 32fd2: e3 30 cpi r30, 0x03 ; 3 32fd4: 40 f0 brcs .+16 ; 0x32fe6 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 32fd6: 10 92 77 13 sts 0x1377, r1 ; 0x801377 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32fda: e7 e7 ldi r30, 0x77 ; 119 32fdc: f9 ea ldi r31, 0xA9 ; 169 32fde: 84 91 lpm r24, Z 32fe0: 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); 32fe2: 0d 94 98 97 jmp 0x32f30 ; 0x32f30 32fe6: f0 e0 ldi r31, 0x00 ; 0 32fe8: e0 57 subi r30, 0x70 ; 112 32fea: f6 45 sbci r31, 0x56 ; 86 32fec: 84 91 lpm r24, Z 32fee: 67 e0 ldi r22, 0x07 ; 7 32ff0: f8 cf rjmp .-16 ; 0x32fe2 00032ff2 : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 32ff2: cf 93 push r28 32ff4: df 93 push r29 32ff6: 00 d0 rcall .+0 ; 0x32ff8 32ff8: 00 d0 rcall .+0 ; 0x32ffa 32ffa: 00 d0 rcall .+0 ; 0x32ffc 32ffc: 1f 92 push r1 32ffe: cd b7 in r28, 0x3d ; 61 33000: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 33002: 80 91 33 13 lds r24, 0x1333 ; 0x801333 33006: 82 34 cpi r24, 0x42 ; 66 33008: 09 f4 brne .+2 ; 0x3300c 3300a: 46 c0 rjmp .+140 ; 0x33098 3300c: b8 f5 brcc .+110 ; 0x3307c 3300e: 88 23 and r24, r24 33010: 09 f4 brne .+2 ; 0x33014 33012: 72 c0 rjmp .+228 ; 0x330f8 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 33014: 84 e0 ldi r24, 0x04 ; 4 33016: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b 3301a: 85 e0 ldi r24, 0x05 ; 5 3301c: e3 e3 ldi r30, 0x33 ; 51 3301e: f3 e1 ldi r31, 0x13 ; 19 33020: de 01 movw r26, r28 33022: 16 96 adiw r26, 0x06 ; 6 33024: 01 90 ld r0, Z+ 33026: 0d 92 st X+, r0 33028: 8a 95 dec r24 3302a: e1 f7 brne .-8 ; 0x33024 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 3302c: 85 e0 ldi r24, 0x05 ; 5 3302e: fe 01 movw r30, r28 33030: 36 96 adiw r30, 0x06 ; 6 33032: ae e2 ldi r26, 0x2E ; 46 33034: b3 e1 ldi r27, 0x13 ; 19 33036: 01 90 ld r0, Z+ 33038: 0d 92 st X+, r0 3303a: 8a 95 dec r24 3303c: e1 f7 brne .-8 ; 0x33036 SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 3303e: 40 e0 ldi r20, 0x00 ; 0 33040: 60 e0 ldi r22, 0x00 ; 0 33042: ce 01 movw r24, r28 33044: 01 96 adiw r24, 0x01 ; 1 33046: 0f 94 0c c3 call 0x38618 ; 0x38618 3304a: 85 e0 ldi r24, 0x05 ; 5 3304c: fe 01 movw r30, r28 3304e: 31 96 adiw r30, 0x01 ; 1 33050: a3 e3 ldi r26, 0x33 ; 51 33052: b3 e1 ldi r27, 0x13 ; 19 33054: 01 90 ld r0, Z+ 33056: 0d 92 st X+, r0 33058: 8a 95 dec r24 3305a: e1 f7 brne .-8 ; 0x33054 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3305c: 85 e0 ldi r24, 0x05 ; 5 3305e: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c SendMsg(rq); 33062: 40 91 2e 13 lds r20, 0x132E ; 0x80132e 33066: 50 91 2f 13 lds r21, 0x132F ; 0x80132f 3306a: 60 91 30 13 lds r22, 0x1330 ; 0x801330 3306e: 70 91 31 13 lds r23, 0x1331 ; 0x801331 33072: 80 91 32 13 lds r24, 0x1332 ; 0x801332 33076: 0f 94 99 71 call 0x2e332 ; 0x2e332 3307a: 2e c0 rjmp .+92 ; 0x330d8 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 3307c: 82 35 cpi r24, 0x52 ; 82 3307e: b1 f1 breq .+108 ; 0x330ec 33080: 87 35 cpi r24, 0x57 ; 87 33082: 41 f6 brne .-112 ; 0x33014 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); 33084: 60 91 35 13 lds r22, 0x1335 ; 0x801335 33088: 70 91 36 13 lds r23, 0x1336 ; 0x801336 3308c: 4c e0 ldi r20, 0x0C ; 12 3308e: 80 91 34 13 lds r24, 0x1334 ; 0x801334 33092: 0f 94 04 72 call 0x2e408 ; 0x2e408 33096: 11 c0 rjmp .+34 ; 0x330ba SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 33098: 40 91 34 13 lds r20, 0x1334 ; 0x801334 3309c: 62 e4 ldi r22, 0x42 ; 66 3309e: ce 01 movw r24, r28 330a0: 01 96 adiw r24, 0x01 ; 1 330a2: 0f 94 0c c3 call 0x38618 ; 0x38618 330a6: 49 81 ldd r20, Y+1 ; 0x01 330a8: 5a 81 ldd r21, Y+2 ; 0x02 330aa: 6b 81 ldd r22, Y+3 ; 0x03 330ac: 7c 81 ldd r23, Y+4 ; 0x04 330ae: 8d 81 ldd r24, Y+5 ; 0x05 330b0: 0f 94 99 71 call 0x2e332 ; 0x2e332 scopeState = ScopeState::ButtonSent; 330b4: 8a e0 ldi r24, 0x0A ; 10 330b6: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c SendReadRegister(plannedRq.value, ScopeState::ReadRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 330ba: 40 e0 ldi r20, 0x00 ; 0 330bc: 60 e0 ldi r22, 0x00 ; 0 330be: ce 01 movw r24, r28 330c0: 01 96 adiw r24, 0x01 ; 1 330c2: 0f 94 0c c3 call 0x38618 ; 0x38618 330c6: 85 e0 ldi r24, 0x05 ; 5 330c8: fe 01 movw r30, r28 330ca: 31 96 adiw r30, 0x01 ; 1 330cc: a3 e3 ldi r26, 0x33 ; 51 330ce: b3 e1 ldi r27, 0x13 ; 19 330d0: 01 90 ld r0, Z+ 330d2: 0d 92 st X+, r0 330d4: 8a 95 dec r24 330d6: e1 f7 brne .-8 ; 0x330d0 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 330d8: 81 e0 ldi r24, 0x01 ; 1 } } 330da: 2a 96 adiw r28, 0x0a ; 10 330dc: 0f b6 in r0, 0x3f ; 63 330de: f8 94 cli 330e0: de bf out 0x3e, r29 ; 62 330e2: 0f be out 0x3f, r0 ; 63 330e4: cd bf out 0x3d, r28 ; 61 330e6: df 91 pop r29 330e8: cf 91 pop r28 330ea: 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); 330ec: 6b e0 ldi r22, 0x0B ; 11 330ee: 80 91 34 13 lds r24, 0x1334 ; 0x801334 330f2: 0f 94 98 97 call 0x32f30 ; 0x32f30 330f6: e1 cf rjmp .-62 ; 0x330ba case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 330f8: 80 e0 ldi r24, 0x00 ; 0 330fa: ef cf rjmp .-34 ; 0x330da 000330fc : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 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 3310a: 49 83 std Y+1, r20 ; 0x01 3310c: 5a 83 std Y+2, r21 ; 0x02 3310e: 6b 83 std Y+3, r22 ; 0x03 33110: 7c 83 std Y+4, r23 ; 0x04 33112: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 33114: 85 e0 ldi r24, 0x05 ; 5 33116: fe 01 movw r30, r28 33118: 31 96 adiw r30, 0x01 ; 1 3311a: a3 e3 ldi r26, 0x33 ; 51 3311c: b3 e1 ldi r27, 0x13 ; 19 3311e: 01 90 ld r0, Z+ 33120: 0d 92 st X+, r0 33122: 8a 95 dec r24 33124: e1 f7 brne .-8 ; 0x3311e if (!ExpectsResponse()) { 33126: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 3312a: 87 ff sbrs r24, 7 3312c: 09 c0 rjmp .+18 ; 0x33140 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 3312e: 0f 90 pop r0 33130: 0f 90 pop r0 33132: 0f 90 pop r0 33134: 0f 90 pop r0 33136: 0f 90 pop r0 33138: df 91 pop r29 3313a: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 3313c: 0d 94 f9 97 jmp 0x32ff2 ; 0x32ff2 } // otherwise wait for an empty window to activate the request } 33140: 0f 90 pop r0 33142: 0f 90 pop r0 33144: 0f 90 pop r0 33146: 0f 90 pop r0 33148: 0f 90 pop r0 3314a: df 91 pop r29 3314c: cf 91 pop r28 3314e: 08 95 ret 00033150 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 33150: 1f 93 push r17 33152: cf 93 push r28 33154: df 93 push r29 33156: 00 d0 rcall .+0 ; 0x33158 33158: 1f 92 push r1 3315a: 1f 92 push r1 3315c: cd b7 in r28, 0x3d ; 61 3315e: de b7 in r29, 0x3e ; 62 33160: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 33162: 48 2f mov r20, r24 33164: 63 e5 ldi r22, 0x53 ; 83 33166: ce 01 movw r24, r28 33168: 01 96 adiw r24, 0x01 ; 1 3316a: 0f 94 0c c3 call 0x38618 ; 0x38618 3316e: 49 81 ldd r20, Y+1 ; 0x01 33170: 5a 81 ldd r21, Y+2 ; 0x02 33172: 6b 81 ldd r22, Y+3 ; 0x03 33174: 7c 81 ldd r23, Y+4 ; 0x04 33176: 8d 81 ldd r24, Y+5 ; 0x05 33178: 0f 94 99 71 call 0x2e332 ; 0x2e332 scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 3317c: 10 93 2c 13 sts 0x132C, r17 ; 0x80132c } 33180: 0f 90 pop r0 33182: 0f 90 pop r0 33184: 0f 90 pop r0 33186: 0f 90 pop r0 33188: 0f 90 pop r0 3318a: df 91 pop r29 3318c: cf 91 pop r28 3318e: 1f 91 pop r17 33190: 08 95 ret 00033192 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 33192: cf 93 push r28 33194: df 93 push r29 33196: 00 d0 rcall .+0 ; 0x33198 33198: 1f 92 push r1 3319a: 1f 92 push r1 3319c: cd b7 in r28, 0x3d ; 61 3319e: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 331a0: 40 e0 ldi r20, 0x00 ; 0 331a2: 61 e5 ldi r22, 0x51 ; 81 331a4: ce 01 movw r24, r28 331a6: 01 96 adiw r24, 0x01 ; 1 331a8: 0f 94 0c c3 call 0x38618 ; 0x38618 331ac: 49 81 ldd r20, Y+1 ; 0x01 331ae: 5a 81 ldd r21, Y+2 ; 0x02 331b0: 6b 81 ldd r22, Y+3 ; 0x03 331b2: 7c 81 ldd r23, Y+4 ; 0x04 331b4: 8d 81 ldd r24, Y+5 ; 0x05 331b6: 0f 94 99 71 call 0x2e332 ; 0x2e332 scopeState = ScopeState::QuerySent; 331ba: 84 e0 ldi r24, 0x04 ; 4 331bc: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c } 331c0: 0f 90 pop r0 331c2: 0f 90 pop r0 331c4: 0f 90 pop r0 331c6: 0f 90 pop r0 331c8: 0f 90 pop r0 331ca: df 91 pop r29 331cc: cf 91 pop r28 331ce: 08 95 ret 000331d0 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 331d0: cf 93 push r28 331d2: df 93 push r29 331d4: 00 d0 rcall .+0 ; 0x331d6 331d6: 1f 92 push r1 331d8: 1f 92 push r1 331da: cd b7 in r28, 0x3d ; 61 331dc: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 331de: 0f 94 64 c3 call 0x386c8 ; 0x386c8 331e2: 80 93 6d 13 sts 0x136D, r24 ; 0x80136d 331e6: 48 2f mov r20, r24 331e8: 66 e6 ldi r22, 0x66 ; 102 331ea: ce 01 movw r24, r28 331ec: 01 96 adiw r24, 0x01 ; 1 331ee: 0f 94 0c c3 call 0x38618 ; 0x38618 331f2: 49 81 ldd r20, Y+1 ; 0x01 331f4: 5a 81 ldd r21, Y+2 ; 0x02 331f6: 6b 81 ldd r22, Y+3 ; 0x03 331f8: 7c 81 ldd r23, Y+4 ; 0x04 331fa: 8d 81 ldd r24, Y+5 ; 0x05 331fc: 0f 94 99 71 call 0x2e332 ; 0x2e332 scopeState = ScopeState::FilamentSensorStateSent; 33200: 86 e0 ldi r24, 0x06 ; 6 33202: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c } 33206: 0f 90 pop r0 33208: 0f 90 pop r0 3320a: 0f 90 pop r0 3320c: 0f 90 pop r0 3320e: 0f 90 pop r0 33210: df 91 pop r29 33212: cf 91 pop r28 33214: 08 95 ret 00033216 : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 33216: cf 93 push r28 33218: df 93 push r29 3321a: 00 d0 rcall .+0 ; 0x3321c 3321c: 1f 92 push r1 3321e: 1f 92 push r1 33220: cd b7 in r28, 0x3d ; 61 33222: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 33224: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33228: 85 34 cpi r24, 0x45 ; 69 3322a: f1 f0 breq .+60 ; 0x33268 3322c: 20 f4 brcc .+8 ; 0x33236 3322e: 82 34 cpi r24, 0x42 ; 66 33230: 51 f1 breq .+84 ; 0x33286 } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 33232: 85 e0 ldi r24, 0x05 ; 5 33234: 11 c0 rjmp .+34 ; 0x33258 } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 33236: 86 34 cpi r24, 0x46 ; 70 33238: 71 f1 breq .+92 ; 0x33296 3323a: 80 35 cpi r24, 0x50 ; 80 3323c: d1 f7 brne .-12 ; 0x33232 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 3323e: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33242: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = ErrorCode::OK; 33246: 81 e0 ldi r24, 0x01 ; 1 33248: 90 e0 ldi r25, 0x00 ; 0 3324a: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 3324e: 80 93 69 13 sts 0x1369, r24 ; 0x801369 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 33252: 0f 94 e8 98 call 0x331d0 ; 0x331d0 return Processing; 33256: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 33258: 0f 90 pop r0 3325a: 0f 90 pop r0 3325c: 0f 90 pop r0 3325e: 0f 90 pop r0 33260: 0f 90 pop r0 33262: df 91 pop r29 33264: cf 91 pop r28 33266: 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; 33268: 8c e0 ldi r24, 0x0C ; 12 3326a: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = static_cast(rsp.paramValue); 3326e: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33272: 90 91 45 13 lds r25, 0x1345 ; 0x801345 33276: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 3327a: 80 93 69 13 sts 0x1369, r24 ; 0x801369 // keep on reporting the state of fsensor regularly even in command error state // - the MMU checks FINDA and fsensor even while recovering from errors SendAndUpdateFilamentSensor(); 3327e: 0f 94 e8 98 call 0x331d0 ; 0x331d0 return CommandError; 33282: 87 e0 ldi r24, 0x07 ; 7 33284: e9 cf rjmp .-46 ; 0x33258 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); 33286: 80 91 44 13 lds r24, 0x1344 ; 0x801344 3328a: 80 93 6c 13 sts 0x136C, r24 ; 0x80136c SendAndUpdateFilamentSensor(); 3328e: 0f 94 e8 98 call 0x331d0 ; 0x331d0 return ButtonPushed; 33292: 8b e0 ldi r24, 0x0B ; 11 33294: e1 cf rjmp .-62 ; 0x33258 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) { 33296: 90 91 2e 13 lds r25, 0x132E ; 0x80132e 3329a: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 3329e: 98 13 cpse r25, r24 332a0: 22 c0 rjmp .+68 ; 0x332e6 332a2: 90 91 2f 13 lds r25, 0x132F ; 0x80132f 332a6: 80 91 3f 13 lds r24, 0x133F ; 0x80133f 332aa: 98 13 cpse r25, r24 332ac: 1c c0 rjmp .+56 ; 0x332e6 progressCode = ProgressCode::OK; 332ae: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b errorCode = ErrorCode::OK; 332b2: 81 e0 ldi r24, 0x01 ; 1 332b4: 90 e0 ldi r25, 0x00 ; 0 332b6: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 332ba: 80 93 69 13 sts 0x1369, r24 ; 0x801369 scopeState = ScopeState::Ready; 332be: 82 e8 ldi r24, 0x82 ; 130 332c0: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 332c4: 40 e0 ldi r20, 0x00 ; 0 332c6: 60 e0 ldi r22, 0x00 ; 0 332c8: ce 01 movw r24, r28 332ca: 01 96 adiw r24, 0x01 ; 1 332cc: 0f 94 0c c3 call 0x38618 ; 0x38618 332d0: 85 e0 ldi r24, 0x05 ; 5 332d2: fe 01 movw r30, r28 332d4: 31 96 adiw r30, 0x01 ; 1 332d6: ae e2 ldi r26, 0x2E ; 46 332d8: b3 e1 ldi r27, 0x13 ; 19 332da: 01 90 ld r0, Z+ 332dc: 0d 92 st X+, r0 332de: 8a 95 dec r24 332e0: e1 f7 brne .-8 ; 0x332da 332e2: 82 e0 ldi r24, 0x02 ; 2 332e4: b9 cf rjmp .-142 ; 0x33258 return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 332e6: 83 e0 ldi r24, 0x03 ; 3 332e8: b7 cf rjmp .-146 ; 0x33258 000332ea : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 332ea: 1f 93 push r17 332ec: cf 93 push r28 332ee: df 93 push r29 332f0: 00 d0 rcall .+0 ; 0x332f2 332f2: 1f 92 push r1 332f4: 1f 92 push r1 332f6: cd b7 in r28, 0x3d ; 61 332f8: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 332fa: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 332fe: 81 11 cpse r24, r1 33300: 2a c0 rjmp .+84 ; 0x33356 auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 33302: 10 91 93 13 lds r17, 0x1393 ; 0x801393 33306: 1f 3f cpi r17, 0xFF ; 255 33308: 91 f5 brne .+100 ; 0x3336e btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 3330a: 80 91 92 13 lds r24, 0x1392 ; 0x801392 3330e: 81 11 cpse r24, r1 33310: 60 c0 rjmp .+192 ; 0x333d2 33312: 1f 3f cpi r17, 0xFF ; 255 33314: b9 f0 breq .+46 ; 0x33344 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 33316: 81 e0 ldi r24, 0x01 ; 1 33318: 90 e0 ldi r25, 0x00 ; 0 3331a: 90 93 2a 13 sts 0x132A, r25 ; 0x80132a 3331e: 80 93 29 13 sts 0x1329, r24 ; 0x801329 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 33322: 90 93 91 13 sts 0x1391, r25 ; 0x801391 33326: 80 93 90 13 sts 0x1390, r24 ; 0x801390 lastErrorSource = ErrorSource::ErrorSourceNone; 3332a: 8f ef ldi r24, 0xFF ; 255 3332c: 80 93 92 13 sts 0x1392, r24 ; 0x801392 // Moreover - if the MMU is currently doing something (like the LoadFilament - see comment above) // we'll actually wait for it automagically in manage_response and after it finishes correctly, // we'll issue another command (like toolchange) } switch (btn) { 33330: 13 30 cpi r17, 0x03 ; 3 33332: 09 f4 brne .+2 ; 0x33336 33334: 82 c0 rjmp .+260 ; 0x3343a 33336: f8 f0 brcs .+62 ; 0x33376 33338: 16 30 cpi r17, 0x06 ; 6 3333a: 08 f4 brcc .+2 ; 0x3333e 3333c: 7b c0 rjmp .+246 ; 0x33434 3333e: 17 30 cpi r17, 0x07 ; 7 33340: 09 f4 brne .+2 ; 0x33344 33342: 7e c0 rjmp .+252 ; 0x33440 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 33344: 0f 90 pop r0 33346: 0f 90 pop r0 33348: 0f 90 pop r0 3334a: 0f 90 pop r0 3334c: 0f 90 pop r0 3334e: df 91 pop r29 33350: cf 91 pop r28 33352: 1f 91 pop r17 33354: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 33356: 80 91 90 13 lds r24, 0x1390 ; 0x801390 3335a: 90 91 91 13 lds r25, 0x1391 ; 0x801391 3335e: 0f 94 f1 c5 call 0x38be2 ; 0x38be2 33362: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 33364: 10 92 5f 0e sts 0x0E5F, r1 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> void MMU2::CheckUserInput() { auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 33368: 8f 3f cpi r24, 0xFF ; 255 3336a: 79 f6 brne .-98 ; 0x3330a 3336c: ca cf rjmp .-108 ; 0x33302 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 3336e: 8f ef ldi r24, 0xFF ; 255 33370: 80 93 93 13 sts 0x1393, r24 ; 0x801393 33374: ca cf rjmp .-108 ; 0x3330a switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 33376: 8c e0 ldi r24, 0x0C ; 12 33378: 98 ea ldi r25, 0xA8 ; 168 3337a: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 3337e: 81 2f mov r24, r17 33380: 90 e0 ldi r25, 0x00 ; 0 33382: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 33386: 0f 94 40 9f call 0x33e80 ; 0x33e80 if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 3338a: 80 91 92 13 lds r24, 0x1392 ; 0x801392 3338e: 81 30 cpi r24, 0x01 ; 1 33390: 89 f4 brne .+34 ; 0x333b4 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 33392: 85 e0 ldi r24, 0x05 ; 5 33394: 98 ea ldi r25, 0xA8 ; 168 33396: 0f 94 54 c3 call 0x386a8 ; 0x386a8 void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 3339a: 41 2f mov r20, r17 3339c: 62 e4 ldi r22, 0x42 ; 66 3339e: ce 01 movw r24, r28 333a0: 01 96 adiw r24, 0x01 ; 1 333a2: 0f 94 0c c3 call 0x38618 ; 0x38618 333a6: 49 81 ldd r20, Y+1 ; 0x01 333a8: 5a 81 ldd r21, Y+2 ; 0x02 333aa: 6b 81 ldd r22, Y+3 ; 0x03 333ac: 7c 81 ldd r23, Y+4 ; 0x04 333ae: 8d 81 ldd r24, Y+5 ; 0x05 333b0: 0f 94 7e 98 call 0x330fc ; 0x330fc } // 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) { 333b4: 80 91 90 13 lds r24, 0x1390 ; 0x801390 333b8: 90 91 91 13 lds r25, 0x1391 ; 0x801391 333bc: 84 30 cpi r24, 0x04 ; 4 333be: 20 e8 ldi r18, 0x80 ; 128 333c0: 92 07 cpc r25, r18 333c2: 21 f0 breq .+8 ; 0x333cc 333c4: 89 30 cpi r24, 0x09 ; 9 333c6: 90 48 sbci r25, 0x80 ; 128 333c8: 09 f0 breq .+2 ; 0x333cc 333ca: bc cf rjmp .-136 ; 0x33344 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 333cc: 0f 94 2c 74 call 0x2e858 ; 0x2e858 333d0: b9 cf rjmp .-142 ; 0x33344 // 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) { 333d2: 19 30 cpi r17, 0x09 ; 9 333d4: 08 f0 brcs .+2 ; 0x333d8 333d6: b6 cf rjmp .-148 ; 0x33344 333d8: e1 2f mov r30, r17 333da: f0 e0 ldi r31, 0x00 ; 0 333dc: 88 27 eor r24, r24 333de: ec 50 subi r30, 0x0C ; 12 333e0: f6 46 sbci r31, 0x66 ; 102 333e2: 8e 4f sbci r24, 0xFE ; 254 333e4: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 333e8: 32 3a cpi r19, 0xA2 ; 162 333ea: 32 3a cpi r19, 0xA2 ; 162 333ec: 32 3a cpi r19, 0xA2 ; 162 333ee: 52 3a cpi r21, 0xA2 ; 162 333f0: 24 3a cpi r18, 0xA4 ; 164 333f2: 24 3a cpi r18, 0xA4 ; 164 333f4: 16 3a cpi r17, 0xA6 ; 166 333f6: a4 39 cpi r26, 0x94 ; 148 333f8: 68 39 cpi r22, 0x98 ; 152 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 333fa: 80 91 90 13 lds r24, 0x1390 ; 0x801390 333fe: 90 91 91 13 lds r25, 0x1391 ; 0x801391 33402: 87 38 cpi r24, 0x87 ; 135 33404: 20 e8 ldi r18, 0x80 ; 128 33406: 92 07 cpc r25, r18 33408: 21 f0 breq .+8 ; 0x33412 3340a: 87 30 cpi r24, 0x07 ; 7 3340c: 91 48 sbci r25, 0x81 ; 129 3340e: 09 f0 breq .+2 ; 0x33412 33410: 99 cf rjmp .-206 ; 0x33344 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33412: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33416: 84 30 cpi r24, 0x04 ; 4 33418: 21 f4 brne .+8 ; 0x33422 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 3341a: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 3341e: 81 11 cpse r24, r1 33420: 91 cf rjmp .-222 ; 0x33344 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 33422: 81 e0 ldi r24, 0x01 ; 1 33424: 80 93 5e 0e sts 0x0E5E, r24 ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> menu_submenu(tuneIdlerStallguardThresholdMenu); 33428: 60 e0 ldi r22, 0x00 ; 0 3342a: 8c e5 ldi r24, 0x5C ; 92 3342c: 99 e3 ldi r25, 0x39 ; 57 3342e: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa 33432: 88 cf rjmp .-240 ; 0x33344 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 33434: 10 93 96 13 sts 0x1396, r17 ; 0x801396 33438: 85 cf rjmp .-246 ; 0x33344 void MMU2::ResetX42() { logic.ResetMMU(42); } void MMU2::TriggerResetPin() { reset(); 3343a: 0f 94 19 c3 call 0x38632 ; 0x38632 3343e: 82 cf rjmp .-252 ; 0x33344 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 33440: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33444: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 33448: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b 3344c: 60 e0 ldi r22, 0x00 ; 0 3344e: 8c ea ldi r24, 0xAC ; 172 33450: 9c e0 ldi r25, 0x0C ; 12 33452: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 33456: 0f 94 07 77 call 0x2ee0e ; 0x2ee0e 3345a: 74 cf rjmp .-280 ; 0x33344 0003345c : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 3345c: 4f 92 push r4 3345e: 5f 92 push r5 33460: 6f 92 push r6 33462: 7f 92 push r7 33464: 8f 92 push r8 33466: 9f 92 push r9 33468: af 92 push r10 3346a: bf 92 push r11 3346c: cf 92 push r12 3346e: df 92 push r13 33470: ef 92 push r14 33472: ff 92 push r15 33474: 0f 93 push r16 33476: 1f 93 push r17 33478: cf 93 push r28 3347a: df 93 push r29 3347c: cd b7 in r28, 0x3d ; 61 3347e: de b7 in r29, 0x3e ; 62 33480: a0 97 sbiw r28, 0x20 ; 32 33482: 0f b6 in r0, 0x3f ; 63 33484: f8 94 cli 33486: de bf out 0x3e, r29 ; 62 33488: 0f be out 0x3f, r0 ; 63 3348a: cd bf out 0x3d, r28 ; 61 3348c: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 3348e: 0f 94 75 99 call 0x332ea ; 0x332ea DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 33492: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33496: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 33498: 0f 94 f9 97 call 0x32ff2 ; 0x32ff2 3349c: 90 91 2c 13 lds r25, 0x132C ; 0x80132c } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 334a0: 97 ff sbrs r25, 7 334a2: 7d c0 rjmp .+250 ; 0x3359e // we are waiting for something switch (currentScope) { 334a4: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 334a8: 82 30 cpi r24, 0x02 ; 2 334aa: b1 f0 breq .+44 ; 0x334d8 334ac: 08 f4 brcc .+2 ; 0x334b0 334ae: 75 c0 rjmp .+234 ; 0x3359a 334b0: 83 30 cpi r24, 0x03 ; 3 334b2: e1 f1 breq .+120 ; 0x3352c 334b4: 84 30 cpi r24, 0x04 ; 4 334b6: 09 f4 brne .+2 ; 0x334ba 334b8: 54 c0 rjmp .+168 ; 0x33562 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 334ba: 0f 94 f9 97 call 0x32ff2 ; 0x32ff2 334be: 81 11 cpse r24, r1 334c0: 6b c3 rjmp .+1750 ; 0x33b98 // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 334c2: 82 e0 ldi r24, 0x02 ; 2 334c4: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::Idle; 334c8: 83 e0 ldi r24, 0x03 ; 3 334ca: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 334ce: 82 e8 ldi r24, 0x82 ; 130 334d0: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c // We are ok, switching to Idle if there is no potential next request planned. // But the trouble is we must report a finished command if the previous command has just been finished // i.e. only try to find some planned command if we just finished the Idle cycle if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle SwitchToIdle(); } else if (ExpectsResponse()) { 334d4: 12 e0 ldi r17, 0x02 ; 2 334d6: db c2 rjmp .+1462 ; 0x33a8e IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 334d8: 0f 94 8b 3f call 0x27f16 ; 0x27f16 334dc: ab 01 movw r20, r22 334de: bc 01 movw r22, r24 334e0: 80 91 38 13 lds r24, 0x1338 ; 0x801338 334e4: 90 91 39 13 lds r25, 0x1339 ; 0x801339 334e8: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 334ec: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 334f0: 88 51 subi r24, 0x18 ; 24 334f2: 9c 4f sbci r25, 0xFC ; 252 334f4: af 4f sbci r26, 0xFF ; 255 334f6: 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 334f8: 48 17 cp r20, r24 334fa: 59 07 cpc r21, r25 334fc: 6a 07 cpc r22, r26 334fe: 7b 07 cpc r23, r27 33500: 08 f4 brcc .+2 ; 0x33504 33502: 4b c0 rjmp .+150 ; 0x3359a void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 33504: 82 e7 ldi r24, 0x72 ; 114 33506: 92 e1 ldi r25, 0x12 ; 18 33508: 0f 94 bd db call 0x3b77a ; 0x3b77a while (uart->read() != -1) 3350c: 01 96 adiw r24, 0x01 ; 1 3350e: d1 f7 brne .-12 ; 0x33504 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 33510: 81 e0 ldi r24, 0x01 ; 1 33512: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::StartSeq; 33516: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 3351a: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 3351e: 86 e0 ldi r24, 0x06 ; 6 33520: 80 93 2d 13 sts 0x132D, r24 ; 0x80132d SendVersion(0); 33524: 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); 33526: 0f 94 a8 98 call 0x33150 ; 0x33150 3352a: 37 c0 rjmp .+110 ; 0x3359a } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 3352c: 92 38 cpi r25, 0x82 ; 130 3352e: 29 f6 brne .-118 ; 0x334ba IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33530: 0f 94 8b 3f call 0x27f16 ; 0x27f16 33534: ab 01 movw r20, r22 33536: bc 01 movw r22, r24 33538: 80 91 38 13 lds r24, 0x1338 ; 0x801338 3353c: 90 91 39 13 lds r25, 0x1339 ; 0x801339 33540: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 33544: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 33548: 88 51 subi r24, 0x18 ; 24 3354a: 9c 4f sbci r25, 0xFC ; 252 3354c: af 4f sbci r26, 0xFF ; 255 3354e: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 33550: 48 17 cp r20, r24 33552: 59 07 cpc r21, r25 33554: 6a 07 cpc r22, r26 33556: 7b 07 cpc r23, r27 33558: 08 f4 brcc .+2 ; 0x3355c 3355a: af cf rjmp .-162 ; 0x334ba void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 3355c: 0f 94 c9 98 call 0x33192 ; 0x33192 33560: 1c c0 rjmp .+56 ; 0x3359a } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33562: 0f 94 8b 3f call 0x27f16 ; 0x27f16 33566: ab 01 movw r20, r22 33568: bc 01 movw r22, r24 3356a: 80 91 38 13 lds r24, 0x1338 ; 0x801338 3356e: 90 91 39 13 lds r25, 0x1339 ; 0x801339 33572: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 33576: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 3357a: 88 51 subi r24, 0x18 ; 24 3357c: 9c 4f sbci r25, 0xFC ; 252 3357e: af 4f sbci r26, 0xFF ; 255 33580: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 33582: 48 17 cp r20, r24 33584: 59 07 cpc r21, r25 33586: 6a 07 cpc r22, r26 33588: 7b 07 cpc r23, r27 3358a: 40 f7 brcc .-48 ; 0x3355c }; 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(); 3358c: 0f 94 64 c3 call 0x386c8 ; 0x386c8 if (fs != lastFSensor) { 33590: 90 91 6d 13 lds r25, 0x136D ; 0x80136d 33594: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 33596: 0f 94 e8 98 call 0x331d0 ; 0x331d0 // 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; 3359a: 10 e0 ldi r17, 0x00 ; 0 3359c: 78 c2 rjmp .+1264 ; 0x33a8e StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 3359e: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 335a0: d1 2c mov r13, r1 335a2: 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; 335a4: 99 24 eor r9, r9 335a6: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 335a8: 55 e0 ldi r21, 0x05 ; 5 335aa: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 335ac: 63 e0 ldi r22, 0x03 ; 3 335ae: 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; 335b0: 74 e0 ldi r23, 0x04 ; 4 335b2: 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; 335b4: e2 e0 ldi r30, 0x02 ; 2 335b6: 6e 2e mov r6, r30 335b8: 66 c0 rjmp .+204 ; 0x33686 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 335ba: 23 30 cpi r18, 0x03 ; 3 335bc: 09 f4 brne .+2 ; 0x335c0 335be: e0 c0 rjmp .+448 ; 0x33780 335c0: 24 30 cpi r18, 0x04 ; 4 335c2: 09 f0 breq .+2 ; 0x335c6 335c4: 83 c0 rjmp .+262 ; 0x336cc } 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'); 335c6: 20 ed ldi r18, 0xD0 ; 208 335c8: 28 0f add r18, r24 335ca: 2a 30 cpi r18, 0x0A ; 10 335cc: 08 f4 brcc .+2 ; 0x335d0 335ce: f8 c0 rjmp .+496 ; 0x337c0 335d0: 2f e9 ldi r18, 0x9F ; 159 335d2: 28 0f add r18, r24 335d4: 26 30 cpi r18, 0x06 ; 6 335d6: 08 f4 brcc .+2 ; 0x335da 335d8: f3 c0 rjmp .+486 ; 0x337c0 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 335da: 8a 30 cpi r24, 0x0A ; 10 335dc: 09 f0 breq .+2 ; 0x335e0 335de: fa c0 rjmp .+500 ; 0x337d4 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()) { 335e0: 40 90 52 13 lds r4, 0x1352 ; 0x801352 335e4: 8e e4 ldi r24, 0x4E ; 78 335e6: 93 e1 ldi r25, 0x13 ; 19 335e8: 0f 94 fb c2 call 0x385f6 ; 0x385f6 335ec: 48 12 cpse r4, r24 335ee: b8 c0 rjmp .+368 ; 0x33760 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 335f0: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d /// @returns the most recently lexed request message inline const RequestMsg GetRequestMsg() const { return requestMsg; } /// @returns the most recently lexed response message inline const ResponseMsg GetResponseMsg() const { return responseMsg; } 335f4: 88 e0 ldi r24, 0x08 ; 8 335f6: ee e4 ldi r30, 0x4E ; 78 335f8: f3 e1 ldi r31, 0x13 ; 19 335fa: de 01 movw r26, r28 335fc: 51 96 adiw r26, 0x11 ; 17 335fe: 01 90 ld r0, Z+ 33600: 0d 92 st X+, r0 33602: 8a 95 dec r24 33604: e1 f7 brne .-8 ; 0x335fe 33606: 88 e0 ldi r24, 0x08 ; 8 33608: fe 01 movw r30, r28 3360a: 71 96 adiw r30, 0x11 ; 17 3360c: de 01 movw r26, r28 3360e: 59 96 adiw r26, 0x19 ; 25 33610: 01 90 ld r0, Z+ 33612: 0d 92 st X+, r0 33614: 8a 95 dec r24 33616: e1 f7 brne .-8 ; 0x33610 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 33618: 88 e0 ldi r24, 0x08 ; 8 3361a: fe 01 movw r30, r28 3361c: 79 96 adiw r30, 0x19 ; 25 3361e: ae e3 ldi r26, 0x3E ; 62 33620: b3 e1 ldi r27, 0x13 ; 19 33622: 01 90 ld r0, Z+ 33624: 0d 92 st X+, r0 33626: 8a 95 dec r24 33628: e1 f7 brne .-8 ; 0x33622 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 3362a: 8c e3 ldi r24, 0x3C ; 60 3362c: 89 83 std Y+1, r24 ; 0x01 3362e: fe 01 movw r30, r28 33630: 32 96 adiw r30, 0x02 ; 2 33632: a6 e5 ldi r26, 0x56 ; 86 33634: b3 e1 ldi r27, 0x13 ; 19 for (uint8_t i = 0; i < lrb; ++i) { 33636: 20 e0 ldi r18, 0x00 ; 0 33638: cf 01 movw r24, r30 3363a: 52 16 cp r5, r18 3363c: 09 f4 brne .+2 ; 0x33640 3363e: cd c0 rjmp .+410 ; 0x337da uint8_t b = lastReceivedBytes[i]; 33640: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 33642: 40 ee ldi r20, 0xE0 ; 224 33644: 43 0f add r20, r19 33646: 40 36 cpi r20, 0x60 ; 96 33648: 08 f0 brcs .+2 ; 0x3364c b = '.'; 3364a: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 3364c: 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) { 3364e: 2f 5f subi r18, 0xFF ; 255 33650: f4 cf rjmp .-24 ; 0x3363a } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33652: 8e 34 cpi r24, 0x4E ; 78 33654: 08 f0 brcs .+2 ; 0x33658 33656: 56 c0 rjmp .+172 ; 0x33704 33658: 8b 34 cpi r24, 0x4B ; 75 3365a: 08 f0 brcs .+2 ; 0x3365e 3365c: 46 c0 rjmp .+140 ; 0x336ea 3365e: 82 34 cpi r24, 0x42 ; 66 33660: 09 f4 brne .+2 ; 0x33664 33662: 43 c0 rjmp .+134 ; 0x336ea 33664: e0 f5 brcc .+120 ; 0x336de 33666: 8a 30 cpi r24, 0x0A ; 10 33668: 59 f0 breq .+22 ; 0x33680 3366a: 8d 30 cpi r24, 0x0D ; 13 3366c: 49 f0 breq .+18 ; 0x33680 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 3366e: b0 92 4d 13 sts 0x134D, r11 ; 0x80134d Matched }; /// @returns true when "ok\n" gets detected State Detect(uint8_t c) { // consume old MMU FW's data if any -> avoid confusion of protocol decoder if (ok == 0 && c == 'o') { 33672: a1 10 cpse r10, r1 33674: 05 c1 rjmp .+522 ; 0x33880 33676: 1f 36 cpi r17, 0x6F ; 111 33678: 09 f0 breq .+2 ; 0x3367c 3367a: fc c3 rjmp .+2040 ; 0x33e74 ++ok; 3367c: aa 24 eor r10, r10 3367e: 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; 33680: 4f ef ldi r20, 0xFF ; 255 33682: c4 1a sub r12, r20 33684: d4 0a sbc r13, r20 33686: 82 e7 ldi r24, 0x72 ; 114 33688: 92 e1 ldi r25, 0x12 ; 18 3368a: 0f 94 bd db call 0x3b77a ; 0x3b77a 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) { 3368e: 97 fd sbrc r25, 7 33690: 00 c1 rjmp .+512 ; 0x33892 ++bytesConsumed; RecordReceivedByte(c); 33692: 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]; 33694: 20 91 66 13 lds r18, 0x1366 ; 0x801366 33698: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 3369a: f9 01 movw r30, r18 3369c: e7 5d subi r30, 0xD7 ; 215 3369e: fc 4e sbci r31, 0xEC ; 236 336a0: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 336a2: 79 01 movw r14, r18 336a4: ef ef ldi r30, 0xFF ; 255 336a6: ee 1a sub r14, r30 336a8: fe 0a sbc r15, r30 336aa: ff e0 ldi r31, 0x0F ; 15 336ac: ef 22 and r14, r31 336ae: ff 24 eor r15, r15 336b0: 5e 2c mov r5, r14 336b2: e0 92 66 13 sts 0x1366, r14 ; 0x801366 ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 336b6: 20 91 4d 13 lds r18, 0x134D ; 0x80134d 336ba: 22 30 cpi r18, 0x02 ; 2 336bc: 09 f4 brne .+2 ; 0x336c0 336be: 48 c0 rjmp .+144 ; 0x33750 336c0: 08 f0 brcs .+2 ; 0x336c4 336c2: 7b cf rjmp .-266 ; 0x335ba 336c4: 22 23 and r18, r18 336c6: 29 f2 breq .-118 ; 0x33652 336c8: 21 30 cpi r18, 0x01 ; 1 336ca: 51 f1 breq .+84 ; 0x33720 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 336cc: 1a 30 cpi r17, 0x0A ; 10 336ce: 09 f4 brne .+2 ; 0x336d2 336d0: 8f cf rjmp .-226 ; 0x335f0 336d2: 1d 30 cpi r17, 0x0D ; 13 336d4: 09 f4 brne .+2 ; 0x336d8 336d6: 8c cf rjmp .-232 ; 0x335f0 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 336d8: 10 92 53 13 sts 0x1353, r1 ; 0x801353 336dc: ca cf rjmp .-108 ; 0x33672 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 336de: 85 34 cpi r24, 0x45 ; 69 336e0: 30 f2 brcs .-116 ; 0x3366e 336e2: 87 34 cpi r24, 0x47 ; 71 336e4: 10 f0 brcs .+4 ; 0x336ea 336e6: 88 34 cpi r24, 0x48 ; 72 336e8: 11 f6 brne .-124 ; 0x3366e case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 336ea: 80 93 4e 13 sts 0x134E, r24 ; 0x80134e responseMsg.request.value = 0; 336ee: 10 92 4f 13 sts 0x134F, r1 ; 0x80134f responseMsg.request.value2 = 0; 336f2: 10 92 51 13 sts 0x1351, r1 ; 0x801351 336f6: 10 92 50 13 sts 0x1350, r1 ; 0x801350 responseMsg.request.crc8 = 0; 336fa: 10 92 52 13 sts 0x1352, r1 ; 0x801352 rspState = ResponseStates::RequestValue; 336fe: 90 92 4d 13 sts 0x134D, r9 ; 0x80134d 33702: be cf rjmp .-132 ; 0x33680 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33704: 89 35 cpi r24, 0x59 ; 89 33706: 40 f4 brcc .+16 ; 0x33718 33708: 87 35 cpi r24, 0x57 ; 87 3370a: 78 f7 brcc .-34 ; 0x336ea 3370c: 20 eb ldi r18, 0xB0 ; 176 3370e: 28 0f add r18, r24 33710: 26 30 cpi r18, 0x06 ; 6 33712: 08 f0 brcs .+2 ; 0x33716 33714: ac cf rjmp .-168 ; 0x3366e 33716: e9 cf rjmp .-46 ; 0x336ea 33718: 86 36 cpi r24, 0x66 ; 102 3371a: 09 f0 breq .+2 ; 0x3371e 3371c: a8 cf rjmp .-176 ; 0x3366e 3371e: e5 cf rjmp .-54 ; 0x336ea } 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'); 33720: 20 ed ldi r18, 0xD0 ; 208 33722: 28 0f add r18, r24 33724: 2a 30 cpi r18, 0x0A ; 10 33726: 50 f0 brcs .+20 ; 0x3373c 33728: 2f e9 ldi r18, 0x9F ; 159 3372a: 28 0f add r18, r24 3372c: 26 30 cpi r18, 0x06 ; 6 3372e: 30 f0 brcs .+12 ; 0x3373c case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 33730: 80 32 cpi r24, 0x20 ; 32 33732: 09 f0 breq .+2 ; 0x33736 33734: 9c cf rjmp .-200 ; 0x3366e rspState = ResponseStates::ParamCode; 33736: 60 92 4d 13 sts 0x134D, r6 ; 0x80134d 3373a: a2 cf rjmp .-188 ; 0x33680 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 3373c: 0f 94 da c2 call 0x385b4 ; 0x385b4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 33740: 90 91 4f 13 lds r25, 0x134F ; 0x80134f 33744: 92 95 swap r25 33746: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 33748: 89 0f add r24, r25 3374a: 80 93 4f 13 sts 0x134F, r24 ; 0x80134f 3374e: 98 cf rjmp .-208 ; 0x33680 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 33750: 87 34 cpi r24, 0x47 ; 71 33752: 48 f4 brcc .+18 ; 0x33766 33754: 85 34 cpi r24, 0x45 ; 69 33756: 58 f4 brcc .+22 ; 0x3376e 33758: 2f eb ldi r18, 0xBF ; 191 3375a: 28 0f add r18, r24 3375c: 22 30 cpi r18, 0x02 ; 2 3375e: 38 f0 brcs .+14 ; 0x3376e return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 33760: 10 92 53 13 sts 0x1353, r1 ; 0x801353 33764: 84 cf rjmp .-248 ; 0x3366e } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 33766: 80 35 cpi r24, 0x50 ; 80 33768: 11 f0 breq .+4 ; 0x3376e 3376a: 82 35 cpi r24, 0x52 ; 82 3376c: c9 f7 brne .-14 ; 0x33760 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 3376e: 80 92 4d 13 sts 0x134D, r8 ; 0x80134d responseMsg.paramCode = (ResponseMsgParamCodes)c; 33772: 80 93 53 13 sts 0x1353, r24 ; 0x801353 responseMsg.paramValue = 0; 33776: 10 92 55 13 sts 0x1355, r1 ; 0x801355 3377a: 10 92 54 13 sts 0x1354, r1 ; 0x801354 3377e: 80 cf rjmp .-256 ; 0x33680 33780: 20 ed ldi r18, 0xD0 ; 208 33782: 28 0f add r18, r24 33784: 2a 30 cpi r18, 0x0A ; 10 33786: 48 f0 brcs .+18 ; 0x3379a 33788: 2f e9 ldi r18, 0x9F ; 159 3378a: 28 0f add r18, r24 3378c: 26 30 cpi r18, 0x06 ; 6 3378e: 28 f0 brcs .+10 ; 0x3379a case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 33790: 8a 32 cpi r24, 0x2A ; 42 33792: 31 f7 brne .-52 ; 0x33760 rspState = ResponseStates::CRC; 33794: 70 92 4d 13 sts 0x134D, r7 ; 0x80134d 33798: 73 cf rjmp .-282 ; 0x33680 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 3379a: 0f 94 da c2 call 0x385b4 ; 0x385b4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 3379e: 20 91 54 13 lds r18, 0x1354 ; 0x801354 337a2: 30 91 55 13 lds r19, 0x1355 ; 0x801355 337a6: 44 e0 ldi r20, 0x04 ; 4 337a8: 22 0f add r18, r18 337aa: 33 1f adc r19, r19 337ac: 4a 95 dec r20 337ae: e1 f7 brne .-8 ; 0x337a8 responseMsg.paramValue += Char2Nibble(c); 337b0: 82 0f add r24, r18 337b2: 93 2f mov r25, r19 337b4: 91 1d adc r25, r1 337b6: 90 93 55 13 sts 0x1355, r25 ; 0x801355 337ba: 80 93 54 13 sts 0x1354, r24 ; 0x801354 337be: 60 cf rjmp .-320 ; 0x33680 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 337c0: 0f 94 da c2 call 0x385b4 ; 0x385b4 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 337c4: 90 91 52 13 lds r25, 0x1352 ; 0x801352 337c8: 92 95 swap r25 337ca: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 337cc: 89 0f add r24, r25 337ce: 80 93 52 13 sts 0x1352, r24 ; 0x801352 337d2: 56 cf rjmp .-340 ; 0x33680 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 337d4: 8d 30 cpi r24, 0x0D ; 13 337d6: 21 f6 brne .-120 ; 0x33760 337d8: 03 cf rjmp .-506 ; 0x335e0 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 337da: e8 0e add r14, r24 337dc: f9 1e adc r15, r25 337de: f7 01 movw r30, r14 337e0: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 337e2: 10 92 66 13 sts 0x1366, r1 ; 0x801366 } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 337e6: 82 ef ldi r24, 0xF2 ; 242 337e8: 99 ea ldi r25, 0xA9 ; 169 337ea: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 337ee: 8c ee ldi r24, 0xEC ; 236 337f0: 99 ea ldi r25, 0xA9 ; 169 337f2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 337f6: ce 01 movw r24, r28 337f8: 01 96 adiw r24, 0x01 ; 1 337fa: 0f 94 96 d6 call 0x3ad2c ; 0x3ad2c 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 337fe: 0f 94 93 70 call 0x2e126 ; 0x2e126 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 33802: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33806: 81 30 cpi r24, 0x01 ; 1 33808: 09 f4 brne .+2 ; 0x3380c 3380a: 74 c0 rjmp .+232 ; 0x338f4 3380c: 08 f4 brcc .+2 ; 0x33810 3380e: c5 ce rjmp .-630 ; 0x3359a 33810: 83 30 cpi r24, 0x03 ; 3 33812: 09 f4 brne .+2 ; 0x33816 33814: d1 c0 rjmp .+418 ; 0x339b8 33816: 84 30 cpi r24, 0x04 ; 4 33818: 09 f0 breq .+2 ; 0x3381c 3381a: 4f ce rjmp .-866 ; 0x334ba return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 3381c: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33820: 86 30 cpi r24, 0x06 ; 6 33822: 09 f4 brne .+2 ; 0x33826 33824: 6c c1 rjmp .+728 ; 0x33afe 33826: 08 f0 brcs .+2 ; 0x3382a 33828: 93 c1 rjmp .+806 ; 0x33b50 3382a: 84 30 cpi r24, 0x04 ; 4 3382c: 09 f4 brne .+2 ; 0x33830 3382e: 09 c1 rjmp .+530 ; 0x33a42 33830: 85 30 cpi r24, 0x05 ; 5 33832: 09 f0 breq .+2 ; 0x33836 33834: cc c0 rjmp .+408 ; 0x339ce case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 33836: 80 91 43 13 lds r24, 0x1343 ; 0x801343 3383a: 81 34 cpi r24, 0x41 ; 65 3383c: 09 f4 brne .+2 ; 0x33840 3383e: 96 c1 rjmp .+812 ; 0x33b6c 33840: 82 35 cpi r24, 0x52 ; 82 33842: 09 f0 breq .+2 ; 0x33846 33844: c4 c0 rjmp .+392 ; 0x339ce errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 33846: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b errorCode = ErrorCode::PROTOCOL_ERROR; 3384a: 8d e2 ldi r24, 0x2D ; 45 3384c: 90 e8 ldi r25, 0x80 ; 128 3384e: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 33852: 80 93 69 13 sts 0x1369, r24 ; 0x801369 } break; case CommandRejected: // we have to repeat it - that's the only thing we can do // no change in state // @@TODO wait until Q0 returns command in progress finished, then we can send this one LogError(PSTR("Command rejected")); 33856: 85 e7 ldi r24, 0x75 ; 117 33858: 97 ea ldi r25, 0xA7 ; 167 3385a: 0f 94 b0 70 call 0x2e160 ; 0x2e160 void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 3385e: 85 e0 ldi r24, 0x05 ; 5 33860: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c SendMsg(rq); 33864: 40 91 2e 13 lds r20, 0x132E ; 0x80132e 33868: 50 91 2f 13 lds r21, 0x132F ; 0x80132f 3386c: 60 91 30 13 lds r22, 0x1330 ; 0x801330 33870: 70 91 31 13 lds r23, 0x1331 ; 0x801331 33874: 80 91 32 13 lds r24, 0x1332 ; 0x801332 33878: 0f 94 99 71 call 0x2e332 ; 0x2e332 3387c: 16 e0 ldi r17, 0x06 ; 6 3387e: 07 c1 rjmp .+526 ; 0x33a8e 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') { 33880: 1b 36 cpi r17, 0x6B ; 107 33882: 09 f0 breq .+2 ; 0x33886 33884: f7 c2 rjmp .+1518 ; 0x33e74 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")); 33886: 86 e5 ldi r24, 0x56 ; 86 33888: 97 ea ldi r25, 0xA7 ; 167 3388a: 0f 94 b0 70 call 0x2e160 ; 0x2e160 3388e: 18 e0 ldi r17, 0x08 ; 8 33890: fe c0 rjmp .+508 ; 0x33a8e default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 33892: cd 28 or r12, r13 33894: 19 f0 breq .+6 ; 0x3389c RecordUARTActivity(); // something has happened on the UART, update the timeout record 33896: 0f 94 93 70 call 0x2e126 ; 0x2e126 3389a: 7f ce rjmp .-770 ; 0x3359a IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3389c: 0f 94 8b 3f call 0x27f16 ; 0x27f16 338a0: ab 01 movw r20, r22 338a2: bc 01 movw r22, r24 338a4: 80 91 38 13 lds r24, 0x1338 ; 0x801338 338a8: 90 91 39 13 lds r25, 0x1339 ; 0x801339 338ac: a0 91 3a 13 lds r26, 0x133A ; 0x80133a 338b0: b0 91 3b 13 lds r27, 0x133B ; 0x80133b 338b4: 80 53 subi r24, 0x30 ; 48 338b6: 98 4f sbci r25, 0xF8 ; 248 338b8: af 4f sbci r26, 0xFF ; 255 338ba: 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) { 338bc: 48 17 cp r20, r24 338be: 59 07 cpc r21, r25 338c0: 6a 07 cpc r22, r26 338c2: 7b 07 cpc r23, r27 338c4: 08 f4 brcc .+2 ; 0x338c8 338c6: 69 ce rjmp .-814 ; 0x3359a 338c8: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 338cc: 88 23 and r24, r24 338ce: 09 f4 brne .+2 ; 0x338d2 338d0: 64 ce rjmp .-824 ; 0x3359a rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 338d2: 10 92 4d 13 sts 0x134D, r1 ; 0x80134d initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 338d6: 81 e0 ldi r24, 0x01 ; 1 338d8: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::StartSeq; 338dc: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 338e0: 86 e0 ldi r24, 0x06 ; 6 338e2: 80 93 2d 13 sts 0x132D, r24 ; 0x80132d SendVersion(0); 338e6: 80 e0 ldi r24, 0x00 ; 0 338e8: 0f 94 a8 98 call 0x33150 ; 0x33150 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 338ec: 64 e0 ldi r22, 0x04 ; 4 338ee: 8e e2 ldi r24, 0x2E ; 46 338f0: 97 ea ldi r25, 0xA7 ; 167 338f2: 79 c0 rjmp .+242 ; 0x339e6 return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 338f4: 10 91 2c 13 lds r17, 0x132C ; 0x80132c 338f8: 13 30 cpi r17, 0x03 ; 3 338fa: b1 f1 breq .+108 ; 0x33968 338fc: 60 f0 brcs .+24 ; 0x33916 338fe: 16 30 cpi r17, 0x06 ; 6 33900: 09 f4 brne .+2 ; 0x33904 33902: 50 c0 rjmp .+160 ; 0x339a4 33904: 19 30 cpi r17, 0x09 ; 9 33906: 09 f0 breq .+2 ; 0x3390a 33908: be cf rjmp .-132 ; 0x33886 // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 3390a: 0f 94 c3 72 call 0x2e586 ; 0x2e586 3390e: 88 23 and r24, r24 33910: 09 f4 brne .+2 ; 0x33914 33912: 43 ce rjmp .-890 ; 0x3359a 33914: 40 ce rjmp .-896 ; 0x33596 void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 33916: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 3391a: 83 35 cpi r24, 0x53 ; 83 3391c: 21 f4 brne .+8 ; 0x33926 3391e: 80 91 3f 13 lds r24, 0x133F ; 0x80133f 33922: 18 17 cp r17, r24 33924: 11 f0 breq .+4 ; 0x3392a mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 33926: 81 2f mov r24, r17 33928: fe cd rjmp .-1028 ; 0x33526 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; 3392a: 80 91 44 13 lds r24, 0x1344 ; 0x801344 3392e: e1 2f mov r30, r17 33930: f0 e0 ldi r31, 0x00 ; 0 33932: df 01 movw r26, r30 33934: a8 58 subi r26, 0x88 ; 136 33936: bc 4e sbci r27, 0xEC ; 236 33938: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 3393a: ed 5a subi r30, 0xAD ; 173 3393c: f8 45 sbci r31, 0x58 ; 88 3393e: e4 91 lpm r30, Z 33940: 8e 17 cp r24, r30 33942: 41 f0 breq .+16 ; 0x33954 if (--retries == 0) { 33944: 80 91 2d 13 lds r24, 0x132D ; 0x80132d 33948: 81 50 subi r24, 0x01 ; 1 3394a: 80 93 2d 13 sts 0x132D, r24 ; 0x80132d 3394e: 81 11 cpse r24, r1 33950: ea cf rjmp .-44 ; 0x33926 33952: 99 cf rjmp .-206 ; 0x33886 SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 33954: 85 e9 ldi r24, 0x95 ; 149 33956: 99 ea ldi r25, 0xA9 ; 169 33958: 0e 94 06 7b call 0xf60c ; 0xf60c /// @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; } 3395c: 8a e0 ldi r24, 0x0A ; 10 3395e: 80 93 3d 13 sts 0x133D, r24 ; 0x80133d } else { SendVersion(stage); } } else { ResetCommunicationTimeoutAttempts(); // got a meaningful response from the MMU, stop data layer timeout tracking SendVersion(stage + 1); 33962: 81 e0 ldi r24, 0x01 ; 1 33964: 81 0f add r24, r17 33966: df cd rjmp .-1090 ; 0x33526 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) { 33968: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 3396c: 83 35 cpi r24, 0x53 ; 83 3396e: 21 f4 brne .+8 ; 0x33978 33970: 80 91 3f 13 lds r24, 0x133F ; 0x80133f 33974: 83 30 cpi r24, 0x03 ; 3 33976: 11 f0 breq .+4 ; 0x3397c // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 33978: 83 e0 ldi r24, 0x03 ; 3 3397a: d5 cd rjmp .-1110 ; 0x33526 } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 3397c: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33980: 90 91 45 13 lds r25, 0x1345 ; 0x801345 33984: 90 93 7c 13 sts 0x137C, r25 ; 0x80137c 33988: 80 93 7b 13 sts 0x137B, r24 ; 0x80137b } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 3398c: 10 92 77 13 sts 0x1377, r1 ; 0x801377 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 33990: e3 e9 ldi r30, 0x93 ; 147 33992: f9 ea ldi r31, 0xA9 ; 169 33994: 84 91 lpm r24, Z 33996: 60 91 75 13 lds r22, 0x1375 ; 0x801375 3399a: 70 e0 ldi r23, 0x00 ; 0 3399c: 49 e0 ldi r20, 0x09 ; 9 3399e: 0f 94 04 72 call 0x2e408 ; 0x2e408 339a2: fb cd rjmp .-1034 ; 0x3359a currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 339a4: 82 e0 ldi r24, 0x02 ; 2 339a6: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::Idle; 339aa: 83 e0 ldi r24, 0x03 ; 3 339ac: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 339b0: 82 e8 ldi r24, 0x82 ; 130 339b2: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 339b6: d2 cd rjmp .-1116 ; 0x3355c } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 339b8: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 339bc: 88 30 cpi r24, 0x08 ; 8 339be: 09 f4 brne .+2 ; 0x339c2 339c0: b7 c0 rjmp .+366 ; 0x33b30 339c2: a8 f4 brcc .+42 ; 0x339ee 339c4: 84 30 cpi r24, 0x04 ; 4 339c6: d9 f0 breq .+54 ; 0x339fe 339c8: 87 30 cpi r24, 0x07 ; 7 339ca: 09 f4 brne .+2 ; 0x339ce 339cc: ae c0 rjmp .+348 ; 0x33b2a return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 339ce: 81 e0 ldi r24, 0x01 ; 1 339d0: 80 93 46 13 sts 0x1346, r24 ; 0x801346 currentScope = Scope::DelayedRestart; 339d4: 82 e0 ldi r24, 0x02 ; 2 339d6: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 339da: 83 e8 ldi r24, 0x83 ; 131 339dc: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; currentScope = Scope::DelayedRestart; DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); 339e0: 65 e0 ldi r22, 0x05 ; 5 339e2: 84 e4 ldi r24, 0x44 ; 68 339e4: 97 ea ldi r25, 0xA7 ; 167 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 339e6: 0f 94 21 71 call 0x2e242 ; 0x2e242 339ea: 18 2f mov r17, r24 339ec: 50 c0 rjmp .+160 ; 0x33a8e } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 339ee: 8a 30 cpi r24, 0x0A ; 10 339f0: 09 f4 brne .+2 ; 0x339f4 339f2: a7 c0 rjmp .+334 ; 0x33b42 339f4: 60 f3 brcs .-40 ; 0x339ce 339f6: 8d 30 cpi r24, 0x0D ; 13 339f8: 08 f4 brcc .+2 ; 0x339fc 339fa: 5f cd rjmp .-1346 ; 0x334ba 339fc: e8 cf rjmp .-48 ; 0x339ce 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) { 339fe: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 33a02: 8e 34 cpi r24, 0x4E ; 78 33a04: 60 f5 brcc .+88 ; 0x33a5e 33a06: 8b 34 cpi r24, 0x4B ; 75 33a08: 10 f4 brcc .+4 ; 0x33a0e 33a0a: 85 34 cpi r24, 0x45 ; 69 33a0c: 01 f7 brne .-64 ; 0x339ce case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 33a0e: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33a12: 86 34 cpi r24, 0x46 ; 70 33a14: 09 f4 brne .+2 ; 0x33a18 33a16: 73 c0 rjmp .+230 ; 0x33afe return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 33a18: 84 e0 ldi r24, 0x04 ; 4 33a1a: 80 93 2b 13 sts 0x132B, r24 ; 0x80132b 33a1e: 85 e0 ldi r24, 0x05 ; 5 33a20: ee e3 ldi r30, 0x3E ; 62 33a22: f3 e1 ldi r31, 0x13 ; 19 33a24: de 01 movw r26, r28 33a26: 11 96 adiw r26, 0x01 ; 1 33a28: 01 90 ld r0, Z+ 33a2a: 0d 92 st X+, r0 33a2c: 8a 95 dec r24 33a2e: e1 f7 brne .-8 ; 0x33a28 StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 33a30: 85 e0 ldi r24, 0x05 ; 5 33a32: fe 01 movw r30, r28 33a34: 31 96 adiw r30, 0x01 ; 1 33a36: ae e2 ldi r26, 0x2E ; 46 33a38: b3 e1 ldi r27, 0x13 ; 19 33a3a: 01 90 ld r0, Z+ 33a3c: 0d 92 st X+, r0 33a3e: 8a 95 dec r24 33a40: e1 f7 brne .-8 ; 0x33a3a default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 33a42: 0f 94 0b 99 call 0x33216 ; 0x33216 33a46: 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) { 33a48: 85 30 cpi r24, 0x05 ; 5 33a4a: 09 f2 breq .-126 ; 0x339ce 33a4c: 08 f0 brcs .+2 ; 0x33a50 33a4e: 9c c0 rjmp .+312 ; 0x33b88 33a50: 82 30 cpi r24, 0x02 ; 2 33a52: 09 f4 brne .+2 ; 0x33a56 33a54: 32 cd rjmp .-1436 ; 0x334ba 33a56: 84 30 cpi r24, 0x04 ; 4 33a58: 09 f4 brne .+2 ; 0x33a5c 33a5a: 3b cf rjmp .-394 ; 0x338d2 33a5c: 18 c0 rjmp .+48 ; 0x33a8e 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) { 33a5e: 84 35 cpi r24, 0x54 ; 84 33a60: 08 f4 brcc .+2 ; 0x33a64 33a62: b5 cf rjmp .-150 ; 0x339ce 33a64: 86 35 cpi r24, 0x56 ; 86 33a66: 98 f2 brcs .-90 ; 0x33a0e 33a68: 88 35 cpi r24, 0x58 ; 88 33a6a: 09 f0 breq .+2 ; 0x33a6e 33a6c: b0 cf rjmp .-160 ; 0x339ce 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) { 33a6e: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33a72: 86 34 cpi r24, 0x46 ; 70 33a74: 89 f1 breq .+98 ; 0x33ad8 33a76: 80 35 cpi r24, 0x50 ; 80 33a78: c1 f1 breq .+112 ; 0x33aea 33a7a: 82 34 cpi r24, 0x42 ; 66 33a7c: 09 f0 breq .+2 ; 0x33a80 33a7e: 42 c0 rjmp .+132 ; 0x33b04 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); 33a80: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33a84: 80 93 6c 13 sts 0x136C, r24 ; 0x80136c StartReading8bitRegisters(); 33a88: 0f 94 b9 97 call 0x32f72 ; 0x32f72 return ButtonPushed; 33a8c: 1b e0 ldi r17, 0x0B ; 11 33a8e: 80 91 29 13 lds r24, 0x1329 ; 0x801329 33a92: 90 91 2a 13 lds r25, 0x132A ; 0x80132a break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 33a96: 81 30 cpi r24, 0x01 ; 1 33a98: 91 05 cpc r25, r1 33a9a: 09 f0 breq .+2 ; 0x33a9e 33a9c: ee c1 rjmp .+988 ; 0x33e7a const StepStatus ss = logic.Step(); switch (ss) { 33a9e: 12 30 cpi r17, 0x02 ; 2 33aa0: 09 f4 brne .+2 ; 0x33aa4 33aa2: 90 c0 rjmp .+288 ; 0x33bc4 33aa4: 08 f0 brcs .+2 ; 0x33aa8 33aa6: 7d c0 rjmp .+250 ; 0x33ba2 33aa8: 11 23 and r17, r17 33aaa: 09 f4 brne .+2 ; 0x33aae 33aac: 18 c1 rjmp .+560 ; 0x33cde case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33aae: 00 23 and r16, r16 33ab0: 09 f4 brne .+2 ; 0x33ab4 33ab2: e4 c0 rjmp .+456 ; 0x33c7c switch (ss) { 33ab4: 17 30 cpi r17, 0x07 ; 7 33ab6: 09 f4 brne .+2 ; 0x33aba 33ab8: c4 c1 rjmp .+904 ; 0x33e42 33aba: 08 f0 brcs .+2 ; 0x33abe 33abc: b8 c1 rjmp .+880 ; 0x33e2e 33abe: 14 30 cpi r17, 0x04 ; 4 33ac0: 09 f4 brne .+2 ; 0x33ac4 33ac2: c7 c1 rjmp .+910 ; 0x33e52 33ac4: 15 30 cpi r17, 0x05 ; 5 33ac6: 09 f0 breq .+2 ; 0x33aca 33ac8: d9 c0 rjmp .+434 ; 0x33c7c state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 33aca: 82 e0 ldi r24, 0x02 ; 2 33acc: 80 93 98 13 sts 0x1398, r24 ; 0x801398 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 33ad0: 60 e0 ldi r22, 0x00 ; 0 33ad2: 8d e2 ldi r24, 0x2D ; 45 33ad4: 90 e8 ldi r25, 0x80 ; 128 33ad6: ba c1 rjmp .+884 ; 0x33e4c // 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) { 33ad8: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 33adc: 88 23 and r24, r24 33ade: 29 f0 breq .+10 ; 0x33aea scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33ae0: 82 e8 ldi r24, 0x82 ; 130 33ae2: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c case ResponseMsgParamCodes::Finished: if (ReqMsg().code != RequestMsgCodes::unknown) { // got reset while doing some other command - the originally issued command was interrupted! // this must be solved by the upper layer, protocol logic doesn't have all the context (like unload before trying again) IdleRestart(); return Interrupted; 33ae6: 13 e0 ldi r17, 0x03 ; 3 33ae8: d2 cf rjmp .-92 ; 0x33a8e } [[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); 33aea: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33aee: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = ErrorCode::OK; 33af2: 81 e0 ldi r24, 0x01 ; 1 33af4: 90 e0 ldi r25, 0x00 ; 0 33af6: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 33afa: 80 93 69 13 sts 0x1369, r24 ; 0x801369 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 33afe: 0f 94 b9 97 call 0x32f72 ; 0x32f72 33b02: 4b cd rjmp .-1386 ; 0x3359a // 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; 33b04: 8c e0 ldi r24, 0x0C ; 12 33b06: 80 93 6b 13 sts 0x136B, r24 ; 0x80136b errorCode = static_cast(rsp.paramValue); 33b0a: 80 91 44 13 lds r24, 0x1344 ; 0x801344 33b0e: 90 91 45 13 lds r25, 0x1345 ; 0x801345 33b12: 90 93 6a 13 sts 0x136A, r25 ; 0x80136a 33b16: 80 93 69 13 sts 0x1369, r24 ; 0x801369 StartReading8bitRegisters(); // continue Idle state without restarting the communication 33b1a: 0f 94 b9 97 call 0x32f72 ; 0x32f72 // @@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")); 33b1e: 87 e6 ldi r24, 0x67 ; 103 33b20: 97 ea ldi r25, 0xA7 ; 167 33b22: 0f 94 b0 70 call 0x2e160 ; 0x2e160 33b26: 17 e0 ldi r17, 0x07 ; 7 33b28: b2 cf rjmp .-156 ; 0x33a8e return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 33b2a: 0f 94 dd 97 call 0x32fba ; 0x32fba 33b2e: 35 cd rjmp .-1430 ; 0x3359a return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 33b30: 82 e8 ldi r24, 0x82 ; 130 33b32: 0f 94 c1 97 call 0x32f82 ; 0x32f82 33b36: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c return scopeState == ScopeState::Ready ? Finished : Processing; 33b3a: 82 38 cpi r24, 0x82 ; 130 33b3c: 09 f0 breq .+2 ; 0x33b40 33b3e: 2d cd rjmp .-1446 ; 0x3359a 33b40: bc cc rjmp .-1672 ; 0x334ba case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33b42: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33b46: 81 34 cpi r24, 0x41 ; 65 33b48: d1 f6 brne .-76 ; 0x33afe // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33b4a: 0f 94 9e 70 call 0x2e13c ; 0x2e13c 33b4e: d7 cf rjmp .-82 ; 0x33afe return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33b50: 88 30 cpi r24, 0x08 ; 8 33b52: b1 f0 breq .+44 ; 0x33b80 33b54: 50 f3 brcs .-44 ; 0x33b2a 33b56: 8a 30 cpi r24, 0x0A ; 10 33b58: 09 f0 breq .+2 ; 0x33b5c 33b5a: 39 cf rjmp .-398 ; 0x339ce return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33b5c: 80 91 43 13 lds r24, 0x1343 ; 0x801343 33b60: 81 34 cpi r24, 0x41 ; 65 33b62: 09 f0 breq .+2 ; 0x33b66 33b64: 18 cd rjmp .-1488 ; 0x33596 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 33b66: 0f 94 9e 70 call 0x2e13c ; 0x2e13c 33b6a: 15 cd rjmp .-1494 ; 0x33596 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; 33b6c: 10 92 6b 13 sts 0x136B, r1 ; 0x80136b errorCode = ErrorCode::RUNNING; 33b70: 10 92 6a 13 sts 0x136A, r1 ; 0x80136a 33b74: 10 92 69 13 sts 0x1369, r1 ; 0x801369 scopeState = ScopeState::Wait; 33b78: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 33b7a: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 33b7e: 0d cd rjmp .-1510 ; 0x3359a 33b80: 81 e8 ldi r24, 0x81 ; 129 33b82: 0f 94 c1 97 call 0x32f82 ; 0x32f82 33b86: f9 cf rjmp .-14 ; 0x33b7a StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 33b88: 87 30 cpi r24, 0x07 ; 7 33b8a: 49 f2 breq .-110 ; 0x33b1e 33b8c: 08 f4 brcc .+2 ; 0x33b90 33b8e: 63 ce rjmp .-826 ; 0x33856 33b90: 88 30 cpi r24, 0x08 ; 8 33b92: 09 f4 brne .+2 ; 0x33b96 33b94: 78 ce rjmp .-784 ; 0x33886 33b96: 7b cf rjmp .-266 ; 0x33a8e // 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()) { 33b98: 80 91 2c 13 lds r24, 0x132C ; 0x80132c 33b9c: 87 fd sbrc r24, 7 33b9e: 9a cc rjmp .-1740 ; 0x334d4 33ba0: fc cc rjmp .-1544 ; 0x3359a StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 33ba2: 13 30 cpi r17, 0x03 ; 3 33ba4: 09 f4 brne .+2 ; 0x33ba8 33ba6: 6a c0 rjmp .+212 ; 0x33c7c 33ba8: 1b 30 cpi r17, 0x0B ; 11 33baa: 09 f0 breq .+2 ; 0x33bae 33bac: 80 cf rjmp .-256 ; 0x33aae case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 33bae: 80 91 6c 13 lds r24, 0x136C ; 0x80136c 33bb2: 80 93 93 13 sts 0x1393, r24 ; 0x801393 LogEchoEvent_P(PSTR("MMU Button pushed")); 33bb6: 86 e8 ldi r24, 0x86 ; 134 33bb8: 97 ea ldi r25, 0xA7 ; 167 33bba: 0f 94 54 c3 call 0x386a8 ; 0x386a8 CheckUserInput(); // Process the button immediately 33bbe: 0f 94 75 99 call 0x332ea ; 0x332ea 33bc2: 5c c0 rjmp .+184 ; 0x33c7c CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 33bc4: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 33bc8: 81 11 cpse r24, r1 33bca: 58 c0 rjmp .+176 ; 0x33c7c 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() 33bcc: 0e 94 45 68 call 0xd08a ; 0xd08a && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 33bd0: 88 23 and r24, r24 33bd2: 09 f4 brne .+2 ; 0x33bd6 33bd4: 53 c0 rjmp .+166 ; 0x33c7c } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 33bd6: 80 91 5b 0e lds r24, 0x0E5B ; 0x800e5b <_ZL17mcode_in_progress.lto_priv.551> 33bda: 90 91 5c 0e lds r25, 0x0E5C ; 0x800e5c <_ZL17mcode_in_progress.lto_priv.551+0x1> 33bde: 88 35 cpi r24, 0x58 ; 88 33be0: 92 40 sbci r25, 0x02 ; 2 33be2: 09 f4 brne .+2 ; 0x33be6 33be4: 4b c0 rjmp .+150 ; 0x33c7c && !saved_printing 33be6: 80 91 5a 0e lds r24, 0x0E5A ; 0x800e5a 33bea: 81 11 cpse r24, r1 33bec: 47 c0 rjmp .+142 ; 0x33c7c && !mesh_bed_leveling_flag 33bee: 80 91 59 0e lds r24, 0x0E59 ; 0x800e59 33bf2: 81 11 cpse r24, r1 33bf4: 43 c0 rjmp .+134 ; 0x33c7c && !homing_flag 33bf6: 80 91 58 0e lds r24, 0x0E58 ; 0x800e58 33bfa: 81 11 cpse r24, r1 33bfc: 3f c0 rjmp .+126 ; 0x33c7c bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 33bfe: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 33c02: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 33c06: 98 17 cp r25, r24 33c08: c9 f1 breq .+114 ; 0x33c7c { uint8_t block_index = block_buffer_tail; 33c0a: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 } #endif bool e_active() { unsigned char e_active = 0; 33c0e: 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++; 33c10: 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) 33c12: 30 91 56 0e lds r19, 0x0E56 ; 0x800e56 33c16: 38 17 cp r19, r24 33c18: 89 f0 breq .+34 ; 0x33c3c { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 33c1a: 28 9f mul r18, r24 33c1c: f0 01 movw r30, r0 33c1e: 11 24 eor r1, r1 33c20: ea 58 subi r30, 0x8A ; 138 33c22: f8 4f sbci r31, 0xF8 ; 248 33c24: 44 85 ldd r20, Z+12 ; 0x0c 33c26: 55 85 ldd r21, Z+13 ; 0x0d 33c28: 66 85 ldd r22, Z+14 ; 0x0e 33c2a: 77 85 ldd r23, Z+15 ; 0x0f 33c2c: 45 2b or r20, r21 33c2e: 46 2b or r20, r22 33c30: 47 2b or r20, r23 33c32: 09 f0 breq .+2 ; 0x33c36 33c34: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 33c36: 8f 5f subi r24, 0xFF ; 255 33c38: 8f 70 andi r24, 0x0F ; 15 33c3a: eb cf rjmp .-42 ; 0x33c12 && e_active(); 33c3c: 99 23 and r25, r25 33c3e: f1 f0 breq .+60 ; 0x33c7c SERIAL_ECHOLNPGM("FINDA filament runout!"); 33c40: 87 e1 ldi r24, 0x17 ; 23 33c42: 97 ea ldi r25, 0xA7 ; 167 33c44: 0e 94 06 7b call 0xf60c ; 0xf60c 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); 33c48: 20 e0 ldi r18, 0x00 ; 0 33c4a: 30 e0 ldi r19, 0x00 ; 0 33c4c: a9 01 movw r20, r18 33c4e: ca 01 movw r24, r20 33c50: b9 01 movw r22, r18 33c52: 0e 94 6a 8a call 0x114d4 ; 0x114d4 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 33c56: 60 e0 ldi r22, 0x00 ; 0 33c58: 70 e0 ldi r23, 0x00 ; 0 33c5a: cb 01 movw r24, r22 33c5c: 0e 94 f9 68 call 0xd1f2 ; 0xd1f2 33c60: 86 ed ldi r24, 0xD6 ; 214 33c62: 9e e0 ldi r25, 0x0E ; 14 33c64: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 33c68: 81 30 cpi r24, 0x01 ; 1 33c6a: 21 f4 brne .+8 ; 0x33c74 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 33c6c: 0f 94 dd 76 call 0x2edba ; 0x2edba 33c70: 8f 3f cpi r24, 0xFF ; 255 33c72: 91 f5 brne .+100 ; 0x33cd8 enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 33c74: 8f e7 ldi r24, 0x7F ; 127 33c76: 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 33c78: 0f 94 21 77 call 0x2ee42 ; 0x2ee42 break; } } } if (logic.Running()) { 33c7c: 80 91 46 13 lds r24, 0x1346 ; 0x801346 33c80: 82 30 cpi r24, 0x02 ; 2 33c82: 19 f4 brne .+6 ; 0x33c8a state = xState::Active; 33c84: 81 e0 ldi r24, 0x01 ; 1 33c86: 80 93 98 13 sts 0x1398, r24 ; 0x801398 mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { logicStepLastStatus = LogicStep(reportErrors); // it looks like the mmu_loop doesn't need to be a blocking call 33c8a: 10 93 97 13 sts 0x1397, r17 ; 0x801397 // UI to resolve the error screen, for example tuning Idler Stallguard Threshold // Set to false to allow the error screen to render again. static bool putErrorScreenToSleep; void CheckErrorScreenUserInput() { if (is_mmu_error_monitor_active) { 33c8e: 80 91 74 07 lds r24, 0x0774 ; 0x800774 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.509> 33c92: 88 23 and r24, r24 33c94: 51 f0 breq .+20 ; 0x33caa bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 33c96: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> 33c9a: 81 11 cpse r24, r1 33c9c: 06 c0 rjmp .+12 ; 0x33caa 33c9e: 80 91 90 13 lds r24, 0x1390 ; 0x801390 33ca2: 90 91 91 13 lds r25, 0x1391 ; 0x801391 33ca6: 0f 94 b7 c4 call 0x3896e ; 0x3896e CheckErrorScreenUserInput(); } 33caa: a0 96 adiw r28, 0x20 ; 32 33cac: 0f b6 in r0, 0x3f ; 63 33cae: f8 94 cli 33cb0: de bf out 0x3e, r29 ; 62 33cb2: 0f be out 0x3f, r0 ; 63 33cb4: cd bf out 0x3d, r28 ; 61 33cb6: df 91 pop r29 33cb8: cf 91 pop r28 33cba: 1f 91 pop r17 33cbc: 0f 91 pop r16 33cbe: ff 90 pop r15 33cc0: ef 90 pop r14 33cc2: df 90 pop r13 33cc4: cf 90 pop r12 33cc6: bf 90 pop r11 33cc8: af 90 pop r10 33cca: 9f 90 pop r9 33ccc: 8f 90 pop r8 33cce: 7f 90 pop r7 33cd0: 6f 90 pop r6 33cd2: 5f 90 pop r5 33cd4: 4f 90 pop r4 33cd6: 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 33cd8: 8d e0 ldi r24, 0x0D ; 13 33cda: 97 ea ldi r25, 0xA7 ; 167 33cdc: cd cf rjmp .-102 ; 0x33c78 33cde: 00 91 6b 13 lds r16, 0x136B ; 0x80136b ReportProgressHook((CommandInProgress)logic.CommandInProgress(), pc); LogEchoEvent_P(_O(ProgressCodeToText(pc))); } void MMU2::OnMMUProgressMsg(ProgressCode pc) { if (pc != lastProgressCode) { 33ce2: 80 91 8f 13 lds r24, 0x138F ; 0x80138f 33ce6: 08 17 cp r16, r24 33ce8: 09 f4 brne .+2 ; 0x33cec 33cea: 49 c0 rjmp .+146 ; 0x33d7e // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 33cec: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33cf0: 84 30 cpi r24, 0x04 ; 4 33cf2: b9 f4 brne .+46 ; 0x33d22 break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 33cf4: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 33cf8: 88 23 and r24, r24 33cfa: 99 f0 breq .+38 ; 0x33d22 custom_message_type = CustomMsg::MMUProgress; 33cfc: 89 e0 ldi r24, 0x09 ; 9 33cfe: 80 93 75 07 sts 0x0775, r24 ; 0x800775 : static_cast(pgm_read_ptr(&progressTexts[0])); 33d02: e3 ed ldi r30, 0xD3 ; 211 33d04: 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])) 33d06: 0e 31 cpi r16, 0x1E ; 30 33d08: 30 f4 brcc .+12 ; 0x33d16 33d0a: e0 2f mov r30, r16 33d0c: f0 e0 ldi r31, 0x00 ; 0 33d0e: ee 0f add r30, r30 33d10: ff 1f adc r31, r31 33d12: ed 52 subi r30, 0x2D ; 45 33d14: f9 45 sbci r31, 0x59 ; 89 : static_cast(pgm_read_ptr(&progressTexts[0])); 33d16: 85 91 lpm r24, Z+ 33d18: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 33d1a: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 33d1e: 0f 94 ea 0b call 0x217d4 ; 0x217d4 33d22: e3 ed ldi r30, 0xD3 ; 211 33d24: 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])) 33d26: 0e 31 cpi r16, 0x1E ; 30 33d28: 30 f4 brcc .+12 ; 0x33d36 33d2a: e0 2f mov r30, r16 33d2c: f0 e0 ldi r31, 0x00 ; 0 33d2e: ee 0f add r30, r30 33d30: ff 1f adc r31, r31 33d32: ed 52 subi r30, 0x2D ; 45 33d34: f9 45 sbci r31, 0x59 ; 89 : static_cast(pgm_read_ptr(&progressTexts[0])); 33d36: 85 91 lpm r24, Z+ 33d38: 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))); 33d3a: 02 96 adiw r24, 0x02 ; 2 33d3c: 0f 94 54 c3 call 0x386a8 ; 0x386a8 } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 33d40: 00 93 8f 13 sts 0x138F, r16 ; 0x80138f switch (pc) { 33d44: 03 30 cpi r16, 0x03 ; 3 33d46: 49 f0 breq .+18 ; 0x33d5a 33d48: 0c 31 cpi r16, 0x1C ; 28 33d4a: 09 f0 breq .+2 ; 0x33d4e 33d4c: 97 cf rjmp .-210 ; 0x33c7c bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33d4e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 33d52: 81 e0 ldi r24, 0x01 ; 1 33d54: 80 93 9a 13 sts 0x139A, r24 ; 0x80139a 33d58: 91 cf rjmp .-222 ; 0x33c7c 33d5a: 80 91 2b 13 lds r24, 0x132B ; 0x80132b 33d5e: 84 30 cpi r24, 0x04 ; 4 33d60: 31 f4 brne .+12 ; 0x33d6e ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 33d62: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 33d66: 84 55 subi r24, 0x54 ; 84 33d68: 82 30 cpi r24, 0x02 ; 2 33d6a: 08 f4 brcc .+2 ; 0x33d6e 33d6c: 87 cf rjmp .-242 ; 0x33c7c 33d6e: 0f 94 2c 59 call 0x2b258 ; 0x2b258 // 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; 33d72: 81 e0 ldi r24, 0x01 ; 1 33d74: 80 93 9b 13 sts 0x139B, r24 ; 0x80139b if (unloadFilamentStarted && !planner_any_moves()) { // Only plan a move if there is no move ongoing switch (WhereIsFilament()) { case FilamentState::AT_FSENSOR: case FilamentState::IN_NOZZLE: case FilamentState::UNAVAILABLE: // actually Unavailable makes sense as well to start the E-move to release the filament from the gears HelpUnloadToFinda(); 33d78: 0f 94 2c 74 call 0x2e858 ; 0x2e858 33d7c: 7f cf rjmp .-258 ; 0x33c7c 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) { 33d7e: 03 30 cpi r16, 0x03 ; 3 33d80: 71 f1 breq .+92 ; 0x33dde 33d82: 0c 31 cpi r16, 0x1C ; 28 33d84: 09 f0 breq .+2 ; 0x33d88 33d86: 7a cf rjmp .-268 ; 0x33c7c unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 33d88: 80 91 9a 13 lds r24, 0x139A ; 0x80139a 33d8c: 88 23 and r24, r24 33d8e: 09 f4 brne .+2 ; 0x33d92 33d90: 75 cf rjmp .-278 ; 0x33c7c switch (WhereIsFilament()) { 33d92: 0f 94 64 c3 call 0x386c8 ; 0x386c8 33d96: 88 23 and r24, r24 33d98: b1 f1 breq .+108 ; 0x33e06 33d9a: 81 30 cpi r24, 0x01 ; 1 33d9c: 09 f0 breq .+2 ; 0x33da0 33d9e: 6e cf rjmp .-292 ; 0x33c7c case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 33da0: 10 92 9a 13 sts 0x139A, r1 ; 0x80139a float move_raise_z(float delta) { return raise_z(delta); } void planner_abort_queued_moves() { planner_abort_hard(); 33da4: 0f 94 0d bc call 0x3781a ; 0x3781a // 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; 33da8: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 33dac: 60 91 76 13 lds r22, 0x1376 ; 0x801376 33db0: 70 e0 ldi r23, 0x00 ; 0 33db2: 90 e0 ldi r25, 0x00 ; 0 33db4: 80 e0 ldi r24, 0x00 ; 0 33db6: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 33dba: 6b 01 movw r12, r22 33dbc: 7c 01 movw r14, r24 33dbe: 60 91 75 13 lds r22, 0x1375 ; 0x801375 33dc2: 70 e0 ldi r23, 0x00 ; 0 33dc4: 6e 5f subi r22, 0xFE ; 254 33dc6: 7f 4f sbci r23, 0xFF ; 255 33dc8: 07 2e mov r0, r23 33dca: 00 0c add r0, r0 33dcc: 88 0b sbc r24, r24 33dce: 99 0b sbc r25, r25 33dd0: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 33dd4: a7 01 movw r20, r14 33dd6: 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()); 33dd8: 0f 94 30 c3 call 0x38660 ; 0x38660 33ddc: 4f cf rjmp .-354 ; 0x33c7c } 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 33dde: 80 91 9b 13 lds r24, 0x139B ; 0x80139b 33de2: 88 23 and r24, r24 33de4: 09 f4 brne .+2 ; 0x33de8 33de6: 4a cf rjmp .-364 ; 0x33c7c 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); 33de8: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 33dec: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 33df0: 98 13 cpse r25, r24 33df2: 44 cf rjmp .-376 ; 0x33c7c switch (WhereIsFilament()) { 33df4: 0f 94 64 c3 call 0x386c8 ; 0x386c8 33df8: 81 50 subi r24, 0x01 ; 1 33dfa: 83 30 cpi r24, 0x03 ; 3 33dfc: 08 f4 brcc .+2 ; 0x33e00 33dfe: bc cf rjmp .-136 ; 0x33d78 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; 33e00: 10 92 9b 13 sts 0x139B, r1 ; 0x80139b 33e04: 3b cf rjmp .-394 ; 0x33c7c 33e06: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 33e0a: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); } break; case FilamentState::NOT_PRESENT: // fsensor not triggered, continue moving extruder if (!planner_any_moves()) { // Only plan a move if there is no move ongoing 33e0e: 98 13 cpse r25, r24 33e10: 35 cf rjmp .-406 ; 0x33c7c // 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()); 33e12: 60 91 76 13 lds r22, 0x1376 ; 0x801376 33e16: 70 e0 ldi r23, 0x00 ; 0 33e18: 90 e0 ldi r25, 0x00 ; 0 33e1a: 80 e0 ldi r24, 0x00 ; 0 33e1c: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 33e20: 9b 01 movw r18, r22 33e22: ac 01 movw r20, r24 33e24: 60 e0 ldi r22, 0x00 ; 0 33e26: 70 e0 ldi r23, 0x00 ; 0 33e28: 8f ea ldi r24, 0xAF ; 175 33e2a: 93 e4 ldi r25, 0x43 ; 67 33e2c: d5 cf rjmp .-86 ; 0x33dd8 // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 33e2e: 18 30 cpi r17, 0x08 ; 8 33e30: b9 f0 breq .+46 ; 0x33e60 33e32: 19 30 cpi r17, 0x09 ; 9 33e34: 09 f0 breq .+2 ; 0x33e38 33e36: 22 cf rjmp .-444 ; 0x33c7c StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 33e38: 60 e0 ldi r22, 0x00 ; 0 33e3a: 0f 94 a4 83 call 0x30748 ; 0x30748 33e3e: 19 e0 ldi r17, 0x09 ; 9 33e40: 1d cf rjmp .-454 ; 0x33c7c default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 33e42: 61 e0 ldi r22, 0x01 ; 1 33e44: 80 91 69 13 lds r24, 0x1369 ; 0x801369 33e48: 90 91 6a 13 lds r25, 0x136A ; 0x80136a ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33e4c: 0f 94 a4 83 call 0x30748 ; 0x30748 33e50: 15 cf rjmp .-470 ; 0x33c7c case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 33e52: 82 e0 ldi r24, 0x02 ; 2 33e54: 80 93 98 13 sts 0x1398, r24 ; 0x801398 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 33e58: 60 e0 ldi r22, 0x00 ; 0 33e5a: 8e e2 ldi r24, 0x2E ; 46 33e5c: 90 e8 ldi r25, 0x80 ; 128 33e5e: f6 cf rjmp .-20 ; 0x33e4c StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 33e60: 10 92 98 13 sts 0x1398, r1 ; 0x801398 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 33e64: 10 92 46 13 sts 0x1346, r1 ; 0x801346 currentScope = Scope::Stopped; 33e68: 10 92 2b 13 sts 0x132B, r1 ; 0x80132b ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 33e6c: 60 e0 ldi r22, 0x00 ; 0 33e6e: 8c e2 ldi r24, 0x2C ; 44 33e70: 90 e8 ldi r25, 0x80 ; 128 33e72: ec cf rjmp .-40 ; 0x33e4c break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 33e74: 0f 94 93 70 call 0x2e126 ; 0x2e126 33e78: aa cd rjmp .-1196 ; 0x339ce case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33e7a: 00 23 and r16, r16 33e7c: 01 f3 breq .-64 ; 0x33e3e 33e7e: dc cf rjmp .-72 ; 0x33e38 00033e80 : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 33e80: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33e84: 82 ff sbrs r24, 2 33e86: 07 c0 rjmp .+14 ; 0x33e96 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 33e88: 8b 7f andi r24, 0xFB ; 251 33e8a: 80 93 99 13 sts 0x1399, r24 ; 0x801399 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 33e8e: 81 e6 ldi r24, 0x61 ; 97 33e90: 98 ea ldi r25, 0xA8 ; 168 33e92: 0f 94 54 c3 call 0x386a8 ; 0x386a8 } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 33e96: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33e9a: 81 ff sbrs r24, 1 33e9c: 52 c0 rjmp .+164 ; 0x33f42 33e9e: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33ea2: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33ea6: 89 2b or r24, r25 33ea8: 09 f4 brne .+2 ; 0x33eac 33eaa: 4b c0 rjmp .+150 ; 0x33f42 LogEchoEvent_P(PSTR("Resuming Temp")); 33eac: 83 e5 ldi r24, 0x53 ; 83 33eae: 98 ea ldi r25, 0xA8 ; 168 33eb0: 0f 94 54 c3 call 0x386a8 ; 0x386a8 // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 33eb4: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33eb8: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33ebc: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 mmu_print_saved &= ~(SavedState::Cooldown); 33ec0: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33ec4: 8d 7f andi r24, 0xFD ; 253 33ec6: 80 93 99 13 sts 0x1399, r24 ; 0x801399 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 33eca: 80 91 8d 13 lds r24, 0x138D ; 0x80138d 33ece: 90 91 8e 13 lds r25, 0x138E ; 0x80138e 33ed2: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 33ed6: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); } void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); 33eda: 89 e8 ldi r24, 0x89 ; 137 33edc: 9c e5 ldi r25, 0x5C ; 92 33ede: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 33ee2: 0f 94 85 35 call 0x26b0a ; 0x26b0a 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)); 33ee6: 43 e2 ldi r20, 0x23 ; 35 33ee8: 58 ea ldi r21, 0xA8 ; 168 33eea: 62 e0 ldi r22, 0x02 ; 2 33eec: 80 e0 ldi r24, 0x00 ; 0 33eee: 0e 94 a9 6f call 0xdf52 ; 0xdf52 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 33ef2: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 33ef6: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 33efa: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 33efe: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 33f02: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 33f06: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 33f0a: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 33f0e: c9 01 movw r24, r18 33f10: 86 1b sub r24, r22 33f12: 97 0b sbc r25, r23 33f14: 06 97 sbiw r24, 0x06 ; 6 33f16: 6c f0 brlt .+26 ; 0x33f32 void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 33f18: 81 e0 ldi r24, 0x01 ; 1 33f1a: 0e 94 e2 8b call 0x117c4 ; 0x117c4 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); 33f1e: 80 e0 ldi r24, 0x00 ; 0 33f20: 0f 94 2e 9a call 0x3345c ; 0x3345c ReportErrorHookDynamicRender(); 33f24: 0f 94 78 c2 call 0x384f0 ; 0x384f0 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 33f28: 84 e6 ldi r24, 0x64 ; 100 33f2a: 90 e0 ldi r25, 0x00 ; 0 33f2c: 0e 94 87 8e call 0x11d0e ; 0x11d0e 33f30: e0 cf rjmp .-64 ; 0x33ef2 }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 33f32: 0f 94 4e c2 call 0x3849c ; 0x3849c LogEchoEvent_P(PSTR("Hotend temperature reached")); 33f36: 88 e3 ldi r24, 0x38 ; 56 33f38: 98 ea ldi r25, 0xA8 ; 168 33f3a: 0f 94 54 c3 call 0x386a8 ; 0x386a8 void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 33f3e: 0c 94 c8 6f jmp 0xdf90 ; 0xdf90 ScreenClear(); } } 33f42: 08 95 ret 00033f44 : /// 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) { 33f44: 0f 93 push r16 33f46: 1f 93 push r17 33f48: cf 93 push r28 33f4a: df 93 push r29 33f4c: 00 d0 rcall .+0 ; 0x33f4e 33f4e: 1f 92 push r1 33f50: 1f 92 push r1 33f52: cd b7 in r28, 0x3d ; 61 33f54: de b7 in r29, 0x3e ; 62 33f56: 18 2f mov r17, r24 33f58: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 33f5a: 10 92 99 13 sts 0x1399, r1 ; 0x801399 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 33f5e: 83 e0 ldi r24, 0x03 ; 3 33f60: 80 93 96 02 sts 0x0296, r24 ; 0x800296 LongTimer nozzleTimeout; 33f64: 19 82 std Y+1, r1 ; 0x01 33f66: 1a 82 std Y+2, r1 ; 0x02 33f68: 1b 82 std Y+3, r1 ; 0x03 33f6a: 1c 82 std Y+4, r1 ; 0x04 33f6c: 1d 82 std Y+5, r1 ; 0x05 33f6e: 90 e0 ldi r25, 0x00 ; 0 33f70: 80 e0 ldi r24, 0x00 ; 0 33f72: 0e 94 87 8e call 0x11d0e ; 0x11d0e // - 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) { 33f76: 90 91 99 13 lds r25, 0x1399 ; 0x801399 33f7a: 89 81 ldd r24, Y+1 ; 0x01 33f7c: 92 ff sbrs r25, 2 33f7e: 37 c0 rjmp .+110 ; 0x33fee if (!nozzleTimeout.running()) { 33f80: 81 11 cpse r24, r1 33f82: 1e c0 rjmp .+60 ; 0x33fc0 nozzleTimeout.start(); 33f84: ce 01 movw r24, r28 33f86: 01 96 adiw r24, 0x01 ; 1 33f88: 0f 94 2e 42 call 0x2845c ; 0x2845c ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33f8c: 8d e4 ldi r24, 0x4D ; 77 33f8e: 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")); 33f90: 0f 94 54 c3 call 0x386a8 ; 0x386a8 } switch (logicStepLastStatus) { 33f94: e0 91 97 13 lds r30, 0x1397 ; 0x801397 33f98: e2 50 subi r30, 0x02 ; 2 33f9a: ea 30 cpi r30, 0x0A ; 10 33f9c: 40 f7 brcc .-48 ; 0x33f6e 33f9e: f0 e0 ldi r31, 0x00 ; 0 33fa0: 88 27 eor r24, r24 33fa2: ea 52 subi r30, 0x2A ; 42 33fa4: f0 46 sbci r31, 0x60 ; 96 33fa6: 8e 4f sbci r24, 0xFE ; 254 33fa8: 0d 94 a1 de jmp 0x3bd42 ; 0x3bd42 <__tablejump2__> 33fac: 4a 3b cpi r20, 0xBA ; 186 33fae: 60 3a cpi r22, 0xA0 ; 160 33fb0: 5a 3a cpi r21, 0xAA ; 170 33fb2: 5a 3a cpi r21, 0xAA ; 170 33fb4: 52 3b cpi r21, 0xB2 ; 178 33fb6: 5a 3a cpi r21, 0xAA ; 170 33fb8: b4 3a cpi r27, 0xA4 ; 164 33fba: f0 39 cpi r31, 0x90 ; 144 33fbc: 04 3b cpi r16, 0xB4 ; 180 33fbe: 5a 3a cpi r21, 0xAA ; 170 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. 33fc0: 40 e4 ldi r20, 0x40 ; 64 33fc2: 57 e7 ldi r21, 0x77 ; 119 33fc4: 6b e1 ldi r22, 0x1B ; 27 33fc6: 70 e0 ldi r23, 0x00 ; 0 33fc8: ce 01 movw r24, r28 33fca: 01 96 adiw r24, 0x01 ; 1 33fcc: 0f 94 6f 40 call 0x280de ; 0x280de ::expired(unsigned long)> 33fd0: 88 23 and r24, r24 33fd2: 01 f3 breq .-64 ; 0x33f94 mmu_print_saved &= ~(SavedState::CooldownPending); 33fd4: 80 91 99 13 lds r24, 0x1399 ; 0x801399 33fd8: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33fda: 82 60 ori r24, 0x02 ; 2 33fdc: 80 93 99 13 sts 0x1399, r24 ; 0x801399 33fe0: 10 92 6e 0e sts 0x0E6E, r1 ; 0x800e6e 33fe4: 10 92 6d 0e sts 0x0E6D, r1 ; 0x800e6d thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33fe8: 8d e3 ldi r24, 0x3D ; 61 33fea: 96 ea ldi r25, 0xA6 ; 166 33fec: d1 cf rjmp .-94 ; 0x33f90 } } else if (nozzleTimeout.running()) { 33fee: 88 23 and r24, r24 33ff0: 89 f2 breq .-94 ; 0x33f94 33ff2: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33ff4: 87 e2 ldi r24, 0x27 ; 39 33ff6: 96 ea ldi r25, 0xA6 ; 166 33ff8: cb cf rjmp .-106 ; 0x33f90 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(); 33ffa: 0f 94 40 9f call 0x33e80 ; 0x33e80 ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33ffe: 0f 94 52 74 call 0x2e8a4 ; 0x2e8a4 if (!TuneMenuEntered()) { 34002: 80 91 5e 0e lds r24, 0x0E5E ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> 34006: 81 11 cpse r24, r1 34008: 07 c0 rjmp .+14 ; 0x34018 retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 3400a: 84 e1 ldi r24, 0x14 ; 20 3400c: 96 ea ldi r25, 0xA6 ; 166 3400e: 0e 94 06 7b call 0xf60c ; 0xf60c retryAttempts = MAX_RETRIES; 34012: 83 e0 ldi r24, 0x03 ; 3 34014: 80 93 7d 13 sts 0x137D, r24 ; 0x80137d bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 34018: 0f 94 2c 59 call 0x2b258 ; 0x2b258 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; 3401c: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 3401e: 0f 90 pop r0 34020: 0f 90 pop r0 34022: 0f 90 pop r0 34024: 0f 90 pop r0 34026: 0f 90 pop r0 34028: df 91 pop r29 3402a: cf 91 pop r28 3402c: 1f 91 pop r17 3402e: 0f 91 pop r16 34030: 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(); 34032: 0f 94 75 99 call 0x332ea ; 0x332ea 34036: f2 cf rjmp .-28 ; 0x3401c break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 34038: 80 91 7e 13 lds r24, 0x137E ; 0x80137e 3403c: 81 11 cpse r24, r1 3403e: 97 cf rjmp .-210 ; 0x33f6e // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 34040: 81 2f mov r24, r17 34042: 0f 94 9e 74 call 0x2e93c ; 0x2e93c SaveHotendTemp(turn_off_nozzle); 34046: 80 2f mov r24, r16 34048: 0f 94 36 74 call 0x2e86c ; 0x2e86c CheckUserInput(); 3404c: 0f 94 75 99 call 0x332ea ; 0x332ea 34050: 8e cf rjmp .-228 ; 0x33f6e } 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(); 34052: 0f 94 40 9f call 0x33e80 ; 0x33e80 ResumeUnpark(); 34056: 0f 94 52 74 call 0x2e8a4 ; 0x2e8a4 3405a: 89 cf rjmp .-238 ; 0x33f6e } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 3405c: 80 e0 ldi r24, 0x00 ; 0 3405e: df cf rjmp .-66 ; 0x3401e 00034060 : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 34060: cf 93 push r28 34062: df 93 push r29 34064: 00 d0 rcall .+0 ; 0x34066 34066: 1f 92 push r1 34068: 1f 92 push r1 3406a: cd b7 in r28, 0x3d ; 61 3406c: 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; 3406e: 10 92 8a 17 sts 0x178A, r1 ; 0x80178a fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 34072: 10 92 89 17 sts 0x1789, r1 ; 0x801789 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 34076: 62 e1 ldi r22, 0x12 ; 18 34078: 84 e8 ldi r24, 0x84 ; 132 3407a: 95 ea ldi r25, 0xA5 ; 165 3407c: 0f 94 2d 88 call 0x3105a ; 0x3105a 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(); 34080: 0f 94 2e c3 call 0x3865c ; 0x3865c void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 34084: 40 e0 ldi r20, 0x00 ; 0 34086: 65 e5 ldi r22, 0x55 ; 85 34088: ce 01 movw r24, r28 3408a: 01 96 adiw r24, 0x01 ; 1 3408c: 0f 94 0c c3 call 0x38618 ; 0x38618 34090: 49 81 ldd r20, Y+1 ; 0x01 34092: 5a 81 ldd r21, Y+2 ; 0x02 34094: 6b 81 ldd r22, Y+3 ; 0x03 34096: 7c 81 ldd r23, Y+4 ; 0x04 34098: 8d 81 ldd r24, Y+5 ; 0x05 3409a: 0f 94 7e 98 call 0x330fc ; 0x330fc logic.UnloadFilament(); if (manage_response(false, true)) { 3409e: 61 e0 ldi r22, 0x01 ; 1 340a0: 80 e0 ldi r24, 0x00 ; 0 340a2: 0f 94 a2 9f call 0x33f44 ; 0x33f44 340a6: 81 11 cpse r24, r1 340a8: 03 c0 rjmp .+6 ; 0x340b0 break; } IncrementMMUFails(); 340aa: 0f 94 70 c2 call 0x384e0 ; 0x384e0 340ae: e8 cf rjmp .-48 ; 0x34080 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); 340b0: 83 e0 ldi r24, 0x03 ; 3 340b2: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 340b6: 83 e6 ldi r24, 0x63 ; 99 340b8: 0f 94 d5 87 call 0x30faa ; 0x30faa tool_change_extruder = MMU2_NO_TOOL; 340bc: 83 e6 ldi r24, 0x63 ; 99 340be: 80 93 80 13 sts 0x1380, r24 ; 0x801380 #ifdef FSENSOR_PROBING bool IR_sensor::probeOtherType() { return pat9125_probe(); } #endif void IR_sensor::settings_init() { Filament_sensor::settings_init_common(); } 340c2: 88 e8 ldi r24, 0x88 ; 136 340c4: 97 e1 ldi r25, 0x17 ; 23 340c6: 0e 94 84 75 call 0xeb08 ; 0xeb08 } 340ca: 0f 90 pop r0 340cc: 0f 90 pop r0 340ce: 0f 90 pop r0 340d0: 0f 90 pop r0 340d2: 0f 90 pop r0 340d4: df 91 pop r29 340d6: cf 91 pop r28 340d8: 08 95 ret 000340da : bool MMU2::unload() { 340da: cf 93 push r28 if (!WaitForMMUReady()) { 340dc: 0f 94 56 88 call 0x310ac ; 0x310ac 340e0: c8 2f mov r28, r24 340e2: 88 23 and r24, r24 340e4: 79 f0 breq .+30 ; 0x34104 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 340e6: 88 ec ldi r24, 0xC8 ; 200 340e8: 90 e0 ldi r25, 0x00 ; 0 340ea: 0f 94 ad c6 call 0x38d5a ; 0x38d5a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]> 340ee: 82 e0 ldi r24, 0x02 ; 2 340f0: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 340f4: 0f 94 ca 87 call 0x30f94 ; 0x30f94 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 340f8: 0f 94 30 a0 call 0x34060 ; 0x34060 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 340fc: 0f 94 4b 88 call 0x31096 ; 0x31096 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 34100: 0f 94 4e c2 call 0x3849c ; 0x3849c return true; } 34104: 8c 2f mov r24, r28 34106: cf 91 pop r28 34108: 08 95 ret 0003410a : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 3410a: 0f 93 push r16 3410c: 1f 93 push r17 3410e: cf 93 push r28 34110: df 93 push r29 34112: 00 d0 rcall .+0 ; 0x34114 34114: 1f 92 push r1 34116: 1f 92 push r1 34118: cd b7 in r28, 0x3d ; 61 3411a: de b7 in r29, 0x3e ; 62 3411c: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 3411e: 0f 94 56 88 call 0x310ac ; 0x310ac 34122: 18 2f mov r17, r24 34124: 88 23 and r24, r24 34126: 49 f1 breq .+82 ; 0x3417a void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 34128: 86 e7 ldi r24, 0x76 ; 118 3412a: 9c e5 ldi r25, 0x5C ; 92 3412c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 34130: 60 2f mov r22, r16 34132: 0f 94 51 c2 call 0x384a2 ; 0x384a2 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 34136: 0f 94 ca 87 call 0x30f94 ; 0x30f94 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 3413a: 0f 94 2e c3 call 0x3865c ; 0x3865c } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 3413e: 40 2f mov r20, r16 34140: 6c e4 ldi r22, 0x4C ; 76 34142: ce 01 movw r24, r28 34144: 01 96 adiw r24, 0x01 ; 1 34146: 0f 94 0c c3 call 0x38618 ; 0x38618 3414a: 49 81 ldd r20, Y+1 ; 0x01 3414c: 5a 81 ldd r21, Y+2 ; 0x02 3414e: 6b 81 ldd r22, Y+3 ; 0x03 34150: 7c 81 ldd r23, Y+4 ; 0x04 34152: 8d 81 ldd r24, Y+5 ; 0x05 34154: 0f 94 7e 98 call 0x330fc ; 0x330fc logic.LoadFilament(slot); if (manage_response(false, false)) { 34158: 60 e0 ldi r22, 0x00 ; 0 3415a: 80 e0 ldi r24, 0x00 ; 0 3415c: 0f 94 a2 9f call 0x33f44 ; 0x33f44 34160: 18 2f mov r17, r24 34162: 81 11 cpse r24, r1 34164: 03 c0 rjmp .+6 ; 0x3416c break; } IncrementMMUFails(); 34166: 0f 94 70 c2 call 0x384e0 ; 0x384e0 3416a: e7 cf rjmp .-50 ; 0x3413a 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); 3416c: 83 e0 ldi r24, 0x03 ; 3 3416e: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34172: 0f 94 4b 88 call 0x31096 ; 0x31096 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 34176: 0f 94 4e c2 call 0x3849c ; 0x3849c return true; } 3417a: 81 2f mov r24, r17 3417c: 0f 90 pop r0 3417e: 0f 90 pop r0 34180: 0f 90 pop r0 34182: 0f 90 pop r0 34184: 0f 90 pop r0 34186: df 91 pop r29 34188: cf 91 pop r28 3418a: 1f 91 pop r17 3418c: 0f 91 pop r16 3418e: 08 95 ret 00034190 : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 34190: ff 92 push r15 34192: 0f 93 push r16 34194: 1f 93 push r17 34196: cf 93 push r28 34198: df 93 push r29 3419a: 00 d0 rcall .+0 ; 0x3419c 3419c: 1f 92 push r1 3419e: 1f 92 push r1 341a0: cd b7 in r28, 0x3d ; 61 341a2: de b7 in r29, 0x3e ; 62 341a4: 08 2f mov r16, r24 341a6: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 341a8: 0f 94 56 88 call 0x310ac ; 0x310ac 341ac: 18 2f mov r17, r24 341ae: 88 23 and r24, r24 341b0: b1 f1 breq .+108 ; 0x3421e return false; } if (enableFullScreenMsg) { 341b2: ff 20 and r15, r15 341b4: 39 f0 breq .+14 ; 0x341c4 void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 341b6: 85 e6 ldi r24, 0x65 ; 101 341b8: 9c e5 ldi r25, 0x5C ; 92 341ba: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 341be: 60 2f mov r22, r16 341c0: 0f 94 51 c2 call 0x384a2 ; 0x384a2 FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 341c4: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 341c8: 81 11 cpse r24, r1 unload(); 341ca: 0f 94 6d a0 call 0x340da ; 0x340da struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 341ce: 0f 94 ca 87 call 0x30f94 ; 0x30f94 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 341d2: 0f 94 2e c3 call 0x3865c ; 0x3865c } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 341d6: 40 2f mov r20, r16 341d8: 65 e4 ldi r22, 0x45 ; 69 341da: ce 01 movw r24, r28 341dc: 01 96 adiw r24, 0x01 ; 1 341de: 0f 94 0c c3 call 0x38618 ; 0x38618 341e2: 49 81 ldd r20, Y+1 ; 0x01 341e4: 5a 81 ldd r21, Y+2 ; 0x02 341e6: 6b 81 ldd r22, Y+3 ; 0x03 341e8: 7c 81 ldd r23, Y+4 ; 0x04 341ea: 8d 81 ldd r24, Y+5 ; 0x05 341ec: 0f 94 7e 98 call 0x330fc ; 0x330fc logic.EjectFilament(slot); if (manage_response(false, true)) { 341f0: 61 e0 ldi r22, 0x01 ; 1 341f2: 80 e0 ldi r24, 0x00 ; 0 341f4: 0f 94 a2 9f call 0x33f44 ; 0x33f44 341f8: 18 2f mov r17, r24 341fa: 81 11 cpse r24, r1 341fc: 03 c0 rjmp .+6 ; 0x34204 break; } IncrementMMUFails(); 341fe: 0f 94 70 c2 call 0x384e0 ; 0x384e0 34202: e7 cf rjmp .-50 ; 0x341d2 } SetCurrentTool(MMU2_NO_TOOL); 34204: 83 e6 ldi r24, 0x63 ; 99 34206: 0f 94 d5 87 call 0x30faa ; 0x30faa tool_change_extruder = MMU2_NO_TOOL; 3420a: 83 e6 ldi r24, 0x63 ; 99 3420c: 80 93 80 13 sts 0x1380, r24 ; 0x801380 bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 34210: 83 e0 ldi r24, 0x03 ; 3 34212: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 34216: 0f 94 4b 88 call 0x31096 ; 0x31096 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 3421a: 0f 94 4e c2 call 0x3849c ; 0x3849c return true; } 3421e: 81 2f mov r24, r17 34220: 0f 90 pop r0 34222: 0f 90 pop r0 34224: 0f 90 pop r0 34226: 0f 90 pop r0 34228: 0f 90 pop r0 3422a: df 91 pop r29 3422c: cf 91 pop r28 3422e: 1f 91 pop r17 34230: 0f 91 pop r16 34232: ff 90 pop r15 34234: 08 95 ret 00034236 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 34236: 1f 93 push r17 34238: cf 93 push r28 3423a: df 93 push r29 3423c: 00 d0 rcall .+0 ; 0x3423e 3423e: 1f 92 push r1 34240: 1f 92 push r1 34242: cd b7 in r28, 0x3d ; 61 34244: de b7 in r29, 0x3e ; 62 34246: 18 2f mov r17, r24 for (;;) { Disable_E0(); 34248: 0f 94 2e c3 call 0x3865c ; 0x3865c } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 3424c: 41 2f mov r20, r17 3424e: 6b e4 ldi r22, 0x4B ; 75 34250: ce 01 movw r24, r28 34252: 01 96 adiw r24, 0x01 ; 1 34254: 0f 94 0c c3 call 0x38618 ; 0x38618 34258: 49 81 ldd r20, Y+1 ; 0x01 3425a: 5a 81 ldd r21, Y+2 ; 0x02 3425c: 6b 81 ldd r22, Y+3 ; 0x03 3425e: 7c 81 ldd r23, Y+4 ; 0x04 34260: 8d 81 ldd r24, Y+5 ; 0x05 34262: 0f 94 7e 98 call 0x330fc ; 0x330fc logic.CutFilament(slot); if (manage_response(false, true)) { 34266: 61 e0 ldi r22, 0x01 ; 1 34268: 80 e0 ldi r24, 0x00 ; 0 3426a: 0f 94 a2 9f call 0x33f44 ; 0x33f44 3426e: 81 11 cpse r24, r1 34270: 03 c0 rjmp .+6 ; 0x34278 break; } IncrementMMUFails(); 34272: 0f 94 70 c2 call 0x384e0 ; 0x384e0 34276: e8 cf rjmp .-48 ; 0x34248 } } 34278: 0f 90 pop r0 3427a: 0f 90 pop r0 3427c: 0f 90 pop r0 3427e: 0f 90 pop r0 34280: 0f 90 pop r0 34282: df 91 pop r29 34284: cf 91 pop r28 34286: 1f 91 pop r17 34288: 08 95 ret 0003428a : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 3428a: cf 93 push r28 3428c: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 3428e: 86 e5 ldi r24, 0x56 ; 86 34290: 9c e5 ldi r25, 0x5C ; 92 34292: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 34296: 6c 2f mov r22, r28 34298: 0f 94 51 c2 call 0x384a2 ; 0x384a2 if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 3429c: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 342a0: 81 11 cpse r24, r1 unload(); 342a2: 0f 94 6d a0 call 0x340da ; 0x340da struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 342a6: 0f 94 ca 87 call 0x30f94 ; 0x30f94 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 342aa: 8c 2f mov r24, r28 342ac: 0f 94 1b a1 call 0x34236 ; 0x34236 SetCurrentTool(MMU2_NO_TOOL); 342b0: 83 e6 ldi r24, 0x63 ; 99 342b2: 0f 94 d5 87 call 0x30faa ; 0x30faa tool_change_extruder = MMU2_NO_TOOL; 342b6: 83 e6 ldi r24, 0x63 ; 99 342b8: 80 93 80 13 sts 0x1380, r24 ; 0x801380 bool cutter_enabled(){ return eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) == EEPROM_MMU_CUTTER_ENABLED_enabled; } void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); 342bc: 83 e0 ldi r24, 0x03 ; 3 342be: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 342c2: 0f 94 4b 88 call 0x31096 ; 0x31096 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 342c6: 0f 94 4e c2 call 0x3849c ; 0x3849c return true; } 342ca: 81 e0 ldi r24, 0x01 ; 1 342cc: cf 91 pop r28 342ce: 08 95 ret 000342d0 : ch = UDR0; return ch; } static void putch(char ch) { while (!(UCSR0A & _BV(UDRE0))); 342d0: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 342d4: 95 ff sbrs r25, 5 342d6: fc cf rjmp .-8 ; 0x342d0 UDR0 = ch; 342d8: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> } 342dc: 08 95 ret 000342de : #define RECV_READY ((UCSR0A & _BV(RXC0)) != 0) static uint8_t getch(void) { uint8_t ch; while(! RECV_READY) ; 342de: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 342e2: 87 ff sbrs r24, 7 342e4: fc cf rjmp .-8 ; 0x342de if (!(UCSR0A & _BV(FE0))) { 342e6: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 342ea: 84 fd sbrc r24, 4 342ec: 01 c0 rjmp .+2 ; 0x342f0 * 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(); 342ee: a8 95 wdr } ch = UDR0; 342f0: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> return ch; } 342f4: 08 95 ret 000342f6 : /// 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; 342f6: 86 27 eor r24, r22 342f8: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 342fa: 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) { 342fc: 38 2f mov r19, r24 342fe: 88 0f add r24, r24 34300: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 34302: 82 27 eor r24, r18 34304: 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++) { 34306: d1 f7 brne .-12 ; 0x342fc } else { data <<= 1U; } } return data; } 34308: 08 95 ret 0003430a : // 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) { 3430a: 2f 92 push r2 3430c: 3f 92 push r3 3430e: 4f 92 push r4 34310: 5f 92 push r5 34312: 6f 92 push r6 34314: 7f 92 push r7 34316: 8f 92 push r8 34318: 9f 92 push r9 3431a: af 92 push r10 3431c: bf 92 push r11 3431e: cf 92 push r12 34320: df 92 push r13 34322: ef 92 push r14 34324: ff 92 push r15 34326: 0f 93 push r16 34328: 1f 93 push r17 3432a: cf 93 push r28 3432c: df 93 push r29 3432e: cd b7 in r28, 0x3d ; 61 34330: de b7 in r29, 0x3e ; 62 34332: a1 97 sbiw r28, 0x21 ; 33 34334: 0f b6 in r0, 0x3f ; 63 34336: f8 94 cli 34338: de bf out 0x3e, r29 ; 62 3433a: 0f be out 0x3f, r0 ; 63 3433c: cd bf out 0x3d, r28 ; 61 3433e: 1c 01 movw r2, r24 34340: 48 01 movw r8, r16 34342: 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) 34344: fc 01 movw r30, r24 34346: e8 5b subi r30, 0xB8 ; 184 34348: ff 4f sbci r31, 0xFF ; 255 3434a: c0 80 ld r12, Z 3434c: d1 80 ldd r13, Z+1 ; 0x01 3434e: e2 80 ldd r14, Z+2 ; 0x02 34350: f3 80 ldd r15, Z+3 ; 0x03 34352: 9a 01 movw r18, r20 34354: ab 01 movw r20, r22 34356: c7 01 movw r24, r14 34358: b6 01 movw r22, r12 3435a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3435e: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 34362: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 34366: 8b 01 movw r16, r22 34368: 8d 83 std Y+5, r24 ; 0x05 3436a: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 3436c: a5 01 movw r20, r10 3436e: 94 01 movw r18, r8 34370: c7 01 movw r24, r14 34372: b6 01 movw r22, r12 34374: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 34378: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 3437c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 34380: 36 2f mov r19, r22 34382: 27 2f mov r18, r23 34384: a8 01 movw r20, r16 34386: 6d 81 ldd r22, Y+5 ; 0x05 34388: 79 81 ldd r23, Y+1 ; 0x01 3438a: 48 37 cpi r20, 0x78 ; 120 3438c: 51 05 cpc r21, r1 3438e: 61 05 cpc r22, r1 34390: 71 05 cpc r23, r1 34392: 20 f4 brcc .+8 ; 0x3439c 34394: 48 e7 ldi r20, 0x78 ; 120 34396: 50 e0 ldi r21, 0x00 ; 0 34398: 60 e0 ldi r22, 0x00 ; 0 3439a: 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) 3439c: d1 01 movw r26, r2 3439e: d6 96 adiw r26, 0x36 ; 54 343a0: 8d 90 ld r8, X+ 343a2: 9d 90 ld r9, X+ 343a4: ad 90 ld r10, X+ 343a6: bc 90 ld r11, X 343a8: d9 97 sbiw r26, 0x39 ; 57 343aa: 8f 8a std Y+23, r8 ; 0x17 343ac: 98 8e std Y+24, r9 ; 0x18 343ae: a9 8e std Y+25, r10 ; 0x19 343b0: ba 8e std Y+26, r11 ; 0x1a 343b2: 48 15 cp r20, r8 343b4: 59 05 cpc r21, r9 343b6: 6a 05 cpc r22, r10 343b8: 7b 05 cpc r23, r11 343ba: 20 f4 brcc .+8 ; 0x343c4 343bc: 4f 8b std Y+23, r20 ; 0x17 343be: 58 8f std Y+24, r21 ; 0x18 343c0: 69 8f std Y+25, r22 ; 0x19 343c2: 7a 8f std Y+26, r23 ; 0x1a 343c4: 43 2f mov r20, r19 343c6: 52 2f mov r21, r18 343c8: bc 01 movw r22, r24 343ca: 48 37 cpi r20, 0x78 ; 120 343cc: 51 05 cpc r21, r1 343ce: 61 05 cpc r22, r1 343d0: 71 05 cpc r23, r1 343d2: 20 f4 brcc .+8 ; 0x343dc 343d4: 48 e7 ldi r20, 0x78 ; 120 343d6: 50 e0 ldi r21, 0x00 ; 0 343d8: 60 e0 ldi r22, 0x00 ; 0 343da: 70 e0 ldi r23, 0x00 ; 0 343dc: 18 2d mov r17, r8 343de: 09 2d mov r16, r9 343e0: a9 a2 std Y+33, r10 ; 0x21 343e2: b8 a2 std Y+32, r11 ; 0x20 343e4: 48 15 cp r20, r8 343e6: 59 05 cpc r21, r9 343e8: 6a 05 cpc r22, r10 343ea: 7b 05 cpc r23, r11 343ec: 20 f4 brcc .+8 ; 0x343f6 343ee: 14 2f mov r17, r20 343f0: 05 2f mov r16, r21 343f2: 69 a3 std Y+33, r22 ; 0x21 343f4: 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; 343f6: f1 01 movw r30, r2 343f8: ee 5b subi r30, 0xBE ; 190 343fa: ff 4f sbci r31, 0xFF ; 255 343fc: c0 80 ld r12, Z 343fe: d1 80 ldd r13, Z+1 ; 0x01 34400: e2 80 ldd r14, Z+2 ; 0x02 34402: f3 80 ldd r15, Z+3 ; 0x03 34404: cd 82 std Y+5, r12 ; 0x05 34406: de 82 std Y+6, r13 ; 0x06 34408: ef 82 std Y+7, r14 ; 0x07 3440a: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 3440c: cd 28 or r12, r13 3440e: ce 28 or r12, r14 34410: cf 28 or r12, r15 34412: 41 f4 brne .+16 ; 0x34424 // Don't allow zero acceleration. acceleration = 1; 34414: c1 2c mov r12, r1 34416: d1 2c mov r13, r1 34418: 76 01 movw r14, r12 3441a: c3 94 inc r12 3441c: cd 82 std Y+5, r12 ; 0x05 3441e: de 82 std Y+6, r13 ; 0x06 34420: ef 82 std Y+7, r14 ; 0x07 34422: 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; 34424: 2f 89 ldd r18, Y+23 ; 0x17 34426: 38 8d ldd r19, Y+24 ; 0x18 34428: 49 8d ldd r20, Y+25 ; 0x19 3442a: 5a 8d ldd r21, Y+26 ; 0x1a 3442c: b9 01 movw r22, r18 3442e: ca 01 movw r24, r20 34430: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__mulsi3> 34434: 6d 87 std Y+13, r22 ; 0x0d 34436: 7e 87 std Y+14, r23 ; 0x0e 34438: 8f 87 std Y+15, r24 ; 0x0f 3443a: 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; 3443c: a5 01 movw r20, r10 3443e: 94 01 movw r18, r8 34440: c5 01 movw r24, r10 34442: b4 01 movw r22, r8 34444: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__mulsi3> 34448: 2b 01 movw r4, r22 3444a: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 3444c: 21 2f mov r18, r17 3444e: 30 2f mov r19, r16 34450: 49 a1 ldd r20, Y+33 ; 0x21 34452: 58 a1 ldd r21, Y+32 ; 0x20 34454: 61 2f mov r22, r17 34456: 70 2f mov r23, r16 34458: ca 01 movw r24, r20 3445a: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__mulsi3> 3445e: 69 8b std Y+17, r22 ; 0x11 34460: 7a 8b std Y+18, r23 ; 0x12 34462: 8b 8b std Y+19, r24 ; 0x13 34464: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 34466: cd 80 ldd r12, Y+5 ; 0x05 34468: de 80 ldd r13, Y+6 ; 0x06 3446a: ef 80 ldd r14, Y+7 ; 0x07 3446c: f8 84 ldd r15, Y+8 ; 0x08 3446e: cc 0c add r12, r12 34470: dd 1c adc r13, r13 34472: ee 1c adc r14, r14 34474: ff 1c adc r15, r15 34476: c9 86 std Y+9, r12 ; 0x09 34478: da 86 std Y+10, r13 ; 0x0a 3447a: eb 86 std Y+11, r14 ; 0x0b 3447c: 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; 3447e: c3 01 movw r24, r6 34480: b2 01 movw r22, r4 34482: 61 50 subi r22, 0x01 ; 1 34484: 71 09 sbc r23, r1 34486: 81 09 sbc r24, r1 34488: 91 09 sbc r25, r1 3448a: cd 84 ldd r12, Y+13 ; 0x0d 3448c: de 84 ldd r13, Y+14 ; 0x0e 3448e: ef 84 ldd r14, Y+15 ; 0x0f 34490: f8 88 ldd r15, Y+16 ; 0x10 34492: 6c 19 sub r22, r12 34494: 7d 09 sbc r23, r13 34496: 8e 09 sbc r24, r14 34498: 9f 09 sbc r25, r15 3449a: c9 84 ldd r12, Y+9 ; 0x09 3449c: da 84 ldd r13, Y+10 ; 0x0a 3449e: eb 84 ldd r14, Y+11 ; 0x0b 344a0: fc 84 ldd r15, Y+12 ; 0x0c 344a2: 6c 0d add r22, r12 344a4: 7d 1d adc r23, r13 344a6: 8e 1d adc r24, r14 344a8: 9f 1d adc r25, r15 344aa: a7 01 movw r20, r14 344ac: 96 01 movw r18, r12 344ae: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 344b2: 69 01 movw r12, r18 344b4: 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; 344b6: c3 01 movw r24, r6 344b8: b2 01 movw r22, r4 344ba: 29 89 ldd r18, Y+17 ; 0x11 344bc: 3a 89 ldd r19, Y+18 ; 0x12 344be: 4b 89 ldd r20, Y+19 ; 0x13 344c0: 5c 89 ldd r21, Y+20 ; 0x14 344c2: 62 1b sub r22, r18 344c4: 73 0b sbc r23, r19 344c6: 84 0b sbc r24, r20 344c8: 95 0b sbc r25, r21 344ca: 29 85 ldd r18, Y+9 ; 0x09 344cc: 3a 85 ldd r19, Y+10 ; 0x0a 344ce: 4b 85 ldd r20, Y+11 ; 0x0b 344d0: 5c 85 ldd r21, Y+12 ; 0x0c 344d2: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 344d6: 29 01 movw r4, r18 344d8: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 344da: d7 01 movw r26, r14 344dc: c6 01 movw r24, r12 344de: 84 0d add r24, r4 344e0: 95 1d adc r25, r5 344e2: a6 1d adc r26, r6 344e4: b7 1d adc r27, r7 344e6: 8c 8f std Y+28, r24 ; 0x1c 344e8: 9d 8f std Y+29, r25 ; 0x1d 344ea: ae 8f std Y+30, r26 ; 0x1e 344ec: 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) { 344ee: f1 01 movw r30, r2 344f0: e4 5b subi r30, 0xB4 ; 180 344f2: ff 4f sbci r31, 0xFF ; 255 344f4: 90 81 ld r25, Z 344f6: 9b 8f std Y+27, r25 ; 0x1b 344f8: 99 23 and r25, r25 344fa: 09 f4 brne .+2 ; 0x344fe 344fc: 8d c0 rjmp .+282 ; 0x34618 final_adv_steps = final_rate * block->adv_comp; 344fe: 61 2f mov r22, r17 34500: 70 2f mov r23, r16 34502: 89 a1 ldd r24, Y+33 ; 0x21 34504: 98 a1 ldd r25, Y+32 ; 0x20 34506: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 3450a: f1 01 movw r30, r2 3450c: ec 5a subi r30, 0xAC ; 172 3450e: ff 4f sbci r31, 0xFF ; 255 34510: 20 81 ld r18, Z 34512: 31 81 ldd r19, Z+1 ; 0x01 34514: 42 81 ldd r20, Z+2 ; 0x02 34516: 53 81 ldd r21, Z+3 ; 0x03 34518: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3451c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 34520: 6d 8b std Y+21, r22 ; 0x15 34522: 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) { 34524: d1 01 movw r26, r2 34526: 50 96 adiw r26, 0x10 ; 16 34528: 2d 91 ld r18, X+ 3452a: 3d 91 ld r19, X+ 3452c: 4d 91 ld r20, X+ 3452e: 5c 91 ld r21, X 34530: 53 97 sbiw r26, 0x13 ; 19 34532: 29 83 std Y+1, r18 ; 0x01 34534: 3a 83 std Y+2, r19 ; 0x02 34536: 4b 83 std Y+3, r20 ; 0x03 34538: 5c 83 std Y+4, r21 ; 0x04 3453a: 8c 8d ldd r24, Y+28 ; 0x1c 3453c: 9d 8d ldd r25, Y+29 ; 0x1d 3453e: ae 8d ldd r26, Y+30 ; 0x1e 34540: bf 8d ldd r27, Y+31 ; 0x1f 34542: 82 17 cp r24, r18 34544: 93 07 cpc r25, r19 34546: a4 07 cpc r26, r20 34548: b5 07 cpc r27, r21 3454a: 08 f0 brcs .+2 ; 0x3454e 3454c: 68 c0 rjmp .+208 ; 0x3461e plateau_steps = block->step_event_count.wide - accel_decel_steps; 3454e: 29 01 movw r4, r18 34550: 3a 01 movw r6, r20 34552: 48 1a sub r4, r24 34554: 59 0a sbc r5, r25 34556: 6a 0a sbc r6, r26 34558: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 3455a: 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; 3455c: 40 e0 ldi r20, 0x00 ; 0 3455e: 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) 34560: 99 23 and r25, r25 34562: 89 f0 breq .+34 ; 0x34586 max_adv_steps = block->nominal_rate * block->adv_comp; 34564: c5 01 movw r24, r10 34566: b4 01 movw r22, r8 34568: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 3456c: f1 01 movw r30, r2 3456e: ec 5a subi r30, 0xAC ; 172 34570: ff 4f sbci r31, 0xFF ; 255 34572: 20 81 ld r18, Z 34574: 31 81 ldd r19, Z+1 ; 0x01 34576: 42 81 ldd r20, Z+2 ; 0x02 34578: 53 81 ldd r21, Z+3 ; 0x03 3457a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3457e: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 34582: 46 2f mov r20, r22 34584: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 34586: 3f b7 in r19, 0x3f ; 63 34588: 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. 3458a: f1 01 movw r30, r2 3458c: e9 5b subi r30, 0xB9 ; 185 3458e: ff 4f sbci r31, 0xFF ; 255 34590: 20 81 ld r18, Z 34592: 21 11 cpse r18, r1 34594: 27 c0 rjmp .+78 ; 0x345e4 block->accelerate_until = accelerate_steps; 34596: d1 01 movw r26, r2 34598: 59 96 adiw r26, 0x19 ; 25 3459a: cd 92 st X+, r12 3459c: dd 92 st X+, r13 3459e: ed 92 st X+, r14 345a0: fc 92 st X, r15 345a2: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 345a4: c4 0c add r12, r4 345a6: d5 1c adc r13, r5 345a8: e6 1c adc r14, r6 345aa: f7 1c adc r15, r7 345ac: f1 01 movw r30, r2 345ae: c5 8e std Z+29, r12 ; 0x1d 345b0: d6 8e std Z+30, r13 ; 0x1e 345b2: e7 8e std Z+31, r14 ; 0x1f 345b4: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 345b6: cf 88 ldd r12, Y+23 ; 0x17 345b8: c2 ae std Z+58, r12 ; 0x3a 345ba: d8 8c ldd r13, Y+24 ; 0x18 345bc: d3 ae std Z+59, r13 ; 0x3b 345be: e9 8c ldd r14, Y+25 ; 0x19 345c0: e4 ae std Z+60, r14 ; 0x3c 345c2: fa 8c ldd r15, Y+26 ; 0x1a 345c4: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 345c6: fe 96 adiw r30, 0x3e ; 62 345c8: 10 83 st Z, r17 345ca: 01 83 std Z+1, r16 ; 0x01 345cc: c9 a0 ldd r12, Y+33 ; 0x21 345ce: c2 82 std Z+2, r12 ; 0x02 345d0: d8 a0 ldd r13, Y+32 ; 0x20 345d2: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 345d4: 73 96 adiw r30, 0x13 ; 19 345d6: ed 88 ldd r14, Y+21 ; 0x15 345d8: e0 82 st Z, r14 345da: fe 88 ldd r15, Y+22 ; 0x16 345dc: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 345de: 32 97 sbiw r30, 0x02 ; 2 345e0: 40 83 st Z, r20 345e2: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 345e4: 3f bf out 0x3f, r19 ; 63 } 345e6: a1 96 adiw r28, 0x21 ; 33 345e8: 0f b6 in r0, 0x3f ; 63 345ea: f8 94 cli 345ec: de bf out 0x3e, r29 ; 62 345ee: 0f be out 0x3f, r0 ; 63 345f0: cd bf out 0x3d, r28 ; 61 345f2: df 91 pop r29 345f4: cf 91 pop r28 345f6: 1f 91 pop r17 345f8: 0f 91 pop r16 345fa: ff 90 pop r15 345fc: ef 90 pop r14 345fe: df 90 pop r13 34600: cf 90 pop r12 34602: bf 90 pop r11 34604: af 90 pop r10 34606: 9f 90 pop r9 34608: 8f 90 pop r8 3460a: 7f 90 pop r7 3460c: 6f 90 pop r6 3460e: 5f 90 pop r5 34610: 4f 90 pop r4 34612: 3f 90 pop r3 34614: 2f 90 pop r2 34616: 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; 34618: 1d 8a std Y+21, r1 ; 0x15 3461a: 1e 8a std Y+22, r1 ; 0x16 3461c: 83 cf rjmp .-250 ; 0x34524 #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; 3461e: 2d 81 ldd r18, Y+5 ; 0x05 34620: 3e 81 ldd r19, Y+6 ; 0x06 34622: 4f 81 ldd r20, Y+7 ; 0x07 34624: 58 85 ldd r21, Y+8 ; 0x08 34626: 82 e0 ldi r24, 0x02 ; 2 34628: 22 0f add r18, r18 3462a: 33 1f adc r19, r19 3462c: 44 1f adc r20, r20 3462e: 55 1f adc r21, r21 34630: 8a 95 dec r24 34632: d1 f7 brne .-12 ; 0x34628 34634: 89 81 ldd r24, Y+1 ; 0x01 34636: 9a 81 ldd r25, Y+2 ; 0x02 34638: ab 81 ldd r26, Y+3 ; 0x03 3463a: bc 81 ldd r27, Y+4 ; 0x04 3463c: 81 70 andi r24, 0x01 ; 1 3463e: 99 27 eor r25, r25 34640: aa 27 eor r26, r26 34642: bb 27 eor r27, r27 34644: 8d 83 std Y+5, r24 ; 0x05 34646: 9e 83 std Y+6, r25 ; 0x06 34648: af 83 std Y+7, r26 ; 0x07 3464a: b8 87 std Y+8, r27 ; 0x08 3464c: 89 80 ldd r8, Y+1 ; 0x01 3464e: 9a 80 ldd r9, Y+2 ; 0x02 34650: ab 80 ldd r10, Y+3 ; 0x03 34652: bc 80 ldd r11, Y+4 ; 0x04 34654: b6 94 lsr r11 34656: a7 94 ror r10 34658: 97 94 ror r9 3465a: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 3465c: cd 84 ldd r12, Y+13 ; 0x0d 3465e: de 84 ldd r13, Y+14 ; 0x0e 34660: ef 84 ldd r14, Y+15 ; 0x0f 34662: f8 88 ldd r15, Y+16 ; 0x10 34664: 89 89 ldd r24, Y+17 ; 0x11 34666: 9a 89 ldd r25, Y+18 ; 0x12 34668: ab 89 ldd r26, Y+19 ; 0x13 3466a: bc 89 ldd r27, Y+20 ; 0x14 3466c: 8c 15 cp r24, r12 3466e: 9d 05 cpc r25, r13 34670: ae 05 cpc r26, r14 34672: bf 05 cpc r27, r15 34674: 08 f4 brcc .+2 ; 0x34678 34676: 6f c0 rjmp .+222 ; 0x34756 // 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; 34678: 6c 01 movw r12, r24 3467a: 7d 01 movw r14, r26 3467c: 91 e0 ldi r25, 0x01 ; 1 3467e: c9 1a sub r12, r25 34680: d1 08 sbc r13, r1 34682: e1 08 sbc r14, r1 34684: f1 08 sbc r15, r1 34686: 8d 85 ldd r24, Y+13 ; 0x0d 34688: 9e 85 ldd r25, Y+14 ; 0x0e 3468a: af 85 ldd r26, Y+15 ; 0x0f 3468c: b8 89 ldd r27, Y+16 ; 0x10 3468e: c8 1a sub r12, r24 34690: d9 0a sbc r13, r25 34692: ea 0a sbc r14, r26 34694: fb 0a sbc r15, r27 34696: c7 01 movw r24, r14 34698: b6 01 movw r22, r12 3469a: 62 0f add r22, r18 3469c: 73 1f adc r23, r19 3469e: 84 1f adc r24, r20 346a0: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 346a2: cd 80 ldd r12, Y+5 ; 0x05 346a4: de 80 ldd r13, Y+6 ; 0x06 346a6: ef 80 ldd r14, Y+7 ; 0x07 346a8: f8 84 ldd r15, Y+8 ; 0x08 346aa: cd 28 or r12, r13 346ac: ce 28 or r12, r14 346ae: cf 28 or r12, r15 346b0: 41 f0 breq .+16 ; 0x346c2 accelerate_steps += acceleration_x2; 346b2: c9 84 ldd r12, Y+9 ; 0x09 346b4: da 84 ldd r13, Y+10 ; 0x0a 346b6: eb 84 ldd r14, Y+11 ; 0x0b 346b8: fc 84 ldd r15, Y+12 ; 0x0c 346ba: 6c 0d add r22, r12 346bc: 7d 1d adc r23, r13 346be: 8e 1d adc r24, r14 346c0: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 346c2: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 346c6: 75 01 movw r14, r10 346c8: 64 01 movw r12, r8 346ca: c2 0e add r12, r18 346cc: d3 1e adc r13, r19 346ce: e4 1e adc r14, r20 346d0: f5 1e adc r15, r21 346d2: 29 81 ldd r18, Y+1 ; 0x01 346d4: 3a 81 ldd r19, Y+2 ; 0x02 346d6: 4b 81 ldd r20, Y+3 ; 0x03 346d8: 5c 81 ldd r21, Y+4 ; 0x04 346da: 2c 15 cp r18, r12 346dc: 3d 05 cpc r19, r13 346de: 4e 05 cpc r20, r14 346e0: 5f 05 cpc r21, r15 346e2: 10 f4 brcc .+4 ; 0x346e8 346e4: 69 01 movw r12, r18 346e6: 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) { 346e8: 2b 8d ldd r18, Y+27 ; 0x1b 346ea: 22 23 and r18, r18 346ec: 09 f4 brne .+2 ; 0x346f0 346ee: 69 c0 rjmp .+210 ; 0x347c2 if(!accelerate_steps || !decelerate_steps) { 346f0: c1 14 cp r12, r1 346f2: d1 04 cpc r13, r1 346f4: e1 04 cpc r14, r1 346f6: f1 04 cpc r15, r1 346f8: 09 f4 brne .+2 ; 0x346fc 346fa: 66 c0 rjmp .+204 ; 0x347c8 // 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; 346fc: 4d 89 ldd r20, Y+21 ; 0x15 346fe: 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) { 34700: 41 14 cp r4, r1 34702: 51 04 cpc r5, r1 34704: 61 04 cpc r6, r1 34706: 71 04 cpc r7, r1 34708: 09 f4 brne .+2 ; 0x3470c 3470a: 3d cf rjmp .-390 ; 0x34586 // 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); 3470c: a7 01 movw r20, r14 3470e: 96 01 movw r18, r12 34710: 69 85 ldd r22, Y+9 ; 0x09 34712: 7a 85 ldd r23, Y+10 ; 0x0a 34714: 8b 85 ldd r24, Y+11 ; 0x0b 34716: 9c 85 ldd r25, Y+12 ; 0x0c 34718: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__mulsi3> 3471c: 2d 85 ldd r18, Y+13 ; 0x0d 3471e: 3e 85 ldd r19, Y+14 ; 0x0e 34720: 4f 85 ldd r20, Y+15 ; 0x0f 34722: 58 89 ldd r21, Y+16 ; 0x10 34724: 62 0f add r22, r18 34726: 73 1f adc r23, r19 34728: 84 1f adc r24, r20 3472a: 95 1f adc r25, r21 3472c: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 34730: 0f 94 87 e2 call 0x3c50e ; 0x3c50e max_adv_steps = max_rate * block->adv_comp; 34734: f1 01 movw r30, r2 34736: ec 5a subi r30, 0xAC ; 172 34738: ff 4f sbci r31, 0xFF ; 255 3473a: 20 81 ld r18, Z 3473c: 31 81 ldd r19, Z+1 ; 0x01 3473e: 42 81 ldd r20, Z+2 ; 0x02 34740: 53 81 ldd r21, Z+3 ; 0x03 34742: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 34746: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 3474a: 46 2f mov r20, r22 3474c: 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; 3474e: 41 2c mov r4, r1 34750: 51 2c mov r5, r1 34752: 32 01 movw r6, r4 34754: 18 cf rjmp .-464 ; 0x34586 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; 34756: 6d 85 ldd r22, Y+13 ; 0x0d 34758: 7e 85 ldd r23, Y+14 ; 0x0e 3475a: 8f 85 ldd r24, Y+15 ; 0x0f 3475c: 98 89 ldd r25, Y+16 ; 0x10 3475e: c9 88 ldd r12, Y+17 ; 0x11 34760: da 88 ldd r13, Y+18 ; 0x12 34762: eb 88 ldd r14, Y+19 ; 0x13 34764: fc 88 ldd r15, Y+20 ; 0x14 34766: 6c 19 sub r22, r12 34768: 7d 09 sbc r23, r13 3476a: 8e 09 sbc r24, r14 3476c: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 3476e: cd 80 ldd r12, Y+5 ; 0x05 34770: de 80 ldd r13, Y+6 ; 0x06 34772: ef 80 ldd r14, Y+7 ; 0x07 34774: f8 84 ldd r15, Y+8 ; 0x08 34776: cd 28 or r12, r13 34778: ce 28 or r12, r14 3477a: cf 28 or r12, r15 3477c: 41 f0 breq .+16 ; 0x3478e decelerate_steps += acceleration_x2; 3477e: c9 84 ldd r12, Y+9 ; 0x09 34780: da 84 ldd r13, Y+10 ; 0x0a 34782: eb 84 ldd r14, Y+11 ; 0x0b 34784: fc 84 ldd r15, Y+12 ; 0x0c 34786: 6c 0d add r22, r12 34788: 7d 1d adc r23, r13 3478a: 8e 1d adc r24, r14 3478c: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 3478e: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 34792: 82 0e add r8, r18 34794: 93 1e adc r9, r19 34796: a4 1e adc r10, r20 34798: b5 1e adc r11, r21 3479a: 49 80 ldd r4, Y+1 ; 0x01 3479c: 5a 80 ldd r5, Y+2 ; 0x02 3479e: 6b 80 ldd r6, Y+3 ; 0x03 347a0: 7c 80 ldd r7, Y+4 ; 0x04 347a2: 84 14 cp r8, r4 347a4: 95 04 cpc r9, r5 347a6: a6 04 cpc r10, r6 347a8: b7 04 cpc r11, r7 347aa: 10 f4 brcc .+4 ; 0x347b0 347ac: 24 01 movw r4, r8 347ae: 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; 347b0: c9 80 ldd r12, Y+1 ; 0x01 347b2: da 80 ldd r13, Y+2 ; 0x02 347b4: eb 80 ldd r14, Y+3 ; 0x03 347b6: fc 80 ldd r15, Y+4 ; 0x04 347b8: c4 18 sub r12, r4 347ba: d5 08 sbc r13, r5 347bc: e6 08 sbc r14, r6 347be: f7 08 sbc r15, r7 347c0: 93 cf rjmp .-218 ; 0x346e8 // 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; 347c2: 40 e0 ldi r20, 0x00 ; 0 347c4: 80 e0 ldi r24, 0x00 ; 0 347c6: c3 cf rjmp .-122 ; 0x3474e #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; 347c8: 4d 89 ldd r20, Y+21 ; 0x15 347ca: 8e 89 ldd r24, Y+22 ; 0x16 347cc: c0 cf rjmp .-128 ; 0x3474e 000347ce : while (!(UCSR0A & _BV(UDRE0))); UDR0 = ch; } static void verifySpace() { if (getch() != CRC_EOP) { 347ce: 0f 94 6f a1 call 0x342de ; 0x342de 347d2: 80 32 cpi r24, 0x20 ; 32 347d4: 29 f0 breq .+10 ; 0x347e0 putch(STK_FAILED); 347d6: 81 e1 ldi r24, 0x11 ; 17 347d8: 0f 94 68 a1 call 0x342d0 ; 0x342d0 softReset(); 347dc: 0e 94 01 68 call 0xd002 ; 0xd002 } putch(STK_INSYNC); 347e0: 84 e1 ldi r24, 0x14 ; 20 347e2: 0d 94 68 a1 jmp 0x342d0 ; 0x342d0 000347e6 : } static void getNch(uint8_t count) { 347e6: cf 93 push r28 347e8: c8 2f mov r28, r24 do getch(); while (--count); 347ea: 0f 94 6f a1 call 0x342de ; 0x342de 347ee: c1 50 subi r28, 0x01 ; 1 347f0: e1 f7 brne .-8 ; 0x347ea verifySpace(); } 347f2: cf 91 pop r28 putch(STK_INSYNC); } static void getNch(uint8_t count) { do getch(); while (--count); verifySpace(); 347f4: 0d 94 e7 a3 jmp 0x347ce ; 0x347ce 000347f8 : /// @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) { 347f8: 0f 93 push r16 347fa: 1f 93 push r17 347fc: cf 93 push r28 347fe: df 93 push r29 34800: eb 01 movw r28, r22 34802: 14 2f mov r17, r20 34804: 05 2f mov r16, r21 lcd_putc(chr); 34806: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_puts_P(str); 3480a: ce 01 movw r24, r28 3480c: 0e 94 80 6f call 0xdf00 ; 0xdf00 lcd_putc(':'); 34810: 8a e3 ldi r24, 0x3A ; 58 34812: 0e 94 84 6f call 0xdf08 ; 0xdf08 34816: ce 01 movw r24, r28 34818: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); 3481c: 9e e0 ldi r25, 0x0E ; 14 3481e: 98 1b sub r25, r24 34820: 89 2f mov r24, r25 34822: 0e 94 8b 6f call 0xdf16 ; 0xdf16 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); 34826: 0f 93 push r16 34828: 1f 93 push r17 3482a: 8f e0 ldi r24, 0x0F ; 15 3482c: 9a ea ldi r25, 0xAA ; 170 3482e: 9f 93 push r25 34830: 8f 93 push r24 34832: 0e 94 6e 6f call 0xdedc ; 0xdedc 34836: 0f 90 pop r0 34838: 0f 90 pop r0 3483a: 0f 90 pop r0 3483c: 0f 90 pop r0 } 3483e: df 91 pop r29 34840: cf 91 pop r28 34842: 1f 91 pop r17 34844: 0f 91 pop r16 34846: 08 95 ret 00034848 : * \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) { 34848: 0f 93 push r16 3484a: 1f 93 push r17 3484c: cf 93 push r28 3484e: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 34850: fc 01 movw r30, r24 34852: 23 81 ldd r18, Z+3 ; 0x03 34854: 22 23 and r18, r18 34856: 31 f0 breq .+12 ; 0x34864 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 34858: 80 e0 ldi r24, 0x00 ; 0 } 3485a: df 91 pop r29 3485c: cf 91 pop r28 3485e: 1f 91 pop r17 34860: 0f 91 pop r16 34862: 08 95 ret 34864: 8b 01 movw r16, r22 34866: ec 01 movw r28, r24 34868: fb 01 movw r30, r22 3486a: 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)) { 3486c: 80 31 cpi r24, 0x10 ; 16 3486e: 39 f5 brne .+78 ; 0x348be type_ = FAT_FILE_TYPE_ROOT_FIXED; 34870: 82 e0 ldi r24, 0x02 ; 2 34872: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 34874: 1d 8a std Y+21, r1 ; 0x15 34876: 1e 8a std Y+22, r1 ; 0x16 34878: 1f 8a std Y+23, r1 ; 0x17 3487a: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 3487c: 80 8d ldd r24, Z+24 ; 0x18 3487e: 91 8d ldd r25, Z+25 ; 0x19 34880: b0 e0 ldi r27, 0x00 ; 0 34882: a0 e0 ldi r26, 0x00 ; 0 34884: 25 e0 ldi r18, 0x05 ; 5 34886: 88 0f add r24, r24 34888: 99 1f adc r25, r25 3488a: aa 1f adc r26, r26 3488c: bb 1f adc r27, r27 3488e: 2a 95 dec r18 34890: d1 f7 brne .-12 ; 0x34886 34892: 89 8b std Y+17, r24 ; 0x11 34894: 9a 8b std Y+18, r25 ; 0x12 34896: ab 8b std Y+19, r26 ; 0x13 34898: 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; 3489a: 1a 8f std Y+26, r17 ; 0x1a 3489c: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 3489e: 81 e0 ldi r24, 0x01 ; 1 348a0: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 348a2: 1c 82 std Y+4, r1 ; 0x04 348a4: 1d 82 std Y+5, r1 ; 0x05 348a6: 1e 82 std Y+6, r1 ; 0x06 348a8: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 348aa: 18 86 std Y+8, r1 ; 0x08 348ac: 19 86 std Y+9, r1 ; 0x09 348ae: 1a 86 std Y+10, r1 ; 0x0a 348b0: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 348b2: 1c 86 std Y+12, r1 ; 0x0c 348b4: 1d 86 std Y+13, r1 ; 0x0d 348b6: 1e 86 std Y+14, r1 ; 0x0e 348b8: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 348ba: 18 8a std Y+16, r1 ; 0x10 348bc: ce cf rjmp .-100 ; 0x3485a 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) { 348be: 80 32 cpi r24, 0x20 ; 32 348c0: 59 f6 brne .-106 ; 0x34858 type_ = FAT_FILE_TYPE_ROOT32; 348c2: 83 e0 ldi r24, 0x03 ; 3 348c4: 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_;} 348c6: 42 8d ldd r20, Z+26 ; 0x1a 348c8: 53 8d ldd r21, Z+27 ; 0x1b 348ca: 64 8d ldd r22, Z+28 ; 0x1c 348cc: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 348ce: 4d 8b std Y+21, r20 ; 0x15 348d0: 5e 8b std Y+22, r21 ; 0x16 348d2: 6f 8b std Y+23, r22 ; 0x17 348d4: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 348d6: 9e 01 movw r18, r28 348d8: 2f 5e subi r18, 0xEF ; 239 348da: 3f 4f sbci r19, 0xFF ; 255 348dc: c8 01 movw r24, r16 348de: 0f 94 31 6d call 0x2da62 ; 0x2da62 348e2: 81 11 cpse r24, r1 348e4: da cf rjmp .-76 ; 0x3489a 348e6: b8 cf rjmp .-144 ; 0x34858 000348e8 : * * \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() { 348e8: cf 93 push r28 348ea: df 93 push r29 348ec: ec 01 movw r28, r24 bool rtn = sync(); 348ee: 0f 94 7c 6e call 0x2dcf8 ; 0x2dcf8 type_ = FAT_FILE_TYPE_CLOSED; 348f2: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 348f4: df 91 pop r29 348f6: cf 91 pop r28 348f8: 08 95 ret 000348fa : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 348fa: cf 93 push r28 348fc: df 93 push r29 348fe: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 34900: 46 2f mov r20, r22 34902: 41 70 andi r20, 0x01 ; 1 34904: 6c 85 ldd r22, Y+12 ; 0x0c 34906: 7d 85 ldd r23, Y+13 ; 0x0d 34908: 8e 85 ldd r24, Y+14 ; 0x0e 3490a: 9f 85 ldd r25, Y+15 ; 0x0f 3490c: 0f 94 df 6b call 0x2d7be ; 0x2d7be 34910: 88 23 and r24, r24 34912: 51 f0 breq .+20 ; 0x34928 return vol_->cache()->dir + dirIndex_; 34914: 88 89 ldd r24, Y+16 ; 0x10 34916: 20 e2 ldi r18, 0x20 ; 32 34918: 82 9f mul r24, r18 3491a: c0 01 movw r24, r0 3491c: 11 24 eor r1, r1 3491e: 85 58 subi r24, 0x85 ; 133 34920: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 34922: df 91 pop r29 34924: cf 91 pop r28 34926: 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; 34928: 90 e0 ldi r25, 0x00 ; 0 3492a: 80 e0 ldi r24, 0x00 ; 0 3492c: fa cf rjmp .-12 ; 0x34922 0003492e : * \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) { 3492e: cf 93 push r28 34930: df 93 push r29 34932: eb 01 movw r28, r22 34934: fc 01 movw r30, r24 34936: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 34938: 21 11 cpse r18, r1 3493a: 04 c0 rjmp .+8 ; 0x34944 3493c: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 3493e: df 91 pop r29 34940: cf 91 pop r28 34942: 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; 34944: 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()) { 34946: 22 30 cpi r18, 0x02 ; 2 34948: 28 f4 brcc .+10 ; 0x34954 name[0] = '/'; 3494a: 8f e2 ldi r24, 0x2F ; 47 3494c: 88 83 st Y, r24 name[1] = '\0'; 3494e: 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; 34950: 81 e0 ldi r24, 0x01 ; 1 34952: f5 cf rjmp .-22 ; 0x3493e name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 34954: 60 e0 ldi r22, 0x00 ; 0 34956: 0f 94 7d a4 call 0x348fa ; 0x348fa if (!p) return false; 3495a: 00 97 sbiw r24, 0x00 ; 0 3495c: 79 f3 breq .-34 ; 0x3493c 3495e: 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; 34960: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 34962: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 34964: 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; 34966: 2d 91 ld r18, X+ 34968: 20 32 cpi r18, 0x20 ; 32 3496a: 99 f0 breq .+38 ; 0x34992 if (i == 8) name[j++] = '.'; 3496c: 88 30 cpi r24, 0x08 ; 8 3496e: 31 f4 brne .+12 ; 0x3497c 34970: 9e 01 movw r18, r28 34972: 26 0f add r18, r22 34974: 31 1d adc r19, r1 34976: f9 01 movw r30, r18 34978: 90 83 st Z, r25 3497a: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 3497c: 9e 01 movw r18, r28 3497e: 26 0f add r18, r22 34980: 31 1d adc r19, r1 34982: ad 01 movw r20, r26 34984: 41 50 subi r20, 0x01 ; 1 34986: 51 09 sbc r21, r1 34988: fa 01 movw r30, r20 3498a: 40 81 ld r20, Z 3498c: f9 01 movw r30, r18 3498e: 40 83 st Z, r20 34990: 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++) { 34992: 8f 5f subi r24, 0xFF ; 255 34994: 8b 30 cpi r24, 0x0B ; 11 34996: 39 f7 brne .-50 ; 0x34966 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 34998: fe 01 movw r30, r28 3499a: e6 0f add r30, r22 3499c: f1 1d adc r31, r1 3499e: 10 82 st Z, r1 349a0: d7 cf rjmp .-82 ; 0x34950 000349a2 : 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() { 349a2: 3f 92 push r3 349a4: 4f 92 push r4 349a6: 5f 92 push r5 349a8: 6f 92 push r6 349aa: 7f 92 push r7 349ac: 8f 92 push r8 349ae: 9f 92 push r9 349b0: af 92 push r10 349b2: bf 92 push r11 349b4: cf 92 push r12 349b6: df 92 push r13 349b8: ef 92 push r14 349ba: ff 92 push r15 349bc: 0f 93 push r16 349be: 1f 93 push r17 349c0: cf 93 push r28 349c2: df 93 push r29 349c4: cd b7 in r28, 0x3d ; 61 349c6: de b7 in r29, 0x3e ; 62 349c8: 2c 97 sbiw r28, 0x0c ; 12 349ca: 0f b6 in r0, 0x3f ; 63 349cc: f8 94 cli 349ce: de bf out 0x3e, r29 ; 62 349d0: 0f be out 0x3f, r0 ; 63 349d2: cd bf out 0x3d, r28 ; 61 349d4: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 349d6: dc 01 movw r26, r24 349d8: 59 96 adiw r26, 0x19 ; 25 349da: 8d 90 ld r8, X+ 349dc: 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; 349de: f4 01 movw r30, r8 349e0: 81 85 ldd r24, Z+9 ; 0x09 349e2: 92 85 ldd r25, Z+10 ; 0x0a 349e4: a3 85 ldd r26, Z+11 ; 0x0b 349e6: b4 85 ldd r27, Z+12 ; 0x0c 349e8: 9c 01 movw r18, r24 349ea: ad 01 movw r20, r26 349ec: 2f 5f subi r18, 0xFF ; 255 349ee: 3f 4f sbci r19, 0xFF ; 255 349f0: 4f 4f sbci r20, 0xFF ; 255 349f2: 5f 4f sbci r21, 0xFF ; 255 349f4: 29 87 std Y+9, r18 ; 0x09 349f6: 3a 87 std Y+10, r19 ; 0x0a 349f8: 4b 87 std Y+11, r20 ; 0x0b 349fa: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 349fc: d5 01 movw r26, r10 349fe: 14 96 adiw r26, 0x04 ; 4 34a00: 4d 90 ld r4, X+ 34a02: 5d 90 ld r5, X+ 34a04: 6d 90 ld r6, X+ 34a06: 7c 90 ld r7, X 34a08: 17 97 sbiw r26, 0x07 ; 7 34a0a: 41 14 cp r4, r1 34a0c: 51 04 cpc r5, r1 34a0e: 61 04 cpc r6, r1 34a10: 71 04 cpc r7, r1 34a12: 09 f4 brne .+2 ; 0x34a16 34a14: 59 c0 rjmp .+178 ; 0x34ac8 // try to make file contiguous bgnCluster = *curCluster + 1; 34a16: bf ef ldi r27, 0xFF ; 255 34a18: 4b 1a sub r4, r27 34a1a: 5b 0a sbc r5, r27 34a1c: 6b 0a sbc r6, r27 34a1e: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 34a20: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 34a22: 73 01 movw r14, r6 34a24: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34a26: 1d 82 std Y+5, r1 ; 0x05 34a28: 1e 82 std Y+6, r1 ; 0x06 34a2a: 1f 82 std Y+7, r1 ; 0x07 34a2c: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 34a2e: f4 01 movw r30, r8 34a30: 81 85 ldd r24, Z+9 ; 0x09 34a32: 92 85 ldd r25, Z+10 ; 0x0a 34a34: a3 85 ldd r26, Z+11 ; 0x0b 34a36: b4 85 ldd r27, Z+12 ; 0x0c 34a38: 2d 81 ldd r18, Y+5 ; 0x05 34a3a: 3e 81 ldd r19, Y+6 ; 0x06 34a3c: 4f 81 ldd r20, Y+7 ; 0x07 34a3e: 58 85 ldd r21, Y+8 ; 0x08 34a40: 28 17 cp r18, r24 34a42: 39 07 cpc r19, r25 34a44: 4a 07 cpc r20, r26 34a46: 5b 07 cpc r21, r27 34a48: 08 f0 brcs .+2 ; 0x34a4c 34a4a: 56 c0 rjmp .+172 ; 0x34af8 // past end - start from beginning of FAT if (endCluster > fatEnd) { 34a4c: 89 85 ldd r24, Y+9 ; 0x09 34a4e: 9a 85 ldd r25, Y+10 ; 0x0a 34a50: ab 85 ldd r26, Y+11 ; 0x0b 34a52: bc 85 ldd r27, Y+12 ; 0x0c 34a54: 8c 15 cp r24, r12 34a56: 9d 05 cpc r25, r13 34a58: ae 05 cpc r26, r14 34a5a: bf 05 cpc r27, r15 34a5c: 50 f4 brcc .+20 ; 0x34a72 bgnCluster = endCluster = 2; 34a5e: 82 e0 ldi r24, 0x02 ; 2 34a60: c8 2e mov r12, r24 34a62: d1 2c mov r13, r1 34a64: e1 2c mov r14, r1 34a66: f1 2c mov r15, r1 34a68: 92 e0 ldi r25, 0x02 ; 2 34a6a: 49 2e mov r4, r25 34a6c: 51 2c mov r5, r1 34a6e: 61 2c mov r6, r1 34a70: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 34a72: 9e 01 movw r18, r28 34a74: 2f 5f subi r18, 0xFF ; 255 34a76: 3f 4f sbci r19, 0xFF ; 255 34a78: b7 01 movw r22, r14 34a7a: a6 01 movw r20, r12 34a7c: c4 01 movw r24, r8 34a7e: 0f 94 ae 6c call 0x2d95c ; 0x2d95c 34a82: 88 23 and r24, r24 34a84: c9 f1 breq .+114 ; 0x34af8 if (f != 0) { 34a86: 89 81 ldd r24, Y+1 ; 0x01 34a88: 9a 81 ldd r25, Y+2 ; 0x02 34a8a: ab 81 ldd r26, Y+3 ; 0x03 34a8c: bc 81 ldd r27, Y+4 ; 0x04 34a8e: 89 2b or r24, r25 34a90: 8a 2b or r24, r26 34a92: 8b 2b or r24, r27 34a94: 01 f1 breq .+64 ; 0x34ad6 // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 34a96: 26 01 movw r4, r12 34a98: 37 01 movw r6, r14 34a9a: 9f ef ldi r25, 0xFF ; 255 34a9c: 49 1a sub r4, r25 34a9e: 59 0a sbc r5, r25 34aa0: 69 0a sbc r6, r25 34aa2: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 34aa4: 2d 81 ldd r18, Y+5 ; 0x05 34aa6: 3e 81 ldd r19, Y+6 ; 0x06 34aa8: 4f 81 ldd r20, Y+7 ; 0x07 34aaa: 58 85 ldd r21, Y+8 ; 0x08 34aac: 2f 5f subi r18, 0xFF ; 255 34aae: 3f 4f sbci r19, 0xFF ; 255 34ab0: 4f 4f sbci r20, 0xFF ; 255 34ab2: 5f 4f sbci r21, 0xFF ; 255 34ab4: 2d 83 std Y+5, r18 ; 0x05 34ab6: 3e 83 std Y+6, r19 ; 0x06 34ab8: 4f 83 std Y+7, r20 ; 0x07 34aba: 58 87 std Y+8, r21 ; 0x08 34abc: 3f ef ldi r19, 0xFF ; 255 34abe: c3 1a sub r12, r19 34ac0: d3 0a sbc r13, r19 34ac2: e3 0a sbc r14, r19 34ac4: f3 0a sbc r15, r19 34ac6: b3 cf rjmp .-154 ; 0x34a2e // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 34ac8: 40 80 ld r4, Z 34aca: 51 80 ldd r5, Z+1 ; 0x01 34acc: 62 80 ldd r6, Z+2 ; 0x02 34ace: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 34ad0: 33 24 eor r3, r3 34ad2: 33 94 inc r3 34ad4: a6 cf rjmp .-180 ; 0x34a22 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) { 34ad6: c4 14 cp r12, r4 34ad8: d5 04 cpc r13, r5 34ada: e6 04 cpc r14, r6 34adc: f7 04 cpc r15, r7 34ade: 11 f7 brne .-60 ; 0x34aa4 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); 34ae0: 0f ef ldi r16, 0xFF ; 255 34ae2: 1f ef ldi r17, 0xFF ; 255 34ae4: 2f ef ldi r18, 0xFF ; 255 34ae6: 3f e0 ldi r19, 0x0F ; 15 34ae8: b7 01 movw r22, r14 34aea: a6 01 movw r20, r12 34aec: c4 01 movw r24, r8 34aee: 0f 94 1c 6c call 0x2d838 ; 0x2d838 34af2: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 34af4: 81 11 cpse r24, r1 34af6: 1a c0 rjmp .+52 ; 0x34b2c flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 34af8: 71 2c mov r7, r1 } 34afa: 87 2d mov r24, r7 34afc: 2c 96 adiw r28, 0x0c ; 12 34afe: 0f b6 in r0, 0x3f ; 63 34b00: f8 94 cli 34b02: de bf out 0x3e, r29 ; 62 34b04: 0f be out 0x3f, r0 ; 63 34b06: cd bf out 0x3d, r28 ; 61 34b08: df 91 pop r29 34b0a: cf 91 pop r28 34b0c: 1f 91 pop r17 34b0e: 0f 91 pop r16 34b10: ff 90 pop r15 34b12: ef 90 pop r14 34b14: df 90 pop r13 34b16: cf 90 pop r12 34b18: bf 90 pop r11 34b1a: af 90 pop r10 34b1c: 9f 90 pop r9 34b1e: 8f 90 pop r8 34b20: 7f 90 pop r7 34b22: 6f 90 pop r6 34b24: 5f 90 pop r5 34b26: 4f 90 pop r4 34b28: 3f 90 pop r3 34b2a: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 34b2c: f5 01 movw r30, r10 34b2e: 44 81 ldd r20, Z+4 ; 0x04 34b30: 55 81 ldd r21, Z+5 ; 0x05 34b32: 66 81 ldd r22, Z+6 ; 0x06 34b34: 77 81 ldd r23, Z+7 ; 0x07 34b36: 41 15 cp r20, r1 34b38: 51 05 cpc r21, r1 34b3a: 61 05 cpc r22, r1 34b3c: 71 05 cpc r23, r1 34b3e: 39 f0 breq .+14 ; 0x34b4e // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 34b40: 97 01 movw r18, r14 34b42: 86 01 movw r16, r12 34b44: c4 01 movw r24, r8 34b46: 0f 94 1c 6c call 0x2d838 ; 0x2d838 34b4a: 88 23 and r24, r24 34b4c: a9 f2 breq .-86 ; 0x34af8 } // return first cluster number to caller *curCluster = bgnCluster; 34b4e: d5 01 movw r26, r10 34b50: 14 96 adiw r26, 0x04 ; 4 34b52: cd 92 st X+, r12 34b54: dd 92 st X+, r13 34b56: ed 92 st X+, r14 34b58: fc 92 st X, r15 34b5a: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 34b5c: 33 20 and r3, r3 34b5e: 51 f0 breq .+20 ; 0x34b74 34b60: d7 01 movw r26, r14 34b62: c6 01 movw r24, r12 34b64: 01 96 adiw r24, 0x01 ; 1 34b66: a1 1d adc r26, r1 34b68: b1 1d adc r27, r1 34b6a: f4 01 movw r30, r8 34b6c: 80 83 st Z, r24 34b6e: 91 83 std Z+1, r25 ; 0x01 34b70: a2 83 std Z+2, r26 ; 0x02 34b72: 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) { 34b74: f5 01 movw r30, r10 34b76: 85 89 ldd r24, Z+21 ; 0x15 34b78: 96 89 ldd r25, Z+22 ; 0x16 34b7a: a7 89 ldd r26, Z+23 ; 0x17 34b7c: b0 8d ldd r27, Z+24 ; 0x18 34b7e: 89 2b or r24, r25 34b80: 8a 2b or r24, r26 34b82: 8b 2b or r24, r27 34b84: 09 f0 breq .+2 ; 0x34b88 34b86: b9 cf rjmp .-142 ; 0x34afa firstCluster_ = curCluster_; 34b88: c5 8a std Z+21, r12 ; 0x15 34b8a: d6 8a std Z+22, r13 ; 0x16 34b8c: e7 8a std Z+23, r14 ; 0x17 34b8e: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 34b90: 81 81 ldd r24, Z+1 ; 0x01 34b92: 80 68 ori r24, 0x80 ; 128 34b94: 81 83 std Z+1, r24 ; 0x01 34b96: b1 cf rjmp .-158 ; 0x34afa 00034b98 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 34b98: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34b9a: 0d b4 in r0, 0x2d ; 45 34b9c: 07 fe sbrs r0, 7 34b9e: fd cf rjmp .-6 ; 0x34b9a } 34ba0: 08 95 ret 00034ba2 : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 34ba2: 8f ef ldi r24, 0xFF ; 255 34ba4: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34ba6: 0d b4 in r0, 0x2d ; 45 34ba8: 07 fe sbrs r0, 7 34baa: fd cf rjmp .-6 ; 0x34ba6 return SPDR; 34bac: 8e b5 in r24, 0x2e ; 46 } 34bae: 08 95 ret 00034bb0 : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 34bb0: 8f 92 push r8 34bb2: 9f 92 push r9 34bb4: af 92 push r10 34bb6: bf 92 push r11 34bb8: ef 92 push r14 34bba: ff 92 push r15 34bbc: 0f 93 push r16 34bbe: 1f 93 push r17 34bc0: cf 93 push r28 34bc2: 7c 01 movw r14, r24 34bc4: c6 2f mov r28, r22 34bc6: 49 01 movw r8, r18 34bc8: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 34bca: fc 01 movw r30, r24 34bcc: 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); 34bce: 89 2f mov r24, r25 34bd0: 80 6a ori r24, 0xA0 ; 160 34bd2: 86 95 lsr r24 34bd4: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 34bd6: 90 fd sbrc r25, 0 34bd8: 03 c0 rjmp .+6 ; 0x34be0 34bda: 81 e0 ldi r24, 0x01 ; 1 34bdc: 96 30 cpi r25, 0x06 ; 6 34bde: 09 f4 brne .+2 ; 0x34be2 34be0: 80 e0 ldi r24, 0x00 ; 0 34be2: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 34be4: 9f b7 in r25, 0x3f ; 63 34be6: f8 94 cli 34be8: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34bec: 8f 7b andi r24, 0xBF ; 191 34bee: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 34bf2: 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); 34bf4: 8c e2 ldi r24, 0x2C ; 44 34bf6: 91 e0 ldi r25, 0x01 ; 1 34bf8: 0f 94 ec 76 call 0x2edd8 ; 0x2edd8 // send command spiSend(cmd | 0x40); 34bfc: 8c 2f mov r24, r28 34bfe: 80 64 ori r24, 0x40 ; 64 34c00: 0f 94 cc a5 call 0x34b98 ; 0x34b98 34c04: 08 e1 ldi r16, 0x18 ; 24 34c06: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 34c08: d5 01 movw r26, r10 34c0a: c4 01 movw r24, r8 34c0c: 00 2e mov r0, r16 34c0e: 04 c0 rjmp .+8 ; 0x34c18 34c10: b6 95 lsr r27 34c12: a7 95 ror r26 34c14: 97 95 ror r25 34c16: 87 95 ror r24 34c18: 0a 94 dec r0 34c1a: d2 f7 brpl .-12 ; 0x34c10 34c1c: 0f 94 cc a5 call 0x34b98 ; 0x34b98 34c20: 08 50 subi r16, 0x08 ; 8 34c22: 11 09 sbc r17, r1 34c24: 08 3f cpi r16, 0xF8 ; 248 34c26: ff ef ldi r31, 0xFF ; 255 34c28: 1f 07 cpc r17, r31 34c2a: 71 f7 brne .-36 ; 0x34c08 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 34c2c: 85 e9 ldi r24, 0x95 ; 149 34c2e: cc 23 and r28, r28 34c30: 21 f0 breq .+8 ; 0x34c3a if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 34c32: 87 e8 ldi r24, 0x87 ; 135 34c34: c8 30 cpi r28, 0x08 ; 8 34c36: 09 f0 breq .+2 ; 0x34c3a // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34c38: 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); 34c3a: 0f 94 cc a5 call 0x34b98 ; 0x34b98 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 34c3e: cc 30 cpi r28, 0x0C ; 12 34c40: 11 f4 brne .+4 ; 0x34c46 34c42: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 34c46: 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 */ } 34c48: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 34c4c: f7 01 movw r30, r14 34c4e: 82 83 std Z+2, r24 ; 0x02 34c50: 87 ff sbrs r24, 7 34c52: 04 c0 rjmp .+8 ; 0x34c5c 34c54: cf 3f cpi r28, 0xFF ; 255 34c56: 11 f0 breq .+4 ; 0x34c5c 34c58: cf 5f subi r28, 0xFF ; 255 34c5a: f6 cf rjmp .-20 ; 0x34c48 return status_; } 34c5c: cf 91 pop r28 34c5e: 1f 91 pop r17 34c60: 0f 91 pop r16 34c62: ff 90 pop r15 34c64: ef 90 pop r14 34c66: bf 90 pop r11 34c68: af 90 pop r10 34c6a: 9f 90 pop r9 34c6c: 8f 90 pop r8 34c6e: 08 95 ret 00034c70 : * \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) { 34c70: 0f 93 push r16 34c72: 1f 93 push r17 34c74: cf 93 push r28 34c76: df 93 push r29 34c78: ec 01 movw r28, r24 34c7a: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 34c7c: 8b 81 ldd r24, Y+3 ; 0x03 34c7e: 83 30 cpi r24, 0x03 ; 3 34c80: 39 f0 breq .+14 ; 0x34c90 34c82: 89 e0 ldi r24, 0x09 ; 9 34c84: 44 0f add r20, r20 34c86: 55 1f adc r21, r21 34c88: 66 1f adc r22, r22 34c8a: 77 1f adc r23, r23 34c8c: 8a 95 dec r24 34c8e: d1 f7 brne .-12 ; 0x34c84 if (cardCommand(CMD24, blockNumber)) { 34c90: 9a 01 movw r18, r20 34c92: ab 01 movw r20, r22 34c94: 68 e1 ldi r22, 0x18 ; 24 34c96: ce 01 movw r24, r28 34c98: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 34c9c: 88 23 and r24, r24 34c9e: 19 f0 breq .+6 ; 0x34ca6 34ca0: 86 e0 ldi r24, 0x06 ; 6 34ca2: 88 83 st Y, r24 34ca4: 39 c0 rjmp .+114 ; 0x34d18 } //------------------------------------------------------------------------------ /** 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; 34ca6: 8e ef ldi r24, 0xFE ; 254 34ca8: 8e bd out 0x2e, r24 ; 46 34caa: f8 01 movw r30, r16 34cac: c8 01 movw r24, r16 34cae: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34cb0: 0d b4 in r0, 0x2d ; 45 34cb2: 07 fe sbrs r0, 7 34cb4: fd cf rjmp .-6 ; 0x34cb0 SPDR = buf[i]; 34cb6: 20 81 ld r18, Z 34cb8: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34cba: 0d b4 in r0, 0x2d ; 45 34cbc: 07 fe sbrs r0, 7 34cbe: fd cf rjmp .-6 ; 0x34cba SPDR = buf[i + 1]; 34cc0: 21 81 ldd r18, Z+1 ; 0x01 34cc2: 2e bd out 0x2e, r18 ; 46 34cc4: 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) { 34cc6: e8 17 cp r30, r24 34cc8: f9 07 cpc r31, r25 34cca: 91 f7 brne .-28 ; 0x34cb0 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 */ } 34ccc: 0d b4 in r0, 0x2d ; 45 34cce: 07 fe sbrs r0, 7 34cd0: fd cf rjmp .-6 ; 0x34ccc //------------------------------------------------------------------------------ // 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 34cd2: 8f ef ldi r24, 0xFF ; 255 34cd4: 0f 94 cc a5 call 0x34b98 ; 0x34b98 spiSend(0xff); // dummy crc 34cd8: 8f ef ldi r24, 0xFF ; 255 34cda: 0f 94 cc a5 call 0x34b98 ; 0x34b98 status_ = spiRec(); 34cde: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 34ce2: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 34ce4: 8f 71 andi r24, 0x1F ; 31 34ce6: 85 30 cpi r24, 0x05 ; 5 34ce8: 99 f4 brne .+38 ; 0x34d10 goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 34cea: 88 e5 ldi r24, 0x58 ; 88 34cec: 92 e0 ldi r25, 0x02 ; 2 34cee: 0f 94 ec 76 call 0x2edd8 ; 0x2edd8 34cf2: 18 2f mov r17, r24 34cf4: 87 e1 ldi r24, 0x17 ; 23 34cf6: 11 23 and r17, r17 34cf8: a1 f2 breq .-88 ; 0x34ca2 error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 34cfa: 20 e0 ldi r18, 0x00 ; 0 34cfc: 30 e0 ldi r19, 0x00 ; 0 34cfe: a9 01 movw r20, r18 34d00: 6d e0 ldi r22, 0x0D ; 13 34d02: ce 01 movw r24, r28 34d04: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 34d08: 88 23 and r24, r24 34d0a: 51 f0 breq .+20 ; 0x34d20 34d0c: 86 e1 ldi r24, 0x16 ; 22 34d0e: c9 cf rjmp .-110 ; 0x34ca2 34d10: 83 e1 ldi r24, 0x13 ; 19 34d12: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 34d14: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 } chipSelectHigh(); return true; fail: chipSelectHigh(); 34d18: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 return false; 34d1c: 10 e0 ldi r17, 0x00 ; 0 34d1e: 06 c0 rjmp .+12 ; 0x34d2c 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()) { 34d20: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 34d24: 81 11 cpse r24, r1 34d26: f2 cf rjmp .-28 ; 0x34d0c error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 34d28: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 return true; fail: chipSelectHigh(); return false; } 34d2c: 81 2f mov r24, r17 34d2e: df 91 pop r29 34d30: cf 91 pop r28 34d32: 1f 91 pop r17 34d34: 0f 91 pop r16 34d36: 08 95 ret 00034d38 : * \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) { 34d38: 2f 92 push r2 34d3a: 3f 92 push r3 34d3c: 4f 92 push r4 34d3e: 5f 92 push r5 34d40: 6f 92 push r6 34d42: 7f 92 push r7 34d44: 8f 92 push r8 34d46: 9f 92 push r9 34d48: af 92 push r10 34d4a: bf 92 push r11 34d4c: cf 92 push r12 34d4e: df 92 push r13 34d50: ef 92 push r14 34d52: ff 92 push r15 34d54: 0f 93 push r16 34d56: 1f 93 push r17 34d58: cf 93 push r28 34d5a: df 93 push r29 34d5c: ec 01 movw r28, r24 34d5e: 2a 01 movw r4, r20 34d60: 3b 01 movw r6, r22 34d62: 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; 34d64: 8b 81 ldd r24, Y+3 ; 0x03 34d66: 83 30 cpi r24, 0x03 ; 3 34d68: 39 f0 breq .+14 ; 0x34d78 34d6a: 69 e0 ldi r22, 0x09 ; 9 34d6c: 44 0c add r4, r4 34d6e: 55 1c adc r5, r5 34d70: 66 1c adc r6, r6 34d72: 77 1c adc r7, r7 34d74: 6a 95 dec r22 34d76: d1 f7 brne .-12 ; 0x34d6c retry2: 34d78: 43 e0 ldi r20, 0x03 ; 3 34d7a: 94 2e mov r9, r20 34d7c: 56 01 movw r10, r12 34d7e: 81 e0 ldi r24, 0x01 ; 1 34d80: a8 1a sub r10, r24 34d82: 8e ef ldi r24, 0xFE ; 254 34d84: b8 0a sbc r11, r24 34d86: 16 01 movw r2, r12 34d88: ee ef ldi r30, 0xFE ; 254 34d8a: 3e 1a sub r3, r30 34d8c: 54 e0 ldi r21, 0x04 ; 4 34d8e: 85 2e mov r8, r21 retryCnt --; 34d90: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 34d92: a3 01 movw r20, r6 34d94: 92 01 movw r18, r4 34d96: 61 e1 ldi r22, 0x11 ; 17 34d98: ce 01 movw r24, r28 34d9a: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 34d9e: 88 23 and r24, r24 34da0: 79 f0 breq .+30 ; 0x34dc0 34da2: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 34da4: 99 20 and r9, r9 34da6: 09 f4 brne .+2 ; 0x34daa 34da8: 7a c0 rjmp .+244 ; 0x34e9e if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 34daa: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 34dae: 20 e0 ldi r18, 0x00 ; 0 34db0: 30 e0 ldi r19, 0x00 ; 0 34db2: a9 01 movw r20, r18 34db4: 6c e0 ldi r22, 0x0C ; 12 34db6: ce 01 movw r24, r28 34db8: 0f 94 d8 a5 call 0x34bb0 ; 0x34bb0 errorCode_ = 0; 34dbc: 18 82 st Y, r1 34dbe: e8 cf rjmp .-48 ; 0x34d90 #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 34dc0: 0f 94 8b 3f call 0x27f16 ; 0x27f16 34dc4: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 34dc6: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 34dca: 8a 83 std Y+2, r24 ; 0x02 34dcc: 8f 3f cpi r24, 0xFF ; 255 34dce: 91 f4 brne .+36 ; 0x34df4 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 34dd0: 0f 94 8b 3f call 0x27f16 ; 0x27f16 34dd4: 60 1b sub r22, r16 34dd6: 71 0b sbc r23, r17 34dd8: 6d 32 cpi r22, 0x2D ; 45 34dda: 71 40 sbci r23, 0x01 ; 1 34ddc: a0 f3 brcs .-24 ; 0x34dc6 34dde: 81 e1 ldi r24, 0x11 ; 17 34de0: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 34de2: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34de6: 8c 81 ldd r24, Y+4 ; 0x04 34de8: 88 23 and r24, r24 34dea: e1 f2 breq .-72 ; 0x34da4 spiSend(0XFF); 34dec: 8f ef ldi r24, 0xFF ; 255 34dee: 0f 94 cc a5 call 0x34b98 ; 0x34b98 34df2: d8 cf rjmp .-80 ; 0x34da4 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 34df4: 8e 3f cpi r24, 0xFE ; 254 34df6: 11 f0 breq .+4 ; 0x34dfc 34df8: 8f e0 ldi r24, 0x0F ; 15 34dfa: f2 cf rjmp .-28 ; 0x34de0 //------------------------------------------------------------------------------ /** 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; 34dfc: 8f ef ldi r24, 0xFF ; 255 34dfe: 8e bd out 0x2e, r24 ; 46 34e00: d6 01 movw r26, r12 34e02: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34e04: 0d b4 in r0, 0x2d ; 45 34e06: 07 fe sbrs r0, 7 34e08: fd cf rjmp .-6 ; 0x34e04 buf[i] = SPDR; 34e0a: 9e b5 in r25, 0x2e ; 46 34e0c: 91 93 st Z+, r25 SPDR = 0XFF; 34e0e: 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++) { 34e10: ea 15 cp r30, r10 34e12: fb 05 cpc r31, r11 34e14: b9 f7 brne .-18 ; 0x34e04 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 34e16: 0d b4 in r0, 0x2d ; 45 34e18: 07 fe sbrs r0, 7 34e1a: fd cf rjmp .-6 ; 0x34e16 buf[nbyte] = SPDR; 34e1c: 8e b5 in r24, 0x2e ; 46 34e1e: f5 01 movw r30, r10 34e20: 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; 34e22: f1 2c mov r15, r1 34e24: 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); 34e26: 8d 91 ld r24, X+ 34e28: ef 2d mov r30, r15 34e2a: ff 27 eor r31, r31 34e2c: e8 27 eor r30, r24 34e2e: ee 0f add r30, r30 34e30: ff 1f adc r31, r31 34e32: e5 55 subi r30, 0x55 ; 85 34e34: f3 45 sbci r31, 0x53 ; 83 34e36: 85 91 lpm r24, Z+ 34e38: 94 91 lpm r25, Z 34e3a: fe 2c mov r15, r14 34e3c: ee 24 eor r14, r14 34e3e: e8 26 eor r14, r24 34e40: 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++) { 34e42: 2a 16 cp r2, r26 34e44: 3b 06 cpc r3, r27 34e46: 79 f7 brne .-34 ; 0x34e26 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 34e48: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 34e4c: 08 2f mov r16, r24 34e4e: 10 e0 ldi r17, 0x00 ; 0 34e50: 10 2f mov r17, r16 34e52: 00 27 eor r16, r16 recvCrc |= spiRec(); 34e54: 0f 94 d1 a5 call 0x34ba2 ; 0x34ba2 34e58: 08 2b or r16, r24 if (calcCrc != recvCrc) 34e5a: 0e 15 cp r16, r14 34e5c: 1f 05 cpc r17, r15 34e5e: 19 f0 breq .+6 ; 0x34e66 34e60: f0 e2 ldi r31, 0x20 ; 32 34e62: f8 83 st Y, r31 34e64: be cf rjmp .-132 ; 0x34de2 #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 34e66: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 34e6a: cc 81 ldd r28, Y+4 ; 0x04 34e6c: cc 23 and r28, r28 34e6e: d9 f0 breq .+54 ; 0x34ea6 spiSend(0XFF); 34e70: 8f ef ldi r24, 0xFF ; 255 34e72: 0f 94 cc a5 call 0x34b98 ; 0x34b98 #endif fail: chipSelectHigh(); return false; } 34e76: 8c 2f mov r24, r28 34e78: df 91 pop r29 34e7a: cf 91 pop r28 34e7c: 1f 91 pop r17 34e7e: 0f 91 pop r16 34e80: ff 90 pop r15 34e82: ef 90 pop r14 34e84: df 90 pop r13 34e86: cf 90 pop r12 34e88: bf 90 pop r11 34e8a: af 90 pop r10 34e8c: 9f 90 pop r9 34e8e: 8f 90 pop r8 34e90: 7f 90 pop r7 34e92: 6f 90 pop r6 34e94: 5f 90 pop r5 34e96: 4f 90 pop r4 34e98: 3f 90 pop r3 34e9a: 2f 90 pop r2 34e9c: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 34e9e: 0f 94 e3 76 call 0x2edc6 ; 0x2edc6 return false; 34ea2: c0 e0 ldi r28, 0x00 ; 0 34ea4: e8 cf rjmp .-48 ; 0x34e76 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 34ea6: c1 e0 ldi r28, 0x01 ; 1 34ea8: e6 cf rjmp .-52 ; 0x34e76 00034eaa : * 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) { 34eaa: 2f 92 push r2 34eac: 3f 92 push r3 34eae: 4f 92 push r4 34eb0: 5f 92 push r5 34eb2: 6f 92 push r6 34eb4: 7f 92 push r7 34eb6: 8f 92 push r8 34eb8: 9f 92 push r9 34eba: af 92 push r10 34ebc: bf 92 push r11 34ebe: cf 92 push r12 34ec0: df 92 push r13 34ec2: ef 92 push r14 34ec4: ff 92 push r15 34ec6: 0f 93 push r16 34ec8: 1f 93 push r17 34eca: cf 93 push r28 34ecc: df 93 push r29 34ece: 00 d0 rcall .+0 ; 0x34ed0 34ed0: 1f 92 push r1 34ed2: cd b7 in r28, 0x3d ; 61 34ed4: de b7 in r29, 0x3e ; 62 34ed6: 9c 83 std Y+4, r25 ; 0x04 34ed8: 8b 83 std Y+3, r24 ; 0x03 34eda: 4b 01 movw r8, r22 34edc: 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; 34ede: dc 01 movw r26, r24 34ee0: 13 96 adiw r26, 0x03 ; 3 34ee2: 8c 91 ld r24, X 34ee4: 81 11 cpse r24, r1 34ee6: 19 c0 rjmp .+50 ; 0x34f1a toRead -= n; } return nbyte; fail: return -1; 34ee8: 8f ef ldi r24, 0xFF ; 255 34eea: 9f ef ldi r25, 0xFF ; 255 } 34eec: 0f 90 pop r0 34eee: 0f 90 pop r0 34ef0: 0f 90 pop r0 34ef2: 0f 90 pop r0 34ef4: df 91 pop r29 34ef6: cf 91 pop r28 34ef8: 1f 91 pop r17 34efa: 0f 91 pop r16 34efc: ff 90 pop r15 34efe: ef 90 pop r14 34f00: df 90 pop r13 34f02: cf 90 pop r12 34f04: bf 90 pop r11 34f06: af 90 pop r10 34f08: 9f 90 pop r9 34f0a: 8f 90 pop r8 34f0c: 7f 90 pop r7 34f0e: 6f 90 pop r6 34f10: 5f 90 pop r5 34f12: 4f 90 pop r4 34f14: 3f 90 pop r3 34f16: 2f 90 pop r2 34f18: 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; 34f1a: eb 81 ldd r30, Y+3 ; 0x03 34f1c: fc 81 ldd r31, Y+4 ; 0x04 34f1e: 81 81 ldd r24, Z+1 ; 0x01 34f20: 80 ff sbrs r24, 0 34f22: e2 cf rjmp .-60 ; 0x34ee8 // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 34f24: 01 89 ldd r16, Z+17 ; 0x11 34f26: 12 89 ldd r17, Z+18 ; 0x12 34f28: 23 89 ldd r18, Z+19 ; 0x13 34f2a: 34 89 ldd r19, Z+20 ; 0x14 34f2c: 40 85 ldd r20, Z+8 ; 0x08 34f2e: 51 85 ldd r21, Z+9 ; 0x09 34f30: 62 85 ldd r22, Z+10 ; 0x0a 34f32: 73 85 ldd r23, Z+11 ; 0x0b 34f34: c7 01 movw r24, r14 34f36: b0 e0 ldi r27, 0x00 ; 0 34f38: a0 e0 ldi r26, 0x00 ; 0 34f3a: 28 01 movw r4, r16 34f3c: 39 01 movw r6, r18 34f3e: 44 1a sub r4, r20 34f40: 55 0a sbc r5, r21 34f42: 66 0a sbc r6, r22 34f44: 77 0a sbc r7, r23 34f46: 84 15 cp r24, r4 34f48: 95 05 cpc r25, r5 34f4a: a6 05 cpc r26, r6 34f4c: b7 05 cpc r27, r7 34f4e: 18 f0 brcs .+6 ; 0x34f56 nbyte = fileSize_ - curPosition_; 34f50: 78 01 movw r14, r16 34f52: e4 1a sub r14, r20 34f54: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 34f56: 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; 34f58: 8b 81 ldd r24, Y+3 ; 0x03 34f5a: 9c 81 ldd r25, Y+4 ; 0x04 34f5c: 04 96 adiw r24, 0x04 ; 4 34f5e: 9a 83 std Y+2, r25 ; 0x02 34f60: 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; 34f62: 61 2c mov r6, r1 34f64: 32 e0 ldi r19, 0x02 ; 2 34f66: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 34f68: c1 14 cp r12, r1 34f6a: d1 04 cpc r13, r1 34f6c: 09 f4 brne .+2 ; 0x34f70 34f6e: b7 c0 rjmp .+366 ; 0x350de offset = curPosition_ & 0X1FF; // offset in block 34f70: ab 81 ldd r26, Y+3 ; 0x03 34f72: bc 81 ldd r27, Y+4 ; 0x04 34f74: 18 96 adiw r26, 0x08 ; 8 34f76: 4d 91 ld r20, X+ 34f78: 5d 91 ld r21, X+ 34f7a: 6d 91 ld r22, X+ 34f7c: 7c 91 ld r23, X 34f7e: 1b 97 sbiw r26, 0x0b ; 11 34f80: 5a 01 movw r10, r20 34f82: b1 e0 ldi r27, 0x01 ; 1 34f84: bb 22 and r11, r27 34f86: eb 81 ldd r30, Y+3 ; 0x03 34f88: fc 81 ldd r31, Y+4 ; 0x04 34f8a: 81 8d ldd r24, Z+25 ; 0x19 34f8c: 92 8d ldd r25, Z+26 ; 0x1a 34f8e: 1a 01 movw r2, r20 34f90: 2b 01 movw r4, r22 34f92: 29 e0 ldi r18, 0x09 ; 9 34f94: 56 94 lsr r5 34f96: 47 94 ror r4 34f98: 37 94 ror r3 34f9a: 27 94 ror r2 34f9c: 2a 95 dec r18 34f9e: d1 f7 brne .-12 ; 0x34f94 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 34fa0: 23 81 ldd r18, Z+3 ; 0x03 34fa2: 22 30 cpi r18, 0x02 ; 2 34fa4: 91 f5 brne .+100 ; 0x3500a block = vol_->rootDirStart() + (curPosition_ >> 9); 34fa6: dc 01 movw r26, r24 34fa8: 5a 96 adiw r26, 0x1a ; 26 34faa: 6d 91 ld r22, X+ 34fac: 7d 91 ld r23, X+ 34fae: 8d 91 ld r24, X+ 34fb0: 9c 91 ld r25, X 34fb2: 5d 97 sbiw r26, 0x1d ; 29 34fb4: 62 0d add r22, r2 34fb6: 73 1d adc r23, r3 34fb8: 84 1d adc r24, r4 34fba: 95 1d adc r25, r5 34fbc: 83 01 movw r16, r6 34fbe: 0a 19 sub r16, r10 34fc0: 1b 09 sbc r17, r11 34fc2: c0 16 cp r12, r16 34fc4: d1 06 cpc r13, r17 34fc6: 08 f4 brcc .+2 ; 0x34fca 34fc8: 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()) { 34fca: 01 15 cp r16, r1 34fcc: b2 e0 ldi r27, 0x02 ; 2 34fce: 1b 07 cpc r17, r27 34fd0: 71 f4 brne .+28 ; 0x34fee 34fd2: 20 91 6f 0e lds r18, 0x0E6F ; 0x800e6f 34fd6: 30 91 70 0e lds r19, 0x0E70 ; 0x800e70 34fda: 40 91 71 0e lds r20, 0x0E71 ; 0x800e71 34fde: 50 91 72 0e lds r21, 0x0E72 ; 0x800e72 34fe2: 62 17 cp r22, r18 34fe4: 73 07 cpc r23, r19 34fe6: 84 07 cpc r24, r20 34fe8: 95 07 cpc r25, r21 34fea: 09 f0 breq .+2 ; 0x34fee 34fec: 59 c0 rjmp .+178 ; 0x350a0 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; 34fee: 40 e0 ldi r20, 0x00 ; 0 34ff0: 0f 94 df 6b call 0x2d7be ; 0x2d7be 34ff4: 88 23 and r24, r24 34ff6: 09 f4 brne .+2 ; 0x34ffa 34ff8: 77 cf rjmp .-274 ; 0x34ee8 uint8_t* src = vol_->cache()->data + offset; 34ffa: b5 01 movw r22, r10 34ffc: 65 58 subi r22, 0x85 ; 133 34ffe: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 35000: a8 01 movw r20, r16 35002: c4 01 movw r24, r8 35004: 0f 94 ba e3 call 0x3c774 ; 0x3c774 35008: 57 c0 rjmp .+174 ; 0x350b8 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);} 3500a: fc 01 movw r30, r24 3500c: 14 81 ldd r17, Z+4 ; 0x04 3500e: 11 50 subi r17, 0x01 ; 1 35010: 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) { 35012: a1 14 cp r10, r1 35014: b1 04 cpc r11, r1 35016: 81 f4 brne .+32 ; 0x35038 35018: 11 11 cpse r17, r1 3501a: 0e c0 rjmp .+28 ; 0x35038 // start of new cluster if (curPosition_ == 0) { 3501c: 45 2b or r20, r21 3501e: 46 2b or r20, r22 35020: 47 2b or r20, r23 35022: 79 f5 brne .+94 ; 0x35082 // use first cluster in file curCluster_ = firstCluster_; 35024: eb 81 ldd r30, Y+3 ; 0x03 35026: fc 81 ldd r31, Y+4 ; 0x04 35028: 85 89 ldd r24, Z+21 ; 0x15 3502a: 96 89 ldd r25, Z+22 ; 0x16 3502c: a7 89 ldd r26, Z+23 ; 0x17 3502e: b0 8d ldd r27, Z+24 ; 0x18 35030: 84 83 std Z+4, r24 ; 0x04 35032: 95 83 std Z+5, r25 ; 0x05 35034: a6 83 std Z+6, r26 ; 0x06 35036: 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; 35038: ab 81 ldd r26, Y+3 ; 0x03 3503a: bc 81 ldd r27, Y+4 ; 0x04 3503c: 59 96 adiw r26, 0x19 ; 25 3503e: ed 91 ld r30, X+ 35040: fc 91 ld r31, X 35042: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 35044: 14 96 adiw r26, 0x04 ; 4 35046: 6d 91 ld r22, X+ 35048: 7d 91 ld r23, X+ 3504a: 8d 91 ld r24, X+ 3504c: 9c 91 ld r25, X 3504e: 17 97 sbiw r26, 0x07 ; 7 35050: 62 50 subi r22, 0x02 ; 2 35052: 71 09 sbc r23, r1 35054: 81 09 sbc r24, r1 35056: 91 09 sbc r25, r1 35058: 25 85 ldd r18, Z+13 ; 0x0d 3505a: 04 c0 rjmp .+8 ; 0x35064 3505c: 66 0f add r22, r22 3505e: 77 1f adc r23, r23 35060: 88 1f adc r24, r24 35062: 99 1f adc r25, r25 35064: 2a 95 dec r18 35066: d2 f7 brpl .-12 ; 0x3505c 35068: 26 85 ldd r18, Z+14 ; 0x0e 3506a: 37 85 ldd r19, Z+15 ; 0x0f 3506c: 40 89 ldd r20, Z+16 ; 0x10 3506e: 51 89 ldd r21, Z+17 ; 0x11 35070: 62 0f add r22, r18 35072: 73 1f adc r23, r19 35074: 84 1f adc r24, r20 35076: 95 1f adc r25, r21 35078: 61 0f add r22, r17 3507a: 71 1d adc r23, r1 3507c: 81 1d adc r24, r1 3507e: 91 1d adc r25, r1 35080: 9d cf rjmp .-198 ; 0x34fbc if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 35082: ab 81 ldd r26, Y+3 ; 0x03 35084: bc 81 ldd r27, Y+4 ; 0x04 35086: 14 96 adiw r26, 0x04 ; 4 35088: 4d 91 ld r20, X+ 3508a: 5d 91 ld r21, X+ 3508c: 6d 91 ld r22, X+ 3508e: 7c 91 ld r23, X 35090: 17 97 sbiw r26, 0x07 ; 7 35092: 29 81 ldd r18, Y+1 ; 0x01 35094: 3a 81 ldd r19, Y+2 ; 0x02 35096: 0f 94 ae 6c call 0x2d95c ; 0x2d95c 3509a: 81 11 cpse r24, r1 3509c: cd cf rjmp .-102 ; 0x35038 3509e: 24 cf rjmp .-440 ; 0x34ee8 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);} 350a0: 94 01 movw r18, r8 350a2: ab 01 movw r20, r22 350a4: bc 01 movw r22, r24 350a6: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 350aa: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 350ae: 0f 94 9c a6 call 0x34d38 ; 0x34d38 // 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; 350b2: 88 23 and r24, r24 350b4: 09 f4 brne .+2 ; 0x350b8 350b6: 18 cf rjmp .-464 ; 0x34ee8 // 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; 350b8: 80 0e add r8, r16 350ba: 91 1e adc r9, r17 curPosition_ += n; 350bc: eb 81 ldd r30, Y+3 ; 0x03 350be: fc 81 ldd r31, Y+4 ; 0x04 350c0: 80 85 ldd r24, Z+8 ; 0x08 350c2: 91 85 ldd r25, Z+9 ; 0x09 350c4: a2 85 ldd r26, Z+10 ; 0x0a 350c6: b3 85 ldd r27, Z+11 ; 0x0b 350c8: 80 0f add r24, r16 350ca: 91 1f adc r25, r17 350cc: a1 1d adc r26, r1 350ce: b1 1d adc r27, r1 350d0: 80 87 std Z+8, r24 ; 0x08 350d2: 91 87 std Z+9, r25 ; 0x09 350d4: a2 87 std Z+10, r26 ; 0x0a 350d6: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 350d8: c0 1a sub r12, r16 350da: d1 0a sbc r13, r17 350dc: 45 cf rjmp .-374 ; 0x34f68 } return nbyte; 350de: c7 01 movw r24, r14 350e0: 05 cf rjmp .-502 ; 0x34eec 000350e2 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 350e2: 4f 92 push r4 350e4: 5f 92 push r5 350e6: 6f 92 push r6 350e8: 7f 92 push r7 350ea: af 92 push r10 350ec: bf 92 push r11 350ee: cf 92 push r12 350f0: df 92 push r13 350f2: ef 92 push r14 350f4: ff 92 push r15 350f6: 0f 93 push r16 350f8: 1f 93 push r17 350fa: cf 93 push r28 350fc: df 93 push r29 350fe: 1f 92 push r1 35100: cd b7 in r28, 0x3d ; 61 35102: de b7 in r29, 0x3e ; 62 35104: 8c 01 movw r16, r24 35106: 7b 01 movw r14, r22 35108: 5a 01 movw r10, r20 3510a: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 3510c: db 01 movw r26, r22 3510e: 59 96 adiw r26, 0x19 ; 25 35110: 8d 91 ld r24, X+ 35112: 9c 91 ld r25, X 35114: f8 01 movw r30, r16 35116: 92 8f std Z+26, r25 ; 0x1a 35118: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 3511a: cb 01 movw r24, r22 3511c: 0e 94 b7 78 call 0xf16e ; 0xf16e } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 35120: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 35122: f7 01 movw r30, r14 35124: 80 85 ldd r24, Z+8 ; 0x08 35126: 91 85 ldd r25, Z+9 ; 0x09 35128: a2 85 ldd r26, Z+10 ; 0x0a 3512a: b3 85 ldd r27, Z+11 ; 0x0b 3512c: 41 89 ldd r20, Z+17 ; 0x11 3512e: 52 89 ldd r21, Z+18 ; 0x12 35130: 63 89 ldd r22, Z+19 ; 0x13 35132: 74 89 ldd r23, Z+20 ; 0x14 35134: 84 17 cp r24, r20 35136: 95 07 cpc r25, r21 35138: a6 07 cpc r26, r22 3513a: b7 07 cpc r27, r23 3513c: 08 f0 brcs .+2 ; 0x35140 3513e: 52 c0 rjmp .+164 ; 0x351e4 index = 0XF & (dirFile->curPosition_ >> 5); 35140: 55 e0 ldi r21, 0x05 ; 5 35142: b6 95 lsr r27 35144: a7 95 ror r26 35146: 97 95 ror r25 35148: 87 95 ror r24 3514a: 5a 95 dec r21 3514c: d1 f7 brne .-12 ; 0x35142 3514e: f8 2f mov r31, r24 35150: ff 70 andi r31, 0x0F ; 15 35152: 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; 35154: d7 01 movw r26, r14 35156: 13 96 adiw r26, 0x03 ; 3 35158: 8c 91 ld r24, X 3515a: 82 30 cpi r24, 0x02 ; 2 3515c: 10 f4 brcc .+4 ; 0x35162 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 3515e: 80 e0 ldi r24, 0x00 ; 0 35160: db c0 rjmp .+438 ; 0x35318 * \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; 35162: 41 e0 ldi r20, 0x01 ; 1 35164: 50 e0 ldi r21, 0x00 ; 0 35166: be 01 movw r22, r28 35168: 6f 5f subi r22, 0xFF ; 255 3516a: 7f 4f sbci r23, 0xFF ; 255 3516c: c7 01 movw r24, r14 3516e: 0f 94 55 a7 call 0x34eaa ; 0x34eaa 35172: 01 97 sbiw r24, 0x01 ; 1 35174: a1 f7 brne .-24 ; 0x3515e // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 35176: f7 01 movw r30, r14 35178: 80 85 ldd r24, Z+8 ; 0x08 3517a: 91 85 ldd r25, Z+9 ; 0x09 3517c: a2 85 ldd r26, Z+10 ; 0x0a 3517e: b3 85 ldd r27, Z+11 ; 0x0b 35180: 4f 96 adiw r24, 0x1f ; 31 35182: a1 1d adc r26, r1 35184: b1 1d adc r27, r1 35186: 80 87 std Z+8, r24 ; 0x08 35188: 91 87 std Z+9, r25 ; 0x09 3518a: a2 87 std Z+10, r26 ; 0x0a 3518c: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 3518e: f0 e2 ldi r31, 0x20 ; 32 35190: df 9e mul r13, r31 35192: b0 01 movw r22, r0 35194: 11 24 eor r1, r1 35196: 65 58 subi r22, 0x85 ; 133 35198: 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; 3519a: 61 15 cp r22, r1 3519c: 71 05 cpc r23, r1 3519e: f9 f2 breq .-66 ; 0x3515e if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 351a0: db 01 movw r26, r22 351a2: 8c 91 ld r24, X 351a4: 88 23 and r24, r24 351a6: 41 f0 breq .+16 ; 0x351b8 351a8: 85 3e cpi r24, 0xE5 ; 229 351aa: 09 f0 breq .+2 ; 0x351ae 351ac: 4c c0 rjmp .+152 ; 0x35246 // remember first empty slot if (!emptyFound) { 351ae: 77 20 and r7, r7 351b0: 29 f0 breq .+10 ; 0x351bc return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 351b2: 77 24 eor r7, r7 351b4: 73 94 inc r7 351b6: b5 cf rjmp .-150 ; 0x35122 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) { 351b8: 71 10 cpse r7, r1 351ba: 0e c0 rjmp .+28 ; 0x351d8 dirBlock_ = dirFile->vol_->cacheBlockNumber(); 351bc: 80 91 6f 0e lds r24, 0x0E6F ; 0x800e6f 351c0: 90 91 70 0e lds r25, 0x0E70 ; 0x800e70 351c4: a0 91 71 0e lds r26, 0x0E71 ; 0x800e71 351c8: b0 91 72 0e lds r27, 0x0E72 ; 0x800e72 351cc: f8 01 movw r30, r16 351ce: 84 87 std Z+12, r24 ; 0x0c 351d0: 95 87 std Z+13, r25 ; 0x0d 351d2: a6 87 std Z+14, r26 ; 0x0e 351d4: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 351d6: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 351d8: db 01 movw r26, r22 351da: 8c 91 ld r24, X 351dc: 81 11 cpse r24, r1 351de: e9 cf rjmp .-46 ; 0x351b2 351e0: 77 24 eor r7, r7 351e2: 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; 351e4: 8c 2d mov r24, r12 351e6: 82 74 andi r24, 0x42 ; 66 351e8: 82 34 cpi r24, 0x42 ; 66 351ea: 09 f0 breq .+2 ; 0x351ee 351ec: b8 cf rjmp .-144 ; 0x3515e if (emptyFound) { 351ee: 77 20 and r7, r7 351f0: 09 f4 brne .+2 ; 0x351f4 351f2: a2 c0 rjmp .+324 ; 0x35338 index = dirIndex_; 351f4: f8 01 movw r30, r16 351f6: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 351f8: 61 e0 ldi r22, 0x01 ; 1 351fa: c8 01 movw r24, r16 351fc: 0f 94 7d a4 call 0x348fa ; 0x348fa if (!p) goto fail; 35200: 00 97 sbiw r24, 0x00 ; 0 35202: 09 f4 brne .+2 ; 0x35206 35204: ac cf rjmp .-168 ; 0x3515e // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 35206: 20 e2 ldi r18, 0x20 ; 32 35208: dc 01 movw r26, r24 3520a: 1d 92 st X+, r1 3520c: 2a 95 dec r18 3520e: e9 f7 brne .-6 ; 0x3520a memcpy(p->name, dname, 11); 35210: 2b e0 ldi r18, 0x0B ; 11 35212: f5 01 movw r30, r10 35214: dc 01 movw r26, r24 35216: 01 90 ld r0, Z+ 35218: 0d 92 st X+, r0 3521a: 2a 95 dec r18 3521c: e1 f7 brne .-8 ; 0x35216 if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 3521e: 21 e2 ldi r18, 0x21 ; 33 35220: 38 e2 ldi r19, 0x28 ; 40 35222: fc 01 movw r30, r24 35224: 31 8b std Z+17, r19 ; 0x11 35226: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 35228: 40 e0 ldi r20, 0x00 ; 0 3522a: 58 e0 ldi r21, 0x08 ; 8 3522c: 57 87 std Z+15, r21 ; 0x0f 3522e: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 35230: 33 8b std Z+19, r19 ; 0x13 35232: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 35234: 31 8f std Z+25, r19 ; 0x19 35236: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 35238: 57 8b std Z+23, r21 ; 0x17 3523a: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 3523c: 0f 94 a0 6b call 0x2d740 ; 0x2d740 35240: 81 11 cpse r24, r1 35242: 09 c0 rjmp .+18 ; 0x35256 35244: 8c cf rjmp .-232 ; 0x3515e dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 35246: 4b e0 ldi r20, 0x0B ; 11 35248: 50 e0 ldi r21, 0x00 ; 0 3524a: c5 01 movw r24, r10 3524c: 0f 94 ad e3 call 0x3c75a ; 0x3c75a 35250: 89 2b or r24, r25 35252: 09 f0 breq .+2 ; 0x35256 35254: 66 cf rjmp .-308 ; 0x35122 } //------------------------------------------------------------------------------ // 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]; 35256: f0 e2 ldi r31, 0x20 ; 32 35258: df 9e mul r13, r31 3525a: d0 01 movw r26, r0 3525c: 11 24 eor r1, r1 3525e: 9d 01 movw r18, r26 35260: 25 58 subi r18, 0x85 ; 133 35262: 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)) { 35264: f9 01 movw r30, r18 35266: 83 85 ldd r24, Z+11 ; 0x0b 35268: 81 71 andi r24, 0x11 ; 17 3526a: 21 f0 breq .+8 ; 0x35274 if (oflag & (O_WRITE | O_TRUNC)) goto fail; 3526c: 8c 2d mov r24, r12 3526e: 82 71 andi r24, 0x12 ; 18 35270: 09 f0 breq .+2 ; 0x35274 35272: fc c0 rjmp .+504 ; 0x3546c } //------------------------------------------------------------------------------ // 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]; 35274: f8 01 movw r30, r16 35276: 81 8d ldd r24, Z+25 ; 0x19 35278: 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(); 3527a: 40 91 6f 0e lds r20, 0x0E6F ; 0x800e6f 3527e: 50 91 70 0e lds r21, 0x0E70 ; 0x800e70 35282: 60 91 71 0e lds r22, 0x0E71 ; 0x800e71 35286: 70 91 72 0e lds r23, 0x0E72 ; 0x800e72 3528a: 44 87 std Z+12, r20 ; 0x0c 3528c: 55 87 std Z+13, r21 ; 0x0d 3528e: 66 87 std Z+14, r22 ; 0x0e 35290: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 35292: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 35294: fd 01 movw r30, r26 35296: e5 58 subi r30, 0x85 ; 133 35298: f1 4f sbci r31, 0xF1 ; 241 3529a: 44 88 ldd r4, Z+20 ; 0x14 3529c: 55 88 ldd r5, Z+21 ; 0x15 3529e: 71 2c mov r7, r1 352a0: 61 2c mov r6, r1 352a2: 32 01 movw r6, r4 352a4: 55 24 eor r5, r5 352a6: 44 24 eor r4, r4 352a8: d8 01 movw r26, r16 352aa: 55 96 adiw r26, 0x15 ; 21 352ac: 4d 92 st X+, r4 352ae: 5d 92 st X+, r5 352b0: 6d 92 st X+, r6 352b2: 7c 92 st X, r7 352b4: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 352b6: 42 8d ldd r20, Z+26 ; 0x1a 352b8: 53 8d ldd r21, Z+27 ; 0x1b 352ba: 70 e0 ldi r23, 0x00 ; 0 352bc: 60 e0 ldi r22, 0x00 ; 0 352be: 44 29 or r20, r4 352c0: 55 29 or r21, r5 352c2: 66 29 or r22, r6 352c4: 77 29 or r23, r7 352c6: 55 96 adiw r26, 0x15 ; 21 352c8: 4d 93 st X+, r20 352ca: 5d 93 st X+, r21 352cc: 6d 93 st X+, r22 352ce: 7c 93 st X, r23 352d0: 58 97 sbiw r26, 0x18 ; 24 352d2: d9 01 movw r26, r18 352d4: 1b 96 adiw r26, 0x0b ; 11 352d6: 2c 91 ld r18, X 352d8: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 352da: 09 f0 breq .+2 ; 0x352de 352dc: b9 c0 rjmp .+370 ; 0x35450 fileSize_ = p->fileSize; 352de: 84 8d ldd r24, Z+28 ; 0x1c 352e0: 95 8d ldd r25, Z+29 ; 0x1d 352e2: a6 8d ldd r26, Z+30 ; 0x1e 352e4: b7 8d ldd r27, Z+31 ; 0x1f 352e6: f8 01 movw r30, r16 352e8: 81 8b std Z+17, r24 ; 0x11 352ea: 92 8b std Z+18, r25 ; 0x12 352ec: a3 8b std Z+19, r26 ; 0x13 352ee: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 352f0: 81 e0 ldi r24, 0x01 ; 1 352f2: 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; 352f4: 8c 2d mov r24, r12 352f6: 8f 70 andi r24, 0x0F ; 15 352f8: f8 01 movw r30, r16 352fa: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 352fc: 14 82 std Z+4, r1 ; 0x04 352fe: 15 82 std Z+5, r1 ; 0x05 35300: 16 82 std Z+6, r1 ; 0x06 35302: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 35304: 10 86 std Z+8, r1 ; 0x08 35306: 11 86 std Z+9, r1 ; 0x09 35308: 12 86 std Z+10, r1 ; 0x0a 3530a: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 3530c: 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; 3530e: c4 fe sbrs r12, 4 35310: 03 c0 rjmp .+6 ; 0x35318 35312: c8 01 movw r24, r16 35314: 0f 94 a1 78 call 0x2f142 ; 0x2f142 // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 35318: 0f 90 pop r0 3531a: df 91 pop r29 3531c: cf 91 pop r28 3531e: 1f 91 pop r17 35320: 0f 91 pop r16 35322: ff 90 pop r15 35324: ef 90 pop r14 35326: df 90 pop r13 35328: cf 90 pop r12 3532a: bf 90 pop r11 3532c: af 90 pop r10 3532e: 7f 90 pop r7 35330: 6f 90 pop r6 35332: 5f 90 pop r5 35334: 4f 90 pop r4 35336: 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; 35338: d7 01 movw r26, r14 3533a: 13 96 adiw r26, 0x03 ; 3 3533c: 8c 91 ld r24, X 3533e: 13 97 sbiw r26, 0x03 ; 3 35340: 82 30 cpi r24, 0x02 ; 2 35342: 09 f4 brne .+2 ; 0x35346 35344: 0c cf rjmp .-488 ; 0x3515e // 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; 35346: 51 96 adiw r26, 0x11 ; 17 35348: 8d 91 ld r24, X+ 3534a: 9d 91 ld r25, X+ 3534c: 0d 90 ld r0, X+ 3534e: bc 91 ld r27, X 35350: a0 2d mov r26, r0 35352: 80 3e cpi r24, 0xE0 ; 224 35354: 9f 4f sbci r25, 0xFF ; 255 35356: af 41 sbci r26, 0x1F ; 31 35358: b1 05 cpc r27, r1 3535a: 08 f0 brcs .+2 ; 0x3535e 3535c: 00 cf rjmp .-512 ; 0x3515e if (!addCluster()) goto fail; 3535e: c7 01 movw r24, r14 35360: 0f 94 d1 a4 call 0x349a2 ; 0x349a2 35364: 88 23 and r24, r24 35366: 09 f4 brne .+2 ; 0x3536a 35368: fa ce rjmp .-524 ; 0x3515e if (!vol_->cacheFlush()) goto fail; 3536a: 0f 94 a0 6b call 0x2d740 ; 0x2d740 3536e: 88 23 and r24, r24 35370: 09 f4 brne .+2 ; 0x35374 35372: f5 ce rjmp .-534 ; 0x3515e block = vol_->clusterStartBlock(curCluster_); 35374: d7 01 movw r26, r14 35376: 59 96 adiw r26, 0x19 ; 25 35378: ed 91 ld r30, X+ 3537a: fc 91 ld r31, X 3537c: 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_);} 3537e: 14 96 adiw r26, 0x04 ; 4 35380: 4d 90 ld r4, X+ 35382: 5d 90 ld r5, X+ 35384: 6d 90 ld r6, X+ 35386: 7c 90 ld r7, X 35388: 17 97 sbiw r26, 0x07 ; 7 3538a: b2 e0 ldi r27, 0x02 ; 2 3538c: 4b 1a sub r4, r27 3538e: 51 08 sbc r5, r1 35390: 61 08 sbc r6, r1 35392: 71 08 sbc r7, r1 35394: 85 85 ldd r24, Z+13 ; 0x0d 35396: 04 c0 rjmp .+8 ; 0x353a0 35398: 44 0c add r4, r4 3539a: 55 1c adc r5, r5 3539c: 66 1c adc r6, r6 3539e: 77 1c adc r7, r7 353a0: 8a 95 dec r24 353a2: d2 f7 brpl .-12 ; 0x35398 353a4: 86 85 ldd r24, Z+14 ; 0x0e 353a6: 97 85 ldd r25, Z+15 ; 0x0f 353a8: a0 89 ldd r26, Z+16 ; 0x10 353aa: b1 89 ldd r27, Z+17 ; 0x11 353ac: 48 0e add r4, r24 353ae: 59 1e adc r5, r25 353b0: 6a 1e adc r6, r26 353b2: 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; 353b4: 81 e0 ldi r24, 0x01 ; 1 353b6: 80 93 77 0e sts 0x0E77, r24 ; 0x800e77 cacheBlockNumber_ = blockNumber; 353ba: 40 92 6f 0e sts 0x0E6F, r4 ; 0x800e6f 353be: 50 92 70 0e sts 0x0E70, r5 ; 0x800e70 353c2: 60 92 71 0e sts 0x0E71, r6 ; 0x800e71 353c6: 70 92 72 0e sts 0x0E72, r7 ; 0x800e72 // set cache to first block of cluster vol_->cacheSetBlockNumber(block, true); // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); 353ca: eb e7 ldi r30, 0x7B ; 123 353cc: fe e0 ldi r31, 0x0E ; 14 353ce: 80 e0 ldi r24, 0x00 ; 0 353d0: 92 e0 ldi r25, 0x02 ; 2 353d2: df 01 movw r26, r30 353d4: 9c 01 movw r18, r24 353d6: 1d 92 st X+, r1 353d8: 21 50 subi r18, 0x01 ; 1 353da: 30 40 sbci r19, 0x00 ; 0 353dc: e1 f7 brne .-8 ; 0x353d6 // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 353de: dd 24 eor r13, r13 353e0: d3 94 inc r13 353e2: d7 01 movw r26, r14 353e4: 59 96 adiw r26, 0x19 ; 25 353e6: ed 91 ld r30, X+ 353e8: fc 91 ld r31, X 353ea: 84 81 ldd r24, Z+4 ; 0x04 353ec: d8 16 cp r13, r24 353ee: 98 f4 brcc .+38 ; 0x35416 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); 353f0: 2b e7 ldi r18, 0x7B ; 123 353f2: 3e e0 ldi r19, 0x0E ; 14 353f4: b3 01 movw r22, r6 353f6: a2 01 movw r20, r4 353f8: 4d 0d add r20, r13 353fa: 51 1d adc r21, r1 353fc: 61 1d adc r22, r1 353fe: 71 1d adc r23, r1 35400: 80 91 78 0e lds r24, 0x0E78 ; 0x800e78 35404: 90 91 79 0e lds r25, 0x0E79 ; 0x800e79 35408: 0f 94 38 a6 call 0x34c70 ; 0x34c70 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 3540c: 88 23 and r24, r24 3540e: 09 f4 brne .+2 ; 0x35412 35410: a6 ce rjmp .-692 ; 0x3515e // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 35412: d3 94 inc r13 35414: e6 cf rjmp .-52 ; 0x353e2 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 35416: 25 85 ldd r18, Z+13 ; 0x0d 35418: 80 e0 ldi r24, 0x00 ; 0 3541a: 92 e0 ldi r25, 0x02 ; 2 3541c: a0 e0 ldi r26, 0x00 ; 0 3541e: b0 e0 ldi r27, 0x00 ; 0 35420: 04 c0 rjmp .+8 ; 0x3542a 35422: 88 0f add r24, r24 35424: 99 1f adc r25, r25 35426: aa 1f adc r26, r26 35428: bb 1f adc r27, r27 3542a: 2a 95 dec r18 3542c: d2 f7 brpl .-12 ; 0x35422 3542e: f7 01 movw r30, r14 35430: 41 89 ldd r20, Z+17 ; 0x11 35432: 52 89 ldd r21, Z+18 ; 0x12 35434: 63 89 ldd r22, Z+19 ; 0x13 35436: 74 89 ldd r23, Z+20 ; 0x14 35438: 84 0f add r24, r20 3543a: 95 1f adc r25, r21 3543c: a6 1f adc r26, r22 3543e: b7 1f adc r27, r23 35440: 81 8b std Z+17, r24 ; 0x11 35442: 92 8b std Z+18, r25 ; 0x12 35444: a3 8b std Z+19, r26 ; 0x13 35446: 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; 35448: 8b e7 ldi r24, 0x7B ; 123 3544a: 9e e0 ldi r25, 0x0E ; 14 index = 0; 3544c: d1 2c mov r13, r1 3544e: db ce rjmp .-586 ; 0x35206 // 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)) { 35450: 20 31 cpi r18, 0x10 ; 16 35452: 61 f4 brne .+24 ; 0x3546c if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 35454: 98 01 movw r18, r16 35456: 2f 5e subi r18, 0xEF ; 239 35458: 3f 4f sbci r19, 0xFF ; 255 3545a: 0f 94 31 6d call 0x2da62 ; 0x2da62 3545e: 88 23 and r24, r24 35460: 29 f0 breq .+10 ; 0x3546c type_ = FAT_FILE_TYPE_SUBDIR; 35462: 84 e0 ldi r24, 0x04 ; 4 35464: d8 01 movw r26, r16 35466: 13 96 adiw r26, 0x03 ; 3 35468: 8c 93 st X, r24 3546a: 44 cf rjmp .-376 ; 0x352f4 curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 3546c: d8 01 movw r26, r16 3546e: 13 96 adiw r26, 0x03 ; 3 35470: 1c 92 st X, r1 35472: 75 ce rjmp .-790 ; 0x3515e 00035474 : 35474: 88 e1 ldi r24, 0x18 ; 24 35476: 9e e0 ldi r25, 0x0E ; 14 35478: 0f b6 in r0, 0x3f ; 63 3547a: f8 94 cli 3547c: a8 95 wdr 3547e: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 35482: 0f be out 0x3f, r0 ; 63 35484: 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); 35488: 9f b7 in r25, 0x3f ; 63 3548a: f8 94 cli 3548c: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 35490: 84 60 ori r24, 0x04 ; 4 35492: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 35496: 9f bf out 0x3f, r25 ; 63 lcd_clear(); 35498: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 1, MSG_POWERPANIC_DETECTED); 3549c: 4f e3 ldi r20, 0x3F ; 63 3549e: 51 e7 ldi r21, 0x71 ; 113 354a0: 61 e0 ldi r22, 0x01 ; 1 354a2: 80 e0 ldi r24, 0x00 ; 0 354a4: 0e 94 a9 6f call 0xdf52 ; 0xdf52 354a8: ff cf rjmp .-2 ; 0x354a8 000354aa : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 354aa: 60 91 56 0e lds r22, 0x0E56 ; 0x800e56 uint8_t _block_buffer_tail = block_buffer_tail; 354ae: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 uint16_t sdlen = 0; 354b2: 30 e0 ldi r19, 0x00 ; 0 354b4: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 354b6: 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) 354b8: 96 17 cp r25, r22 354ba: 61 f0 breq .+24 ; 0x354d4 { sdlen += block_buffer[_block_buffer_tail].sdlen; 354bc: 89 9f mul r24, r25 354be: f0 01 movw r30, r0 354c0: 11 24 eor r1, r1 354c2: ee 51 subi r30, 0x1E ; 30 354c4: f8 4f sbci r31, 0xF8 ; 248 354c6: 40 81 ld r20, Z 354c8: 51 81 ldd r21, Z+1 ; 0x01 354ca: 24 0f add r18, r20 354cc: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 354ce: 9f 5f subi r25, 0xFF ; 255 354d0: 9f 70 andi r25, 0x0F ; 15 354d2: f2 cf rjmp .-28 ; 0x354b8 } return sdlen; } 354d4: c9 01 movw r24, r18 354d6: 08 95 ret 000354d8 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 354d8: 30 91 56 0e lds r19, 0x0E56 ; 0x800e56 354dc: 20 91 57 0e lds r18, 0x0E57 ; 0x800e57 354e0: 32 17 cp r19, r18 354e2: 91 f0 breq .+36 ; 0x35508 // 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; 354e4: e0 91 56 0e lds r30, 0x0E56 ; 0x800e56 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 354e8: e1 11 cpse r30, r1 354ea: 01 c0 rjmp .+2 ; 0x354ee block_index = BLOCK_BUFFER_SIZE; 354ec: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 354ee: 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; 354f0: 2e e6 ldi r18, 0x6E ; 110 354f2: e2 9f mul r30, r18 354f4: f0 01 movw r30, r0 354f6: 11 24 eor r1, r1 354f8: ee 51 subi r30, 0x1E ; 30 354fa: f8 4f sbci r31, 0xF8 ; 248 354fc: 20 81 ld r18, Z 354fe: 31 81 ldd r19, Z+1 ; 0x01 35500: 82 0f add r24, r18 35502: 93 1f adc r25, r19 35504: 91 83 std Z+1, r25 ; 0x01 35506: 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. } } 35508: 08 95 ret 0003550a : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 3550a: 8f 92 push r8 3550c: 9f 92 push r9 3550e: af 92 push r10 35510: bf 92 push r11 35512: cf 92 push r12 35514: df 92 push r13 35516: ef 92 push r14 35518: ff 92 push r15 3551a: 0f 93 push r16 3551c: 1f 93 push r17 3551e: cf 93 push r28 35520: df 93 push r29 35522: c0 91 97 02 lds r28, 0x0297 ; 0x800297 35526: d0 91 98 02 lds r29, 0x0298 ; 0x800298 3552a: 82 e7 ldi r24, 0x72 ; 114 3552c: e8 2e mov r14, r24 3552e: 86 e0 ldi r24, 0x06 ; 6 35530: f8 2e mov r15, r24 35532: 00 ef ldi r16, 0xF0 ; 240 35534: 17 e1 ldi r17, 0x17 ; 23 35536: 6e 01 movw r12, r28 35538: 80 e1 ldi r24, 0x10 ; 16 3553a: c8 0e add r12, r24 3553c: 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]; 3553e: 69 91 ld r22, Y+ 35540: 79 91 ld r23, Y+ 35542: 89 91 ld r24, Y+ 35544: 99 91 ld r25, Y+ 35546: f7 01 movw r30, r14 35548: 81 90 ld r8, Z+ 3554a: 91 90 ld r9, Z+ 3554c: a1 90 ld r10, Z+ 3554e: b1 90 ld r11, Z+ 35550: 7f 01 movw r14, r30 35552: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 35556: a5 01 movw r20, r10 35558: 94 01 movw r18, r8 3555a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3555e: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 35562: f8 01 movw r30, r16 35564: 61 93 st Z+, r22 35566: 71 93 st Z+, r23 35568: 81 93 st Z+, r24 3556a: 91 93 st Z+, r25 3556c: 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++) 3556e: cc 15 cp r28, r12 35570: dd 05 cpc r29, r13 35572: 29 f7 brne .-54 ; 0x3553e max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 35574: df 91 pop r29 35576: cf 91 pop r28 35578: 1f 91 pop r17 3557a: 0f 91 pop r16 3557c: ff 90 pop r15 3557e: ef 90 pop r14 35580: df 90 pop r13 35582: cf 90 pop r12 35584: bf 90 pop r11 35586: af 90 pop r10 35588: 9f 90 pop r9 3558a: 8f 90 pop r8 3558c: 08 95 ret 0003558e : #ifdef TMC2130 void update_mode_profile() { if (tmc2130_mode == TMC2130_MODE_NORMAL) 3558e: 80 91 6c 06 lds r24, 0x066C ; 0x80066c 35592: 81 11 cpse r24, r1 35594: 0e c0 rjmp .+28 ; 0x355b2 { max_feedrate = cs.max_feedrate_normal; 35596: 82 e8 ldi r24, 0x82 ; 130 35598: 96 e0 ldi r25, 0x06 ; 6 3559a: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 3559e: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_normal; 355a2: 82 e9 ldi r24, 0x92 ; 146 355a4: 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; 355a6: 90 93 98 02 sts 0x0298, r25 ; 0x800298 355aa: 80 93 97 02 sts 0x0297, r24 ; 0x800297 } reset_acceleration_rates(); 355ae: 0d 94 85 aa jmp 0x3550a ; 0x3550a 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) 355b2: 81 30 cpi r24, 0x01 ; 1 355b4: e1 f7 brne .-8 ; 0x355ae { max_feedrate = cs.max_feedrate_silent; 355b6: 8a e0 ldi r24, 0x0A ; 10 355b8: 97 e0 ldi r25, 0x07 ; 7 355ba: 90 93 9a 02 sts 0x029A, r25 ; 0x80029a 355be: 80 93 99 02 sts 0x0299, r24 ; 0x800299 max_acceleration_mm_per_s2 = cs.max_acceleration_mm_per_s2_silent; 355c2: 8a e1 ldi r24, 0x1A ; 26 355c4: 97 e0 ldi r25, 0x07 ; 7 355c6: ef cf rjmp .-34 ; 0x355a6 000355c8 : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 355c8: fc 01 movw r30, r24 355ca: 40 81 ld r20, Z 355cc: 51 81 ldd r21, Z+1 ; 0x01 355ce: 62 81 ldd r22, Z+2 ; 0x02 355d0: 73 81 ldd r23, Z+3 ; 0x03 355d2: 40 93 dc 04 sts 0x04DC, r20 ; 0x8004dc 355d6: 50 93 dd 04 sts 0x04DD, r21 ; 0x8004dd 355da: 60 93 de 04 sts 0x04DE, r22 ; 0x8004de 355de: 70 93 df 04 sts 0x04DF, r23 ; 0x8004df #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 355e2: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 355e6: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 355ea: 40 91 80 06 lds r20, 0x0680 ; 0x800680 355ee: 50 91 81 06 lds r21, 0x0681 ; 0x800681 355f2: 60 81 ld r22, Z 355f4: 71 81 ldd r23, Z+1 ; 0x01 355f6: 82 81 ldd r24, Z+2 ; 0x02 355f8: 93 81 ldd r25, Z+3 ; 0x03 355fa: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 355fe: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 35602: e4 e5 ldi r30, 0x54 ; 84 35604: f7 e0 ldi r31, 0x07 ; 7 35606: 64 87 std Z+12, r22 ; 0x0c 35608: 75 87 std Z+13, r23 ; 0x0d 3560a: 86 87 std Z+14, r24 ; 0x0e 3560c: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 3560e: 8f b7 in r24, 0x3f ; 63 35610: f8 94 cli count_position[E_AXIS] = e; 35612: 44 85 ldd r20, Z+12 ; 0x0c 35614: 55 85 ldd r21, Z+13 ; 0x0d 35616: 66 85 ldd r22, Z+14 ; 0x0e 35618: 77 85 ldd r23, Z+15 ; 0x0f 3561a: 40 93 70 07 sts 0x0770, r20 ; 0x800770 3561e: 50 93 71 07 sts 0x0771, r21 ; 0x800771 35622: 60 93 72 07 sts 0x0772, r22 ; 0x800772 35626: 70 93 73 07 sts 0x0773, r23 ; 0x800773 CRITICAL_SECTION_END; 3562a: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 3562c: 08 95 ret 0003562e : // 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; 3562e: fc 01 movw r30, r24 35630: 40 81 ld r20, Z 35632: 51 81 ldd r21, Z+1 ; 0x01 35634: 62 81 ldd r22, Z+2 ; 0x02 35636: 73 81 ldd r23, Z+3 ; 0x03 35638: 40 93 d8 04 sts 0x04D8, r20 ; 0x8004d8 3563c: 50 93 d9 04 sts 0x04D9, r21 ; 0x8004d9 35640: 60 93 da 04 sts 0x04DA, r22 ; 0x8004da 35644: 70 93 db 04 sts 0x04DB, r23 ; 0x8004db #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 35648: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 3564c: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 35650: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 35654: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 35658: 60 81 ld r22, Z 3565a: 71 81 ldd r23, Z+1 ; 0x01 3565c: 82 81 ldd r24, Z+2 ; 0x02 3565e: 93 81 ldd r25, Z+3 ; 0x03 35660: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 35664: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 35668: 60 93 5c 07 sts 0x075C, r22 ; 0x80075c 3566c: 70 93 5d 07 sts 0x075D, r23 ; 0x80075d 35670: 80 93 5e 07 sts 0x075E, r24 ; 0x80075e 35674: 90 93 5f 07 sts 0x075F, r25 ; 0x80075f st_set_position(position); 35678: 0d 94 bd 87 jmp 0x30f7a ; 0x30f7a 0003567c : // 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) { 3567c: 2f 92 push r2 3567e: 3f 92 push r3 35680: 4f 92 push r4 35682: 5f 92 push r5 35684: 6f 92 push r6 35686: 7f 92 push r7 35688: 8f 92 push r8 3568a: 9f 92 push r9 3568c: af 92 push r10 3568e: bf 92 push r11 35690: cf 92 push r12 35692: df 92 push r13 35694: ef 92 push r14 35696: ff 92 push r15 35698: 0f 93 push r16 3569a: 1f 93 push r17 3569c: cf 93 push r28 3569e: df 93 push r29 356a0: cd b7 in r28, 0x3d ; 61 356a2: de b7 in r29, 0x3e ; 62 356a4: c5 58 subi r28, 0x85 ; 133 356a6: d1 09 sbc r29, r1 356a8: 0f b6 in r0, 0x3f ; 63 356aa: f8 94 cli 356ac: de bf out 0x3e, r29 ; 62 356ae: 0f be out 0x3f, r0 ; 63 356b0: cd bf out 0x3d, r28 ; 61 356b2: 69 a3 std Y+33, r22 ; 0x21 356b4: 7a a3 std Y+34, r23 ; 0x22 356b6: 8b a3 std Y+35, r24 ; 0x23 356b8: 9c a3 std Y+36, r25 ; 0x24 356ba: 2d a3 std Y+37, r18 ; 0x25 356bc: 3e a3 std Y+38, r19 ; 0x26 356be: 4f a3 std Y+39, r20 ; 0x27 356c0: 58 a7 std Y+40, r21 ; 0x28 356c2: a8 96 adiw r28, 0x28 ; 40 356c4: ec ae std Y+60, r14 ; 0x3c 356c6: fd ae std Y+61, r15 ; 0x3d 356c8: 0e af std Y+62, r16 ; 0x3e 356ca: 1f af std Y+63, r17 ; 0x3f 356cc: a8 97 sbiw r28, 0x28 ; 40 356ce: aa 96 adiw r28, 0x2a ; 42 356d0: df ae std Y+63, r13 ; 0x3f 356d2: ce ae std Y+62, r12 ; 0x3e 356d4: aa 97 sbiw r28, 0x2a ; 42 356d6: 89 aa std Y+49, r8 ; 0x31 356d8: 99 ae std Y+57, r9 ; 0x39 356da: ad ae std Y+61, r10 ; 0x3d 356dc: bd aa std Y+53, r11 ; 0x35 356de: c5 56 subi r28, 0x65 ; 101 356e0: df 4f sbci r29, 0xFF ; 255 356e2: 08 81 ld r16, Y 356e4: 19 81 ldd r17, Y+1 ; 0x01 356e6: cb 59 subi r28, 0x9B ; 155 356e8: 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); 356ea: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 static bool plan_reset_next_e_sched; // Returns the index of the next block in the ring buffer // NOTE: Removed modulo (%) operator, which uses an expensive divide and multiplication. static inline uint8_t next_block_index(uint8_t block_index) { if (++ block_index == BLOCK_BUFFER_SIZE) 356ee: 8f 5f subi r24, 0xFF ; 255 356f0: a1 96 adiw r28, 0x21 ; 33 356f2: 8f af std Y+63, r24 ; 0x3f 356f4: a1 97 sbiw r28, 0x21 ; 33 356f6: 80 31 cpi r24, 0x10 ; 16 356f8: 19 f4 brne .+6 ; 0x35700 block_index = 0; 356fa: a1 96 adiw r28, 0x21 ; 33 356fc: 1f ae std Y+63, r1 ; 0x3f 356fe: 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) { 35700: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 35704: a1 96 adiw r28, 0x21 ; 33 35706: 2f ad ldd r18, Y+63 ; 0x3f 35708: a1 97 sbiw r28, 0x21 ; 33 3570a: 82 13 cpse r24, r18 3570c: 0f c0 rjmp .+30 ; 0x3572c do { manage_heater(); 3570e: 0f 94 a0 4e call 0x29d40 ; 0x29d40 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 35712: 80 e0 ldi r24, 0x00 ; 0 35714: 0e 94 e2 8b call 0x117c4 ; 0x117c4 lcd_update(0); 35718: 80 e0 ldi r24, 0x00 ; 0 3571a: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 } while (block_buffer_tail == next_buffer_head); 3571e: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 35722: a1 96 adiw r28, 0x21 ; 33 35724: 3f ad ldd r19, Y+63 ; 0x3f 35726: a1 97 sbiw r28, 0x21 ; 33 35728: 83 17 cp r24, r19 3572a: 89 f3 breq .-30 ; 0x3570e } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 3572c: 40 91 5d 0e lds r20, 0x0E5D ; 0x800e5d 35730: a2 96 adiw r28, 0x22 ; 34 35732: 4f af std Y+63, r20 ; 0x3f 35734: a2 97 sbiw r28, 0x22 ; 34 35736: 44 23 and r20, r20 35738: 11 f1 breq .+68 ; 0x3577e // avoid planning the block early if aborted SERIAL_ECHO_START; 3573a: 82 ef ldi r24, 0xF2 ; 242 3573c: 99 ea ldi r25, 0xA9 ; 169 3573e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n("Move aborted")); 35742: 82 e3 ldi r24, 0x32 ; 50 35744: 91 e7 ldi r25, 0x71 ; 113 35746: 0e 94 06 7b call 0xf60c ; 0xf60c // 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(); } 3574a: cb 57 subi r28, 0x7B ; 123 3574c: df 4f sbci r29, 0xFF ; 255 3574e: 0f b6 in r0, 0x3f ; 63 35750: f8 94 cli 35752: de bf out 0x3e, r29 ; 62 35754: 0f be out 0x3f, r0 ; 63 35756: cd bf out 0x3d, r28 ; 61 35758: df 91 pop r29 3575a: cf 91 pop r28 3575c: 1f 91 pop r17 3575e: 0f 91 pop r16 35760: ff 90 pop r15 35762: ef 90 pop r14 35764: df 90 pop r13 35766: cf 90 pop r12 35768: bf 90 pop r11 3576a: af 90 pop r10 3576c: 9f 90 pop r9 3576e: 8f 90 pop r8 35770: 7f 90 pop r7 35772: 6f 90 pop r6 35774: 5f 90 pop r5 35776: 4f 90 pop r4 35778: 3f 90 pop r3 3577a: 2f 90 pop r2 3577c: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 3577e: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 35782: 29 2e mov r2, r25 35784: 31 2c mov r3, r1 35786: 8e e6 ldi r24, 0x6E ; 110 35788: 98 9f mul r25, r24 3578a: d0 01 movw r26, r0 3578c: 11 24 eor r1, r1 3578e: a4 96 adiw r28, 0x24 ; 36 35790: bf af std Y+63, r27 ; 0x3f 35792: ae af std Y+62, r26 ; 0x3e 35794: 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; 35796: cd 01 movw r24, r26 35798: 8a 58 subi r24, 0x8A ; 138 3579a: 98 4f sbci r25, 0xF8 ; 248 3579c: fc 01 movw r30, r24 3579e: e9 5b subi r30, 0xB9 ; 185 357a0: ff 4f sbci r31, 0xFF ; 255 357a2: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 357a4: 84 59 subi r24, 0x94 ; 148 357a6: 9f 4f sbci r25, 0xFF ; 255 357a8: fc 01 movw r30, r24 357aa: 11 82 std Z+1, r1 ; 0x01 357ac: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 357ae: 01 15 cp r16, r1 357b0: 11 05 cpc r17, r1 357b2: 11 f4 brne .+4 ; 0x357b8 357b4: 0d 94 32 b6 jmp 0x36c64 ; 0x36c64 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 357b8: 80 e1 ldi r24, 0x10 ; 16 357ba: f8 01 movw r30, r16 357bc: a2 53 subi r26, 0x32 ; 50 357be: b8 4f sbci r27, 0xF8 ; 248 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 357c0: 01 90 ld r0, Z+ 357c2: 0d 92 st X+, r0 357c4: 8a 95 dec r24 357c6: e1 f7 brne .-8 ; 0x357c0 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 357c8: 8e e6 ldi r24, 0x6E ; 110 357ca: 82 9d mul r24, r2 357cc: 80 01 movw r16, r0 357ce: 83 9d mul r24, r3 357d0: 10 0d add r17, r0 357d2: 11 24 eor r1, r1 357d4: 0a 58 subi r16, 0x8A ; 138 357d6: 18 4f sbci r17, 0xF8 ; 248 357d8: f8 01 movw r30, r16 357da: e8 59 subi r30, 0x98 ; 152 357dc: ff 4f sbci r31, 0xFF ; 255 357de: c3 56 subi r28, 0x63 ; 99 357e0: df 4f sbci r29, 0xFF ; 255 357e2: 88 81 ld r24, Y 357e4: 99 81 ldd r25, Y+1 ; 0x01 357e6: cd 59 subi r28, 0x9D ; 157 357e8: d0 40 sbci r29, 0x00 ; 0 357ea: 91 83 std Z+1, r25 ; 0x01 357ec: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 357ee: 06 59 subi r16, 0x96 ; 150 357f0: 1f 4f sbci r17, 0xFF ; 255 357f2: 60 91 90 02 lds r22, 0x0290 ; 0x800290 357f6: 70 91 91 02 lds r23, 0x0291 ; 0x800291 357fa: 80 91 92 02 lds r24, 0x0292 ; 0x800292 357fe: 90 91 93 02 lds r25, 0x0293 ; 0x800293 35802: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 35806: d8 01 movw r26, r16 35808: 6d 93 st X+, r22 3580a: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 3580c: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.505> 35810: 88 23 and r24, r24 35812: a9 f0 breq .+42 ; 0x3583e { position[E_AXIS] = 0; 35814: 10 92 60 07 sts 0x0760, r1 ; 0x800760 35818: 10 92 61 07 sts 0x0761, r1 ; 0x800761 3581c: 10 92 62 07 sts 0x0762, r1 ; 0x800762 35820: 10 92 63 07 sts 0x0763, r1 ; 0x800763 #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 35824: 10 92 dc 04 sts 0x04DC, r1 ; 0x8004dc 35828: 10 92 dd 04 sts 0x04DD, r1 ; 0x8004dd 3582c: 10 92 de 04 sts 0x04DE, r1 ; 0x8004de 35830: 10 92 df 04 sts 0x04DF, r1 ; 0x8004df #endif // the block might still be discarded later, but we need to ensure the lower-level // count_position is also reset correctly for consistent results! plan_reset_next_e_queue = false; 35834: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.505> plan_reset_next_e_sched = true; 35838: 81 e0 ldi r24, 0x01 ; 1 3583a: 80 93 ba 04 sts 0x04BA, r24 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.506> } // Apply the machine correction matrix. world2machine(x, y); 3583e: be 01 movw r22, r28 35840: 6b 5d subi r22, 0xDB ; 219 35842: 7f 4f sbci r23, 0xFF ; 255 35844: ce 01 movw r24, r28 35846: 81 96 adiw r24, 0x21 ; 33 35848: 0e 94 b7 6a call 0xd56e ; 0xd56e // 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]); 3584c: c9 a0 ldd r12, Y+33 ; 0x21 3584e: da a0 ldd r13, Y+34 ; 0x22 35850: eb a0 ldd r14, Y+35 ; 0x23 35852: fc a0 ldd r15, Y+36 ; 0x24 35854: 20 91 72 06 lds r18, 0x0672 ; 0x800672 35858: 30 91 73 06 lds r19, 0x0673 ; 0x800673 3585c: 40 91 74 06 lds r20, 0x0674 ; 0x800674 35860: 50 91 75 06 lds r21, 0x0675 ; 0x800675 35864: c7 01 movw r24, r14 35866: b6 01 movw r22, r12 35868: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3586c: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 35870: c2 58 subi r28, 0x82 ; 130 35872: df 4f sbci r29, 0xFF ; 255 35874: 68 83 st Y, r22 35876: 79 83 std Y+1, r23 ; 0x01 35878: 8a 83 std Y+2, r24 ; 0x02 3587a: 9b 83 std Y+3, r25 ; 0x03 3587c: ce 57 subi r28, 0x7E ; 126 3587e: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 35880: 8d a0 ldd r8, Y+37 ; 0x25 35882: 9e a0 ldd r9, Y+38 ; 0x26 35884: af a0 ldd r10, Y+39 ; 0x27 35886: b8 a4 ldd r11, Y+40 ; 0x28 35888: 20 91 76 06 lds r18, 0x0676 ; 0x800676 3588c: 30 91 77 06 lds r19, 0x0677 ; 0x800677 35890: 40 91 78 06 lds r20, 0x0678 ; 0x800678 35894: 50 91 79 06 lds r21, 0x0679 ; 0x800679 35898: c5 01 movw r24, r10 3589a: b4 01 movw r22, r8 3589c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 358a0: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 358a4: ce 57 subi r28, 0x7E ; 126 358a6: df 4f sbci r29, 0xFF ; 255 358a8: 68 83 st Y, r22 358aa: 79 83 std Y+1, r23 ; 0x01 358ac: 8a 83 std Y+2, r24 ; 0x02 358ae: 9b 83 std Y+3, r25 ; 0x03 358b0: c2 58 subi r28, 0x82 ; 130 358b2: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 358b4: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 358b8: 88 23 and r24, r24 358ba: 11 f4 brne .+4 ; 0x358c0 358bc: 0d 94 39 b6 jmp 0x36c72 ; 0x36c72 target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 358c0: a5 01 movw r20, r10 358c2: 94 01 movw r18, r8 358c4: c7 01 movw r24, r14 358c6: b6 01 movw r22, r12 358c8: 0f 94 53 96 call 0x32ca6 ; 0x32ca6 358cc: a8 96 adiw r28, 0x28 ; 40 358ce: 2c ad ldd r18, Y+60 ; 0x3c 358d0: 3d ad ldd r19, Y+61 ; 0x3d 358d2: 4e ad ldd r20, Y+62 ; 0x3e 358d4: 5f ad ldd r21, Y+63 ; 0x3f 358d6: a8 97 sbiw r28, 0x28 ; 40 358d8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 358dc: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 358e0: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 358e4: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 358e8: 50 91 7d 06 lds r21, 0x067D ; 0x80067d }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 358ec: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 358f0: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 358f4: e6 96 adiw r28, 0x36 ; 54 358f6: 6c af std Y+60, r22 ; 0x3c 358f8: 7d af std Y+61, r23 ; 0x3d 358fa: 8e af std Y+62, r24 ; 0x3e 358fc: 9f af std Y+63, r25 ; 0x3f 358fe: 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]); 35900: aa 96 adiw r28, 0x2a ; 42 35902: ee ad ldd r30, Y+62 ; 0x3e 35904: ff ad ldd r31, Y+63 ; 0x3f 35906: aa 97 sbiw r28, 0x2a ; 42 35908: 80 80 ld r8, Z 3590a: 91 80 ldd r9, Z+1 ; 0x01 3590c: a2 80 ldd r10, Z+2 ; 0x02 3590e: b3 80 ldd r11, Z+3 ; 0x03 35910: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 35914: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 35918: 40 91 80 06 lds r20, 0x0680 ; 0x800680 3591c: 50 91 81 06 lds r21, 0x0681 ; 0x800681 35920: c5 01 movw r24, r10 35922: b4 01 movw r22, r8 35924: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 35928: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 3592c: ae 96 adiw r28, 0x2e ; 46 3592e: 6c af std Y+60, r22 ; 0x3c 35930: 7d af std Y+61, r23 ; 0x3d 35932: 8e af std Y+62, r24 ; 0x3e 35934: 9f af std Y+63, r25 ; 0x3f 35936: 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]; 35938: 80 91 60 07 lds r24, 0x0760 ; 0x800760 3593c: 90 91 61 07 lds r25, 0x0761 ; 0x800761 35940: a0 91 62 07 lds r26, 0x0762 ; 0x800762 35944: b0 91 63 07 lds r27, 0x0763 ; 0x800763 35948: ae 96 adiw r28, 0x2e ; 46 3594a: 4c ac ldd r4, Y+60 ; 0x3c 3594c: 5d ac ldd r5, Y+61 ; 0x3d 3594e: 6e ac ldd r6, Y+62 ; 0x3e 35950: 7f ac ldd r7, Y+63 ; 0x3f 35952: ae 97 sbiw r28, 0x2e ; 46 35954: 48 1a sub r4, r24 35956: 59 0a sbc r5, r25 35958: 6a 0a sbc r6, r26 3595a: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 3595c: 80 91 54 07 lds r24, 0x0754 ; 0x800754 35960: 90 91 55 07 lds r25, 0x0755 ; 0x800755 35964: a0 91 56 07 lds r26, 0x0756 ; 0x800756 35968: b0 91 57 07 lds r27, 0x0757 ; 0x800757 3596c: c2 58 subi r28, 0x82 ; 130 3596e: df 4f sbci r29, 0xFF ; 255 35970: c8 80 ld r12, Y 35972: d9 80 ldd r13, Y+1 ; 0x01 35974: ea 80 ldd r14, Y+2 ; 0x02 35976: fb 80 ldd r15, Y+3 ; 0x03 35978: ce 57 subi r28, 0x7E ; 126 3597a: d0 40 sbci r29, 0x00 ; 0 3597c: c8 1a sub r12, r24 3597e: d9 0a sbc r13, r25 35980: ea 0a sbc r14, r26 35982: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 35984: 80 91 58 07 lds r24, 0x0758 ; 0x800758 35988: 90 91 59 07 lds r25, 0x0759 ; 0x800759 3598c: a0 91 5a 07 lds r26, 0x075A ; 0x80075a 35990: b0 91 5b 07 lds r27, 0x075B ; 0x80075b 35994: ce 57 subi r28, 0x7E ; 126 35996: df 4f sbci r29, 0xFF ; 255 35998: 28 81 ld r18, Y 3599a: 39 81 ldd r19, Y+1 ; 0x01 3599c: 4a 81 ldd r20, Y+2 ; 0x02 3599e: 5b 81 ldd r21, Y+3 ; 0x03 359a0: c2 58 subi r28, 0x82 ; 130 359a2: d0 40 sbci r29, 0x00 ; 0 359a4: 28 1b sub r18, r24 359a6: 39 0b sbc r19, r25 359a8: 4a 0b sbc r20, r26 359aa: 5b 0b sbc r21, r27 359ac: 29 a7 std Y+41, r18 ; 0x29 359ae: 3a a7 std Y+42, r19 ; 0x2a 359b0: 4b a7 std Y+43, r20 ; 0x2b 359b2: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 359b4: 80 91 5c 07 lds r24, 0x075C ; 0x80075c 359b8: 90 91 5d 07 lds r25, 0x075D ; 0x80075d 359bc: a0 91 5e 07 lds r26, 0x075E ; 0x80075e 359c0: b0 91 5f 07 lds r27, 0x075F ; 0x80075f 359c4: e6 96 adiw r28, 0x36 ; 54 359c6: 2c ad ldd r18, Y+60 ; 0x3c 359c8: 3d ad ldd r19, Y+61 ; 0x3d 359ca: 4e ad ldd r20, Y+62 ; 0x3e 359cc: 5f ad ldd r21, Y+63 ; 0x3f 359ce: e6 97 sbiw r28, 0x36 ; 54 359d0: 28 1b sub r18, r24 359d2: 39 0b sbc r19, r25 359d4: 4a 0b sbc r20, r26 359d6: 5b 0b sbc r21, r27 359d8: 2d a7 std Y+45, r18 ; 0x2d 359da: 3e a7 std Y+46, r19 ; 0x2e 359dc: 4f a7 std Y+47, r20 ; 0x2f 359de: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 359e0: 41 14 cp r4, r1 359e2: 51 04 cpc r5, r1 359e4: 61 04 cpc r6, r1 359e6: 71 04 cpc r7, r1 359e8: 09 f4 brne .+2 ; 0x359ec 359ea: 80 c0 rjmp .+256 ; 0x35aec { if((int)degHotend(active_extruder) 359f0: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 359f4: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 359f8: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 359fc: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 35a00: 20 91 6b 02 lds r18, 0x026B ; 0x80026b 35a04: 30 91 6c 02 lds r19, 0x026C ; 0x80026c 35a08: 62 17 cp r22, r18 35a0a: 73 07 cpc r23, r19 35a0c: 0c f5 brge .+66 ; 0x35a50 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 35a0e: ae 96 adiw r28, 0x2e ; 46 35a10: 8c ad ldd r24, Y+60 ; 0x3c 35a12: 9d ad ldd r25, Y+61 ; 0x3d 35a14: ae ad ldd r26, Y+62 ; 0x3e 35a16: bf ad ldd r27, Y+63 ; 0x3f 35a18: ae 97 sbiw r28, 0x2e ; 46 35a1a: 80 93 60 07 sts 0x0760, r24 ; 0x800760 35a1e: 90 93 61 07 sts 0x0761, r25 ; 0x800761 35a22: a0 93 62 07 sts 0x0762, r26 ; 0x800762 35a26: b0 93 63 07 sts 0x0763, r27 ; 0x800763 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35a2a: 80 92 dc 04 sts 0x04DC, r8 ; 0x8004dc 35a2e: 90 92 dd 04 sts 0x04DD, r9 ; 0x8004dd 35a32: a0 92 de 04 sts 0x04DE, r10 ; 0x8004de 35a36: b0 92 df 04 sts 0x04DF, r11 ; 0x8004df #endif de = 0; // no difference SERIAL_ECHO_START; 35a3a: 82 ef ldi r24, 0xF2 ; 242 35a3c: 99 ea ldi r25, 0xA9 ; 169 35a3e: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 35a42: 88 e1 ldi r24, 0x18 ; 24 35a44: 91 e7 ldi r25, 0x71 ; 113 35a46: 0e 94 06 7b call 0xf60c ; 0xf60c { 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 35a4a: 41 2c mov r4, r1 35a4c: 51 2c mov r5, r1 35a4e: 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) 35a50: c3 01 movw r24, r6 35a52: b2 01 movw r22, r4 35a54: 77 fe sbrs r7, 7 35a56: 07 c0 rjmp .+14 ; 0x35a66 35a58: 66 27 eor r22, r22 35a5a: 77 27 eor r23, r23 35a5c: cb 01 movw r24, r22 35a5e: 64 19 sub r22, r4 35a60: 75 09 sbc r23, r5 35a62: 86 09 sbc r24, r6 35a64: 97 09 sbc r25, r7 35a66: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 35a6a: 4b 01 movw r8, r22 35a6c: 5c 01 movw r10, r24 35a6e: 20 e0 ldi r18, 0x00 ; 0 35a70: 30 ec ldi r19, 0xC0 ; 192 35a72: 4b ee ldi r20, 0xEB ; 235 35a74: 53 e4 ldi r21, 0x43 ; 67 35a76: 60 91 7e 06 lds r22, 0x067E ; 0x80067e 35a7a: 70 91 7f 06 lds r23, 0x067F ; 0x80067f 35a7e: 80 91 80 06 lds r24, 0x0680 ; 0x800680 35a82: 90 91 81 06 lds r25, 0x0681 ; 0x800681 35a86: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 35a8a: 9b 01 movw r18, r22 35a8c: ac 01 movw r20, r24 35a8e: c5 01 movw r24, r10 35a90: b4 01 movw r22, r8 35a92: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 35a96: 18 16 cp r1, r24 35a98: 4c f5 brge .+82 ; 0x35aec { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 35a9a: ae 96 adiw r28, 0x2e ; 46 35a9c: 2c ad ldd r18, Y+60 ; 0x3c 35a9e: 3d ad ldd r19, Y+61 ; 0x3d 35aa0: 4e ad ldd r20, Y+62 ; 0x3e 35aa2: 5f ad ldd r21, Y+63 ; 0x3f 35aa4: ae 97 sbiw r28, 0x2e ; 46 35aa6: 20 93 60 07 sts 0x0760, r18 ; 0x800760 35aaa: 30 93 61 07 sts 0x0761, r19 ; 0x800761 35aae: 40 93 62 07 sts 0x0762, r20 ; 0x800762 35ab2: 50 93 63 07 sts 0x0763, r21 ; 0x800763 #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 35ab6: aa 96 adiw r28, 0x2a ; 42 35ab8: ee ad ldd r30, Y+62 ; 0x3e 35aba: ff ad ldd r31, Y+63 ; 0x3f 35abc: aa 97 sbiw r28, 0x2a ; 42 35abe: 80 81 ld r24, Z 35ac0: 91 81 ldd r25, Z+1 ; 0x01 35ac2: a2 81 ldd r26, Z+2 ; 0x02 35ac4: b3 81 ldd r27, Z+3 ; 0x03 35ac6: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc 35aca: 90 93 dd 04 sts 0x04DD, r25 ; 0x8004dd 35ace: a0 93 de 04 sts 0x04DE, r26 ; 0x8004de 35ad2: b0 93 df 04 sts 0x04DF, r27 ; 0x8004df #endif de = 0; // no difference SERIAL_ECHO_START; 35ad6: 82 ef ldi r24, 0xF2 ; 242 35ad8: 99 ea ldi r25, 0xA9 ; 169 35ada: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 35ade: 8a ef ldi r24, 0xFA ; 250 35ae0: 90 e7 ldi r25, 0x70 ; 112 35ae2: 0e 94 06 7b call 0xf60c ; 0xf60c { 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 35ae6: 41 2c mov r4, r1 35ae8: 51 2c mov r5, r1 35aea: 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); 35aec: 8e e6 ldi r24, 0x6E ; 110 35aee: 82 9d mul r24, r2 35af0: f0 01 movw r30, r0 35af2: 83 9d mul r24, r3 35af4: f0 0d add r31, r0 35af6: 11 24 eor r1, r1 35af8: ea 58 subi r30, 0x8A ; 138 35afa: f8 4f sbci r31, 0xF8 ; 248 35afc: d7 01 movw r26, r14 35afe: c6 01 movw r24, r12 35b00: f7 fe sbrs r15, 7 35b02: 07 c0 rjmp .+14 ; 0x35b12 35b04: 88 27 eor r24, r24 35b06: 99 27 eor r25, r25 35b08: dc 01 movw r26, r24 35b0a: 8c 19 sub r24, r12 35b0c: 9d 09 sbc r25, r13 35b0e: ae 09 sbc r26, r14 35b10: bf 09 sbc r27, r15 35b12: 80 83 st Z, r24 35b14: 91 83 std Z+1, r25 ; 0x01 35b16: a2 83 std Z+2, r26 ; 0x02 35b18: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 35b1a: 8e e6 ldi r24, 0x6E ; 110 35b1c: 82 9d mul r24, r2 35b1e: f0 01 movw r30, r0 35b20: 83 9d mul r24, r3 35b22: f0 0d add r31, r0 35b24: 11 24 eor r1, r1 35b26: ea 58 subi r30, 0x8A ; 138 35b28: f8 4f sbci r31, 0xF8 ; 248 35b2a: 89 a5 ldd r24, Y+41 ; 0x29 35b2c: 9a a5 ldd r25, Y+42 ; 0x2a 35b2e: ab a5 ldd r26, Y+43 ; 0x2b 35b30: bc a5 ldd r27, Y+44 ; 0x2c 35b32: b7 ff sbrs r27, 7 35b34: 07 c0 rjmp .+14 ; 0x35b44 35b36: b0 95 com r27 35b38: a0 95 com r26 35b3a: 90 95 com r25 35b3c: 81 95 neg r24 35b3e: 9f 4f sbci r25, 0xFF ; 255 35b40: af 4f sbci r26, 0xFF ; 255 35b42: bf 4f sbci r27, 0xFF ; 255 35b44: 84 83 std Z+4, r24 ; 0x04 35b46: 95 83 std Z+5, r25 ; 0x05 35b48: a6 83 std Z+6, r26 ; 0x06 35b4a: 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); 35b4c: 8e e6 ldi r24, 0x6E ; 110 35b4e: 82 9d mul r24, r2 35b50: f0 01 movw r30, r0 35b52: 83 9d mul r24, r3 35b54: f0 0d add r31, r0 35b56: 11 24 eor r1, r1 35b58: ea 58 subi r30, 0x8A ; 138 35b5a: f8 4f sbci r31, 0xF8 ; 248 35b5c: 8d a5 ldd r24, Y+45 ; 0x2d 35b5e: 9e a5 ldd r25, Y+46 ; 0x2e 35b60: af a5 ldd r26, Y+47 ; 0x2f 35b62: b8 a9 ldd r27, Y+48 ; 0x30 35b64: b7 ff sbrs r27, 7 35b66: 07 c0 rjmp .+14 ; 0x35b76 35b68: b0 95 com r27 35b6a: a0 95 com r26 35b6c: 90 95 com r25 35b6e: 81 95 neg r24 35b70: 9f 4f sbci r25, 0xFF ; 255 35b72: af 4f sbci r26, 0xFF ; 255 35b74: bf 4f sbci r27, 0xFF ; 255 35b76: 80 87 std Z+8, r24 ; 0x08 35b78: 91 87 std Z+9, r25 ; 0x09 35b7a: a2 87 std Z+10, r26 ; 0x0a 35b7c: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 35b7e: b3 01 movw r22, r6 35b80: a2 01 movw r20, r4 35b82: 77 fe sbrs r7, 7 35b84: 07 c0 rjmp .+14 ; 0x35b94 35b86: 44 27 eor r20, r20 35b88: 55 27 eor r21, r21 35b8a: ba 01 movw r22, r20 35b8c: 44 19 sub r20, r4 35b8e: 55 09 sbc r21, r5 35b90: 66 09 sbc r22, r6 35b92: 77 09 sbc r23, r7 35b94: 8e e6 ldi r24, 0x6E ; 110 35b96: 82 9d mul r24, r2 35b98: f0 01 movw r30, r0 35b9a: 83 9d mul r24, r3 35b9c: f0 0d add r31, r0 35b9e: 11 24 eor r1, r1 35ba0: ea 58 subi r30, 0x8A ; 138 35ba2: f8 4f sbci r31, 0xF8 ; 248 35ba4: 44 87 std Z+12, r20 ; 0x0c 35ba6: 55 87 std Z+13, r21 ; 0x0d 35ba8: 66 87 std Z+14, r22 ; 0x0e 35baa: 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))); 35bac: 00 81 ld r16, Z 35bae: 11 81 ldd r17, Z+1 ; 0x01 35bb0: 22 81 ldd r18, Z+2 ; 0x02 35bb2: 33 81 ldd r19, Z+3 ; 0x03 35bb4: 84 81 ldd r24, Z+4 ; 0x04 35bb6: 95 81 ldd r25, Z+5 ; 0x05 35bb8: a6 81 ldd r26, Z+6 ; 0x06 35bba: b7 81 ldd r27, Z+7 ; 0x07 35bbc: 80 17 cp r24, r16 35bbe: 91 07 cpc r25, r17 35bc0: a2 07 cpc r26, r18 35bc2: b3 07 cpc r27, r19 35bc4: 14 f4 brge .+4 ; 0x35bca 35bc6: d9 01 movw r26, r18 35bc8: c8 01 movw r24, r16 35bca: ee e6 ldi r30, 0x6E ; 110 35bcc: be 2e mov r11, r30 35bce: b2 9c mul r11, r2 35bd0: f0 01 movw r30, r0 35bd2: b3 9c mul r11, r3 35bd4: f0 0d add r31, r0 35bd6: 11 24 eor r1, r1 35bd8: ea 58 subi r30, 0x8A ; 138 35bda: f8 4f sbci r31, 0xF8 ; 248 35bdc: 80 84 ldd r8, Z+8 ; 0x08 35bde: 91 84 ldd r9, Z+9 ; 0x09 35be0: a2 84 ldd r10, Z+10 ; 0x0a 35be2: b3 84 ldd r11, Z+11 ; 0x0b 35be4: 88 15 cp r24, r8 35be6: 99 05 cpc r25, r9 35be8: aa 05 cpc r26, r10 35bea: bb 05 cpc r27, r11 35bec: 14 f4 brge .+4 ; 0x35bf2 35bee: d5 01 movw r26, r10 35bf0: c4 01 movw r24, r8 35bf2: 84 17 cp r24, r20 35bf4: 95 07 cpc r25, r21 35bf6: a6 07 cpc r26, r22 35bf8: b7 07 cpc r27, r23 35bfa: 14 f4 brge .+4 ; 0x35c00 35bfc: db 01 movw r26, r22 35bfe: ca 01 movw r24, r20 35c00: 4e e6 ldi r20, 0x6E ; 110 35c02: 42 9d mul r20, r2 35c04: f0 01 movw r30, r0 35c06: 43 9d mul r20, r3 35c08: f0 0d add r31, r0 35c0a: 11 24 eor r1, r1 35c0c: ea 58 subi r30, 0x8A ; 138 35c0e: f8 4f sbci r31, 0xF8 ; 248 35c10: 80 8b std Z+16, r24 ; 0x10 35c12: 91 8b std Z+17, r25 ; 0x11 35c14: a2 8b std Z+18, r26 ; 0x12 35c16: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 35c18: 06 97 sbiw r24, 0x06 ; 6 35c1a: a1 05 cpc r26, r1 35c1c: b1 05 cpc r27, r1 35c1e: 0c f4 brge .+2 ; 0x35c22 35c20: 94 cd rjmp .-1240 ; 0x3574a planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 35c22: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 35c26: df 01 movw r26, r30 35c28: aa 5b subi r26, 0xBA ; 186 35c2a: bf 4f sbci r27, 0xFF ; 255 35c2c: 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); 35c2e: f7 fe sbrs r15, 7 35c30: 02 c0 rjmp .+4 ; 0x35c36 35c32: 0d 94 49 b6 jmp 0x36c92 ; 0x36c92 } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 35c36: 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); 35c38: 89 a5 ldd r24, Y+41 ; 0x29 35c3a: 9a a5 ldd r25, Y+42 ; 0x2a 35c3c: ab a5 ldd r26, Y+43 ; 0x2b 35c3e: bc a5 ldd r27, Y+44 ; 0x2c 35c40: b7 ff sbrs r27, 7 35c42: 0b c0 rjmp .+22 ; 0x35c5a 35c44: 8e e6 ldi r24, 0x6E ; 110 35c46: 82 9d mul r24, r2 35c48: f0 01 movw r30, r0 35c4a: 83 9d mul r24, r3 35c4c: f0 0d add r31, r0 35c4e: 11 24 eor r1, r1 35c50: ea 58 subi r30, 0x8A ; 138 35c52: f8 4f sbci r31, 0xF8 ; 248 35c54: 80 8d ldd r24, Z+24 ; 0x18 35c56: 82 60 ori r24, 0x02 ; 2 35c58: 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); 35c5a: 8d a5 ldd r24, Y+45 ; 0x2d 35c5c: 9e a5 ldd r25, Y+46 ; 0x2e 35c5e: af a5 ldd r26, Y+47 ; 0x2f 35c60: b8 a9 ldd r27, Y+48 ; 0x30 35c62: b7 ff sbrs r27, 7 35c64: 0b c0 rjmp .+22 ; 0x35c7c 35c66: 8e e6 ldi r24, 0x6E ; 110 35c68: 82 9d mul r24, r2 35c6a: f0 01 movw r30, r0 35c6c: 83 9d mul r24, r3 35c6e: f0 0d add r31, r0 35c70: 11 24 eor r1, r1 35c72: ea 58 subi r30, 0x8A ; 138 35c74: f8 4f sbci r31, 0xF8 ; 248 35c76: 80 8d ldd r24, Z+24 ; 0x18 35c78: 84 60 ori r24, 0x04 ; 4 35c7a: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 35c7c: 77 fe sbrs r7, 7 35c7e: 0b c0 rjmp .+22 ; 0x35c96 35c80: 8e e6 ldi r24, 0x6E ; 110 35c82: 82 9d mul r24, r2 35c84: f0 01 movw r30, r0 35c86: 83 9d mul r24, r3 35c88: f0 0d add r31, r0 35c8a: 11 24 eor r1, r1 35c8c: ea 58 subi r30, 0x8A ; 138 35c8e: f8 4f sbci r31, 0xF8 ; 248 35c90: 80 8d ldd r24, Z+24 ; 0x18 35c92: 88 60 ori r24, 0x08 ; 8 35c94: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 35c96: 01 2b or r16, r17 35c98: 02 2b or r16, r18 35c9a: 03 2b or r16, r19 35c9c: 09 f0 breq .+2 ; 0x35ca0 35c9e: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 35ca0: 8e e6 ldi r24, 0x6E ; 110 35ca2: 82 9d mul r24, r2 35ca4: f0 01 movw r30, r0 35ca6: 83 9d mul r24, r3 35ca8: f0 0d add r31, r0 35caa: 11 24 eor r1, r1 35cac: ea 58 subi r30, 0x8A ; 138 35cae: f8 4f sbci r31, 0xF8 ; 248 35cb0: 84 81 ldd r24, Z+4 ; 0x04 35cb2: 95 81 ldd r25, Z+5 ; 0x05 35cb4: a6 81 ldd r26, Z+6 ; 0x06 35cb6: b7 81 ldd r27, Z+7 ; 0x07 35cb8: 89 2b or r24, r25 35cba: 8a 2b or r24, r26 35cbc: 8b 2b or r24, r27 35cbe: 09 f0 breq .+2 ; 0x35cc2 35cc0: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 35cc2: 8e e6 ldi r24, 0x6E ; 110 35cc4: 82 9d mul r24, r2 35cc6: f0 01 movw r30, r0 35cc8: 83 9d mul r24, r3 35cca: f0 0d add r31, r0 35ccc: 11 24 eor r1, r1 35cce: ea 58 subi r30, 0x8A ; 138 35cd0: f8 4f sbci r31, 0xF8 ; 248 35cd2: 80 85 ldd r24, Z+8 ; 0x08 35cd4: 91 85 ldd r25, Z+9 ; 0x09 35cd6: a2 85 ldd r26, Z+10 ; 0x0a 35cd8: b3 85 ldd r27, Z+11 ; 0x0b 35cda: 89 2b or r24, r25 35cdc: 8a 2b or r24, r26 35cde: 8b 2b or r24, r27 35ce0: 09 f0 breq .+2 ; 0x35ce4 35ce2: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 35ce4: 8e e6 ldi r24, 0x6E ; 110 35ce6: 82 9d mul r24, r2 35ce8: f0 01 movw r30, r0 35cea: 83 9d mul r24, r3 35cec: f0 0d add r31, r0 35cee: 11 24 eor r1, r1 35cf0: ea 58 subi r30, 0x8A ; 138 35cf2: f8 4f sbci r31, 0xF8 ; 248 35cf4: 84 85 ldd r24, Z+12 ; 0x0c 35cf6: 95 85 ldd r25, Z+13 ; 0x0d 35cf8: a6 85 ldd r26, Z+14 ; 0x0e 35cfa: b7 85 ldd r27, Z+15 ; 0x0f 35cfc: 89 2b or r24, r25 35cfe: 8a 2b or r24, r26 35d00: 8b 2b or r24, r27 35d02: 09 f0 breq .+2 ; 0x35d06 35d04: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 35d06: 8e e6 ldi r24, 0x6E ; 110 35d08: 82 9d mul r24, r2 35d0a: f0 01 movw r30, r0 35d0c: 83 9d mul r24, r3 35d0e: f0 0d add r31, r0 35d10: 11 24 eor r1, r1 35d12: ea 58 subi r30, 0x8A ; 138 35d14: f8 4f sbci r31, 0xF8 ; 248 35d16: 24 85 ldd r18, Z+12 ; 0x0c 35d18: 35 85 ldd r19, Z+13 ; 0x0d 35d1a: 46 85 ldd r20, Z+14 ; 0x0e 35d1c: 57 85 ldd r21, Z+15 ; 0x0f 35d1e: 2a 96 adiw r28, 0x0a ; 10 35d20: 2c af std Y+60, r18 ; 0x3c 35d22: 3d af std Y+61, r19 ; 0x3d 35d24: 4e af std Y+62, r20 ; 0x3e 35d26: 5f af std Y+63, r21 ; 0x3f 35d28: 2a 97 sbiw r28, 0x0a ; 10 35d2a: 23 2b or r18, r19 35d2c: 24 2b or r18, r20 35d2e: 25 2b or r18, r21 35d30: 09 f0 breq .+2 ; 0x35d34 35d32: b3 c7 rjmp .+3942 ; 0x36c9a { if(feed_rate 35d38: b0 90 af 06 lds r11, 0x06AF ; 0x8006af 35d3c: 00 91 b0 06 lds r16, 0x06B0 ; 0x8006b0 35d40: 10 91 b1 06 lds r17, 0x06B1 ; 0x8006b1 } else { if(feed_rate 35d54: 18 16 cp r1, r24 35d56: 24 f4 brge .+8 ; 0x35d60 35d58: a9 aa std Y+49, r10 ; 0x31 35d5a: b9 ae std Y+57, r11 ; 0x39 35d5c: 0d af std Y+61, r16 ; 0x3d 35d5e: 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]; 35d60: c7 01 movw r24, r14 35d62: b6 01 movw r22, r12 35d64: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 35d68: 20 91 72 06 lds r18, 0x0672 ; 0x800672 35d6c: 30 91 73 06 lds r19, 0x0673 ; 0x800673 35d70: 40 91 74 06 lds r20, 0x0674 ; 0x800674 35d74: 50 91 75 06 lds r21, 0x0675 ; 0x800675 35d78: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 35d7c: 4b 01 movw r8, r22 35d7e: 5c 01 movw r10, r24 35d80: 89 82 std Y+1, r8 ; 0x01 35d82: 9a 82 std Y+2, r9 ; 0x02 35d84: ab 82 std Y+3, r10 ; 0x03 35d86: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 35d88: 69 a5 ldd r22, Y+41 ; 0x29 35d8a: 7a a5 ldd r23, Y+42 ; 0x2a 35d8c: 8b a5 ldd r24, Y+43 ; 0x2b 35d8e: 9c a5 ldd r25, Y+44 ; 0x2c 35d90: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 35d94: 20 91 76 06 lds r18, 0x0676 ; 0x800676 35d98: 30 91 77 06 lds r19, 0x0677 ; 0x800677 35d9c: 40 91 78 06 lds r20, 0x0678 ; 0x800678 35da0: 50 91 79 06 lds r21, 0x0679 ; 0x800679 35da4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 35da8: 6b 01 movw r12, r22 35daa: 7c 01 movw r14, r24 35dac: cd 82 std Y+5, r12 ; 0x05 35dae: de 82 std Y+6, r13 ; 0x06 35db0: ef 82 std Y+7, r14 ; 0x07 35db2: 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]; 35db4: 6d a5 ldd r22, Y+45 ; 0x2d 35db6: 7e a5 ldd r23, Y+46 ; 0x2e 35db8: 8f a5 ldd r24, Y+47 ; 0x2f 35dba: 98 a9 ldd r25, Y+48 ; 0x30 35dbc: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 35dc0: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 35dc4: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 35dc8: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 35dcc: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 35dd0: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 35dd4: 22 96 adiw r28, 0x02 ; 2 35dd6: 6c af std Y+60, r22 ; 0x3c 35dd8: 7d af std Y+61, r23 ; 0x3d 35dda: 8e af std Y+62, r24 ; 0x3e 35ddc: 9f af std Y+63, r25 ; 0x3f 35dde: 22 97 sbiw r28, 0x02 ; 2 35de0: 69 87 std Y+9, r22 ; 0x09 35de2: 7a 87 std Y+10, r23 ; 0x0a 35de4: 8b 87 std Y+11, r24 ; 0x0b 35de6: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 35de8: c3 01 movw r24, r6 35dea: b2 01 movw r22, r4 35dec: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 35df0: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 35df4: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 35df8: 40 91 80 06 lds r20, 0x0680 ; 0x800680 35dfc: 50 91 81 06 lds r21, 0x0681 ; 0x800681 35e00: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 35e04: 26 96 adiw r28, 0x06 ; 6 35e06: 6c af std Y+60, r22 ; 0x3c 35e08: 7d af std Y+61, r23 ; 0x3d 35e0a: 8e af std Y+62, r24 ; 0x3e 35e0c: 9f af std Y+63, r25 ; 0x3f 35e0e: 26 97 sbiw r28, 0x06 ; 6 35e10: 6d 87 std Y+13, r22 ; 0x0d 35e12: 7e 87 std Y+14, r23 ; 0x0e 35e14: 8f 87 std Y+15, r24 ; 0x0f 35e16: 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 ) 35e18: 8e e6 ldi r24, 0x6E ; 110 35e1a: 82 9d mul r24, r2 35e1c: f0 01 movw r30, r0 35e1e: 83 9d mul r24, r3 35e20: f0 0d add r31, r0 35e22: 11 24 eor r1, r1 35e24: ea 58 subi r30, 0x8A ; 138 35e26: f8 4f sbci r31, 0xF8 ; 248 35e28: 80 81 ld r24, Z 35e2a: 91 81 ldd r25, Z+1 ; 0x01 35e2c: a2 81 ldd r26, Z+2 ; 0x02 35e2e: b3 81 ldd r27, Z+3 ; 0x03 35e30: 2e 96 adiw r28, 0x0e ; 14 35e32: 8c af std Y+60, r24 ; 0x3c 35e34: 9d af std Y+61, r25 ; 0x3d 35e36: ae af std Y+62, r26 ; 0x3e 35e38: bf af std Y+63, r27 ; 0x3f 35e3a: 2e 97 sbiw r28, 0x0e ; 14 35e3c: 06 97 sbiw r24, 0x06 ; 6 35e3e: a1 05 cpc r26, r1 35e40: b1 05 cpc r27, r1 35e42: 0c f0 brlt .+2 ; 0x35e46 35e44: 33 c7 rjmp .+3686 ; 0x36cac 35e46: 84 81 ldd r24, Z+4 ; 0x04 35e48: 95 81 ldd r25, Z+5 ; 0x05 35e4a: a6 81 ldd r26, Z+6 ; 0x06 35e4c: b7 81 ldd r27, Z+7 ; 0x07 35e4e: 06 97 sbiw r24, 0x06 ; 6 35e50: a1 05 cpc r26, r1 35e52: b1 05 cpc r27, r1 35e54: 0c f0 brlt .+2 ; 0x35e58 35e56: 2a c7 rjmp .+3668 ; 0x36cac 35e58: 80 85 ldd r24, Z+8 ; 0x08 35e5a: 91 85 ldd r25, Z+9 ; 0x09 35e5c: a2 85 ldd r26, Z+10 ; 0x0a 35e5e: b3 85 ldd r27, Z+11 ; 0x0b 35e60: 06 97 sbiw r24, 0x06 ; 6 35e62: a1 05 cpc r26, r1 35e64: b1 05 cpc r27, r1 35e66: 0c f0 brlt .+2 ; 0x35e6a 35e68: 21 c7 rjmp .+3650 ; 0x36cac { block->millimeters = fabs(delta_mm[E_AXIS]); 35e6a: 26 96 adiw r28, 0x06 ; 6 35e6c: 8c ad ldd r24, Y+60 ; 0x3c 35e6e: 9d ad ldd r25, Y+61 ; 0x3d 35e70: ae ad ldd r26, Y+62 ; 0x3e 35e72: bf ad ldd r27, Y+63 ; 0x3f 35e74: 26 97 sbiw r28, 0x06 ; 6 35e76: bf 77 andi r27, 0x7F ; 127 35e78: 85 a7 std Z+45, r24 ; 0x2d 35e7a: 96 a7 std Z+46, r25 ; 0x2e 35e7c: a7 a7 std Z+47, r26 ; 0x2f 35e7e: 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 35e80: 8e e6 ldi r24, 0x6E ; 110 35e82: 82 9d mul r24, r2 35e84: f0 01 movw r30, r0 35e86: 83 9d mul r24, r3 35e88: f0 0d add r31, r0 35e8a: 11 24 eor r1, r1 35e8c: ea 58 subi r30, 0x8A ; 138 35e8e: f8 4f sbci r31, 0xF8 ; 248 35e90: 45 a4 ldd r4, Z+45 ; 0x2d 35e92: 56 a4 ldd r5, Z+46 ; 0x2e 35e94: 67 a4 ldd r6, Z+47 ; 0x2f 35e96: 70 a8 ldd r7, Z+48 ; 0x30 35e98: a3 01 movw r20, r6 35e9a: 92 01 movw r18, r4 35e9c: 60 e0 ldi r22, 0x00 ; 0 35e9e: 70 e0 ldi r23, 0x00 ; 0 35ea0: 80 e8 ldi r24, 0x80 ; 128 35ea2: 9f e3 ldi r25, 0x3F ; 63 35ea4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 35ea8: 29 a9 ldd r18, Y+49 ; 0x31 35eaa: 39 ad ldd r19, Y+57 ; 0x39 35eac: 4d ad ldd r20, Y+61 ; 0x3d 35eae: 5d a9 ldd r21, Y+53 ; 0x35 35eb0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 35eb4: 6b 01 movw r12, r22 35eb6: 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); 35eb8: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 35ebc: 90 91 57 0e lds r25, 0x0E57 ; 0x800e57 35ec0: 89 1b sub r24, r25 35ec2: 8f 70 andi r24, 0x0F ; 15 35ec4: 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)) { 35ec6: 82 50 subi r24, 0x02 ; 2 35ec8: 86 30 cpi r24, 0x06 ; 6 35eca: 08 f0 brcs .+2 ; 0x35ece 35ecc: 40 c0 rjmp .+128 ; 0x35f4e // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 35ece: a7 01 movw r20, r14 35ed0: 96 01 movw r18, r12 35ed2: 60 e0 ldi r22, 0x00 ; 0 35ed4: 74 e2 ldi r23, 0x24 ; 36 35ed6: 84 e7 ldi r24, 0x74 ; 116 35ed8: 99 e4 ldi r25, 0x49 ; 73 35eda: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 35ede: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 35ee2: 4b 01 movw r8, r22 35ee4: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 35ee6: 80 91 b2 06 lds r24, 0x06B2 ; 0x8006b2 35eea: 90 91 b3 06 lds r25, 0x06B3 ; 0x8006b3 35eee: a0 91 b4 06 lds r26, 0x06B4 ; 0x8006b4 35ef2: b0 91 b5 06 lds r27, 0x06B5 ; 0x8006b5 35ef6: 88 16 cp r8, r24 35ef8: 99 06 cpc r9, r25 35efa: aa 06 cpc r10, r26 35efc: bb 06 cpc r11, r27 35efe: 38 f5 brcc .+78 ; 0x35f4e // 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)); 35f00: bc 01 movw r22, r24 35f02: cd 01 movw r24, r26 35f04: 68 19 sub r22, r8 35f06: 79 09 sbc r23, r9 35f08: 8a 09 sbc r24, r10 35f0a: 9b 09 sbc r25, r11 35f0c: 66 0f add r22, r22 35f0e: 77 1f adc r23, r23 35f10: 88 1f adc r24, r24 35f12: 99 1f adc r25, r25 35f14: ad ad ldd r26, Y+61 ; 0x3d 35f16: 2a 2f mov r18, r26 35f18: 30 e0 ldi r19, 0x00 ; 0 35f1a: 50 e0 ldi r21, 0x00 ; 0 35f1c: 40 e0 ldi r20, 0x00 ; 0 35f1e: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 35f22: ca 01 movw r24, r20 35f24: b9 01 movw r22, r18 35f26: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 35f2a: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 35f2e: 68 0d add r22, r8 35f30: 79 1d adc r23, r9 35f32: 8a 1d adc r24, r10 35f34: 9b 1d adc r25, r11 35f36: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 35f3a: 9b 01 movw r18, r22 35f3c: ac 01 movw r20, r24 35f3e: 60 e0 ldi r22, 0x00 ; 0 35f40: 74 e2 ldi r23, 0x24 ; 36 35f42: 84 e7 ldi r24, 0x74 ; 116 35f44: 99 e4 ldi r25, 0x49 ; 73 35f46: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 35f4a: 6b 01 movw r12, r22 35f4c: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 35f4e: a3 01 movw r20, r6 35f50: 92 01 movw r18, r4 35f52: c7 01 movw r24, r14 35f54: b6 01 movw r22, r12 35f56: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 35f5a: 6d ab std Y+53, r22 ; 0x35 35f5c: 7e ab std Y+54, r23 ; 0x36 35f5e: 8f ab std Y+55, r24 ; 0x37 35f60: 98 af std Y+56, r25 ; 0x38 35f62: 8e e6 ldi r24, 0x6E ; 110 35f64: 82 9d mul r24, r2 35f66: 80 01 movw r16, r0 35f68: 83 9d mul r24, r3 35f6a: 10 0d add r17, r0 35f6c: 11 24 eor r1, r1 35f6e: 0a 58 subi r16, 0x8A ; 138 35f70: 18 4f sbci r17, 0xF8 ; 248 35f72: 2d a9 ldd r18, Y+53 ; 0x35 35f74: 3e a9 ldd r19, Y+54 ; 0x36 35f76: 4f a9 ldd r20, Y+55 ; 0x37 35f78: 58 ad ldd r21, Y+56 ; 0x38 35f7a: d8 01 movw r26, r16 35f7c: 91 96 adiw r26, 0x21 ; 33 35f7e: 2d 93 st X+, r18 35f80: 3d 93 st X+, r19 35f82: 4d 93 st X+, r20 35f84: 5c 93 st X, r21 35f86: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 35f88: 50 96 adiw r26, 0x10 ; 16 35f8a: 6d 91 ld r22, X+ 35f8c: 7d 91 ld r23, X+ 35f8e: 8d 91 ld r24, X+ 35f90: 9c 91 ld r25, X 35f92: 53 97 sbiw r26, 0x13 ; 19 35f94: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 35f98: 69 af std Y+57, r22 ; 0x39 35f9a: 7a af std Y+58, r23 ; 0x3a 35f9c: 8b af std Y+59, r24 ; 0x3b 35f9e: 9c af std Y+60, r25 ; 0x3c 35fa0: 9b 01 movw r18, r22 35fa2: ac 01 movw r20, r24 35fa4: c7 01 movw r24, r14 35fa6: b6 01 movw r22, r12 35fa8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 35fac: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 35fb0: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 35fb4: 62 96 adiw r28, 0x12 ; 18 35fb6: 6c af std Y+60, r22 ; 0x3c 35fb8: 7d af std Y+61, r23 ; 0x3d 35fba: 8e af std Y+62, r24 ; 0x3e 35fbc: 9f af std Y+63, r25 ; 0x3f 35fbe: 62 97 sbiw r28, 0x12 ; 18 35fc0: f8 01 movw r30, r16 35fc2: 66 ab std Z+54, r22 ; 0x36 35fc4: 77 ab std Z+55, r23 ; 0x37 35fc6: 80 af std Z+56, r24 ; 0x38 35fc8: 91 af std Z+57, r25 ; 0x39 35fca: 9e 01 movw r18, r28 35fcc: 2f 5f subi r18, 0xFF ; 255 35fce: 3f 4f sbci r19, 0xFF ; 255 35fd0: 6c 96 adiw r28, 0x1c ; 28 35fd2: 3f af std Y+63, r19 ; 0x3f 35fd4: 2e af std Y+62, r18 ; 0x3e 35fd6: 6c 97 sbiw r28, 0x1c ; 28 35fd8: ae 01 movw r20, r28 35fda: 4f 5e subi r20, 0xEF ; 239 35fdc: 5f 4f sbci r21, 0xFF ; 255 35fde: a0 96 adiw r28, 0x20 ; 32 35fe0: 5f af std Y+63, r21 ; 0x3f 35fe2: 4e af std Y+62, r20 ; 0x3e 35fe4: a0 97 sbiw r28, 0x20 ; 32 35fe6: 80 91 99 02 lds r24, 0x0299 ; 0x800299 35fea: 90 91 9a 02 lds r25, 0x029A ; 0x80029a 35fee: 9a ab std Y+50, r25 ; 0x32 35ff0: 89 ab std Y+49, r24 ; 0x31 35ff2: 40 96 adiw r24, 0x10 ; 16 35ff4: 6e 96 adiw r28, 0x1e ; 30 35ff6: 9f af std Y+63, r25 ; 0x3f 35ff8: 8e af std Y+62, r24 ; 0x3e 35ffa: 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]) 35ffc: 68 96 adiw r28, 0x18 ; 24 35ffe: 5f af std Y+63, r21 ; 0x3f 36000: 4e af std Y+62, r20 ; 0x3e 36002: 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 36004: 19 a6 std Y+41, r1 ; 0x29 36006: 1d a6 std Y+45, r1 ; 0x2d 36008: 00 e8 ldi r16, 0x80 ; 128 3600a: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 3600c: 6c 96 adiw r28, 0x1c ; 28 3600e: ae ad ldd r26, Y+62 ; 0x3e 36010: bf ad ldd r27, Y+63 ; 0x3f 36012: 6c 97 sbiw r28, 0x1c ; 28 36014: 2d 91 ld r18, X+ 36016: 3d 91 ld r19, X+ 36018: 4d 91 ld r20, X+ 3601a: 5d 91 ld r21, X+ 3601c: 6c 96 adiw r28, 0x1c ; 28 3601e: bf af std Y+63, r27 ; 0x3f 36020: ae af std Y+62, r26 ; 0x3e 36022: 6c 97 sbiw r28, 0x1c ; 28 36024: c7 01 movw r24, r14 36026: b6 01 movw r22, r12 36028: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3602c: 68 96 adiw r28, 0x18 ; 24 3602e: ee ad ldd r30, Y+62 ; 0x3e 36030: ff ad ldd r31, Y+63 ; 0x3f 36032: 68 97 sbiw r28, 0x18 ; 24 36034: 61 93 st Z+, r22 36036: 71 93 st Z+, r23 36038: 81 93 st Z+, r24 3603a: 91 93 st Z+, r25 3603c: 68 96 adiw r28, 0x18 ; 24 3603e: ff af std Y+63, r31 ; 0x3f 36040: ee af std Y+62, r30 ; 0x3e 36042: 68 97 sbiw r28, 0x18 ; 24 if(fabs(current_speed[i]) > max_feedrate[i]) 36044: 4b 01 movw r8, r22 36046: 5c 01 movw r10, r24 36048: e8 94 clt 3604a: b7 f8 bld r11, 7 3604c: a9 a9 ldd r26, Y+49 ; 0x31 3604e: ba a9 ldd r27, Y+50 ; 0x32 36050: 2d 91 ld r18, X+ 36052: 3d 91 ld r19, X+ 36054: 4d 91 ld r20, X+ 36056: 5d 91 ld r21, X+ 36058: ba ab std Y+50, r27 ; 0x32 3605a: a9 ab std Y+49, r26 ; 0x31 3605c: 66 96 adiw r28, 0x16 ; 22 3605e: 2c af std Y+60, r18 ; 0x3c 36060: 3d af std Y+61, r19 ; 0x3d 36062: 4e af std Y+62, r20 ; 0x3e 36064: 5f af std Y+63, r21 ; 0x3f 36066: 66 97 sbiw r28, 0x16 ; 22 36068: c5 01 movw r24, r10 3606a: b4 01 movw r22, r8 3606c: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36070: 18 16 cp r1, r24 36072: b4 f4 brge .+44 ; 0x360a0 { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 36074: a5 01 movw r20, r10 36076: 94 01 movw r18, r8 36078: 66 96 adiw r28, 0x16 ; 22 3607a: 6c ad ldd r22, Y+60 ; 0x3c 3607c: 7d ad ldd r23, Y+61 ; 0x3d 3607e: 8e ad ldd r24, Y+62 ; 0x3e 36080: 9f ad ldd r25, Y+63 ; 0x3f 36082: 66 97 sbiw r28, 0x16 ; 22 36084: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36088: 4b 01 movw r8, r22 3608a: 5c 01 movw r10, r24 3608c: 29 a5 ldd r18, Y+41 ; 0x29 3608e: 3d a5 ldd r19, Y+45 ; 0x2d 36090: a8 01 movw r20, r16 36092: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36096: 18 16 cp r1, r24 36098: 1c f0 brlt .+6 ; 0x360a0 3609a: 89 a6 std Y+41, r8 ; 0x29 3609c: 9d a6 std Y+45, r9 ; 0x2d 3609e: 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++) 360a0: 6e 96 adiw r28, 0x1e ; 30 360a2: ee ad ldd r30, Y+62 ; 0x3e 360a4: ff ad ldd r31, Y+63 ; 0x3f 360a6: 6e 97 sbiw r28, 0x1e ; 30 360a8: 29 a9 ldd r18, Y+49 ; 0x31 360aa: 3a a9 ldd r19, Y+50 ; 0x32 360ac: e2 17 cp r30, r18 360ae: f3 07 cpc r31, r19 360b0: 09 f0 breq .+2 ; 0x360b4 360b2: ac cf rjmp .-168 ; 0x3600c speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 360b4: 20 e0 ldi r18, 0x00 ; 0 360b6: 30 e0 ldi r19, 0x00 ; 0 360b8: 40 e8 ldi r20, 0x80 ; 128 360ba: 5f e3 ldi r21, 0x3F ; 63 360bc: 69 a5 ldd r22, Y+41 ; 0x29 360be: 7d a5 ldd r23, Y+45 ; 0x2d 360c0: c8 01 movw r24, r16 360c2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 360c6: 87 ff sbrs r24, 7 360c8: 50 c0 rjmp .+160 ; 0x3616a 360ca: a0 96 adiw r28, 0x20 ; 32 360cc: ae ac ldd r10, Y+62 ; 0x3e 360ce: bf ac ldd r11, Y+63 ; 0x3f 360d0: a0 97 sbiw r28, 0x20 ; 32 360d2: 30 e1 ldi r19, 0x10 ; 16 360d4: a3 0e add r10, r19 360d6: b1 1c adc r11, r1 360d8: a0 96 adiw r28, 0x20 ; 32 360da: ce ac ldd r12, Y+62 ; 0x3e 360dc: df ac ldd r13, Y+63 ; 0x3f 360de: a0 97 sbiw r28, 0x20 ; 32 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 360e0: d6 01 movw r26, r12 360e2: 6d 91 ld r22, X+ 360e4: 7d 91 ld r23, X+ 360e6: 8d 91 ld r24, X+ 360e8: 9d 91 ld r25, X+ 360ea: 6d 01 movw r12, r26 360ec: 7d 01 movw r14, r26 360ee: b4 e0 ldi r27, 0x04 ; 4 360f0: eb 1a sub r14, r27 360f2: f1 08 sbc r15, r1 360f4: 29 a5 ldd r18, Y+41 ; 0x29 360f6: 3d a5 ldd r19, Y+45 ; 0x2d 360f8: a8 01 movw r20, r16 360fa: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 360fe: f7 01 movw r30, r14 36100: 60 83 st Z, r22 36102: 71 83 std Z+1, r23 ; 0x01 36104: 82 83 std Z+2, r24 ; 0x02 36106: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 36108: ac 14 cp r10, r12 3610a: bd 04 cpc r11, r13 3610c: 49 f7 brne .-46 ; 0x360e0 { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 3610e: 2e e6 ldi r18, 0x6E ; 110 36110: 22 9d mul r18, r2 36112: c0 01 movw r24, r0 36114: 23 9d mul r18, r3 36116: 90 0d add r25, r0 36118: 11 24 eor r1, r1 3611a: 9c 01 movw r18, r24 3611c: 2a 58 subi r18, 0x8A ; 138 3611e: 38 4f sbci r19, 0xF8 ; 248 36120: 79 01 movw r14, r18 36122: 29 a5 ldd r18, Y+41 ; 0x29 36124: 3d a5 ldd r19, Y+45 ; 0x2d 36126: a8 01 movw r20, r16 36128: 6d a9 ldd r22, Y+53 ; 0x35 3612a: 7e a9 ldd r23, Y+54 ; 0x36 3612c: 8f a9 ldd r24, Y+55 ; 0x37 3612e: 98 ad ldd r25, Y+56 ; 0x38 36130: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36134: d7 01 movw r26, r14 36136: 91 96 adiw r26, 0x21 ; 33 36138: 6d 93 st X+, r22 3613a: 7d 93 st X+, r23 3613c: 8d 93 st X+, r24 3613e: 9c 93 st X, r25 36140: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 36142: 62 96 adiw r28, 0x12 ; 18 36144: 6c ad ldd r22, Y+60 ; 0x3c 36146: 7d ad ldd r23, Y+61 ; 0x3d 36148: 8e ad ldd r24, Y+62 ; 0x3e 3614a: 9f ad ldd r25, Y+63 ; 0x3f 3614c: 62 97 sbiw r28, 0x12 ; 18 3614e: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 36152: 29 a5 ldd r18, Y+41 ; 0x29 36154: 3d a5 ldd r19, Y+45 ; 0x2d 36156: a8 01 movw r20, r16 36158: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3615c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 36160: f7 01 movw r30, r14 36162: 66 ab std Z+54, r22 ; 0x36 36164: 77 ab std Z+55, r23 ; 0x37 36166: 80 af std Z+56, r24 ; 0x38 36168: 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; 3616a: a3 01 movw r20, r6 3616c: 92 01 movw r18, r4 3616e: 69 ad ldd r22, Y+57 ; 0x39 36170: 7a ad ldd r23, Y+58 ; 0x3a 36172: 8b ad ldd r24, Y+59 ; 0x3b 36174: 9c ad ldd r25, Y+60 ; 0x3c 36176: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 3617a: 69 a7 std Y+41, r22 ; 0x29 3617c: 7a a7 std Y+42, r23 ; 0x2a 3617e: 8b a7 std Y+43, r24 ; 0x2b 36180: 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) 36182: 2e 96 adiw r28, 0x0e ; 14 36184: 2c ad ldd r18, Y+60 ; 0x3c 36186: 3d ad ldd r19, Y+61 ; 0x3d 36188: 4e ad ldd r20, Y+62 ; 0x3e 3618a: 5f ad ldd r21, Y+63 ; 0x3f 3618c: 2e 97 sbiw r28, 0x0e ; 14 3618e: 23 2b or r18, r19 36190: 24 2b or r18, r20 36192: 25 2b or r18, r21 36194: 09 f0 breq .+2 ; 0x36198 36196: b9 c5 rjmp .+2930 ; 0x36d0a 36198: 8e e6 ldi r24, 0x6E ; 110 3619a: 82 9d mul r24, r2 3619c: 80 01 movw r16, r0 3619e: 83 9d mul r24, r3 361a0: 10 0d add r17, r0 361a2: 11 24 eor r1, r1 361a4: 0a 58 subi r16, 0x8A ; 138 361a6: 18 4f sbci r17, 0xF8 ; 248 361a8: f8 01 movw r30, r16 361aa: 84 81 ldd r24, Z+4 ; 0x04 361ac: 95 81 ldd r25, Z+5 ; 0x05 361ae: a6 81 ldd r26, Z+6 ; 0x06 361b0: b7 81 ldd r27, Z+7 ; 0x07 361b2: 89 2b or r24, r25 361b4: 8a 2b or r24, r26 361b6: 8b 2b or r24, r27 361b8: 09 f0 breq .+2 ; 0x361bc 361ba: a7 c5 rjmp .+2894 ; 0x36d0a 361bc: 80 85 ldd r24, Z+8 ; 0x08 361be: 91 85 ldd r25, Z+9 ; 0x09 361c0: a2 85 ldd r26, Z+10 ; 0x0a 361c2: b3 85 ldd r27, Z+11 ; 0x0b 361c4: 89 2b or r24, r25 361c6: 8a 2b or r24, r26 361c8: 8b 2b or r24, r27 361ca: 09 f0 breq .+2 ; 0x361ce 361cc: 9e c5 rjmp .+2876 ; 0x36d0a { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 361ce: 20 91 a6 06 lds r18, 0x06A6 ; 0x8006a6 361d2: 30 91 a7 06 lds r19, 0x06A7 ; 0x8006a7 361d6: 40 91 a8 06 lds r20, 0x06A8 ; 0x8006a8 361da: 50 91 a9 06 lds r21, 0x06A9 ; 0x8006a9 361de: 69 a5 ldd r22, Y+41 ; 0x29 361e0: 7a a5 ldd r23, Y+42 ; 0x2a 361e2: 8b a5 ldd r24, Y+43 ; 0x2b 361e4: 9c a5 ldd r25, Y+44 ; 0x2c 361e6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 361ea: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 361ee: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 361f2: 2b 01 movw r4, r22 361f4: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 361f6: f8 01 movw r30, r16 361f8: e4 5b subi r30, 0xB4 ; 180 361fa: ff 4f sbci r31, 0xFF ; 255 361fc: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 361fe: 6a 96 adiw r28, 0x1a ; 26 36200: 1c ae std Y+60, r1 ; 0x3c 36202: 1d ae std Y+61, r1 ; 0x3d 36204: 1e ae std Y+62, r1 ; 0x3e 36206: 1f ae std Y+63, r1 ; 0x3f 36208: 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; 3620a: 8e e6 ldi r24, 0x6E ; 110 3620c: 82 9d mul r24, r2 3620e: 80 01 movw r16, r0 36210: 83 9d mul r24, r3 36212: 10 0d add r17, r0 36214: 11 24 eor r1, r1 36216: 0a 58 subi r16, 0x8A ; 138 36218: 18 4f sbci r17, 0xF8 ; 248 3621a: f8 01 movw r30, r16 3621c: ee 5b subi r30, 0xBE ; 190 3621e: ff 4f sbci r31, 0xFF ; 255 36220: 40 82 st Z, r4 36222: 51 82 std Z+1, r5 ; 0x01 36224: 62 82 std Z+2, r6 ; 0x02 36226: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 36228: c3 01 movw r24, r6 3622a: b2 01 movw r22, r4 3622c: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 36230: 6b 01 movw r12, r22 36232: 7c 01 movw r14, r24 36234: 29 a5 ldd r18, Y+41 ; 0x29 36236: 3a a5 ldd r19, Y+42 ; 0x2a 36238: 4b a5 ldd r20, Y+43 ; 0x2b 3623a: 5c a5 ldd r21, Y+44 ; 0x2c 3623c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36240: e2 96 adiw r28, 0x32 ; 50 36242: 6c af std Y+60, r22 ; 0x3c 36244: 7d af std Y+61, r23 ; 0x3d 36246: 8e af std Y+62, r24 ; 0x3e 36248: 9f af std Y+63, r25 ; 0x3f 3624a: e2 97 sbiw r28, 0x32 ; 50 3624c: f8 01 movw r30, r16 3624e: 61 ab std Z+49, r22 ; 0x31 36250: 72 ab std Z+50, r23 ; 0x32 36252: 83 ab std Z+51, r24 ; 0x33 36254: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 36256: 2d eb ldi r18, 0xBD ; 189 36258: 37 e3 ldi r19, 0x37 ; 55 3625a: 46 e0 ldi r20, 0x06 ; 6 3625c: 51 e4 ldi r21, 0x41 ; 65 3625e: c7 01 movw r24, r14 36260: b6 01 movw r22, r12 36262: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36266: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 3626a: d8 01 movw r26, r16 3626c: 54 96 adiw r26, 0x14 ; 20 3626e: 6d 93 st X+, r22 36270: 7d 93 st X+, r23 36272: 8d 93 st X+, r24 36274: 9c 93 st X, r25 36276: 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; 36278: 91 96 adiw r26, 0x21 ; 33 3627a: bc 91 ld r27, X 3627c: 27 96 adiw r28, 0x07 ; 7 3627e: bf af std Y+63, r27 ; 0x3f 36280: 27 97 sbiw r28, 0x07 ; 7 36282: f8 01 movw r30, r16 36284: f2 a1 ldd r31, Z+34 ; 0x22 36286: 2b 96 adiw r28, 0x0b ; 11 36288: ff af std Y+63, r31 ; 0x3f 3628a: 2b 97 sbiw r28, 0x0b ; 11 3628c: d8 01 movw r26, r16 3628e: 93 96 adiw r26, 0x23 ; 35 36290: bc 91 ld r27, X 36292: 2f 96 adiw r28, 0x0f ; 15 36294: bf af std Y+63, r27 ; 0x3f 36296: 2f 97 sbiw r28, 0x0f ; 15 36298: f8 01 movw r30, r16 3629a: f4 a1 ldd r31, Z+36 ; 0x24 3629c: 63 96 adiw r28, 0x13 ; 19 3629e: ff af std Y+63, r31 ; 0x3f 362a0: 63 97 sbiw r28, 0x13 ; 19 362a2: 26 eb ldi r18, 0xB6 ; 182 362a4: 36 e0 ldi r19, 0x06 ; 6 362a6: ee 96 adiw r28, 0x3e ; 62 362a8: 3f af std Y+63, r19 ; 0x3f 362aa: 2e af std Y+62, r18 ; 0x3e 362ac: ee 97 sbiw r28, 0x3e ; 62 362ae: a0 96 adiw r28, 0x20 ; 32 362b0: 4e ac ldd r4, Y+62 ; 0x3e 362b2: 5f ac ldd r5, Y+63 ; 0x3f 362b4: a0 97 sbiw r28, 0x20 ; 32 362b6: 30 e1 ldi r19, 0x10 ; 16 362b8: 43 0e add r4, r19 362ba: 51 1c adc r5, r1 362bc: 06 eb ldi r16, 0xB6 ; 182 362be: 16 e0 ldi r17, 0x06 ; 6 362c0: a0 96 adiw r28, 0x20 ; 32 362c2: 6e ac ldd r6, Y+62 ; 0x3e 362c4: 7f ac ldd r7, Y+63 ; 0x3f 362c6: a0 97 sbiw r28, 0x20 ; 32 362c8: 27 96 adiw r28, 0x07 ; 7 362ca: 4f ad ldd r20, Y+63 ; 0x3f 362cc: 27 97 sbiw r28, 0x07 ; 7 362ce: 49 a7 std Y+41, r20 ; 0x29 362d0: 2b 96 adiw r28, 0x0b ; 11 362d2: 5f ad ldd r21, Y+63 ; 0x3f 362d4: 2b 97 sbiw r28, 0x0b ; 11 362d6: 5d a7 std Y+45, r21 ; 0x2d 362d8: b9 ab std Y+49, r27 ; 0x31 362da: f9 af std Y+57, r31 ; 0x39 bool limited = false; 362dc: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 362de: d3 01 movw r26, r6 362e0: 8d 90 ld r8, X+ 362e2: 9d 90 ld r9, X+ 362e4: ad 90 ld r10, X+ 362e6: bd 90 ld r11, X+ 362e8: 3d 01 movw r6, r26 362ea: e8 94 clt 362ec: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 362ee: f8 01 movw r30, r16 362f0: c1 90 ld r12, Z+ 362f2: d1 90 ld r13, Z+ 362f4: e1 90 ld r14, Z+ 362f6: f1 90 ld r15, Z+ 362f8: 8f 01 movw r16, r30 362fa: a5 01 movw r20, r10 362fc: 94 01 movw r18, r8 362fe: c7 01 movw r24, r14 36300: b6 01 movw r22, r12 36302: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36306: 87 ff sbrs r24, 7 36308: 3a c0 rjmp .+116 ; 0x3637e // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 3630a: fd a9 ldd r31, Y+53 ; 0x35 3630c: ff 23 and r31, r31 3630e: 09 f4 brne .+2 ; 0x36312 36310: 7e c6 rjmp .+3324 ; 0x3700e // 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; 36312: 29 a5 ldd r18, Y+41 ; 0x29 36314: 3d a5 ldd r19, Y+45 ; 0x2d 36316: 49 a9 ldd r20, Y+49 ; 0x31 36318: 59 ad ldd r21, Y+57 ; 0x39 3631a: c5 01 movw r24, r10 3631c: b4 01 movw r22, r8 3631e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36322: 4b 01 movw r8, r22 36324: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 36326: a7 01 movw r20, r14 36328: 96 01 movw r18, r12 3632a: 27 96 adiw r28, 0x07 ; 7 3632c: 6f ad ldd r22, Y+63 ; 0x3f 3632e: 27 97 sbiw r28, 0x07 ; 7 36330: 2b 96 adiw r28, 0x0b ; 11 36332: 7f ad ldd r23, Y+63 ; 0x3f 36334: 2b 97 sbiw r28, 0x0b ; 11 36336: 2f 96 adiw r28, 0x0f ; 15 36338: 8f ad ldd r24, Y+63 ; 0x3f 3633a: 2f 97 sbiw r28, 0x0f ; 15 3633c: 63 96 adiw r28, 0x13 ; 19 3633e: 9f ad ldd r25, Y+63 ; 0x3f 36340: 63 97 sbiw r28, 0x13 ; 19 36342: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36346: 6b 01 movw r12, r22 36348: 7c 01 movw r14, r24 if (jerk > mjerk) { 3634a: ac 01 movw r20, r24 3634c: 9b 01 movw r18, r22 3634e: c5 01 movw r24, r10 36350: b4 01 movw r22, r8 36352: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36356: 18 16 cp r1, r24 36358: 94 f4 brge .+36 ; 0x3637e safe_speed *= mjerk / jerk; 3635a: a5 01 movw r20, r10 3635c: 94 01 movw r18, r8 3635e: c7 01 movw r24, r14 36360: b6 01 movw r22, r12 36362: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36366: 9b 01 movw r18, r22 36368: ac 01 movw r20, r24 3636a: 69 a5 ldd r22, Y+41 ; 0x29 3636c: 7d a5 ldd r23, Y+45 ; 0x2d 3636e: 89 a9 ldd r24, Y+49 ; 0x31 36370: 99 ad ldd r25, Y+57 ; 0x39 36372: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36376: 69 a7 std Y+41, r22 ; 0x29 36378: 7d a7 std Y+45, r23 ; 0x2d 3637a: 89 ab std Y+49, r24 ; 0x31 3637c: 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) { 3637e: 46 14 cp r4, r6 36380: 57 04 cpc r5, r7 36382: 09 f0 breq .+2 ; 0x36386 36384: ac cf rjmp .-168 ; 0x362de } } } // Reset the block flag. block->flag = 0; 36386: 8e e6 ldi r24, 0x6E ; 110 36388: 82 9d mul r24, r2 3638a: f0 01 movw r30, r0 3638c: 83 9d mul r24, r3 3638e: f0 0d add r31, r0 36390: 11 24 eor r1, r1 36392: ea 58 subi r30, 0x8A ; 138 36394: f8 4f sbci r31, 0xF8 ; 248 36396: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 36398: 80 91 ba 04 lds r24, 0x04BA ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.506> 3639c: 88 23 and r24, r24 3639e: 21 f0 breq .+8 ; 0x363a8 { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 363a0: 80 e1 ldi r24, 0x10 ; 16 363a2: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 363a4: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.506> float vmax_junction; //FIXME Vojtech: Why only if at least two lines are planned in the queue? // Is it because we don't want to tinker with the first buffer line, which // is likely to be executed by the stepper interrupt routine soon? if (moves_queued > 1 && previous_nominal_speed > 0.0001f) { 363a8: 3d ad ldd r19, Y+61 ; 0x3d 363aa: 32 30 cpi r19, 0x02 ; 2 363ac: 08 f4 brcc .+2 ; 0x363b0 363ae: 8f c6 rjmp .+3358 ; 0x370ce 363b0: 40 91 bc 04 lds r20, 0x04BC ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507> 363b4: 6b 96 adiw r28, 0x1b ; 27 363b6: 4f af std Y+63, r20 ; 0x3f 363b8: 6b 97 sbiw r28, 0x1b ; 27 363ba: 50 91 bd 04 lds r21, 0x04BD ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x1> 363be: 6d 96 adiw r28, 0x1d ; 29 363c0: 5f af std Y+63, r21 ; 0x3f 363c2: 6d 97 sbiw r28, 0x1d ; 29 363c4: 00 91 be 04 lds r16, 0x04BE ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.507+0x2> 363c8: 10 91 bf 04 lds r17, 0x04BF ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.507+0x3> 363cc: 27 e1 ldi r18, 0x17 ; 23 363ce: 37 eb ldi r19, 0xB7 ; 183 363d0: 41 ed ldi r20, 0xD1 ; 209 363d2: 58 e3 ldi r21, 0x38 ; 56 363d4: 6b 96 adiw r28, 0x1b ; 27 363d6: 6f ad ldd r22, Y+63 ; 0x3f 363d8: 6b 97 sbiw r28, 0x1b ; 27 363da: 6d 96 adiw r28, 0x1d ; 29 363dc: 7f ad ldd r23, Y+63 ; 0x3f 363de: 6d 97 sbiw r28, 0x1d ; 29 363e0: c8 01 movw r24, r16 363e2: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 363e6: 18 16 cp r1, r24 363e8: 0c f0 brlt .+2 ; 0x363ec 363ea: 71 c6 rjmp .+3298 ; 0x370ce // 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); 363ec: 6b 96 adiw r28, 0x1b ; 27 363ee: 2f ad ldd r18, Y+63 ; 0x3f 363f0: 6b 97 sbiw r28, 0x1b ; 27 363f2: 6d 96 adiw r28, 0x1d ; 29 363f4: 3f ad ldd r19, Y+63 ; 0x3f 363f6: 6d 97 sbiw r28, 0x1d ; 29 363f8: a8 01 movw r20, r16 363fa: 27 96 adiw r28, 0x07 ; 7 363fc: 6f ad ldd r22, Y+63 ; 0x3f 363fe: 27 97 sbiw r28, 0x07 ; 7 36400: 2b 96 adiw r28, 0x0b ; 11 36402: 7f ad ldd r23, Y+63 ; 0x3f 36404: 2b 97 sbiw r28, 0x0b ; 11 36406: 2f 96 adiw r28, 0x0f ; 15 36408: 8f ad ldd r24, Y+63 ; 0x3f 3640a: 2f 97 sbiw r28, 0x0f ; 15 3640c: 63 96 adiw r28, 0x13 ; 19 3640e: 9f ad ldd r25, Y+63 ; 0x3f 36410: 63 97 sbiw r28, 0x13 ; 19 36412: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36416: 87 ff sbrs r24, 7 36418: 01 c6 rjmp .+3074 ; 0x3701c 3641a: 6b 96 adiw r28, 0x1b ; 27 3641c: 2f ad ldd r18, Y+63 ; 0x3f 3641e: 6b 97 sbiw r28, 0x1b ; 27 36420: 6d 96 adiw r28, 0x1d ; 29 36422: 3f ad ldd r19, Y+63 ; 0x3f 36424: 6d 97 sbiw r28, 0x1d ; 29 36426: a8 01 movw r20, r16 36428: 27 96 adiw r28, 0x07 ; 7 3642a: 6f ad ldd r22, Y+63 ; 0x3f 3642c: 27 97 sbiw r28, 0x07 ; 7 3642e: 2b 96 adiw r28, 0x0b ; 11 36430: 7f ad ldd r23, Y+63 ; 0x3f 36432: 2b 97 sbiw r28, 0x0b ; 11 36434: 2f 96 adiw r28, 0x0f ; 15 36436: 8f ad ldd r24, Y+63 ; 0x3f 36438: 2f 97 sbiw r28, 0x0f ; 15 3643a: 63 96 adiw r28, 0x13 ; 19 3643c: 9f ad ldd r25, Y+63 ; 0x3f 3643e: 63 97 sbiw r28, 0x13 ; 19 36440: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36444: ec 96 adiw r28, 0x3c ; 60 36446: 6c af std Y+60, r22 ; 0x3c 36448: 7d af std Y+61, r23 ; 0x3d 3644a: 8e af std Y+62, r24 ; 0x3e 3644c: 9f af std Y+63, r25 ; 0x3f 3644e: 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; 36450: 27 96 adiw r28, 0x07 ; 7 36452: 8f ad ldd r24, Y+63 ; 0x3f 36454: 27 97 sbiw r28, 0x07 ; 7 36456: 8d af std Y+61, r24 ; 0x3d 36458: 2b 96 adiw r28, 0x0b ; 11 3645a: 9f ad ldd r25, Y+63 ; 0x3f 3645c: 2b 97 sbiw r28, 0x0b ; 11 3645e: 9d ab std Y+53, r25 ; 0x35 36460: 2f 96 adiw r28, 0x0f ; 15 36462: af ad ldd r26, Y+63 ; 0x3f 36464: 2f 97 sbiw r28, 0x0f ; 15 36466: ae af std Y+62, r26 ; 0x3e 36468: 63 96 adiw r28, 0x13 ; 19 3646a: bf ad ldd r27, Y+63 ; 0x3f 3646c: 63 97 sbiw r28, 0x13 ; 19 3646e: 23 96 adiw r28, 0x03 ; 3 36470: bf af std Y+63, r27 ; 0x3f 36472: 23 97 sbiw r28, 0x03 ; 3 36474: 20 ec ldi r18, 0xC0 ; 192 36476: 34 e0 ldi r19, 0x04 ; 4 36478: e8 96 adiw r28, 0x38 ; 56 3647a: 3f af std Y+63, r19 ; 0x3f 3647c: 2e af std Y+62, r18 ; 0x3e 3647e: e8 97 sbiw r28, 0x38 ; 56 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 36480: 41 2c mov r4, r1 36482: 51 2c mov r5, r1 36484: 30 e8 ldi r19, 0x80 ; 128 36486: 63 2e mov r6, r19 36488: 3f e3 ldi r19, 0x3F ; 63 3648a: 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]; 3648c: e8 96 adiw r28, 0x38 ; 56 3648e: ae ad ldd r26, Y+62 ; 0x3e 36490: bf ad ldd r27, Y+63 ; 0x3f 36492: e8 97 sbiw r28, 0x38 ; 56 36494: 8d 90 ld r8, X+ 36496: 9d 90 ld r9, X+ 36498: ad 90 ld r10, X+ 3649a: bd 90 ld r11, X+ 3649c: e8 96 adiw r28, 0x38 ; 56 3649e: bf af std Y+63, r27 ; 0x3f 364a0: ae af std Y+62, r26 ; 0x3e 364a2: e8 97 sbiw r28, 0x38 ; 56 float v_entry = current_speed [axis]; 364a4: a0 96 adiw r28, 0x20 ; 32 364a6: ee ad ldd r30, Y+62 ; 0x3e 364a8: ff ad ldd r31, Y+63 ; 0x3f 364aa: a0 97 sbiw r28, 0x20 ; 32 364ac: c1 90 ld r12, Z+ 364ae: d1 90 ld r13, Z+ 364b0: e1 90 ld r14, Z+ 364b2: f1 90 ld r15, Z+ 364b4: a0 96 adiw r28, 0x20 ; 32 364b6: ff af std Y+63, r31 ; 0x3f 364b8: ee af std Y+62, r30 ; 0x3e 364ba: a0 97 sbiw r28, 0x20 ; 32 if (prev_speed_larger) 364bc: 6b 96 adiw r28, 0x1b ; 27 364be: 2f ad ldd r18, Y+63 ; 0x3f 364c0: 6b 97 sbiw r28, 0x1b ; 27 364c2: 6d 96 adiw r28, 0x1d ; 29 364c4: 3f ad ldd r19, Y+63 ; 0x3f 364c6: 6d 97 sbiw r28, 0x1d ; 29 364c8: a8 01 movw r20, r16 364ca: 27 96 adiw r28, 0x07 ; 7 364cc: 6f ad ldd r22, Y+63 ; 0x3f 364ce: 27 97 sbiw r28, 0x07 ; 7 364d0: 2b 96 adiw r28, 0x0b ; 11 364d2: 7f ad ldd r23, Y+63 ; 0x3f 364d4: 2b 97 sbiw r28, 0x0b ; 11 364d6: 2f 96 adiw r28, 0x0f ; 15 364d8: 8f ad ldd r24, Y+63 ; 0x3f 364da: 2f 97 sbiw r28, 0x0f ; 15 364dc: 63 96 adiw r28, 0x13 ; 19 364de: 9f ad ldd r25, Y+63 ; 0x3f 364e0: 63 97 sbiw r28, 0x13 ; 19 364e2: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 364e6: 87 ff sbrs r24, 7 364e8: 0c c0 rjmp .+24 ; 0x36502 v_exit *= smaller_speed_factor; 364ea: ec 96 adiw r28, 0x3c ; 60 364ec: 2c ad ldd r18, Y+60 ; 0x3c 364ee: 3d ad ldd r19, Y+61 ; 0x3d 364f0: 4e ad ldd r20, Y+62 ; 0x3e 364f2: 5f ad ldd r21, Y+63 ; 0x3f 364f4: ec 97 sbiw r28, 0x3c ; 60 364f6: c5 01 movw r24, r10 364f8: b4 01 movw r22, r8 364fa: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 364fe: 4b 01 movw r8, r22 36500: 5c 01 movw r10, r24 if (limited) { 36502: a2 96 adiw r28, 0x22 ; 34 36504: ff ad ldd r31, Y+63 ; 0x3f 36506: a2 97 sbiw r28, 0x22 ; 34 36508: ff 23 and r31, r31 3650a: 81 f0 breq .+32 ; 0x3652c v_exit *= v_factor; 3650c: a3 01 movw r20, r6 3650e: 92 01 movw r18, r4 36510: c5 01 movw r24, r10 36512: b4 01 movw r22, r8 36514: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36518: 4b 01 movw r8, r22 3651a: 5c 01 movw r10, r24 v_entry *= v_factor; 3651c: a3 01 movw r20, r6 3651e: 92 01 movw r18, r4 36520: c7 01 movw r24, r14 36522: b6 01 movw r22, r12 36524: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36528: 6b 01 movw r12, r22 3652a: 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) ? 3652c: a7 01 movw r20, r14 3652e: 96 01 movw r18, r12 36530: c5 01 movw r24, r10 36532: b4 01 movw r22, r8 36534: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 36538: 20 e0 ldi r18, 0x00 ; 0 3653a: 30 e0 ldi r19, 0x00 ; 0 3653c: 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) ? 3653e: 18 16 cp r1, r24 36540: 0c f0 brlt .+2 ; 0x36544 36542: a3 c5 rjmp .+2886 ; 0x3708a ((v_entry > 0.f || v_exit < 0.f) ? 36544: c7 01 movw r24, r14 36546: b6 01 movw r22, r12 36548: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 3654c: 18 16 cp r1, r24 3654e: 4c f0 brlt .+18 ; 0x36562 36550: 20 e0 ldi r18, 0x00 ; 0 36552: 30 e0 ldi r19, 0x00 ; 0 36554: a9 01 movw r20, r18 36556: c5 01 movw r24, r10 36558: b4 01 movw r22, r8 3655a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3655e: 87 ff sbrs r24, 7 36560: 85 c5 rjmp .+2826 ; 0x3706c 36562: a7 01 movw r20, r14 36564: 96 01 movw r18, r12 36566: c5 01 movw r24, r10 36568: 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) ? 3656a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 3656e: 6b 01 movw r12, r22 36570: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 36572: ee 96 adiw r28, 0x3e ; 62 36574: ae ad ldd r26, Y+62 ; 0x3e 36576: bf ad ldd r27, Y+63 ; 0x3f 36578: ee 97 sbiw r28, 0x3e ; 62 3657a: 8d 90 ld r8, X+ 3657c: 9d 90 ld r9, X+ 3657e: ad 90 ld r10, X+ 36580: bd 90 ld r11, X+ 36582: ee 96 adiw r28, 0x3e ; 62 36584: bf af std Y+63, r27 ; 0x3f 36586: ae af std Y+62, r26 ; 0x3e 36588: ee 97 sbiw r28, 0x3e ; 62 3658a: a5 01 movw r20, r10 3658c: 94 01 movw r18, r8 3658e: c7 01 movw r24, r14 36590: b6 01 movw r22, r12 36592: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36596: 18 16 cp r1, r24 36598: 94 f4 brge .+36 ; 0x365be v_factor *= cs.max_jerk[axis] / jerk; 3659a: a7 01 movw r20, r14 3659c: 96 01 movw r18, r12 3659e: c5 01 movw r24, r10 365a0: b4 01 movw r22, r8 365a2: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 365a6: 9b 01 movw r18, r22 365a8: ac 01 movw r20, r24 365aa: c3 01 movw r24, r6 365ac: b2 01 movw r22, r4 365ae: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 365b2: 2b 01 movw r4, r22 365b4: 3c 01 movw r6, r24 limited = true; 365b6: b1 e0 ldi r27, 0x01 ; 1 365b8: a2 96 adiw r28, 0x22 ; 34 365ba: bf af std Y+63, r27 ; 0x3f 365bc: 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) { 365be: e0 ed ldi r30, 0xD0 ; 208 365c0: f4 e0 ldi r31, 0x04 ; 4 365c2: e8 96 adiw r28, 0x38 ; 56 365c4: 2e ad ldd r18, Y+62 ; 0x3e 365c6: 3f ad ldd r19, Y+63 ; 0x3f 365c8: e8 97 sbiw r28, 0x38 ; 56 365ca: e2 17 cp r30, r18 365cc: f3 07 cpc r31, r19 365ce: 09 f0 breq .+2 ; 0x365d2 365d0: 5d cf rjmp .-326 ; 0x3648c if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 365d2: a2 96 adiw r28, 0x22 ; 34 365d4: 3f ad ldd r19, Y+63 ; 0x3f 365d6: a2 97 sbiw r28, 0x22 ; 34 365d8: 33 23 and r19, r19 365da: 81 f0 breq .+32 ; 0x365fc vmax_junction *= v_factor; 365dc: a3 01 movw r20, r6 365de: 92 01 movw r18, r4 365e0: 6d ad ldd r22, Y+61 ; 0x3d 365e2: 7d a9 ldd r23, Y+53 ; 0x35 365e4: 8e ad ldd r24, Y+62 ; 0x3e 365e6: 23 96 adiw r28, 0x03 ; 3 365e8: 9f ad ldd r25, Y+63 ; 0x3f 365ea: 23 97 sbiw r28, 0x03 ; 3 365ec: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 365f0: 6d af std Y+61, r22 ; 0x3d 365f2: 7d ab std Y+53, r23 ; 0x35 365f4: 8e af std Y+62, r24 ; 0x3e 365f6: 23 96 adiw r28, 0x03 ; 3 365f8: 9f af std Y+63, r25 ; 0x3f 365fa: 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; 365fc: 24 ea ldi r18, 0xA4 ; 164 365fe: 30 e7 ldi r19, 0x70 ; 112 36600: 4d e7 ldi r20, 0x7D ; 125 36602: 5f e3 ldi r21, 0x3F ; 63 36604: 6d ad ldd r22, Y+61 ; 0x3d 36606: 7d a9 ldd r23, Y+53 ; 0x35 36608: 8e ad ldd r24, Y+62 ; 0x3e 3660a: 23 96 adiw r28, 0x03 ; 3 3660c: 9f ad ldd r25, Y+63 ; 0x3f 3660e: 23 97 sbiw r28, 0x03 ; 3 36610: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36614: 6b 01 movw r12, r22 36616: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 36618: ac 01 movw r20, r24 3661a: 9b 01 movw r18, r22 3661c: 60 91 ec 17 lds r22, 0x17EC ; 0x8017ec 36620: 70 91 ed 17 lds r23, 0x17ED ; 0x8017ed 36624: 80 91 ee 17 lds r24, 0x17EE ; 0x8017ee 36628: 90 91 ef 17 lds r25, 0x17EF ; 0x8017ef 3662c: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36630: 18 16 cp r1, r24 36632: fc f4 brge .+62 ; 0x36672 36634: 29 a5 ldd r18, Y+41 ; 0x29 36636: 3d a5 ldd r19, Y+45 ; 0x2d 36638: 49 a9 ldd r20, Y+49 ; 0x31 3663a: 59 ad ldd r21, Y+57 ; 0x39 3663c: c7 01 movw r24, r14 3663e: b6 01 movw r22, r12 36640: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36644: 87 ff sbrs r24, 7 36646: 15 c0 rjmp .+42 ; 0x36672 // 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; 36648: 8e e6 ldi r24, 0x6E ; 110 3664a: 82 9d mul r24, r2 3664c: f0 01 movw r30, r0 3664e: 83 9d mul r24, r3 36650: f0 0d add r31, r0 36652: 11 24 eor r1, r1 36654: ea 58 subi r30, 0x8A ; 138 36656: f8 4f sbci r31, 0xF8 ; 248 36658: 85 a9 ldd r24, Z+53 ; 0x35 3665a: 84 60 ori r24, 0x04 ; 4 3665c: 85 ab std Z+53, r24 ; 0x35 3665e: 49 a5 ldd r20, Y+41 ; 0x29 36660: 4d af std Y+61, r20 ; 0x3d 36662: 5d a5 ldd r21, Y+45 ; 0x2d 36664: 5d ab std Y+53, r21 ; 0x35 36666: 89 a9 ldd r24, Y+49 ; 0x31 36668: 8e af std Y+62, r24 ; 0x3e 3666a: 99 ad ldd r25, Y+57 ; 0x39 3666c: 23 96 adiw r28, 0x03 ; 3 3666e: 9f af std Y+63, r25 ; 0x3f 36670: 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; 36672: 8e e6 ldi r24, 0x6E ; 110 36674: 82 9d mul r24, r2 36676: 80 01 movw r16, r0 36678: 83 9d mul r24, r3 3667a: 10 0d add r17, r0 3667c: 11 24 eor r1, r1 3667e: 0a 58 subi r16, 0x8A ; 138 36680: 18 4f sbci r17, 0xF8 ; 248 36682: 8d ad ldd r24, Y+61 ; 0x3d 36684: 9d a9 ldd r25, Y+53 ; 0x35 36686: ae ad ldd r26, Y+62 ; 0x3e 36688: 23 96 adiw r28, 0x03 ; 3 3668a: bf ad ldd r27, Y+63 ; 0x3f 3668c: 23 97 sbiw r28, 0x03 ; 3 3668e: f8 01 movw r30, r16 36690: 81 a7 std Z+41, r24 ; 0x29 36692: 92 a7 std Z+42, r25 ; 0x2a 36694: a3 a7 std Z+43, r26 ; 0x2b 36696: 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); 36698: 29 a5 ldd r18, Y+41 ; 0x29 3669a: 3d a5 ldd r19, Y+45 ; 0x2d 3669c: 49 a9 ldd r20, Y+49 ; 0x31 3669e: 59 ad ldd r21, Y+57 ; 0x39 366a0: 69 a5 ldd r22, Y+41 ; 0x29 366a2: 7d a5 ldd r23, Y+45 ; 0x2d 366a4: 89 a9 ldd r24, Y+49 ; 0x31 366a6: 99 ad ldd r25, Y+57 ; 0x39 366a8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 366ac: 6b 01 movw r12, r22 366ae: 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); 366b0: e2 96 adiw r28, 0x32 ; 50 366b2: 6c ad ldd r22, Y+60 ; 0x3c 366b4: 7d ad ldd r23, Y+61 ; 0x3d 366b6: 8e ad ldd r24, Y+62 ; 0x3e 366b8: 9f ad ldd r25, Y+63 ; 0x3f 366ba: e2 97 sbiw r28, 0x32 ; 50 366bc: 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); 366be: 9b 01 movw r18, r22 366c0: ac 01 movw r20, r24 366c2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 366c6: d8 01 movw r26, r16 366c8: 9d 96 adiw r26, 0x2d ; 45 366ca: 2d 91 ld r18, X+ 366cc: 3d 91 ld r19, X+ 366ce: 4d 91 ld r20, X+ 366d0: 5c 91 ld r21, X 366d2: d0 97 sbiw r26, 0x30 ; 48 366d4: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 366d8: 9b 01 movw r18, r22 366da: ac 01 movw r20, r24 366dc: c7 01 movw r24, r14 366de: b6 01 movw r22, r12 366e0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 366e4: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 366e8: d6 2e mov r13, r22 366ea: e7 2e mov r14, r23 366ec: 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); 366ee: 2d ad ldd r18, Y+61 ; 0x3d 366f0: 3d a9 ldd r19, Y+53 ; 0x35 366f2: 4e ad ldd r20, Y+62 ; 0x3e 366f4: 23 96 adiw r28, 0x03 ; 3 366f6: 5f ad ldd r21, Y+63 ; 0x3f 366f8: 23 97 sbiw r28, 0x03 ; 3 366fa: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 366fe: 18 16 cp r1, r24 36700: 34 f0 brlt .+12 ; 0x3670e 36702: dd ae std Y+61, r13 ; 0x3d 36704: ed aa std Y+53, r14 ; 0x35 36706: 0e af std Y+62, r16 ; 0x3e 36708: 23 96 adiw r28, 0x03 ; 3 3670a: 1f af std Y+63, r17 ; 0x3f 3670c: 23 97 sbiw r28, 0x03 ; 3 3670e: 8e e6 ldi r24, 0x6E ; 110 36710: 82 9d mul r24, r2 36712: f0 01 movw r30, r0 36714: 83 9d mul r24, r3 36716: f0 0d add r31, r0 36718: 11 24 eor r1, r1 3671a: ea 58 subi r30, 0x8A ; 138 3671c: f8 4f sbci r31, 0xF8 ; 248 3671e: 8d ad ldd r24, Y+61 ; 0x3d 36720: 9d a9 ldd r25, Y+53 ; 0x35 36722: ae ad ldd r26, Y+62 ; 0x3e 36724: 23 96 adiw r28, 0x03 ; 3 36726: bf ad ldd r27, Y+63 ; 0x3f 36728: 23 97 sbiw r28, 0x03 ; 3 3672a: 85 a3 std Z+37, r24 ; 0x25 3672c: 96 a3 std Z+38, r25 ; 0x26 3672e: a7 a3 std Z+39, r26 ; 0x27 36730: 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; 36732: f5 a8 ldd r15, Z+53 ; 0x35 36734: 2d 2d mov r18, r13 36736: 3e 2d mov r19, r14 36738: a8 01 movw r20, r16 3673a: 27 96 adiw r28, 0x07 ; 7 3673c: 6f ad ldd r22, Y+63 ; 0x3f 3673e: 27 97 sbiw r28, 0x07 ; 7 36740: 2b 96 adiw r28, 0x0b ; 11 36742: 7f ad ldd r23, Y+63 ; 0x3f 36744: 2b 97 sbiw r28, 0x0b ; 11 36746: 2f 96 adiw r28, 0x0f ; 15 36748: 8f ad ldd r24, Y+63 ; 0x3f 3674a: 2f 97 sbiw r28, 0x0f ; 15 3674c: 63 96 adiw r28, 0x13 ; 19 3674e: 9f ad ldd r25, Y+63 ; 0x3f 36750: 63 97 sbiw r28, 0x13 ; 19 36752: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36756: 18 16 cp r1, r24 36758: 0c f4 brge .+2 ; 0x3675c 3675a: cf c4 rjmp .+2462 ; 0x370fa 3675c: 83 e0 ldi r24, 0x03 ; 3 3675e: 9e e6 ldi r25, 0x6E ; 110 36760: 92 9d mul r25, r2 36762: 80 01 movw r16, r0 36764: 93 9d mul r25, r3 36766: 10 0d add r17, r0 36768: 11 24 eor r1, r1 3676a: 0a 58 subi r16, 0x8A ; 138 3676c: 18 4f sbci r17, 0xF8 ; 248 3676e: f8 2a or r15, r24 36770: f8 01 movw r30, r16 36772: 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[] 36774: 80 e1 ldi r24, 0x10 ; 16 36776: fe 01 movw r30, r28 36778: 71 96 adiw r30, 0x11 ; 17 3677a: a0 ec ldi r26, 0xC0 ; 192 3677c: b4 e0 ldi r27, 0x04 ; 4 3677e: 01 90 ld r0, Z+ 36780: 0d 92 st X+, r0 36782: 8a 95 dec r24 36784: e1 f7 brne .-8 ; 0x3677e previous_nominal_speed = block->nominal_speed; 36786: 27 96 adiw r28, 0x07 ; 7 36788: 8f ad ldd r24, Y+63 ; 0x3f 3678a: 27 97 sbiw r28, 0x07 ; 7 3678c: 2b 96 adiw r28, 0x0b ; 11 3678e: 9f ad ldd r25, Y+63 ; 0x3f 36790: 2b 97 sbiw r28, 0x0b ; 11 36792: 2f 96 adiw r28, 0x0f ; 15 36794: af ad ldd r26, Y+63 ; 0x3f 36796: 2f 97 sbiw r28, 0x0f ; 15 36798: 63 96 adiw r28, 0x13 ; 19 3679a: bf ad ldd r27, Y+63 ; 0x3f 3679c: 63 97 sbiw r28, 0x13 ; 19 3679e: 80 93 bc 04 sts 0x04BC, r24 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507> 367a2: 90 93 bd 04 sts 0x04BD, r25 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x1> 367a6: a0 93 be 04 sts 0x04BE, r26 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.507+0x2> 367aa: b0 93 bf 04 sts 0x04BF, r27 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.507+0x3> previous_safe_speed = safe_speed; 367ae: 89 a5 ldd r24, Y+41 ; 0x29 367b0: 9d a5 ldd r25, Y+45 ; 0x2d 367b2: a9 a9 ldd r26, Y+49 ; 0x31 367b4: b9 ad ldd r27, Y+57 ; 0x39 367b6: 80 93 ec 17 sts 0x17EC, r24 ; 0x8017ec 367ba: 90 93 ed 17 sts 0x17ED, r25 ; 0x8017ed 367be: a0 93 ee 17 sts 0x17EE, r26 ; 0x8017ee 367c2: b0 93 ef 17 sts 0x17EF, r27 ; 0x8017ef // Precalculate the division, so when all the trapezoids in the planner queue get recalculated, the division is not repeated. block->speed_factor = block->nominal_rate / block->nominal_speed; 367c6: d8 01 movw r26, r16 367c8: d6 96 adiw r26, 0x36 ; 54 367ca: 6d 91 ld r22, X+ 367cc: 7d 91 ld r23, X+ 367ce: 8d 91 ld r24, X+ 367d0: 9c 91 ld r25, X 367d2: d9 97 sbiw r26, 0x39 ; 57 367d4: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 367d8: 27 96 adiw r28, 0x07 ; 7 367da: 2f ad ldd r18, Y+63 ; 0x3f 367dc: 27 97 sbiw r28, 0x07 ; 7 367de: 2b 96 adiw r28, 0x0b ; 11 367e0: 3f ad ldd r19, Y+63 ; 0x3f 367e2: 2b 97 sbiw r28, 0x0b ; 11 367e4: 2f 96 adiw r28, 0x0f ; 15 367e6: 4f ad ldd r20, Y+63 ; 0x3f 367e8: 2f 97 sbiw r28, 0x0f ; 15 367ea: 63 96 adiw r28, 0x13 ; 19 367ec: 5f ad ldd r21, Y+63 ; 0x3f 367ee: 63 97 sbiw r28, 0x13 ; 19 367f0: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 367f4: 2b 01 movw r4, r22 367f6: 3c 01 movw r6, r24 367f8: f8 01 movw r30, r16 367fa: e8 5b subi r30, 0xB8 ; 184 367fc: ff 4f sbci r31, 0xFF ; 255 367fe: 40 82 st Z, r4 36800: 51 82 std Z+1, r5 ; 0x01 36802: 62 82 std Z+2, r6 ; 0x02 36804: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 36806: 34 96 adiw r30, 0x04 ; 4 36808: 80 81 ld r24, Z 3680a: 88 23 and r24, r24 3680c: 09 f4 brne .+2 ; 0x36810 3680e: 89 c0 rjmp .+274 ; 0x36922 // 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)) 36810: 20 91 07 18 lds r18, 0x1807 ; 0x801807 36814: 30 91 08 18 lds r19, 0x1808 ; 0x801808 36818: 40 91 09 18 lds r20, 0x1809 ; 0x801809 3681c: 50 91 0a 18 lds r21, 0x180A ; 0x80180a 36820: 6a 96 adiw r28, 0x1a ; 26 36822: 6c ad ldd r22, Y+60 ; 0x3c 36824: 7d ad ldd r23, Y+61 ; 0x3d 36826: 8e ad ldd r24, Y+62 ; 0x3e 36828: 9f ad ldd r25, Y+63 ; 0x3f 3682a: 6a 97 sbiw r28, 0x1a ; 26 3682c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36830: 4b 01 movw r8, r22 36832: 5c 01 movw r10, r24 36834: c0 90 7e 06 lds r12, 0x067E ; 0x80067e 36838: d0 90 7f 06 lds r13, 0x067F ; 0x80067f 3683c: e0 90 80 06 lds r14, 0x0680 ; 0x800680 36840: f0 90 81 06 lds r15, 0x0681 ; 0x800681 block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 36844: 0c 5a subi r16, 0xAC ; 172 36846: 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)) 36848: a7 01 movw r20, r14 3684a: 96 01 movw r18, r12 3684c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 36850: a3 01 movw r20, r6 36852: 92 01 movw r18, r4 36854: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36858: f8 01 movw r30, r16 3685a: 60 83 st Z, r22 3685c: 71 83 std Z+1, r23 ; 0x01 3685e: 82 83 std Z+2, r24 ; 0x02 36860: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 36862: 20 e0 ldi r18, 0x00 ; 0 36864: 30 e0 ldi r19, 0x00 ; 0 36866: a9 01 movw r20, r18 36868: 6a 96 adiw r28, 0x1a ; 26 3686a: 6c ad ldd r22, Y+60 ; 0x3c 3686c: 7d ad ldd r23, Y+61 ; 0x3d 3686e: 8e ad ldd r24, Y+62 ; 0x3e 36870: 9f ad ldd r25, Y+63 ; 0x3f 36872: 6a 97 sbiw r28, 0x1a ; 26 36874: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36878: 18 16 cp r1, r24 3687a: 0c f0 brlt .+2 ; 0x3687e 3687c: 40 c4 rjmp .+2176 ; 0x370fe advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 3687e: a5 01 movw r20, r10 36880: 94 01 movw r18, r8 36882: e2 96 adiw r28, 0x32 ; 50 36884: 6c ad ldd r22, Y+60 ; 0x3c 36886: 7d ad ldd r23, Y+61 ; 0x3d 36888: 8e ad ldd r24, Y+62 ; 0x3e 3688a: 9f ad ldd r25, Y+63 ; 0x3f 3688c: e2 97 sbiw r28, 0x32 ; 50 3688e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36892: a7 01 movw r20, r14 36894: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 36896: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3689a: 6b 01 movw r12, r22 3689c: 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; 3689e: 20 e0 ldi r18, 0x00 ; 0 368a0: 30 e4 ldi r19, 0x40 ; 64 368a2: 4c e1 ldi r20, 0x1C ; 28 368a4: 57 e4 ldi r21, 0x47 ; 71 368a6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 368aa: 18 16 cp r1, r24 368ac: 3c f4 brge .+14 ; 0x368bc 368ae: c1 2c mov r12, r1 368b0: 20 e4 ldi r18, 0x40 ; 64 368b2: d2 2e mov r13, r18 368b4: 2c e1 ldi r18, 0x1C ; 28 368b6: e2 2e mov r14, r18 368b8: 27 e4 ldi r18, 0x47 ; 71 368ba: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 368bc: a7 01 movw r20, r14 368be: 96 01 movw r18, r12 368c0: 60 e0 ldi r22, 0x00 ; 0 368c2: 74 e2 ldi r23, 0x24 ; 36 368c4: 84 ef ldi r24, 0xF4 ; 244 368c6: 99 e4 ldi r25, 0x49 ; 73 368c8: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 368cc: 4b 01 movw r8, r22 368ce: 5c 01 movw r10, r24 if (advance_speed > 20000) { 368d0: 20 e0 ldi r18, 0x00 ; 0 368d2: 30 e4 ldi r19, 0x40 ; 64 368d4: 4c e9 ldi r20, 0x9C ; 156 368d6: 56 e4 ldi r21, 0x46 ; 70 368d8: c7 01 movw r24, r14 368da: b6 01 movw r22, r12 368dc: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 368e0: 18 16 cp r1, r24 368e2: 0c f0 brlt .+2 ; 0x368e6 368e4: 17 c4 rjmp .+2094 ; 0x37114 block->advance_rate = advance_rate * 4; 368e6: 8e e6 ldi r24, 0x6E ; 110 368e8: 82 9d mul r24, r2 368ea: 80 01 movw r16, r0 368ec: 83 9d mul r24, r3 368ee: 10 0d add r17, r0 368f0: 11 24 eor r1, r1 368f2: 0a 58 subi r16, 0x8A ; 138 368f4: 18 4f sbci r17, 0xF8 ; 248 368f6: 78 01 movw r14, r16 368f8: fd e4 ldi r31, 0x4D ; 77 368fa: ef 0e add r14, r31 368fc: f1 1c adc r15, r1 368fe: 20 e0 ldi r18, 0x00 ; 0 36900: 30 e0 ldi r19, 0x00 ; 0 36902: 40 e8 ldi r20, 0x80 ; 128 36904: 50 e4 ldi r21, 0x40 ; 64 36906: c5 01 movw r24, r10 36908: b4 01 movw r22, r8 3690a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3690e: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 36912: d7 01 movw r26, r14 36914: 6d 93 st X+, r22 36916: 7c 93 st X, r23 block->advance_step_loops = 4; 36918: f8 01 movw r30, r16 3691a: ed 5a subi r30, 0xAD ; 173 3691c: ff 4f sbci r31, 0xFF ; 255 3691e: 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; 36920: 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); 36922: 09 a5 ldd r16, Y+41 ; 0x29 36924: 1d a5 ldd r17, Y+45 ; 0x2d 36926: 29 a9 ldd r18, Y+49 ; 0x31 36928: 39 ad ldd r19, Y+57 ; 0x39 3692a: 4d ad ldd r20, Y+61 ; 0x3d 3692c: 5d a9 ldd r21, Y+53 ; 0x35 3692e: 6e ad ldd r22, Y+62 ; 0x3e 36930: 23 96 adiw r28, 0x03 ; 3 36932: 7f ad ldd r23, Y+63 ; 0x3f 36934: 23 97 sbiw r28, 0x03 ; 3 36936: a4 96 adiw r28, 0x24 ; 36 36938: 8e ad ldd r24, Y+62 ; 0x3e 3693a: 9f ad ldd r25, Y+63 ; 0x3f 3693c: a4 97 sbiw r28, 0x24 ; 36 3693e: 8a 58 subi r24, 0x8A ; 138 36940: 98 4f sbci r25, 0xF8 ; 248 36942: 0f 94 85 a1 call 0x3430a ; 0x3430a if (block->step_event_count.wide <= 32767) 36946: 8e e6 ldi r24, 0x6E ; 110 36948: 82 9d mul r24, r2 3694a: f0 01 movw r30, r0 3694c: 83 9d mul r24, r3 3694e: f0 0d add r31, r0 36950: 11 24 eor r1, r1 36952: ea 58 subi r30, 0x8A ; 138 36954: f8 4f sbci r31, 0xF8 ; 248 36956: 80 89 ldd r24, Z+16 ; 0x10 36958: 91 89 ldd r25, Z+17 ; 0x11 3695a: a2 89 ldd r26, Z+18 ; 0x12 3695c: b3 89 ldd r27, Z+19 ; 0x13 3695e: 81 15 cp r24, r1 36960: 90 48 sbci r25, 0x80 ; 128 36962: a1 05 cpc r26, r1 36964: b1 05 cpc r27, r1 36966: 18 f4 brcc .+6 ; 0x3696e block->flag |= BLOCK_FLAG_DDA_LOWRES; 36968: 85 a9 ldd r24, Z+53 ; 0x35 3696a: 88 60 ori r24, 0x08 ; 8 3696c: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 3696e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 36970: 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; 36972: 90 91 5d 0e lds r25, 0x0E5D ; 0x800e5d 36976: 91 11 cpse r25, r1 36978: 93 c4 rjmp .+2342 ; 0x372a0 block_buffer_head = next_buffer_head; 3697a: a1 96 adiw r28, 0x21 ; 33 3697c: 3f ad ldd r19, Y+63 ; 0x3f 3697e: a1 97 sbiw r28, 0x21 ; 33 36980: 30 93 56 0e sts 0x0E56, r19 ; 0x800e56 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 36984: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 36986: c2 58 subi r28, 0x82 ; 130 36988: df 4f sbci r29, 0xFF ; 255 3698a: 88 81 ld r24, Y 3698c: 99 81 ldd r25, Y+1 ; 0x01 3698e: aa 81 ldd r26, Y+2 ; 0x02 36990: bb 81 ldd r27, Y+3 ; 0x03 36992: ce 57 subi r28, 0x7E ; 126 36994: d0 40 sbci r29, 0x00 ; 0 36996: 80 93 54 07 sts 0x0754, r24 ; 0x800754 3699a: 90 93 55 07 sts 0x0755, r25 ; 0x800755 3699e: a0 93 56 07 sts 0x0756, r26 ; 0x800756 369a2: b0 93 57 07 sts 0x0757, r27 ; 0x800757 369a6: ce 57 subi r28, 0x7E ; 126 369a8: df 4f sbci r29, 0xFF ; 255 369aa: 28 81 ld r18, Y 369ac: 39 81 ldd r19, Y+1 ; 0x01 369ae: 4a 81 ldd r20, Y+2 ; 0x02 369b0: 5b 81 ldd r21, Y+3 ; 0x03 369b2: c2 58 subi r28, 0x82 ; 130 369b4: d0 40 sbci r29, 0x00 ; 0 369b6: 20 93 58 07 sts 0x0758, r18 ; 0x800758 369ba: 30 93 59 07 sts 0x0759, r19 ; 0x800759 369be: 40 93 5a 07 sts 0x075A, r20 ; 0x80075a 369c2: 50 93 5b 07 sts 0x075B, r21 ; 0x80075b 369c6: e6 96 adiw r28, 0x36 ; 54 369c8: 8c ad ldd r24, Y+60 ; 0x3c 369ca: 9d ad ldd r25, Y+61 ; 0x3d 369cc: ae ad ldd r26, Y+62 ; 0x3e 369ce: bf ad ldd r27, Y+63 ; 0x3f 369d0: e6 97 sbiw r28, 0x36 ; 54 369d2: 80 93 5c 07 sts 0x075C, r24 ; 0x80075c 369d6: 90 93 5d 07 sts 0x075D, r25 ; 0x80075d 369da: a0 93 5e 07 sts 0x075E, r26 ; 0x80075e 369de: b0 93 5f 07 sts 0x075F, r27 ; 0x80075f 369e2: ae 96 adiw r28, 0x2e ; 46 369e4: 2c ad ldd r18, Y+60 ; 0x3c 369e6: 3d ad ldd r19, Y+61 ; 0x3d 369e8: 4e ad ldd r20, Y+62 ; 0x3e 369ea: 5f ad ldd r21, Y+63 ; 0x3f 369ec: ae 97 sbiw r28, 0x2e ; 46 369ee: 20 93 60 07 sts 0x0760, r18 ; 0x800760 369f2: 30 93 61 07 sts 0x0761, r19 ; 0x800761 369f6: 40 93 62 07 sts 0x0762, r20 ; 0x800762 369fa: 50 93 63 07 sts 0x0763, r21 ; 0x800763 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 369fe: 89 a1 ldd r24, Y+33 ; 0x21 36a00: 9a a1 ldd r25, Y+34 ; 0x22 36a02: ab a1 ldd r26, Y+35 ; 0x23 36a04: bc a1 ldd r27, Y+36 ; 0x24 36a06: 80 93 d0 04 sts 0x04D0, r24 ; 0x8004d0 36a0a: 90 93 d1 04 sts 0x04D1, r25 ; 0x8004d1 36a0e: a0 93 d2 04 sts 0x04D2, r26 ; 0x8004d2 36a12: b0 93 d3 04 sts 0x04D3, r27 ; 0x8004d3 position_float[Y_AXIS] = y; 36a16: 8d a1 ldd r24, Y+37 ; 0x25 36a18: 9e a1 ldd r25, Y+38 ; 0x26 36a1a: af a1 ldd r26, Y+39 ; 0x27 36a1c: b8 a5 ldd r27, Y+40 ; 0x28 36a1e: 80 93 d4 04 sts 0x04D4, r24 ; 0x8004d4 36a22: 90 93 d5 04 sts 0x04D5, r25 ; 0x8004d5 36a26: a0 93 d6 04 sts 0x04D6, r26 ; 0x8004d6 36a2a: b0 93 d7 04 sts 0x04D7, r27 ; 0x8004d7 position_float[Z_AXIS] = z; 36a2e: a8 96 adiw r28, 0x28 ; 40 36a30: 8c ad ldd r24, Y+60 ; 0x3c 36a32: 9d ad ldd r25, Y+61 ; 0x3d 36a34: ae ad ldd r26, Y+62 ; 0x3e 36a36: bf ad ldd r27, Y+63 ; 0x3f 36a38: a8 97 sbiw r28, 0x28 ; 40 36a3a: 80 93 d8 04 sts 0x04D8, r24 ; 0x8004d8 36a3e: 90 93 d9 04 sts 0x04D9, r25 ; 0x8004d9 36a42: a0 93 da 04 sts 0x04DA, r26 ; 0x8004da 36a46: b0 93 db 04 sts 0x04DB, r27 ; 0x8004db position_float[E_AXIS] = e; 36a4a: aa 96 adiw r28, 0x2a ; 42 36a4c: ee ad ldd r30, Y+62 ; 0x3e 36a4e: ff ad ldd r31, Y+63 ; 0x3f 36a50: aa 97 sbiw r28, 0x2a ; 42 36a52: 80 81 ld r24, Z 36a54: 91 81 ldd r25, Z+1 ; 0x01 36a56: a2 81 ldd r26, Z+2 ; 0x02 36a58: b3 81 ldd r27, Z+3 ; 0x03 36a5a: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc 36a5e: 90 93 dd 04 sts 0x04DD, r25 ; 0x8004dd 36a62: a0 93 de 04 sts 0x04DE, r26 ; 0x8004de 36a66: b0 93 df 04 sts 0x04DF, r27 ; 0x8004df void planner_recalculate(const float &safe_final_speed) { // Reverse pass // Make a local copy of block_buffer_tail, because the interrupt can alter it // by consuming the blocks, therefore shortening the queue. uint8_t tail = block_buffer_tail; 36a6a: f0 90 57 0e lds r15, 0x0E57 ; 0x800e57 block_t *prev, *current, *next; // SERIAL_ECHOLNPGM("planner_recalculate - 1"); // At least three blocks are in the queue? uint8_t n_blocks = (block_buffer_head + BLOCK_BUFFER_SIZE - tail) & (BLOCK_BUFFER_SIZE - 1); 36a6e: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 36a72: 8f 19 sub r24, r15 36a74: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 36a76: 83 30 cpi r24, 0x03 ; 3 36a78: 40 f1 brcs .+80 ; 0x36aca // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 36a7a: 10 91 56 0e lds r17, 0x0E56 ; 0x800e56 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 36a7e: 11 11 cpse r17, r1 36a80: 01 c0 rjmp .+2 ; 0x36a84 block_index = BLOCK_BUFFER_SIZE; 36a82: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36a84: 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; 36a86: fe e6 ldi r31, 0x6E ; 110 36a88: 1f 9f mul r17, r31 36a8a: c0 01 movw r24, r0 36a8c: 11 24 eor r1, r1 36a8e: 9c 01 movw r18, r24 36a90: 2a 58 subi r18, 0x8A ; 138 36a92: 38 4f sbci r19, 0xF8 ; 248 36a94: 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) 36a96: 11 11 cpse r17, r1 36a98: 01 c0 rjmp .+2 ; 0x36a9c block_index = BLOCK_BUFFER_SIZE; 36a9a: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 36a9c: 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)); 36a9e: 3e e6 ldi r19, 0x6E ; 110 36aa0: 13 9f mul r17, r19 36aa2: c0 01 movw r24, r0 36aa4: 11 24 eor r1, r1 36aa6: ac 01 movw r20, r24 36aa8: 4a 58 subi r20, 0x8A ; 138 36aaa: 58 4f sbci r21, 0xF8 ; 248 36aac: 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)); 36aae: 9e e6 ldi r25, 0x6E ; 110 36ab0: 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) { 36ab2: f1 16 cp r15, r17 36ab4: 69 f0 breq .+26 ; 0x36ad0 if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 36ab6: d6 01 movw r26, r12 36ab8: d5 96 adiw r26, 0x35 ; 53 36aba: 0c 91 ld r16, X 36abc: 02 ff sbrs r16, 2 36abe: 7e c3 rjmp .+1788 ; 0x371bc // 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); 36ac0: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 36ac4: 81 1b sub r24, r17 36ac6: 8f 70 andi r24, 0x0F ; 15 36ac8: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 36aca: 82 30 cpi r24, 0x02 ; 2 36acc: 08 f4 brcc .+2 ; 0x36ad0 36ace: a3 c0 rjmp .+326 ; 0x36c16 // 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; 36ad0: 3e e6 ldi r19, 0x6E ; 110 36ad2: f3 9e mul r15, r19 36ad4: c0 01 movw r24, r0 36ad6: 11 24 eor r1, r1 36ad8: ac 01 movw r20, r24 36ada: 4a 58 subi r20, 0x8A ; 138 36adc: 58 4f sbci r21, 0xF8 ; 248 36ade: 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) 36ae0: f3 94 inc r15 36ae2: 50 e1 ldi r21, 0x10 ; 16 36ae4: f5 12 cpse r15, r21 36ae6: 01 c0 rjmp .+2 ; 0x36aea block_index = 0; 36ae8: 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)); 36aea: ae e6 ldi r26, 0x6E ; 110 36aec: fa 9e mul r15, r26 36aee: c0 01 movw r24, r0 36af0: 11 24 eor r1, r1 36af2: fc 01 movw r30, r24 36af4: ea 58 subi r30, 0x8A ; 138 36af6: f8 4f sbci r31, 0xF8 ; 248 36af8: 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)); 36afa: 8e e6 ldi r24, 0x6E ; 110 36afc: 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) { 36afe: d5 01 movw r26, r10 36b00: d5 96 adiw r26, 0x35 ; 53 36b02: 8c 91 ld r24, X 36b04: d5 97 sbiw r26, 0x35 ; 53 36b06: 81 fd sbrc r24, 1 36b08: 5a c0 rjmp .+180 ; 0x36bbe 36b0a: 95 96 adiw r26, 0x25 ; 37 36b0c: 4d 90 ld r4, X+ 36b0e: 5d 90 ld r5, X+ 36b10: 6d 90 ld r6, X+ 36b12: 7c 90 ld r7, X 36b14: 98 97 sbiw r26, 0x28 ; 40 36b16: f6 01 movw r30, r12 36b18: 95 a0 ldd r9, Z+37 ; 0x25 36b1a: e6 a0 ldd r14, Z+38 ; 0x26 36b1c: 07 a1 ldd r16, Z+39 ; 0x27 36b1e: 10 a5 ldd r17, Z+40 ; 0x28 36b20: 29 2d mov r18, r9 36b22: 3e 2d mov r19, r14 36b24: a8 01 movw r20, r16 36b26: c3 01 movw r24, r6 36b28: b2 01 movw r22, r4 36b2a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36b2e: 87 ff sbrs r24, 7 36b30: 46 c0 rjmp .+140 ; 0x36bbe // 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); 36b32: a3 01 movw r20, r6 36b34: 92 01 movw r18, r4 36b36: c3 01 movw r24, r6 36b38: b2 01 movw r22, r4 36b3a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36b3e: 2b 01 movw r4, r22 36b40: 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)); 36b42: d5 01 movw r26, r10 36b44: d1 96 adiw r26, 0x31 ; 49 36b46: 6d 91 ld r22, X+ 36b48: 7d 91 ld r23, X+ 36b4a: 8d 91 ld r24, X+ 36b4c: 9c 91 ld r25, X 36b4e: d4 97 sbiw r26, 0x34 ; 52 36b50: 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); 36b52: 9b 01 movw r18, r22 36b54: ac 01 movw r20, r24 36b56: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 36b5a: f5 01 movw r30, r10 36b5c: 25 a5 ldd r18, Z+45 ; 0x2d 36b5e: 36 a5 ldd r19, Z+46 ; 0x2e 36b60: 47 a5 ldd r20, Z+47 ; 0x2f 36b62: 50 a9 ldd r21, Z+48 ; 0x30 36b64: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36b68: 9b 01 movw r18, r22 36b6a: ac 01 movw r20, r24 36b6c: c3 01 movw r24, r6 36b6e: b2 01 movw r22, r4 36b70: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 36b74: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 36b78: 2b 01 movw r4, r22 36b7a: 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)); 36b7c: 9b 01 movw r18, r22 36b7e: ac 01 movw r20, r24 36b80: 69 2d mov r22, r9 36b82: 7e 2d mov r23, r14 36b84: c8 01 movw r24, r16 36b86: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36b8a: 87 ff sbrs r24, 7 36b8c: 03 c0 rjmp .+6 ; 0x36b94 36b8e: 49 2c mov r4, r9 36b90: 5e 2c mov r5, r14 36b92: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 36b94: 92 01 movw r18, r4 36b96: a3 01 movw r20, r6 36b98: 69 2d mov r22, r9 36b9a: 7e 2d mov r23, r14 36b9c: c8 01 movw r24, r16 36b9e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36ba2: 88 23 and r24, r24 36ba4: 61 f0 breq .+24 ; 0x36bbe 36ba6: d6 01 movw r26, r12 36ba8: d5 96 adiw r26, 0x35 ; 53 36baa: 2c 91 ld r18, X current->entry_speed = entry_speed; 36bac: c2 01 movw r24, r4 36bae: d3 01 movw r26, r6 36bb0: f6 01 movw r30, r12 36bb2: 85 a3 std Z+37, r24 ; 0x25 36bb4: 96 a3 std Z+38, r25 ; 0x26 36bb6: a7 a3 std Z+39, r26 ; 0x27 36bb8: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 36bba: 21 60 ori r18, 0x01 ; 1 36bbc: 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) { 36bbe: d5 01 movw r26, r10 36bc0: d5 96 adiw r26, 0x35 ; 53 36bc2: 8c 91 ld r24, X 36bc4: d5 97 sbiw r26, 0x35 ; 53 36bc6: f6 01 movw r30, r12 36bc8: 95 a9 ldd r25, Z+53 ; 0x35 36bca: 89 2b or r24, r25 36bcc: 80 ff sbrs r24, 0 36bce: 14 c0 rjmp .+40 ; 0x36bf8 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 36bd0: 05 a1 ldd r16, Z+37 ; 0x25 36bd2: 16 a1 ldd r17, Z+38 ; 0x26 36bd4: 27 a1 ldd r18, Z+39 ; 0x27 36bd6: 30 a5 ldd r19, Z+40 ; 0x28 36bd8: 95 96 adiw r26, 0x25 ; 37 36bda: 4d 91 ld r20, X+ 36bdc: 5d 91 ld r21, X+ 36bde: 6d 91 ld r22, X+ 36be0: 7c 91 ld r23, X 36be2: 98 97 sbiw r26, 0x28 ; 40 36be4: c5 01 movw r24, r10 36be6: 0f 94 85 a1 call 0x3430a ; 0x3430a // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 36bea: d5 01 movw r26, r10 36bec: d5 96 adiw r26, 0x35 ; 53 36bee: 8c 91 ld r24, X 36bf0: d5 97 sbiw r26, 0x35 ; 53 36bf2: 8e 7f andi r24, 0xFE ; 254 36bf4: d5 96 adiw r26, 0x35 ; 53 36bf6: 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) 36bf8: f3 94 inc r15 36bfa: b0 e1 ldi r27, 0x10 ; 16 36bfc: fb 12 cpse r15, r27 36bfe: 01 c0 rjmp .+2 ; 0x36c02 block_index = 0; 36c00: 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)); 36c02: f8 9c mul r15, r8 36c04: c0 01 movw r24, r0 36c06: 11 24 eor r1, r1 36c08: 8a 58 subi r24, 0x8A ; 138 36c0a: 98 4f sbci r25, 0xF8 ; 248 } while (block_index != block_buffer_head); 36c0c: 20 91 56 0e lds r18, 0x0E56 ; 0x800e56 // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; } prev = current; 36c10: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 36c12: f2 12 cpse r15, r18 36c14: 43 c3 rjmp .+1670 ; 0x3729c } // 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); 36c16: 80 91 56 0e lds r24, 0x0E56 ; 0x800e56 } // Returns the index of the previous block in the ring buffer static inline uint8_t prev_block_index(uint8_t block_index) { if (block_index == 0) 36c1a: 81 11 cpse r24, r1 36c1c: 01 c0 rjmp .+2 ; 0x36c20 block_index = BLOCK_BUFFER_SIZE; 36c1e: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 36c20: 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); 36c22: ee e6 ldi r30, 0x6E ; 110 36c24: 8e 9f mul r24, r30 36c26: c0 01 movw r24, r0 36c28: 11 24 eor r1, r1 36c2a: 9c 01 movw r18, r24 36c2c: 2a 58 subi r18, 0x8A ; 138 36c2e: 38 4f sbci r19, 0xF8 ; 248 36c30: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 36c32: d9 01 movw r26, r18 36c34: 95 96 adiw r26, 0x25 ; 37 36c36: 4d 91 ld r20, X+ 36c38: 5d 91 ld r21, X+ 36c3a: 6d 91 ld r22, X+ 36c3c: 7c 91 ld r23, X 36c3e: 98 97 sbiw r26, 0x28 ; 40 36c40: 09 a5 ldd r16, Y+41 ; 0x29 36c42: 1d a5 ldd r17, Y+45 ; 0x2d 36c44: 29 a9 ldd r18, Y+49 ; 0x31 36c46: 39 ad ldd r19, Y+57 ; 0x39 36c48: c7 01 movw r24, r14 36c4a: 0f 94 85 a1 call 0x3430a ; 0x3430a current->flag &= ~BLOCK_FLAG_RECALCULATE; 36c4e: f7 01 movw r30, r14 36c50: 85 a9 ldd r24, Z+53 ; 0x35 36c52: 8e 7f andi r24, 0xFE ; 254 36c54: 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(); 36c56: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36c5a: 82 60 ori r24, 0x02 ; 2 36c5c: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 36c60: 0d 94 a5 ab jmp 0x3574a ; 0x3574a // 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)); 36c64: a2 53 subi r26, 0x32 ; 50 36c66: b8 4f sbci r27, 0xF8 ; 248 36c68: 80 e1 ldi r24, 0x10 ; 16 36c6a: e3 e4 ldi r30, 0x43 ; 67 36c6c: f7 e0 ldi r31, 0x07 ; 7 36c6e: 0d 94 e0 ab jmp 0x357c0 ; 0x357c0 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]); 36c72: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 36c76: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 36c7a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 36c7e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 36c82: a8 96 adiw r28, 0x28 ; 40 36c84: 6c ad ldd r22, Y+60 ; 0x3c 36c86: 7d ad ldd r23, Y+61 ; 0x3d 36c88: 8e ad ldd r24, Y+62 ; 0x3e 36c8a: 9f ad ldd r25, Y+63 ; 0x3f 36c8c: a8 97 sbiw r28, 0x28 ; 40 36c8e: 0d 94 76 ac jmp 0x358ec ; 0x358ec 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); 36c92: 81 e0 ldi r24, 0x01 ; 1 36c94: 80 8f std Z+24, r24 ; 0x18 36c96: 0d 94 1c ae jmp 0x35c38 ; 0x35c38 { if(feed_rate 36c9e: b0 90 ab 06 lds r11, 0x06AB ; 0x8006ab 36ca2: 00 91 ac 06 lds r16, 0x06AC ; 0x8006ac 36ca6: 10 91 ad 06 lds r17, 0x06AD ; 0x8006ad 36caa: 4c c8 rjmp .-3944 ; 0x35d44 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])); 36cac: c5 01 movw r24, r10 36cae: b4 01 movw r22, r8 36cb0: 0f 94 5a d8 call 0x3b0b4 ; 0x3b0b4 36cb4: 4b 01 movw r8, r22 36cb6: 5c 01 movw r10, r24 36cb8: c7 01 movw r24, r14 36cba: b6 01 movw r22, r12 36cbc: 0f 94 5a d8 call 0x3b0b4 ; 0x3b0b4 36cc0: 9b 01 movw r18, r22 36cc2: ac 01 movw r20, r24 36cc4: c5 01 movw r24, r10 36cc6: b4 01 movw r22, r8 36cc8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 36ccc: 6b 01 movw r12, r22 36cce: 7c 01 movw r14, r24 36cd0: 22 96 adiw r28, 0x02 ; 2 36cd2: 6c ad ldd r22, Y+60 ; 0x3c 36cd4: 7d ad ldd r23, Y+61 ; 0x3d 36cd6: 8e ad ldd r24, Y+62 ; 0x3e 36cd8: 9f ad ldd r25, Y+63 ; 0x3f 36cda: 22 97 sbiw r28, 0x02 ; 2 36cdc: 0f 94 5a d8 call 0x3b0b4 ; 0x3b0b4 36ce0: 9b 01 movw r18, r22 36ce2: ac 01 movw r20, r24 36ce4: c7 01 movw r24, r14 36ce6: b6 01 movw r22, r12 36ce8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 36cec: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 36cf0: 2e e6 ldi r18, 0x6E ; 110 36cf2: 22 9d mul r18, r2 36cf4: f0 01 movw r30, r0 36cf6: 23 9d mul r18, r3 36cf8: f0 0d add r31, r0 36cfa: 11 24 eor r1, r1 36cfc: ea 58 subi r30, 0x8A ; 138 36cfe: f8 4f sbci r31, 0xF8 ; 248 36d00: 65 a7 std Z+45, r22 ; 0x2d 36d02: 76 a7 std Z+46, r23 ; 0x2e 36d04: 87 a7 std Z+47, r24 ; 0x2f 36d06: 90 ab std Z+48, r25 ; 0x30 36d08: bb c8 rjmp .-3722 ; 0x35e80 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 36d0a: 2a 96 adiw r28, 0x0a ; 10 36d0c: 2c ad ldd r18, Y+60 ; 0x3c 36d0e: 3d ad ldd r19, Y+61 ; 0x3d 36d10: 4e ad ldd r20, Y+62 ; 0x3e 36d12: 5f ad ldd r21, Y+63 ; 0x3f 36d14: 2a 97 sbiw r28, 0x0a ; 10 36d16: 23 2b or r18, r19 36d18: 24 2b or r18, r20 36d1a: 25 2b or r18, r21 36d1c: 09 f4 brne .+2 ; 0x36d20 36d1e: 0e c1 rjmp .+540 ; 0x36f3c 36d20: 60 91 a2 06 lds r22, 0x06A2 ; 0x8006a2 36d24: 70 91 a3 06 lds r23, 0x06A3 ; 0x8006a3 36d28: 80 91 a4 06 lds r24, 0x06A4 ; 0x8006a4 36d2c: 90 91 a5 06 lds r25, 0x06A5 ; 0x8006a5 36d30: 29 a5 ldd r18, Y+41 ; 0x29 36d32: 3a a5 ldd r19, Y+42 ; 0x2a 36d34: 4b a5 ldd r20, Y+43 ; 0x2b 36d36: 5c a5 ldd r21, Y+44 ; 0x2c 36d38: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36d3c: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 36d40: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 36d44: 2b 01 movw r4, r22 36d46: 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 36d48: 80 91 07 18 lds r24, 0x1807 ; 0x801807 36d4c: 90 91 08 18 lds r25, 0x1808 ; 0x801808 36d50: a0 91 09 18 lds r26, 0x1809 ; 0x801809 36d54: b0 91 0a 18 lds r27, 0x180A ; 0x80180a 36d58: 8d a7 std Y+45, r24 ; 0x2d 36d5a: 9e a7 std Y+46, r25 ; 0x2e 36d5c: af a7 std Y+47, r26 ; 0x2f 36d5e: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 36d60: 20 e0 ldi r18, 0x00 ; 0 36d62: 30 e0 ldi r19, 0x00 ; 0 36d64: a9 01 movw r20, r18 36d66: bc 01 movw r22, r24 36d68: cd 01 movw r24, r26 36d6a: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36d6e: 18 16 cp r1, r24 36d70: 0c f0 brlt .+2 ; 0x36d74 36d72: ed c0 rjmp .+474 ; 0x36f4e * 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 36d74: 20 e0 ldi r18, 0x00 ; 0 36d76: 30 e0 ldi r19, 0x00 ; 0 36d78: a9 01 movw r20, r18 36d7a: 26 96 adiw r28, 0x06 ; 6 36d7c: 6c ad ldd r22, Y+60 ; 0x3c 36d7e: 7d ad ldd r23, Y+61 ; 0x3d 36d80: 8e ad ldd r24, Y+62 ; 0x3e 36d82: 9f ad ldd r25, Y+63 ; 0x3f 36d84: 26 97 sbiw r28, 0x06 ; 6 36d86: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36d8a: 87 fd sbrc r24, 7 36d8c: e0 c0 rjmp .+448 ; 0x36f4e && fabs(delta_mm[Z_AXIS]) < 0.5; 36d8e: 22 96 adiw r28, 0x02 ; 2 36d90: 6c ad ldd r22, Y+60 ; 0x3c 36d92: 7d ad ldd r23, Y+61 ; 0x3d 36d94: 8e ad ldd r24, Y+62 ; 0x3e 36d96: 9f ad ldd r25, Y+63 ; 0x3f 36d98: 22 97 sbiw r28, 0x02 ; 2 36d9a: 9f 77 andi r25, 0x7F ; 127 36d9c: 20 e0 ldi r18, 0x00 ; 0 36d9e: 30 e0 ldi r19, 0x00 ; 0 36da0: 40 e0 ldi r20, 0x00 ; 0 36da2: 5f e3 ldi r21, 0x3F ; 63 36da4: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36da8: 87 ff sbrs r24, 7 36daa: d1 c0 rjmp .+418 ; 0x36f4e * * 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 36dac: 8e e6 ldi r24, 0x6E ; 110 36dae: 82 9d mul r24, r2 36db0: 80 01 movw r16, r0 36db2: 83 9d mul r24, r3 36db4: 10 0d add r17, r0 36db6: 11 24 eor r1, r1 36db8: 0e 53 subi r16, 0x3E ; 62 36dba: 18 4f sbci r17, 0xF8 ; 248 36dbc: 81 e0 ldi r24, 0x01 ; 1 36dbe: d8 01 movw r26, r16 36dc0: 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]) 36dc2: 20 91 d0 04 lds r18, 0x04D0 ; 0x8004d0 36dc6: 30 91 d1 04 lds r19, 0x04D1 ; 0x8004d1 36dca: 40 91 d2 04 lds r20, 0x04D2 ; 0x8004d2 36dce: 50 91 d3 04 lds r21, 0x04D3 ; 0x8004d3 36dd2: 69 a1 ldd r22, Y+33 ; 0x21 36dd4: 7a a1 ldd r23, Y+34 ; 0x22 36dd6: 8b a1 ldd r24, Y+35 ; 0x23 36dd8: 9c a1 ldd r25, Y+36 ; 0x24 36dda: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 36dde: 69 ab std Y+49, r22 ; 0x31 36de0: 7a ab std Y+50, r23 ; 0x32 36de2: 8b ab std Y+51, r24 ; 0x33 36de4: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36de6: 20 91 d4 04 lds r18, 0x04D4 ; 0x8004d4 36dea: 30 91 d5 04 lds r19, 0x04D5 ; 0x8004d5 36dee: 40 91 d6 04 lds r20, 0x04D6 ; 0x8004d6 36df2: 50 91 d7 04 lds r21, 0x04D7 ; 0x8004d7 36df6: 6d a1 ldd r22, Y+37 ; 0x25 36df8: 7e a1 ldd r23, Y+38 ; 0x26 36dfa: 8f a1 ldd r24, Y+39 ; 0x27 36dfc: 98 a5 ldd r25, Y+40 ; 0x28 36dfe: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 36e02: 4b 01 movw r8, r22 36e04: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36e06: 20 91 d8 04 lds r18, 0x04D8 ; 0x8004d8 36e0a: 30 91 d9 04 lds r19, 0x04D9 ; 0x8004d9 36e0e: 40 91 da 04 lds r20, 0x04DA ; 0x8004da 36e12: 50 91 db 04 lds r21, 0x04DB ; 0x8004db 36e16: a8 96 adiw r28, 0x28 ; 40 36e18: 6c ad ldd r22, Y+60 ; 0x3c 36e1a: 7d ad ldd r23, Y+61 ; 0x3d 36e1c: 8e ad ldd r24, Y+62 ; 0x3e 36e1e: 9f ad ldd r25, Y+63 ; 0x3f 36e20: a8 97 sbiw r28, 0x28 ; 40 36e22: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 36e26: 6b 01 movw r12, r22 36e28: 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]) 36e2a: 29 a9 ldd r18, Y+49 ; 0x31 36e2c: 3a a9 ldd r19, Y+50 ; 0x32 36e2e: 4b a9 ldd r20, Y+51 ; 0x33 36e30: 5c a9 ldd r21, Y+52 ; 0x34 36e32: ca 01 movw r24, r20 36e34: b9 01 movw r22, r18 36e36: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36e3a: 69 ab std Y+49, r22 ; 0x31 36e3c: 7a ab std Y+50, r23 ; 0x32 36e3e: 8b ab std Y+51, r24 ; 0x33 36e40: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 36e42: a5 01 movw r20, r10 36e44: 94 01 movw r18, r8 36e46: c5 01 movw r24, r10 36e48: b4 01 movw r22, r8 36e4a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36e4e: 9b 01 movw r18, r22 36e50: ac 01 movw r20, r24 36e52: 69 a9 ldd r22, Y+49 ; 0x31 36e54: 7a a9 ldd r23, Y+50 ; 0x32 36e56: 8b a9 ldd r24, Y+51 ; 0x33 36e58: 9c a9 ldd r25, Y+52 ; 0x34 36e5a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 36e5e: 4b 01 movw r8, r22 36e60: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 36e62: a7 01 movw r20, r14 36e64: 96 01 movw r18, r12 36e66: c7 01 movw r24, r14 36e68: b6 01 movw r22, r12 36e6a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36e6e: 9b 01 movw r18, r22 36e70: ac 01 movw r20, r24 36e72: c5 01 movw r24, r10 36e74: b4 01 movw r22, r8 36e76: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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]) 36e7a: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 36e7e: 6b 01 movw r12, r22 36e80: 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]); 36e82: 20 91 dc 04 lds r18, 0x04DC ; 0x8004dc 36e86: 30 91 dd 04 lds r19, 0x04DD ; 0x8004dd 36e8a: 40 91 de 04 lds r20, 0x04DE ; 0x8004de 36e8e: 50 91 df 04 lds r21, 0x04DF ; 0x8004df 36e92: aa 96 adiw r28, 0x2a ; 42 36e94: ee ad ldd r30, Y+62 ; 0x3e 36e96: ff ad ldd r31, Y+63 ; 0x3f 36e98: aa 97 sbiw r28, 0x2a ; 42 36e9a: 60 81 ld r22, Z 36e9c: 71 81 ldd r23, Z+1 ; 0x01 36e9e: 82 81 ldd r24, Z+2 ; 0x02 36ea0: 93 81 ldd r25, Z+3 ; 0x03 36ea2: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__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; 36ea6: a7 01 movw r20, r14 36ea8: 96 01 movw r18, r12 36eaa: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36eae: 6a 96 adiw r28, 0x1a ; 26 36eb0: 6c af std Y+60, r22 ; 0x3c 36eb2: 7d af std Y+61, r23 ; 0x3d 36eb4: 8e af std Y+62, r24 ; 0x3e 36eb6: 9f af std Y+63, r25 ; 0x3f 36eb8: 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) 36eba: 20 e0 ldi r18, 0x00 ; 0 36ebc: 30 e0 ldi r19, 0x00 ; 0 36ebe: 40 e4 ldi r20, 0x40 ; 64 36ec0: 50 e4 ldi r21, 0x40 ; 64 36ec2: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36ec6: 18 16 cp r1, r24 36ec8: 0c f4 brge .+2 ; 0x36ecc 36eca: 9e c0 rjmp .+316 ; 0x37008 block->use_advance_lead = false; else if (e_D_ratio > 0) { 36ecc: 20 e0 ldi r18, 0x00 ; 0 36ece: 30 e0 ldi r19, 0x00 ; 0 36ed0: a9 01 movw r20, r18 36ed2: 6a 96 adiw r28, 0x1a ; 26 36ed4: 6c ad ldd r22, Y+60 ; 0x3c 36ed6: 7d ad ldd r23, Y+61 ; 0x3d 36ed8: 8e ad ldd r24, Y+62 ; 0x3e 36eda: 9f ad ldd r25, Y+63 ; 0x3f 36edc: 6a 97 sbiw r28, 0x1a ; 26 36ede: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 36ee2: 18 16 cp r1, r24 36ee4: 0c f0 brlt .+2 ; 0x36ee8 36ee6: 42 c0 rjmp .+132 ; 0x36f6c const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 36ee8: 6a 96 adiw r28, 0x1a ; 26 36eea: 2c ad ldd r18, Y+60 ; 0x3c 36eec: 3d ad ldd r19, Y+61 ; 0x3d 36eee: 4e ad ldd r20, Y+62 ; 0x3e 36ef0: 5f ad ldd r21, Y+63 ; 0x3f 36ef2: 6a 97 sbiw r28, 0x1a ; 26 36ef4: 6d a5 ldd r22, Y+45 ; 0x2d 36ef6: 7e a5 ldd r23, Y+46 ; 0x2e 36ef8: 8f a5 ldd r24, Y+47 ; 0x2f 36efa: 98 a9 ldd r25, Y+48 ; 0x30 36efc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36f00: 9b 01 movw r18, r22 36f02: ac 01 movw r20, r24 36f04: 60 91 c2 06 lds r22, 0x06C2 ; 0x8006c2 36f08: 70 91 c3 06 lds r23, 0x06C3 ; 0x8006c3 36f0c: 80 91 c4 06 lds r24, 0x06C4 ; 0x8006c4 36f10: 90 91 c5 06 lds r25, 0x06C5 ; 0x8006c5 36f14: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36f18: 29 a5 ldd r18, Y+41 ; 0x29 36f1a: 3a a5 ldd r19, Y+42 ; 0x2a 36f1c: 4b a5 ldd r20, Y+43 ; 0x2b 36f1e: 5c a5 ldd r21, Y+44 ; 0x2c 36f20: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36f24: 0f 94 97 df call 0x3bf2e ; 0x3bf2e 36f28: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 36f2c: 64 15 cp r22, r4 36f2e: 75 05 cpc r23, r5 36f30: 86 05 cpc r24, r6 36f32: 97 05 cpc r25, r7 36f34: d8 f4 brcc .+54 ; 0x36f6c 36f36: 2b 01 movw r4, r22 36f38: 3c 01 movw r6, r24 36f3a: 18 c0 rjmp .+48 ; 0x36f6c 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 36f3c: 60 91 2e 07 lds r22, 0x072E ; 0x80072e 36f40: 70 91 2f 07 lds r23, 0x072F ; 0x80072f 36f44: 80 91 30 07 lds r24, 0x0730 ; 0x800730 36f48: 90 91 31 07 lds r25, 0x0731 ; 0x800731 36f4c: f1 ce rjmp .-542 ; 0x36d30 * * 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 36f4e: 8e e6 ldi r24, 0x6E ; 110 36f50: 82 9d mul r24, r2 36f52: f0 01 movw r30, r0 36f54: 83 9d mul r24, r3 36f56: f0 0d add r31, r0 36f58: 11 24 eor r1, r1 36f5a: ee 53 subi r30, 0x3E ; 62 36f5c: f8 4f sbci r31, 0xF8 ; 248 36f5e: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 36f60: 6a 96 adiw r28, 0x1a ; 26 36f62: 1c ae std Y+60, r1 ; 0x3c 36f64: 1d ae std Y+61, r1 ; 0x3d 36f66: 1e ae std Y+62, r1 ; 0x3e 36f68: 1f ae std Y+63, r1 ; 0x3f 36f6a: 6a 97 sbiw r28, 0x1a ; 26 36f6c: 10 e0 ldi r17, 0x00 ; 0 36f6e: 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) 36f70: a4 96 adiw r28, 0x24 ; 36 36f72: ee ad ldd r30, Y+62 ; 0x3e 36f74: ff ad ldd r31, Y+63 ; 0x3f 36f76: a4 97 sbiw r28, 0x24 ; 36 36f78: e0 0f add r30, r16 36f7a: f1 1f adc r31, r17 36f7c: ea 58 subi r30, 0x8A ; 138 36f7e: f8 4f sbci r31, 0xF8 ; 248 36f80: c0 80 ld r12, Z 36f82: d1 80 ldd r13, Z+1 ; 0x01 36f84: e2 80 ldd r14, Z+2 ; 0x02 36f86: f3 80 ldd r15, Z+3 ; 0x03 36f88: c1 14 cp r12, r1 36f8a: d1 04 cpc r13, r1 36f8c: e1 04 cpc r14, r1 36f8e: f1 04 cpc r15, r1 36f90: a1 f1 breq .+104 ; 0x36ffa 36f92: f8 01 movw r30, r16 36f94: e0 51 subi r30, 0x10 ; 16 36f96: f8 4e sbci r31, 0xE8 ; 232 36f98: 60 81 ld r22, Z 36f9a: 71 81 ldd r23, Z+1 ; 0x01 36f9c: 82 81 ldd r24, Z+2 ; 0x02 36f9e: 93 81 ldd r25, Z+3 ; 0x03 36fa0: 64 15 cp r22, r4 36fa2: 75 05 cpc r23, r5 36fa4: 86 05 cpc r24, r6 36fa6: 97 05 cpc r25, r7 36fa8: 40 f5 brcc .+80 ; 0x36ffa { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 36faa: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 36fae: 29 ad ldd r18, Y+57 ; 0x39 36fb0: 3a ad ldd r19, Y+58 ; 0x3a 36fb2: 4b ad ldd r20, Y+59 ; 0x3b 36fb4: 5c ad ldd r21, Y+60 ; 0x3c 36fb6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 36fba: 4b 01 movw r8, r22 36fbc: 5c 01 movw r10, r24 36fbe: c7 01 movw r24, r14 36fc0: b6 01 movw r22, r12 36fc2: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 36fc6: 9b 01 movw r18, r22 36fc8: ac 01 movw r20, r24 36fca: c5 01 movw r24, r10 36fcc: b4 01 movw r22, r8 36fce: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 36fd2: 6b 01 movw r12, r22 36fd4: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 36fd6: c3 01 movw r24, r6 36fd8: b2 01 movw r22, r4 36fda: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 36fde: 9b 01 movw r18, r22 36fe0: ac 01 movw r20, r24 36fe2: c7 01 movw r24, r14 36fe4: b6 01 movw r22, r12 36fe6: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 36fea: 87 ff sbrs r24, 7 36fec: 06 c0 rjmp .+12 ; 0x36ffa 36fee: c7 01 movw r24, r14 36ff0: b6 01 movw r22, r12 36ff2: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 36ff6: 2b 01 movw r4, r22 36ff8: 3c 01 movw r6, r24 36ffa: 0c 5f subi r16, 0xFC ; 252 36ffc: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 36ffe: 00 31 cpi r16, 0x10 ; 16 37000: 11 05 cpc r17, r1 37002: 09 f0 breq .+2 ; 0x37006 37004: b5 cf rjmp .-150 ; 0x36f70 37006: 01 c9 rjmp .-3582 ; 0x3620a // 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; 37008: d8 01 movw r26, r16 3700a: 1c 92 st X, r1 3700c: af cf rjmp .-162 ; 0x36f6c if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 3700e: c9 a6 std Y+41, r12 ; 0x29 37010: dd a6 std Y+45, r13 ; 0x2d 37012: e9 aa std Y+49, r14 ; 0x31 37014: f9 ae std Y+57, r15 ; 0x39 limited = true; 37016: 21 e0 ldi r18, 0x01 ; 1 37018: 2d ab std Y+53, r18 ; 0x35 3701a: b1 c9 rjmp .-3230 ; 0x3637e // 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); 3701c: 27 96 adiw r28, 0x07 ; 7 3701e: 2f ad ldd r18, Y+63 ; 0x3f 37020: 27 97 sbiw r28, 0x07 ; 7 37022: 2b 96 adiw r28, 0x0b ; 11 37024: 3f ad ldd r19, Y+63 ; 0x3f 37026: 2b 97 sbiw r28, 0x0b ; 11 37028: 2f 96 adiw r28, 0x0f ; 15 3702a: 4f ad ldd r20, Y+63 ; 0x3f 3702c: 2f 97 sbiw r28, 0x0f ; 15 3702e: 63 96 adiw r28, 0x13 ; 19 37030: 5f ad ldd r21, Y+63 ; 0x3f 37032: 63 97 sbiw r28, 0x13 ; 19 37034: 6b 96 adiw r28, 0x1b ; 27 37036: 6f ad ldd r22, Y+63 ; 0x3f 37038: 6b 97 sbiw r28, 0x1b ; 27 3703a: 6d 96 adiw r28, 0x1d ; 29 3703c: 7f ad ldd r23, Y+63 ; 0x3f 3703e: 6d 97 sbiw r28, 0x1d ; 29 37040: c8 01 movw r24, r16 37042: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 37046: ec 96 adiw r28, 0x3c ; 60 37048: 6c af std Y+60, r22 ; 0x3c 3704a: 7d af std Y+61, r23 ; 0x3d 3704c: 8e af std Y+62, r24 ; 0x3e 3704e: 9f af std Y+63, r25 ; 0x3f 37050: 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; 37052: 6b 96 adiw r28, 0x1b ; 27 37054: ef ad ldd r30, Y+63 ; 0x3f 37056: 6b 97 sbiw r28, 0x1b ; 27 37058: ed af std Y+61, r30 ; 0x3d 3705a: 6d 96 adiw r28, 0x1d ; 29 3705c: ff ad ldd r31, Y+63 ; 0x3f 3705e: 6d 97 sbiw r28, 0x1d ; 29 37060: fd ab std Y+53, r31 ; 0x35 37062: 0e af std Y+62, r16 ; 0x3e 37064: 23 96 adiw r28, 0x03 ; 3 37066: 1f af std Y+63, r17 ; 0x3f 37068: 23 97 sbiw r28, 0x03 ; 3 3706a: 04 ca rjmp .-3064 ; 0x36474 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 3706c: f7 fa bst r15, 7 3706e: f0 94 com r15 37070: f7 f8 bld r15, 7 37072: f0 94 com r15 37074: a5 01 movw r20, r10 37076: 94 01 movw r18, r8 37078: c7 01 movw r24, r14 3707a: b6 01 movw r22, r12 3707c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 37080: 87 ff sbrs r24, 7 37082: 77 ca rjmp .-2834 ; 0x36572 // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 37084: 75 01 movw r14, r10 37086: 64 01 movw r12, r8 37088: 74 ca rjmp .-2840 ; 0x36572 // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 3708a: c7 01 movw r24, r14 3708c: b6 01 movw r22, r12 3708e: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 37092: 87 fd sbrc r24, 7 37094: 09 c0 rjmp .+18 ; 0x370a8 37096: 20 e0 ldi r18, 0x00 ; 0 37098: 30 e0 ldi r19, 0x00 ; 0 3709a: a9 01 movw r20, r18 3709c: c5 01 movw r24, r10 3709e: b4 01 movw r22, r8 370a0: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 370a4: 18 16 cp r1, r24 370a6: 2c f4 brge .+10 ; 0x370b2 370a8: a5 01 movw r20, r10 370aa: 94 01 movw r18, r8 370ac: c7 01 movw r24, r14 370ae: b6 01 movw r22, r12 370b0: 5c ca rjmp .-2888 ; 0x3656a // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 370b2: b7 fa bst r11, 7 370b4: b0 94 com r11 370b6: b7 f8 bld r11, 7 370b8: b0 94 com r11 370ba: a7 01 movw r20, r14 370bc: 96 01 movw r18, r12 370be: c5 01 movw r24, r10 370c0: b4 01 movw r22, r8 370c2: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 370c6: 18 16 cp r1, r24 370c8: 0c f0 brlt .+2 ; 0x370cc 370ca: 53 ca rjmp .-2906 ; 0x36572 370cc: db cf rjmp .-74 ; 0x37084 // 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; 370ce: 8e e6 ldi r24, 0x6E ; 110 370d0: 82 9d mul r24, r2 370d2: f0 01 movw r30, r0 370d4: 83 9d mul r24, r3 370d6: f0 0d add r31, r0 370d8: 11 24 eor r1, r1 370da: ea 58 subi r30, 0x8A ; 138 370dc: f8 4f sbci r31, 0xF8 ; 248 370de: 85 a9 ldd r24, Z+53 ; 0x35 370e0: 84 60 ori r24, 0x04 ; 4 370e2: 85 ab std Z+53, r24 ; 0x35 370e4: a9 a5 ldd r26, Y+41 ; 0x29 370e6: ad af std Y+61, r26 ; 0x3d 370e8: bd a5 ldd r27, Y+45 ; 0x2d 370ea: bd ab std Y+53, r27 ; 0x35 370ec: e9 a9 ldd r30, Y+49 ; 0x31 370ee: ee af std Y+62, r30 ; 0x3e 370f0: f9 ad ldd r31, Y+57 ; 0x39 370f2: 23 96 adiw r28, 0x03 ; 3 370f4: ff af std Y+63, r31 ; 0x3f 370f6: 23 97 sbiw r28, 0x03 ; 3 370f8: bc ca rjmp .-2696 ; 0x36672 // 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; 370fa: 81 e0 ldi r24, 0x01 ; 1 370fc: 30 cb rjmp .-2464 ; 0x3675e 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]; 370fe: 20 91 c2 06 lds r18, 0x06C2 ; 0x8006c2 37102: 30 91 c3 06 lds r19, 0x06C3 ; 0x8006c3 37106: 40 91 c4 06 lds r20, 0x06C4 ; 0x8006c4 3710a: 50 91 c5 06 lds r21, 0x06C5 ; 0x8006c5 3710e: c7 01 movw r24, r14 37110: b6 01 movw r22, r12 37112: c1 cb rjmp .-2174 ; 0x36896 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) { 37114: 20 e0 ldi r18, 0x00 ; 0 37116: 30 e4 ldi r19, 0x40 ; 64 37118: 4c e1 ldi r20, 0x1C ; 28 3711a: 56 e4 ldi r21, 0x46 ; 70 3711c: c7 01 movw r24, r14 3711e: b6 01 movw r22, r12 37120: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 37124: 18 16 cp r1, r24 37126: d4 f4 brge .+52 ; 0x3715c block->advance_rate = advance_rate * 2; 37128: 8e e6 ldi r24, 0x6E ; 110 3712a: 82 9d mul r24, r2 3712c: 80 01 movw r16, r0 3712e: 83 9d mul r24, r3 37130: 10 0d add r17, r0 37132: 11 24 eor r1, r1 37134: 0a 58 subi r16, 0x8A ; 138 37136: 18 4f sbci r17, 0xF8 ; 248 37138: 78 01 movw r14, r16 3713a: bd e4 ldi r27, 0x4D ; 77 3713c: eb 0e add r14, r27 3713e: f1 1c adc r15, r1 37140: a5 01 movw r20, r10 37142: 94 01 movw r18, r8 37144: c5 01 movw r24, r10 37146: b4 01 movw r22, r8 37148: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3714c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 37150: f7 01 movw r30, r14 37152: 71 83 std Z+1, r23 ; 0x01 37154: 60 83 st Z, r22 block->advance_step_loops = 2; 37156: 36 96 adiw r30, 0x06 ; 6 37158: 82 e0 ldi r24, 0x02 ; 2 3715a: e2 cb rjmp .-2108 ; 0x36920 } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 3715c: 20 e0 ldi r18, 0x00 ; 0 3715e: 3f ef ldi r19, 0xFF ; 255 37160: 4f e7 ldi r20, 0x7F ; 127 37162: 57 e4 ldi r21, 0x47 ; 71 37164: c5 01 movw r24, r10 37166: b4 01 movw r22, r8 37168: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3716c: 87 ff sbrs r24, 7 3716e: 19 c0 rjmp .+50 ; 0x371a2 block->advance_rate = advance_rate; 37170: 8e e6 ldi r24, 0x6E ; 110 37172: 82 9d mul r24, r2 37174: 80 01 movw r16, r0 37176: 83 9d mul r24, r3 37178: 10 0d add r17, r0 3717a: 11 24 eor r1, r1 3717c: 0d 53 subi r16, 0x3D ; 61 3717e: 18 4f sbci r17, 0xF8 ; 248 37180: c5 01 movw r24, r10 37182: b4 01 movw r22, r8 37184: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 37188: d8 01 movw r26, r16 3718a: 6d 93 st X+, r22 3718c: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 3718e: 8e e6 ldi r24, 0x6E ; 110 37190: 82 9d mul r24, r2 37192: f0 01 movw r30, r0 37194: 83 9d mul r24, r3 37196: f0 0d add r31, r0 37198: 11 24 eor r1, r1 3719a: e7 53 subi r30, 0x37 ; 55 3719c: f8 4f sbci r31, 0xF8 ; 248 3719e: 81 e0 ldi r24, 0x01 ; 1 371a0: bf cb rjmp .-2178 ; 0x36920 { // 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; 371a2: 8e e6 ldi r24, 0x6E ; 110 371a4: 82 9d mul r24, r2 371a6: f0 01 movw r30, r0 371a8: 83 9d mul r24, r3 371aa: f0 0d add r31, r0 371ac: 11 24 eor r1, r1 371ae: ed 53 subi r30, 0x3D ; 61 371b0: f8 4f sbci r31, 0xF8 ; 248 371b2: 8f ef ldi r24, 0xFF ; 255 371b4: 9f ef ldi r25, 0xFF ; 255 371b6: 91 83 std Z+1, r25 ; 0x01 371b8: 80 83 st Z, r24 371ba: e9 cf rjmp .-46 ; 0x3718e 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) { 371bc: f6 01 movw r30, r12 371be: 71 a4 ldd r7, Z+41 ; 0x29 371c0: 82 a4 ldd r8, Z+42 ; 0x2a 371c2: 93 a4 ldd r9, Z+43 ; 0x2b 371c4: e4 a4 ldd r14, Z+44 ; 0x2c 371c6: 27 2d mov r18, r7 371c8: 38 2d mov r19, r8 371ca: 49 2d mov r20, r9 371cc: 5e 2d mov r21, r14 371ce: 65 a1 ldd r22, Z+37 ; 0x25 371d0: 76 a1 ldd r23, Z+38 ; 0x26 371d2: 87 a1 ldd r24, Z+39 ; 0x27 371d4: 90 a5 ldd r25, Z+40 ; 0x28 371d6: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 371da: 88 23 and r24, r24 371dc: 09 f4 brne .+2 ; 0x371e0 371de: 51 c0 rjmp .+162 ; 0x37282 // 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) ? 371e0: 01 fd sbrc r16, 1 371e2: 44 c0 rjmp .+136 ; 0x3726c 371e4: d5 01 movw r26, r10 371e6: 95 96 adiw r26, 0x25 ; 37 371e8: 2d 90 ld r2, X+ 371ea: 3d 90 ld r3, X+ 371ec: 4d 90 ld r4, X+ 371ee: 5c 90 ld r5, X 371f0: 98 97 sbiw r26, 0x28 ; 40 371f2: a2 01 movw r20, r4 371f4: 91 01 movw r18, r2 371f6: 67 2d mov r22, r7 371f8: 78 2d mov r23, r8 371fa: 89 2d mov r24, r9 371fc: 9e 2d mov r25, r14 371fe: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 37202: 18 16 cp r1, r24 37204: 9c f5 brge .+102 ; 0x3726c // 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); 37206: a2 01 movw r20, r4 37208: 91 01 movw r18, r2 3720a: c2 01 movw r24, r4 3720c: b1 01 movw r22, r2 3720e: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37212: 1b 01 movw r2, r22 37214: 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)); 37216: f6 01 movw r30, r12 37218: 61 a9 ldd r22, Z+49 ; 0x31 3721a: 72 a9 ldd r23, Z+50 ; 0x32 3721c: 83 a9 ldd r24, Z+51 ; 0x33 3721e: 94 a9 ldd r25, Z+52 ; 0x34 37220: 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); 37222: 9b 01 movw r18, r22 37224: ac 01 movw r20, r24 37226: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3722a: d6 01 movw r26, r12 3722c: 9d 96 adiw r26, 0x2d ; 45 3722e: 2d 91 ld r18, X+ 37230: 3d 91 ld r19, X+ 37232: 4d 91 ld r20, X+ 37234: 5c 91 ld r21, X 37236: d0 97 sbiw r26, 0x30 ; 48 37238: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3723c: 9b 01 movw r18, r22 3723e: ac 01 movw r20, r24 37240: c2 01 movw r24, r4 37242: b1 01 movw r22, r2 37244: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 37248: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 3724c: 2b 01 movw r4, r22 3724e: 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)); 37250: 9b 01 movw r18, r22 37252: ac 01 movw r20, r24 37254: 67 2d mov r22, r7 37256: 78 2d mov r23, r8 37258: 89 2d mov r24, r9 3725a: 9e 2d mov r25, r14 3725c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 37260: 87 fd sbrc r24, 7 37262: 04 c0 rjmp .+8 ; 0x3726c 37264: 74 2c mov r7, r4 37266: 85 2c mov r8, r5 37268: 9a 2c mov r9, r10 3726a: 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) ? 3726c: 87 2d mov r24, r7 3726e: 98 2d mov r25, r8 37270: a9 2d mov r26, r9 37272: be 2d mov r27, r14 37274: f6 01 movw r30, r12 37276: 85 a3 std Z+37, r24 ; 0x25 37278: 96 a3 std Z+38, r25 ; 0x26 3727a: a7 a3 std Z+39, r26 ; 0x27 3727c: 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; 3727e: 01 60 ori r16, 0x01 ; 1 37280: 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) 37282: 11 11 cpse r17, r1 37284: 01 c0 rjmp .+2 ; 0x37288 block_index = BLOCK_BUFFER_SIZE; 37286: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 37288: 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)); 3728a: 16 9d mul r17, r6 3728c: c0 01 movw r24, r0 3728e: 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; 37290: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 37292: 9c 01 movw r18, r24 37294: 2a 58 subi r18, 0x8A ; 138 37296: 38 4f sbci r19, 0xF8 ; 248 37298: 69 01 movw r12, r18 3729a: 0b cc rjmp .-2026 ; 0x36ab2 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)); 3729c: 6c 01 movw r12, r24 3729e: 2f cc rjmp .-1954 ; 0x36afe 372a0: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 372a2: 0d 94 a5 ab jmp 0x3574a ; 0x3574a 000372a6 : 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(){ 372a6: 4f 92 push r4 372a8: 5f 92 push r5 372aa: 6f 92 push r6 372ac: 7f 92 push r7 372ae: 8f 92 push r8 372b0: 9f 92 push r9 372b2: af 92 push r10 372b4: bf 92 push r11 372b6: cf 92 push r12 372b8: df 92 push r13 372ba: ef 92 push r14 372bc: ff 92 push r15 372be: cf 93 push r28 372c0: df 93 push r29 372c2: cd b7 in r28, 0x3d ; 61 372c4: de b7 in r29, 0x3e ; 62 372c6: 2c 97 sbiw r28, 0x0c ; 12 372c8: 0f b6 in r0, 0x3f ; 63 372ca: f8 94 cli 372cc: de bf out 0x3e, r29 ; 62 372ce: 0f be out 0x3f, r0 ; 63 372d0: 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]); 372d2: c0 90 4b 07 lds r12, 0x074B ; 0x80074b 372d6: d0 90 4c 07 lds r13, 0x074C ; 0x80074c 372da: e0 90 4d 07 lds r14, 0x074D ; 0x80074d 372de: f0 90 4e 07 lds r15, 0x074E ; 0x80074e 372e2: 80 91 47 07 lds r24, 0x0747 ; 0x800747 372e6: 90 91 48 07 lds r25, 0x0748 ; 0x800748 372ea: a0 91 49 07 lds r26, 0x0749 ; 0x800749 372ee: b0 91 4a 07 lds r27, 0x074A ; 0x80074a 372f2: 40 91 43 07 lds r20, 0x0743 ; 0x800743 372f6: 50 91 44 07 lds r21, 0x0744 ; 0x800744 372fa: 60 91 45 07 lds r22, 0x0745 ; 0x800745 372fe: 70 91 46 07 lds r23, 0x0746 ; 0x800746 37302: 4d 83 std Y+5, r20 ; 0x05 37304: 5e 83 std Y+6, r21 ; 0x06 37306: 6f 83 std Y+7, r22 ; 0x07 37308: 78 87 std Y+8, r23 ; 0x08 3730a: 89 83 std Y+1, r24 ; 0x01 3730c: 9a 83 std Y+2, r25 ; 0x02 3730e: ab 83 std Y+3, r26 ; 0x03 37310: 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); 37312: be 01 movw r22, r28 37314: 6f 5f subi r22, 0xFF ; 255 37316: 7f 4f sbci r23, 0xFF ; 255 37318: ce 01 movw r24, r28 3731a: 05 96 adiw r24, 0x05 ; 5 3731c: 0e 94 b7 6a call 0xd56e ; 0xd56e position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 37320: 4d 80 ldd r4, Y+5 ; 0x05 37322: 5e 80 ldd r5, Y+6 ; 0x06 37324: 6f 80 ldd r6, Y+7 ; 0x07 37326: 78 84 ldd r7, Y+8 ; 0x08 37328: 20 91 72 06 lds r18, 0x0672 ; 0x800672 3732c: 30 91 73 06 lds r19, 0x0673 ; 0x800673 37330: 40 91 74 06 lds r20, 0x0674 ; 0x800674 37334: 50 91 75 06 lds r21, 0x0675 ; 0x800675 37338: c3 01 movw r24, r6 3733a: b2 01 movw r22, r4 3733c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37340: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 37344: 60 93 54 07 sts 0x0754, r22 ; 0x800754 37348: 70 93 55 07 sts 0x0755, r23 ; 0x800755 3734c: 80 93 56 07 sts 0x0756, r24 ; 0x800756 37350: 90 93 57 07 sts 0x0757, r25 ; 0x800757 position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 37354: 89 80 ldd r8, Y+1 ; 0x01 37356: 9a 80 ldd r9, Y+2 ; 0x02 37358: ab 80 ldd r10, Y+3 ; 0x03 3735a: bc 80 ldd r11, Y+4 ; 0x04 3735c: 20 91 76 06 lds r18, 0x0676 ; 0x800676 37360: 30 91 77 06 lds r19, 0x0677 ; 0x800677 37364: 40 91 78 06 lds r20, 0x0678 ; 0x800678 37368: 50 91 79 06 lds r21, 0x0679 ; 0x800679 3736c: c5 01 movw r24, r10 3736e: b4 01 movw r22, r8 37370: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37374: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 37378: 60 93 58 07 sts 0x0758, r22 ; 0x800758 3737c: 70 93 59 07 sts 0x0759, r23 ; 0x800759 37380: 80 93 5a 07 sts 0x075A, r24 ; 0x80075a 37384: 90 93 5b 07 sts 0x075B, r25 ; 0x80075b #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 37388: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 3738c: 88 23 and r24, r24 3738e: 09 f4 brne .+2 ; 0x37392 37390: 8c c0 rjmp .+280 ; 0x374aa lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 37392: a5 01 movw r20, r10 37394: 94 01 movw r18, r8 37396: c3 01 movw r24, r6 37398: b2 01 movw r22, r4 3739a: 0f 94 53 96 call 0x32ca6 ; 0x32ca6 3739e: 9b 01 movw r18, r22 373a0: ac 01 movw r20, r24 373a2: c7 01 movw r24, r14 373a4: b6 01 movw r22, r12 373a6: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 373aa: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 373ae: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 373b2: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 373b6: 50 91 7d 06 lds r21, 0x067D ; 0x80067d lround(z*cs.axis_steps_per_mm[Z_AXIS]); 373ba: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__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 ? 373be: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 373c2: 60 93 5c 07 sts 0x075C, r22 ; 0x80075c 373c6: 70 93 5d 07 sts 0x075D, r23 ; 0x80075d 373ca: 80 93 5e 07 sts 0x075E, r24 ; 0x80075e 373ce: 90 93 5f 07 sts 0x075F, r25 ; 0x80075f lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : lround(z*cs.axis_steps_per_mm[Z_AXIS]); #else position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); #endif // ENABLE_MESH_BED_LEVELING position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 373d2: 80 91 4f 07 lds r24, 0x074F ; 0x80074f 373d6: 90 91 50 07 lds r25, 0x0750 ; 0x800750 373da: a0 91 51 07 lds r26, 0x0751 ; 0x800751 373de: b0 91 52 07 lds r27, 0x0752 ; 0x800752 373e2: 89 87 std Y+9, r24 ; 0x09 373e4: 9a 87 std Y+10, r25 ; 0x0a 373e6: ab 87 std Y+11, r26 ; 0x0b 373e8: bc 87 std Y+12, r27 ; 0x0c 373ea: 20 91 7e 06 lds r18, 0x067E ; 0x80067e 373ee: 30 91 7f 06 lds r19, 0x067F ; 0x80067f 373f2: 40 91 80 06 lds r20, 0x0680 ; 0x800680 373f6: 50 91 81 06 lds r21, 0x0681 ; 0x800681 373fa: bc 01 movw r22, r24 373fc: cd 01 movw r24, r26 373fe: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37402: 0f 94 f6 e1 call 0x3c3ec ; 0x3c3ec 37406: 60 93 60 07 sts 0x0760, r22 ; 0x800760 3740a: 70 93 61 07 sts 0x0761, r23 ; 0x800761 3740e: 80 93 62 07 sts 0x0762, r24 ; 0x800762 37412: 90 93 63 07 sts 0x0763, r25 ; 0x800763 #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 37416: 40 92 d0 04 sts 0x04D0, r4 ; 0x8004d0 3741a: 50 92 d1 04 sts 0x04D1, r5 ; 0x8004d1 3741e: 60 92 d2 04 sts 0x04D2, r6 ; 0x8004d2 37422: 70 92 d3 04 sts 0x04D3, r7 ; 0x8004d3 position_float[Y_AXIS] = y; 37426: 80 92 d4 04 sts 0x04D4, r8 ; 0x8004d4 3742a: 90 92 d5 04 sts 0x04D5, r9 ; 0x8004d5 3742e: a0 92 d6 04 sts 0x04D6, r10 ; 0x8004d6 37432: b0 92 d7 04 sts 0x04D7, r11 ; 0x8004d7 position_float[Z_AXIS] = z; 37436: c0 92 d8 04 sts 0x04D8, r12 ; 0x8004d8 3743a: d0 92 d9 04 sts 0x04D9, r13 ; 0x8004d9 3743e: e0 92 da 04 sts 0x04DA, r14 ; 0x8004da 37442: f0 92 db 04 sts 0x04DB, r15 ; 0x8004db position_float[E_AXIS] = e; 37446: 89 85 ldd r24, Y+9 ; 0x09 37448: 9a 85 ldd r25, Y+10 ; 0x0a 3744a: ab 85 ldd r26, Y+11 ; 0x0b 3744c: bc 85 ldd r27, Y+12 ; 0x0c 3744e: 80 93 dc 04 sts 0x04DC, r24 ; 0x8004dc 37452: 90 93 dd 04 sts 0x04DD, r25 ; 0x8004dd 37456: a0 93 de 04 sts 0x04DE, r26 ; 0x8004de 3745a: b0 93 df 04 sts 0x04DF, r27 ; 0x8004df #endif st_set_position(position); 3745e: 0f 94 bd 87 call 0x30f7a ; 0x30f7a previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 37462: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507> 37466: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x1> 3746a: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.507+0x2> 3746e: 10 92 bf 04 sts 0x04BF, r1 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.507+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37472: e0 ec ldi r30, 0xC0 ; 192 37474: f4 e0 ldi r31, 0x04 ; 4 37476: 80 e1 ldi r24, 0x10 ; 16 37478: df 01 movw r26, r30 3747a: 1d 92 st X+, r1 3747c: 8a 95 dec r24 3747e: e9 f7 brne .-6 ; 0x3747a 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]); } 37480: 2c 96 adiw r28, 0x0c ; 12 37482: 0f b6 in r0, 0x3f ; 63 37484: f8 94 cli 37486: de bf out 0x3e, r29 ; 62 37488: 0f be out 0x3f, r0 ; 63 3748a: cd bf out 0x3d, r28 ; 61 3748c: df 91 pop r29 3748e: cf 91 pop r28 37490: ff 90 pop r15 37492: ef 90 pop r14 37494: df 90 pop r13 37496: cf 90 pop r12 37498: bf 90 pop r11 3749a: af 90 pop r10 3749c: 9f 90 pop r9 3749e: 8f 90 pop r8 374a0: 7f 90 pop r7 374a2: 6f 90 pop r6 374a4: 5f 90 pop r5 374a6: 4f 90 pop r4 374a8: 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]); 374aa: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 374ae: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 374b2: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 374b6: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 374ba: c7 01 movw r24, r14 374bc: b6 01 movw r22, r12 374be: 7d cf rjmp .-262 ; 0x373ba 000374c0 : 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) { 374c0: 8f 92 push r8 374c2: 9f 92 push r9 374c4: af 92 push r10 374c6: bf 92 push r11 374c8: cf 92 push r12 374ca: df 92 push r13 374cc: ef 92 push r14 374ce: ff 92 push r15 374d0: 0f 93 push r16 374d2: 1f 93 push r17 374d4: 4b 01 movw r8, r22 374d6: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 374d8: e4 e5 ldi r30, 0x54 ; 84 374da: f5 e0 ldi r31, 0x05 ; 5 374dc: e0 84 ldd r14, Z+8 ; 0x08 374de: f1 84 ldd r15, Z+9 ; 0x09 374e0: 02 85 ldd r16, Z+10 ; 0x0a 374e2: 13 85 ldd r17, Z+11 ; 0x0b 374e4: 24 81 ldd r18, Z+4 ; 0x04 374e6: 35 81 ldd r19, Z+5 ; 0x05 374e8: 46 81 ldd r20, Z+6 ; 0x06 374ea: 57 81 ldd r21, Z+7 ; 0x07 374ec: 60 81 ld r22, Z 374ee: 71 81 ldd r23, Z+1 ; 0x01 374f0: 82 81 ldd r24, Z+2 ; 0x02 374f2: 93 81 ldd r25, Z+3 ; 0x03 374f4: 1f 92 push r1 374f6: 1f 92 push r1 374f8: 1f 92 push r1 374fa: 1f 92 push r1 374fc: e0 e6 ldi r30, 0x60 ; 96 374fe: ce 2e mov r12, r30 37500: e5 e0 ldi r30, 0x05 ; 5 37502: de 2e mov r13, r30 37504: 0f 94 3e ab call 0x3567c ; 0x3567c 37508: 0f 90 pop r0 3750a: 0f 90 pop r0 3750c: 0f 90 pop r0 3750e: 0f 90 pop r0 } 37510: 1f 91 pop r17 37512: 0f 91 pop r16 37514: ff 90 pop r15 37516: ef 90 pop r14 37518: df 90 pop r13 3751a: cf 90 pop r12 3751c: bf 90 pop r11 3751e: af 90 pop r10 37520: 9f 90 pop r9 37522: 8f 90 pop r8 37524: 08 95 ret 00037526 : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 37526: 8f 92 push r8 37528: 9f 92 push r9 3752a: af 92 push r10 3752c: bf 92 push r11 3752e: cf 92 push r12 37530: df 92 push r13 37532: ef 92 push r14 37534: ff 92 push r15 37536: 0f 93 push r16 37538: 1f 93 push r17 3753a: 4b 01 movw r8, r22 3753c: 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); 3753e: e3 e4 ldi r30, 0x43 ; 67 37540: f7 e0 ldi r31, 0x07 ; 7 37542: e0 84 ldd r14, Z+8 ; 0x08 37544: f1 84 ldd r15, Z+9 ; 0x09 37546: 02 85 ldd r16, Z+10 ; 0x0a 37548: 13 85 ldd r17, Z+11 ; 0x0b 3754a: 24 81 ldd r18, Z+4 ; 0x04 3754c: 35 81 ldd r19, Z+5 ; 0x05 3754e: 46 81 ldd r20, Z+6 ; 0x06 37550: 57 81 ldd r21, Z+7 ; 0x07 37552: 60 81 ld r22, Z 37554: 71 81 ldd r23, Z+1 ; 0x01 37556: 82 81 ldd r24, Z+2 ; 0x02 37558: 93 81 ldd r25, Z+3 ; 0x03 3755a: 1f 92 push r1 3755c: 1f 92 push r1 3755e: 1f 92 push r1 37560: 1f 92 push r1 37562: ef e4 ldi r30, 0x4F ; 79 37564: ce 2e mov r12, r30 37566: e7 e0 ldi r30, 0x07 ; 7 37568: de 2e mov r13, r30 3756a: 0f 94 3e ab call 0x3567c ; 0x3567c 3756e: 0f 90 pop r0 37570: 0f 90 pop r0 37572: 0f 90 pop r0 37574: 0f 90 pop r0 } 37576: 1f 91 pop r17 37578: 0f 91 pop r16 3757a: ff 90 pop r15 3757c: ef 90 pop r14 3757e: df 90 pop r13 37580: cf 90 pop r12 37582: bf 90 pop r11 37584: af 90 pop r10 37586: 9f 90 pop r9 37588: 8f 90 pop r8 3758a: 08 95 ret 0003758c : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 3758c: 4f 92 push r4 3758e: 5f 92 push r5 37590: 6f 92 push r6 37592: 7f 92 push r7 37594: 8f 92 push r8 37596: 9f 92 push r9 37598: af 92 push r10 3759a: bf 92 push r11 3759c: cf 92 push r12 3759e: df 92 push r13 375a0: ef 92 push r14 375a2: ff 92 push r15 375a4: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 375a6: 80 e0 ldi r24, 0x00 ; 0 375a8: 0f 94 0a 59 call 0x2b214 ; 0x2b214 375ac: 60 93 54 07 sts 0x0754, r22 ; 0x800754 375b0: 70 93 55 07 sts 0x0755, r23 ; 0x800755 375b4: 80 93 56 07 sts 0x0756, r24 ; 0x800756 375b8: 90 93 57 07 sts 0x0757, r25 ; 0x800757 position[Y_AXIS] = st_get_position(Y_AXIS); 375bc: 81 e0 ldi r24, 0x01 ; 1 375be: 0f 94 0a 59 call 0x2b214 ; 0x2b214 375c2: 60 93 58 07 sts 0x0758, r22 ; 0x800758 375c6: 70 93 59 07 sts 0x0759, r23 ; 0x800759 375ca: 80 93 5a 07 sts 0x075A, r24 ; 0x80075a 375ce: 90 93 5b 07 sts 0x075B, r25 ; 0x80075b position[Z_AXIS] = st_get_position(Z_AXIS); 375d2: 82 e0 ldi r24, 0x02 ; 2 375d4: 0f 94 0a 59 call 0x2b214 ; 0x2b214 375d8: 60 93 5c 07 sts 0x075C, r22 ; 0x80075c 375dc: 70 93 5d 07 sts 0x075D, r23 ; 0x80075d 375e0: 80 93 5e 07 sts 0x075E, r24 ; 0x80075e 375e4: 90 93 5f 07 sts 0x075F, r25 ; 0x80075f position[E_AXIS] = st_get_position(E_AXIS); 375e8: 83 e0 ldi r24, 0x03 ; 3 375ea: 0f 94 0a 59 call 0x2b214 ; 0x2b214 375ee: 60 93 60 07 sts 0x0760, r22 ; 0x800760 375f2: 70 93 61 07 sts 0x0761, r23 ; 0x800761 375f6: 80 93 62 07 sts 0x0762, r24 ; 0x800762 375fa: 90 93 63 07 sts 0x0763, r25 ; 0x800763 // Second update the current position of the front end. current_position[X_AXIS] = st_get_position_mm(X_AXIS); 375fe: 80 e0 ldi r24, 0x00 ; 0 37600: 0f 94 18 59 call 0x2b230 ; 0x2b230 37604: 60 93 43 07 sts 0x0743, r22 ; 0x800743 37608: 70 93 44 07 sts 0x0744, r23 ; 0x800744 3760c: 80 93 45 07 sts 0x0745, r24 ; 0x800745 37610: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 37614: 81 e0 ldi r24, 0x01 ; 1 37616: 0f 94 18 59 call 0x2b230 ; 0x2b230 3761a: 60 93 47 07 sts 0x0747, r22 ; 0x800747 3761e: 70 93 48 07 sts 0x0748, r23 ; 0x800748 37622: 80 93 49 07 sts 0x0749, r24 ; 0x800749 37626: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 3762a: 82 e0 ldi r24, 0x02 ; 2 3762c: 0f 94 18 59 call 0x2b230 ; 0x2b230 37630: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 37634: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 37638: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3763c: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e current_position[E_AXIS] = st_get_position_mm(E_AXIS); 37640: 83 e0 ldi r24, 0x03 ; 3 37642: 0f 94 18 59 call 0x2b230 ; 0x2b230 37646: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 3764a: 70 93 50 07 sts 0x0750, r23 ; 0x800750 3764e: 80 93 51 07 sts 0x0751, r24 ; 0x800751 37652: 90 93 52 07 sts 0x0752, r25 ; 0x800752 // Apply the mesh bed leveling correction to the Z axis. #ifdef MESH_BED_LEVELING if (mbl.active) { 37656: 80 91 a0 13 lds r24, 0x13A0 ; 0x8013a0 3765a: 88 23 and r24, r24 3765c: 31 f1 breq .+76 ; 0x376aa #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]); 3765e: 20 91 47 07 lds r18, 0x0747 ; 0x800747 37662: 30 91 48 07 lds r19, 0x0748 ; 0x800748 37666: 40 91 49 07 lds r20, 0x0749 ; 0x800749 3766a: 50 91 4a 07 lds r21, 0x074A ; 0x80074a 3766e: 60 91 43 07 lds r22, 0x0743 ; 0x800743 37672: 70 91 44 07 lds r23, 0x0744 ; 0x800744 37676: 80 91 45 07 lds r24, 0x0745 ; 0x800745 3767a: 90 91 46 07 lds r25, 0x0746 ; 0x800746 3767e: 0f 94 53 96 call 0x32ca6 ; 0x32ca6 37682: 9b 01 movw r18, r22 37684: ac 01 movw r20, r24 37686: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3768a: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 3768e: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 37692: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 37696: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 3769a: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 3769e: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 376a2: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 376a6: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 376aa: c0 91 eb 17 lds r28, 0x17EB ; 0x8017eb 376ae: cc 23 and r28, r28 376b0: 09 f4 brne .+2 ; 0x376b4 376b2: 9a c0 rjmp .+308 ; 0x377e8 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 376b4: c0 ff sbrs r28, 0 376b6: 34 c0 rjmp .+104 ; 0x37720 // Then add the offset. x -= world2machine_shift[0]; 376b8: 20 91 e3 17 lds r18, 0x17E3 ; 0x8017e3 376bc: 30 91 e4 17 lds r19, 0x17E4 ; 0x8017e4 376c0: 40 91 e5 17 lds r20, 0x17E5 ; 0x8017e5 376c4: 50 91 e6 17 lds r21, 0x17E6 ; 0x8017e6 376c8: 60 91 43 07 lds r22, 0x0743 ; 0x800743 376cc: 70 91 44 07 lds r23, 0x0744 ; 0x800744 376d0: 80 91 45 07 lds r24, 0x0745 ; 0x800745 376d4: 90 91 46 07 lds r25, 0x0746 ; 0x800746 376d8: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 376dc: 60 93 43 07 sts 0x0743, r22 ; 0x800743 376e0: 70 93 44 07 sts 0x0744, r23 ; 0x800744 376e4: 80 93 45 07 sts 0x0745, r24 ; 0x800745 376e8: 90 93 46 07 sts 0x0746, r25 ; 0x800746 y -= world2machine_shift[1]; 376ec: 20 91 e7 17 lds r18, 0x17E7 ; 0x8017e7 376f0: 30 91 e8 17 lds r19, 0x17E8 ; 0x8017e8 376f4: 40 91 e9 17 lds r20, 0x17E9 ; 0x8017e9 376f8: 50 91 ea 17 lds r21, 0x17EA ; 0x8017ea 376fc: 60 91 47 07 lds r22, 0x0747 ; 0x800747 37700: 70 91 48 07 lds r23, 0x0748 ; 0x800748 37704: 80 91 49 07 lds r24, 0x0749 ; 0x800749 37708: 90 91 4a 07 lds r25, 0x074A ; 0x80074a 3770c: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 37710: 60 93 47 07 sts 0x0747, r22 ; 0x800747 37714: 70 93 48 07 sts 0x0748, r23 ; 0x800748 37718: 80 93 49 07 sts 0x0749, r24 ; 0x800749 3771c: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 37720: c1 ff sbrs r28, 1 37722: 62 c0 rjmp .+196 ; 0x377e8 // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 37724: 80 90 43 07 lds r8, 0x0743 ; 0x800743 37728: 90 90 44 07 lds r9, 0x0744 ; 0x800744 3772c: a0 90 45 07 lds r10, 0x0745 ; 0x800745 37730: b0 90 46 07 lds r11, 0x0746 ; 0x800746 37734: c0 90 47 07 lds r12, 0x0747 ; 0x800747 37738: d0 90 48 07 lds r13, 0x0748 ; 0x800748 3773c: e0 90 49 07 lds r14, 0x0749 ; 0x800749 37740: f0 90 4a 07 lds r15, 0x074A ; 0x80074a float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; 37744: 20 91 db 17 lds r18, 0x17DB ; 0x8017db 37748: 30 91 dc 17 lds r19, 0x17DC ; 0x8017dc 3774c: 40 91 dd 17 lds r20, 0x17DD ; 0x8017dd 37750: 50 91 de 17 lds r21, 0x17DE ; 0x8017de 37754: c5 01 movw r24, r10 37756: b4 01 movw r22, r8 37758: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3775c: 2b 01 movw r4, r22 3775e: 3c 01 movw r6, r24 37760: 20 91 df 17 lds r18, 0x17DF ; 0x8017df 37764: 30 91 e0 17 lds r19, 0x17E0 ; 0x8017e0 37768: 40 91 e1 17 lds r20, 0x17E1 ; 0x8017e1 3776c: 50 91 e2 17 lds r21, 0x17E2 ; 0x8017e2 37770: c7 01 movw r24, r14 37772: b6 01 movw r22, r12 37774: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37778: 9b 01 movw r18, r22 3777a: ac 01 movw r20, r24 3777c: c3 01 movw r24, r6 3777e: b2 01 movw r22, r4 37780: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 37784: 2b 01 movw r4, r22 37786: 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; 37788: 20 91 d3 17 lds r18, 0x17D3 ; 0x8017d3 3778c: 30 91 d4 17 lds r19, 0x17D4 ; 0x8017d4 37790: 40 91 d5 17 lds r20, 0x17D5 ; 0x8017d5 37794: 50 91 d6 17 lds r21, 0x17D6 ; 0x8017d6 37798: c5 01 movw r24, r10 3779a: b4 01 movw r22, r8 3779c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 377a0: 4b 01 movw r8, r22 377a2: 5c 01 movw r10, r24 377a4: 20 91 d7 17 lds r18, 0x17D7 ; 0x8017d7 377a8: 30 91 d8 17 lds r19, 0x17D8 ; 0x8017d8 377ac: 40 91 d9 17 lds r20, 0x17D9 ; 0x8017d9 377b0: 50 91 da 17 lds r21, 0x17DA ; 0x8017da 377b4: c7 01 movw r24, r14 377b6: b6 01 movw r22, r12 377b8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 377bc: 9b 01 movw r18, r22 377be: ac 01 movw r20, r24 377c0: c5 01 movw r24, r10 377c2: b4 01 movw r22, r8 377c4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 377c8: 60 93 43 07 sts 0x0743, r22 ; 0x800743 377cc: 70 93 44 07 sts 0x0744, r23 ; 0x800744 377d0: 80 93 45 07 sts 0x0745, r24 ; 0x800745 377d4: 90 93 46 07 sts 0x0746, r25 ; 0x800746 y = out_y; 377d8: 40 92 47 07 sts 0x0747, r4 ; 0x800747 377dc: 50 92 48 07 sts 0x0748, r5 ; 0x800748 377e0: 60 92 49 07 sts 0x0749, r6 ; 0x800749 377e4: 70 92 4a 07 sts 0x074A, r7 ; 0x80074a } #endif // Apply inverse world correction matrix. machine2world(current_position[X_AXIS], current_position[Y_AXIS]); set_destination_to_current(); 377e8: 0e 94 ef 68 call 0xd1de ; 0xd1de #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 377ec: 80 e1 ldi r24, 0x10 ; 16 377ee: e3 e4 ldi r30, 0x43 ; 67 377f0: f7 e0 ldi r31, 0x07 ; 7 377f2: a0 ed ldi r26, 0xD0 ; 208 377f4: b4 e0 ldi r27, 0x04 ; 4 377f6: 01 90 ld r0, Z+ 377f8: 0d 92 st X+, r0 377fa: 8a 95 dec r24 377fc: e1 f7 brne .-8 ; 0x377f6 #endif } 377fe: cf 91 pop r28 37800: ff 90 pop r15 37802: ef 90 pop r14 37804: df 90 pop r13 37806: cf 90 pop r12 37808: bf 90 pop r11 3780a: af 90 pop r10 3780c: 9f 90 pop r9 3780e: 8f 90 pop r8 37810: 7f 90 pop r7 37812: 6f 90 pop r6 37814: 5f 90 pop r5 37816: 4f 90 pop r4 37818: 08 95 ret 0003781a : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 3781a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 3781e: 8d 7f andi r24, 0xFD ; 253 37820: 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(); 37824: 0f 94 c6 ba call 0x3758c ; 0x3758c // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 37828: 81 e0 ldi r24, 0x01 ; 1 3782a: 80 93 5d 0e sts 0x0E5D, r24 ; 0x800e5d } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 3782e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37832: 8d 7f andi r24, 0xFD ; 253 37834: 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); 37838: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 3783c: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 while (blocks_queued()) plan_discard_current_block(); 37840: 98 17 cp r25, r24 37842: 69 f0 breq .+26 ; 0x3785e 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) { 37844: 90 91 56 0e lds r25, 0x0E56 ; 0x800e56 37848: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 3784c: 98 17 cp r25, r24 3784e: a1 f3 breq .-24 ; 0x37838 block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 37850: 80 91 57 0e lds r24, 0x0E57 ; 0x800e57 37854: 8f 5f subi r24, 0xFF ; 255 37856: 8f 70 andi r24, 0x0F ; 15 37858: 80 93 57 0e sts 0x0E57, r24 ; 0x800e57 3785c: ed cf rjmp .-38 ; 0x37838 current_block = NULL; 3785e: 10 92 a3 05 sts 0x05A3, r1 ; 0x8005a3 37862: 10 92 a2 05 sts 0x05A2, r1 ; 0x8005a2 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 37866: 8f ef ldi r24, 0xFF ; 255 37868: 9f ef ldi r25, 0xFF ; 255 3786a: 90 93 e7 04 sts 0x04E7, r25 ; 0x8004e7 <_ZL14nextAdvanceISR.lto_priv.493+0x1> 3786e: 80 93 e6 04 sts 0x04E6, r24 ; 0x8004e6 <_ZL14nextAdvanceISR.lto_priv.493> current_adv_steps = 0; 37872: 10 92 e3 04 sts 0x04E3, r1 ; 0x8004e3 <_ZL17current_adv_steps.lto_priv.495+0x1> 37876: 10 92 e2 04 sts 0x04E2, r1 ; 0x8004e2 <_ZL17current_adv_steps.lto_priv.495> #endif st_reset_timer(); 3787a: 0f 94 86 59 call 0x2b30c ; 0x2b30c ENABLE_STEPPER_DRIVER_INTERRUPT(); 3787e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 37882: 82 60 ori r24, 0x02 ; 2 37884: 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; 37888: 10 92 bc 04 sts 0x04BC, r1 ; 0x8004bc <_ZL22previous_nominal_speed.lto_priv.507> 3788c: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL22previous_nominal_speed.lto_priv.507+0x1> 37890: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL22previous_nominal_speed.lto_priv.507+0x2> 37894: 10 92 bf 04 sts 0x04BF, r1 ; 0x8004bf <_ZL22previous_nominal_speed.lto_priv.507+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 37898: e0 ec ldi r30, 0xC0 ; 192 3789a: f4 e0 ldi r31, 0x04 ; 4 3789c: 80 e1 ldi r24, 0x10 ; 16 3789e: df 01 movw r26, r30 378a0: 1d 92 st X+, r1 378a2: 8a 95 dec r24 378a4: e9 f7 brne .-6 ; 0x378a0 // Reset position sync requests plan_reset_next_e_queue = false; 378a6: 10 92 bb 04 sts 0x04BB, r1 ; 0x8004bb <_ZL23plan_reset_next_e_queue.lto_priv.505> plan_reset_next_e_sched = false; 378aa: 10 92 ba 04 sts 0x04BA, r1 ; 0x8004ba <_ZL23plan_reset_next_e_sched.lto_priv.506> } 378ae: 08 95 ret 000378b0 <__vector_5>: SERIAL_ECHOLNRPGM(MSG_INT4); uvlo_drain_reset(); } } ISR(INT4_vect) { 378b0: 1f 92 push r1 378b2: 0f 92 push r0 378b4: 0f b6 in r0, 0x3f ; 63 378b6: 0f 92 push r0 378b8: 11 24 eor r1, r1 378ba: 0b b6 in r0, 0x3b ; 59 378bc: 0f 92 push r0 378be: 8f 92 push r8 378c0: 9f 92 push r9 378c2: af 92 push r10 378c4: bf 92 push r11 378c6: cf 92 push r12 378c8: df 92 push r13 378ca: ef 92 push r14 378cc: ff 92 push r15 378ce: 0f 93 push r16 378d0: 1f 93 push r17 378d2: 2f 93 push r18 378d4: 3f 93 push r19 378d6: 4f 93 push r20 378d8: 5f 93 push r21 378da: 6f 93 push r22 378dc: 7f 93 push r23 378de: 8f 93 push r24 378e0: 9f 93 push r25 378e2: af 93 push r26 378e4: bf 93 push r27 378e6: cf 93 push r28 378e8: df 93 push r29 378ea: ef 93 push r30 378ec: ff 93 push r31 EIMSK &= ~(1 << 4); //disable INT4 interrupt to make sure that this code will be executed just once 378ee: ec 98 cbi 0x1d, 4 ; 29 SERIAL_ECHOLNRPGM(MSG_INT4); 378f0: 84 e8 ldi r24, 0x84 ; 132 378f2: 9f e8 ldi r25, 0x8F ; 143 378f4: 0e 94 06 7b call 0xf60c ; 0xf60c if (eeprom_read_byte((uint8_t*)EEPROM_UVLO) == PowerPanic::NO_PENDING_RECOVERY) 378f8: 85 ea ldi r24, 0xA5 ; 165 378fa: 9f e0 ldi r25, 0x0F ; 15 378fc: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 37900: 18 2f mov r17, r24 37902: 81 11 cpse r24, r1 37904: de c2 rjmp .+1468 ; 0x37ec2 <__vector_5+0x612> { if(printer_active()) { 37906: 0e 94 96 68 call 0xd12c ; 0xd12c 3790a: 88 23 and r24, r24 3790c: 09 f4 brne .+2 ; 0x37910 <__vector_5+0x60> 3790e: a9 c3 rjmp .+1874 ; 0x38062 <__vector_5+0x7b2> while(1); } void uvlo_() { unsigned long time_start = _millis(); 37910: 0f 94 8b 3f call 0x27f16 ; 0x27f16 37914: 6b 01 movw r12, r22 37916: 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); 37918: c0 91 5a 0e lds r28, 0x0E5A ; 0x800e5a 3791c: cc 23 and r28, r28 3791e: 31 f0 breq .+12 ; 0x3792c <__vector_5+0x7c> 37920: c1 e0 ldi r28, 0x01 ; 1 37922: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 37926: 82 30 cpi r24, 0x02 ; 2 37928: 09 f4 brne .+2 ; 0x3792c <__vector_5+0x7c> 3792a: c0 e0 ldi r28, 0x00 ; 0 const bool pos_invalid = mesh_bed_leveling_flag || homing_flag; 3792c: d0 91 59 0e lds r29, 0x0E59 ; 0x800e59 37930: d1 11 cpse r29, r1 37932: 02 c0 rjmp .+4 ; 0x37938 <__vector_5+0x88> 37934: d0 91 58 0e lds r29, 0x0E58 ; 0x800e58 // Conserve as much power as soon as possible // Turn off the LCD backlight #ifdef LCD_BL_PIN backlightMode = BACKLIGHT_MODE_DIM; 37938: 10 92 4f 02 sts 0x024F, r1 ; 0x80024f backlightLevel_LOW = 0; 3793c: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc backlight_update(); 37940: 0e 94 39 8b call 0x11672 ; 0x11672 #endif //LCD_BL_PIN // Disable X and Y motors to conserve power disable_x(); 37944: 17 9a sbi 0x02, 7 ; 2 37946: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 3794a: 16 9a sbi 0x02, 6 ; 2 3794c: 10 92 41 07 sts 0x0741, r1 ; 0x800741 // Minimise Z and E motor currents (Hold and Run) #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 37950: 64 e1 ldi r22, 0x14 ; 20 37952: 83 e6 ldi r24, 0x63 ; 99 37954: 92 e0 ldi r25, 0x02 ; 2 37956: 0e 94 b3 68 call 0xd166 ; 0xd166 currents[Z_AXIS].setiRun(20); 3795a: 64 e1 ldi r22, 0x14 ; 20 3795c: 83 e6 ldi r24, 0x63 ; 99 3795e: 92 e0 ldi r25, 0x02 ; 2 37960: 0e 94 bb 68 call 0xd176 ; 0xd176 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37964: 50 e0 ldi r21, 0x00 ; 0 37966: 40 e0 ldi r20, 0x00 ; 0 37968: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 3796c: 82 e0 ldi r24, 0x02 ; 2 3796e: 0f 94 4a 3a call 0x27494 ; 0x27494 currents[E_AXIS].setiHold(20); 37972: 64 e1 ldi r22, 0x14 ; 20 37974: 86 e6 ldi r24, 0x66 ; 102 37976: 92 e0 ldi r25, 0x02 ; 2 37978: 0e 94 b3 68 call 0xd166 ; 0xd166 currents[E_AXIS].setiRun(20); 3797c: 64 e1 ldi r22, 0x14 ; 20 3797e: 86 e6 ldi r24, 0x66 ; 102 37980: 92 e0 ldi r25, 0x02 ; 2 37982: 0e 94 bb 68 call 0xd176 ; 0xd176 tmc2130_setup_chopper(E_AXIS, tmc2130_mres[E_AXIS]); 37986: 50 e0 ldi r21, 0x00 ; 0 37988: 40 e0 ldi r20, 0x00 ; 0 3798a: 60 91 fb 04 lds r22, 0x04FB ; 0x8004fb 3798e: 83 e0 ldi r24, 0x03 ; 3 37990: 0f 94 4a 3a call 0x27494 ; 0x27494 #endif //TMC2130 if (!print_saved_in_ram && !isPartialBackupAvailable) 37994: c1 11 cpse r28, r1 37996: 1b c0 rjmp .+54 ; 0x379ce <__vector_5+0x11e> 37998: 80 91 53 07 lds r24, 0x0753 ; 0x800753 3799c: 81 11 cpse r24, r1 3799e: 17 c0 rjmp .+46 ; 0x379ce <__vector_5+0x11e> { saved_bed_temperature = target_temperature_bed; 379a0: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 379a4: 80 93 af 05 sts 0x05AF, r24 ; 0x8005af saved_extruder_temperature = target_temperature[active_extruder]; 379a8: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 379ac: 90 91 6e 0e lds r25, 0x0E6E ; 0x800e6e 379b0: 90 93 ae 05 sts 0x05AE, r25 ; 0x8005ae 379b4: 80 93 ad 05 sts 0x05AD, r24 ; 0x8005ad saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 379b8: 80 91 e1 03 lds r24, 0x03E1 ; 0x8003e1 379bc: 83 fb bst r24, 3 379be: 88 27 eor r24, r24 379c0: 80 f9 bld r24, 0 379c2: 80 93 06 18 sts 0x1806, r24 ; 0x801806 saved_fan_speed = fanSpeed; 379c6: 80 91 e3 03 lds r24, 0x03E3 ; 0x8003e3 379ca: 80 93 ac 05 sts 0x05AC, r24 ; 0x8005ac } // Stop all heaters before continuing disable_heater(); 379ce: 0f 94 57 45 call 0x28aae ; 0x28aae // Fetch data not included in a partial back-up if (!print_saved_in_ram) { 379d2: c1 11 cpse r28, r1 379d4: 04 c0 rjmp .+8 ; 0x379de <__vector_5+0x12e> // Calculate the file position, from which to resume this print. save_print_file_state(); 379d6: 0e 94 ef 65 call 0xcbde ; 0xcbde // save the global state at planning time save_planner_global_state(); 379da: 0e 94 a5 65 call 0xcb4a ; 0xcb4a } // 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; 379de: 00 91 a0 13 lds r16, 0x13A0 ; 0x8013a0 mbl.active = false; 379e2: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 // After this call, the planner queue is emptied and the current_position is set to a current logical coordinate. // The logical coordinate will likely differ from the machine coordinate if the skew calibration and mesh bed leveling // are in action. planner_abort_hard(); 379e6: 0f 94 0d bc call 0x3781a ; 0x3781a // 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) 379ea: c1 11 cpse r28, r1 379ec: 1b c0 rjmp .+54 ; 0x37a24 <__vector_5+0x174> 379ee: 80 91 53 07 lds r24, 0x0753 ; 0x800753 379f2: 81 11 cpse r24, r1 379f4: 17 c0 rjmp .+46 ; 0x37a24 <__vector_5+0x174> { memcpy(saved_pos, current_position, sizeof(saved_pos)); 379f6: 80 e1 ldi r24, 0x10 ; 16 379f8: e3 e4 ldi r30, 0x43 ; 67 379fa: f7 e0 ldi r31, 0x07 ; 7 379fc: ab e9 ldi r26, 0x9B ; 155 379fe: b2 e0 ldi r27, 0x02 ; 2 37a00: 01 90 ld r0, Z+ 37a02: 0d 92 st X+, r0 37a04: 8a 95 dec r24 37a06: e1 f7 brne .-8 ; 0x37a00 <__vector_5+0x150> if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 37a08: dd 23 and r29, r29 37a0a: 61 f0 breq .+24 ; 0x37a24 <__vector_5+0x174> 37a0c: 80 e0 ldi r24, 0x00 ; 0 37a0e: 90 e0 ldi r25, 0x00 ; 0 37a10: a0 e8 ldi r26, 0x80 ; 128 37a12: bf eb ldi r27, 0xBF ; 191 37a14: 80 93 9b 02 sts 0x029B, r24 ; 0x80029b 37a18: 90 93 9c 02 sts 0x029C, r25 ; 0x80029c 37a1c: a0 93 9d 02 sts 0x029D, r26 ; 0x80029d 37a20: 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]; 37a24: 80 90 a3 02 lds r8, 0x02A3 ; 0x8002a3 37a28: 90 90 a4 02 lds r9, 0x02A4 ; 0x8002a4 37a2c: a0 90 a5 02 lds r10, 0x02A5 ; 0x8002a5 37a30: b0 90 a6 02 lds r11, 0x02A6 ; 0x8002a6 if(mbl_was_active) { 37a34: 00 23 and r16, r16 37a36: d1 f0 breq .+52 ; 0x37a6c <__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]); 37a38: 20 91 9f 02 lds r18, 0x029F ; 0x80029f 37a3c: 30 91 a0 02 lds r19, 0x02A0 ; 0x8002a0 37a40: 40 91 a1 02 lds r20, 0x02A1 ; 0x8002a1 37a44: 50 91 a2 02 lds r21, 0x02A2 ; 0x8002a2 37a48: 60 91 9b 02 lds r22, 0x029B ; 0x80029b 37a4c: 70 91 9c 02 lds r23, 0x029C ; 0x80029c 37a50: 80 91 9d 02 lds r24, 0x029D ; 0x80029d 37a54: 90 91 9e 02 lds r25, 0x029E ; 0x80029e 37a58: 0f 94 53 96 call 0x32ca6 ; 0x32ca6 37a5c: 9b 01 movw r18, r22 37a5e: ac 01 movw r20, r24 37a60: c5 01 movw r24, r10 37a62: b4 01 movw r22, r8 37a64: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 37a68: 4b 01 movw r8, r22 37a6a: 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); 37a6c: b5 01 movw r22, r10 37a6e: a4 01 movw r20, r8 37a70: 8d e8 ldi r24, 0x8D ; 141 37a72: 9f e0 ldi r25, 0x0F ; 15 37a74: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 37a78: 40 91 a7 02 lds r20, 0x02A7 ; 0x8002a7 37a7c: 50 91 a8 02 lds r21, 0x02A8 ; 0x8002a8 37a80: 60 91 a9 02 lds r22, 0x02A9 ; 0x8002a9 37a84: 70 91 aa 02 lds r23, 0x02AA ; 0x8002aa 37a88: 8e e6 ldi r24, 0x6E ; 110 37a8a: 9f e0 ldi r25, 0x0F ; 15 37a8c: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e } 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); 37a90: 60 91 06 18 lds r22, 0x1806 ; 0x801806 37a94: c1 e0 ldi r28, 0x01 ; 1 37a96: 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); 37a98: 82 e7 ldi r24, 0x72 ; 114 37a9a: 9f e0 ldi r25, 0x0F ; 15 37a9c: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37aa0: 0e 94 cf 80 call 0x1019e ; 0x1019e card.sdprinting = false; 37aa4: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e saved_printing = true; 37aa8: c0 93 5a 0e sts 0x0E5A, r28 ; 0x800e5a // Enable stepper driver interrupt to move Z axis. This should be fine as the planner and // command queues are empty, SD card printing is disabled, usb is inhibited. planner_aborted = false; 37aac: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d sei(); 37ab0: 78 94 sei // Retract current_position[E_AXIS] -= default_retraction; 37ab2: 20 e0 ldi r18, 0x00 ; 0 37ab4: 30 e0 ldi r19, 0x00 ; 0 37ab6: 40 e8 ldi r20, 0x80 ; 128 37ab8: 5f e3 ldi r21, 0x3F ; 63 37aba: 60 91 4f 07 lds r22, 0x074F ; 0x80074f 37abe: 70 91 50 07 lds r23, 0x0750 ; 0x800750 37ac2: 80 91 51 07 lds r24, 0x0751 ; 0x800751 37ac6: 90 91 52 07 lds r25, 0x0752 ; 0x800752 37aca: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 37ace: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 37ad2: 70 93 50 07 sts 0x0750, r23 ; 0x800750 37ad6: 80 93 51 07 sts 0x0751, r24 ; 0x800751 37ada: 90 93 52 07 sts 0x0752, r25 ; 0x800752 plan_buffer_line_curposXYZE(95); 37ade: 60 e0 ldi r22, 0x00 ; 0 37ae0: 70 e0 ldi r23, 0x00 ; 0 37ae2: 8e eb ldi r24, 0xBE ; 190 37ae4: 92 e4 ldi r25, 0x42 ; 66 37ae6: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 37aea: 0f 94 2c 59 call 0x2b258 ; 0x2b258 disable_e0(); 37aee: 14 9a sbi 0x02, 4 ; 2 return stat; } uint16_t tmc2130_get_res(uint8_t axis) { return tmc2130_mres2usteps(tmc2130_mres[axis]); 37af0: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 37af4: c0 e0 ldi r28, 0x00 ; 0 37af6: d1 e0 ldi r29, 0x01 ; 1 37af8: 02 c0 rjmp .+4 ; 0x37afe <__vector_5+0x24e> 37afa: d6 95 lsr r29 37afc: c7 95 ror r28 37afe: 8a 95 dec r24 37b00: e2 f7 brpl .-8 ; 0x37afa <__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); 37b02: 82 e0 ldi r24, 0x02 ; 2 37b04: 0f 94 30 3a call 0x27460 ; 0x27460 current_position[Z_AXIS] += float(1024 - z_microsteps) 37b08: 60 e0 ldi r22, 0x00 ; 0 37b0a: 74 e0 ldi r23, 0x04 ; 4 37b0c: 68 1b sub r22, r24 37b0e: 79 0b sbc r23, r25 37b10: 90 e0 ldi r25, 0x00 ; 0 37b12: 80 e0 ldi r24, 0x00 ; 0 37b14: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 37b18: 4b 01 movw r8, r22 37b1a: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37b1c: be 01 movw r22, r28 37b1e: 90 e0 ldi r25, 0x00 ; 0 37b20: 80 e0 ldi r24, 0x00 ; 0 37b22: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 37b26: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37b2a: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37b2e: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 37b32: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 37b36: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37b3a: 9b 01 movw r18, r22 37b3c: ac 01 movw r20, r24 37b3e: c5 01 movw r24, r10 37b40: b4 01 movw r22, r8 37b42: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> + UVLO_Z_AXIS_SHIFT; 37b46: 2a e0 ldi r18, 0x0A ; 10 37b48: 37 ed ldi r19, 0xD7 ; 215 37b4a: 43 e2 ldi r20, 0x23 ; 35 37b4c: 5f e3 ldi r21, 0x3F ; 63 37b4e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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) 37b52: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 37b56: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 37b5a: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 37b5e: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 37b62: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 37b66: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 37b6a: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 37b6e: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 37b72: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37b76: 65 e5 ldi r22, 0x55 ; 85 37b78: 75 e5 ldi r23, 0x55 ; 85 37b7a: 85 e5 ldi r24, 0x55 ; 85 37b7c: 91 e4 ldi r25, 0x41 ; 65 37b7e: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 37b82: 0f 94 2c 59 call 0x2b258 ; 0x2b258 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37b86: 40 91 02 18 lds r20, 0x1802 ; 0x801802 37b8a: 50 91 03 18 lds r21, 0x1803 ; 0x801803 37b8e: 60 91 04 18 lds r22, 0x1804 ; 0x801804 37b92: 70 91 05 18 lds r23, 0x1805 ; 0x801805 37b96: 81 e9 ldi r24, 0x91 ; 145 37b98: 9f e0 ldi r25, 0x0F ; 15 37b9a: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 37b9e: ce ea ldi r28, 0xAE ; 174 37ba0: 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; 37ba2: 97 e0 ldi r25, 0x07 ; 7 37ba4: 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; 37ba6: 70 e0 ldi r23, 0x00 ; 0 37ba8: 60 e0 ldi r22, 0x00 ; 0 37baa: 00 23 and r16, r16 37bac: 19 f1 breq .+70 ; 0x37bf4 <__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; 37bae: 81 2f mov r24, r17 37bb0: 6b 2d mov r22, r11 37bb2: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__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; 37bb6: b8 9e mul r11, r24 37bb8: f0 01 movw r30, r0 37bba: 11 24 eor r1, r1 37bbc: e9 0f add r30, r25 37bbe: f1 1d adc r31, r1 37bc0: ee 0f add r30, r30 37bc2: ff 1f adc r31, r31 37bc4: ee 0f add r30, r30 37bc6: ff 1f adc r31, r31 37bc8: e0 56 subi r30, 0x60 ; 96 37bca: fc 4e sbci r31, 0xEC ; 236 37bcc: 20 e0 ldi r18, 0x00 ; 0 37bce: 30 e0 ldi r19, 0x00 ; 0 37bd0: 4a e7 ldi r20, 0x7A ; 122 37bd2: 54 e4 ldi r21, 0x44 ; 68 37bd4: 61 81 ldd r22, Z+1 ; 0x01 37bd6: 72 81 ldd r23, Z+2 ; 0x02 37bd8: 83 81 ldd r24, Z+3 ; 0x03 37bda: 94 81 ldd r25, Z+4 ; 0x04 37bdc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37be0: 20 e0 ldi r18, 0x00 ; 0 37be2: 30 e0 ldi r19, 0x00 ; 0 37be4: 40 e0 ldi r20, 0x00 ; 0 37be6: 5f e3 ldi r21, 0x3F ; 63 37be8: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 37bec: 0f 94 60 e0 call 0x3c0c0 ; 0x3c0c0 37bf0: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37bf4: ce 01 movw r24, r28 37bf6: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 // 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) 37bfa: 1f 5f subi r17, 0xFF ; 255 37bfc: 22 96 adiw r28, 0x02 ; 2 37bfe: 11 33 cpi r17, 0x31 ; 49 37c00: 91 f6 brne .-92 ; 0x37ba6 <__vector_5+0x2f6> if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c02: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 37c06: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 37c0a: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 37c0e: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 37c12: 8a ed ldi r24, 0xDA ; 218 37c14: 9e e0 ldi r25, 0x0E ; 14 37c16: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 37c1a: 40 91 9b 02 lds r20, 0x029B ; 0x80029b 37c1e: 50 91 9c 02 lds r21, 0x029C ; 0x80029c 37c22: 60 91 9d 02 lds r22, 0x029D ; 0x80029d 37c26: 70 91 9e 02 lds r23, 0x029E ; 0x80029e 37c2a: 8d e9 ldi r24, 0x9D ; 157 37c2c: 9f e0 ldi r25, 0x0F ; 15 37c2e: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 37c32: 40 91 9f 02 lds r20, 0x029F ; 0x80029f 37c36: 50 91 a0 02 lds r21, 0x02A0 ; 0x8002a0 37c3a: 60 91 a1 02 lds r22, 0x02A1 ; 0x8002a1 37c3e: 70 91 a2 02 lds r23, 0x02A2 ; 0x8002a2 37c42: 81 ea ldi r24, 0xA1 ; 161 37c44: 9f e0 ldi r25, 0x0F ; 15 37c46: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37c4a: 60 91 00 18 lds r22, 0x1800 ; 0x801800 37c4e: 70 91 01 18 lds r23, 0x1801 ; 0x801801 37c52: 89 e8 ldi r24, 0x89 ; 137 37c54: 9f e0 ldi r25, 0x0F ; 15 37c56: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 37c5a: 60 91 39 02 lds r22, 0x0239 ; 0x800239 37c5e: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 37c62: 85 e3 ldi r24, 0x35 ; 53 37c64: 9d e0 ldi r25, 0x0D ; 13 37c66: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 37c6a: 60 91 ad 05 lds r22, 0x05AD ; 0x8005ad 37c6e: 70 91 ae 05 lds r23, 0x05AE ; 0x8005ae 37c72: 88 ed ldi r24, 0xD8 ; 216 37c74: 9e e0 ldi r25, 0x0E ; 14 37c76: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37c7a: 60 91 af 05 lds r22, 0x05AF ; 0x8005af 37c7e: 8b e8 ldi r24, 0x8B ; 139 37c80: 9f e0 ldi r25, 0x0F ; 15 37c82: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 37c86: 60 91 ac 05 lds r22, 0x05AC ; 0x8005ac 37c8a: 88 e8 ldi r24, 0x88 ; 136 37c8c: 9f e0 ldi r25, 0x0F ; 15 37c8e: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37c92: 40 91 bb 02 lds r20, 0x02BB ; 0x8002bb 37c96: 50 91 bc 02 lds r21, 0x02BC ; 0x8002bc 37c9a: 60 91 bd 02 lds r22, 0x02BD ; 0x8002bd 37c9e: 70 91 be 02 lds r23, 0x02BE ; 0x8002be 37ca2: 88 ee ldi r24, 0xE8 ; 232 37ca4: 9e e0 ldi r25, 0x0E ; 14 37ca6: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37caa: 60 91 94 02 lds r22, 0x0294 ; 0x800294 37cae: 70 91 95 02 lds r23, 0x0295 ; 0x800295 37cb2: 8e ed ldi r24, 0xDE ; 222 37cb4: 9e e0 ldi r25, 0x0E ; 14 37cb6: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37cba: 40 91 a2 06 lds r20, 0x06A2 ; 0x8006a2 37cbe: 50 91 a3 06 lds r21, 0x06A3 ; 0x8006a3 37cc2: 60 91 a4 06 lds r22, 0x06A4 ; 0x8006a4 37cc6: 70 91 a5 06 lds r23, 0x06A5 ; 0x8006a5 37cca: 81 e1 ldi r24, 0x11 ; 17 37ccc: 9d e0 ldi r25, 0x0D ; 13 37cce: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 37cd2: 40 91 a6 06 lds r20, 0x06A6 ; 0x8006a6 37cd6: 50 91 a7 06 lds r21, 0x06A7 ; 0x8006a7 37cda: 60 91 a8 06 lds r22, 0x06A8 ; 0x8006a8 37cde: 70 91 a9 06 lds r23, 0x06A9 ; 0x8006a9 37ce2: 8d e0 ldi r24, 0x0D ; 13 37ce4: 9d e0 ldi r25, 0x0D ; 13 37ce6: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 37cea: 40 91 2e 07 lds r20, 0x072E ; 0x80072e 37cee: 50 91 2f 07 lds r21, 0x072F ; 0x80072f 37cf2: 60 91 30 07 lds r22, 0x0730 ; 0x800730 37cf6: 70 91 31 07 lds r23, 0x0731 ; 0x800731 37cfa: 89 e0 ldi r24, 0x09 ; 9 37cfc: 9d e0 ldi r25, 0x0D ; 13 37cfe: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e #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); 37d02: 40 e1 ldi r20, 0x10 ; 16 37d04: 50 e0 ldi r21, 0x00 ; 0 37d06: 67 e3 ldi r22, 0x37 ; 55 37d08: 7d e0 ldi r23, 0x0D ; 13 37d0a: 8b ea ldi r24, 0xAB ; 171 37d0c: 92 e0 ldi r25, 0x02 ; 2 37d0e: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37d12: 60 91 0b 18 lds r22, 0x180B ; 0x80180b 37d16: 70 91 0c 18 lds r23, 0x180C ; 0x80180c 37d1a: 8c e6 ldi r24, 0x6C ; 108 37d1c: 9f e0 ldi r25, 0x0F ; 15 37d1e: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37d22: 60 91 6a 02 lds r22, 0x026A ; 0x80026a 37d26: 8c e8 ldi r24, 0x8C ; 140 37d28: 9f e0 ldi r25, 0x0F ; 15 37d2a: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37d2e: 40 91 07 18 lds r20, 0x1807 ; 0x801807 37d32: 50 91 08 18 lds r21, 0x1808 ; 0x801808 37d36: 60 91 09 18 lds r22, 0x1809 ; 0x801809 37d3a: 70 91 0a 18 lds r23, 0x180A ; 0x80180a 37d3e: 8c e2 ldi r24, 0x2C ; 44 37d40: 9d e0 ldi r25, 0x0D ; 13 37d42: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 37d46: 60 91 6b 02 lds r22, 0x026B ; 0x80026b 37d4a: 70 91 6c 02 lds r23, 0x026C ; 0x80026c 37d4e: 8d e7 ldi r24, 0x7D ; 125 37d50: 9c e0 ldi r25, 0x0C ; 12 37d52: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 #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); 37d56: 40 e1 ldi r20, 0x10 ; 16 37d58: 50 e0 ldi r21, 0x00 ; 0 37d5a: 6d e6 ldi r22, 0x6D ; 109 37d5c: 7c e0 ldi r23, 0x0C ; 12 37d5e: 82 e9 ldi r24, 0x92 ; 146 37d60: 96 e0 ldi r25, 0x06 ; 6 37d62: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 37d66: 40 e1 ldi r20, 0x10 ; 16 37d68: 50 e0 ldi r21, 0x00 ; 0 37d6a: 6d e5 ldi r22, 0x5D ; 93 37d6c: 7c e0 ldi r23, 0x0C ; 12 37d6e: 8a e1 ldi r24, 0x1A ; 26 37d70: 97 e0 ldi r25, 0x07 ; 7 37d72: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 37d76: 40 e1 ldi r20, 0x10 ; 16 37d78: 50 e0 ldi r21, 0x00 ; 0 37d7a: 6d e4 ldi r22, 0x4D ; 77 37d7c: 7c e0 ldi r23, 0x0C ; 12 37d7e: 82 e8 ldi r24, 0x82 ; 130 37d80: 96 e0 ldi r25, 0x06 ; 6 37d82: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 37d86: 40 e1 ldi r20, 0x10 ; 16 37d88: 50 e0 ldi r21, 0x00 ; 0 37d8a: 6d e3 ldi r22, 0x3D ; 61 37d8c: 7c e0 ldi r23, 0x0C ; 12 37d8e: 8a e0 ldi r24, 0x0A ; 10 37d90: 97 e0 ldi r25, 0x07 ; 7 37d92: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 37d96: 40 91 aa 06 lds r20, 0x06AA ; 0x8006aa 37d9a: 50 91 ab 06 lds r21, 0x06AB ; 0x8006ab 37d9e: 60 91 ac 06 lds r22, 0x06AC ; 0x8006ac 37da2: 70 91 ad 06 lds r23, 0x06AD ; 0x8006ad 37da6: 89 e3 ldi r24, 0x39 ; 57 37da8: 9c e0 ldi r25, 0x0C ; 12 37daa: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 37dae: 40 91 ae 06 lds r20, 0x06AE ; 0x8006ae 37db2: 50 91 af 06 lds r21, 0x06AF ; 0x8006af 37db6: 60 91 b0 06 lds r22, 0x06B0 ; 0x8006b0 37dba: 70 91 b1 06 lds r23, 0x06B1 ; 0x8006b1 37dbe: 85 e3 ldi r24, 0x35 ; 53 37dc0: 9c e0 ldi r25, 0x0C ; 12 37dc2: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 37dc6: 40 91 b2 06 lds r20, 0x06B2 ; 0x8006b2 37dca: 50 91 b3 06 lds r21, 0x06B3 ; 0x8006b3 37dce: 60 91 b4 06 lds r22, 0x06B4 ; 0x8006b4 37dd2: 70 91 b5 06 lds r23, 0x06B5 ; 0x8006b5 37dd6: 81 e3 ldi r24, 0x31 ; 49 37dd8: 9c e0 ldi r25, 0x0C ; 12 37dda: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e #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); 37dde: 40 e1 ldi r20, 0x10 ; 16 37de0: 50 e0 ldi r21, 0x00 ; 0 37de2: 61 e2 ldi r22, 0x21 ; 33 37de4: 7c e0 ldi r23, 0x0C ; 12 37de6: 86 eb ldi r24, 0xB6 ; 182 37de8: 96 e0 ldi r25, 0x06 ; 6 37dea: 0f 94 a5 dd call 0x3bb4a ; 0x3bb4a 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) { 37dee: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 37df2: 88 23 and r24, r24 37df4: 29 f0 breq .+10 ; 0x37e00 <__vector_5+0x550> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 37df6: 61 e0 ldi r22, 0x01 ; 1 37df8: 8f e7 ldi r24, 0x7F ; 127 37dfa: 9c e0 ldi r25, 0x0C ; 12 37dfc: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 37e00: 61 e0 ldi r22, 0x01 ; 1 37e02: 85 ea ldi r24, 0xA5 ; 165 37e04: 9f e0 ldi r25, 0x0F ; 15 37e06: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a } eeprom_update_byte_notify((uint8_t*)EEPROM_UVLO, PowerPanic::PENDING_RECOVERY); // Increment power failure counter eeprom_increment_byte((uint8_t*)EEPROM_POWER_COUNT); 37e0a: 84 e6 ldi r24, 0x64 ; 100 37e0c: 9f e0 ldi r25, 0x0F ; 15 37e0e: 0e 94 b3 77 call 0xef66 ; 0xef66 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 37e12: 8f ef ldi r24, 0xFF ; 255 37e14: 9e e0 ldi r25, 0x0E ; 14 37e16: 0e 94 a6 77 call 0xef4c ; 0xef4c printf_P(_N("UVLO - end %d\n"), _millis() - time_start); 37e1a: 0f 94 8b 3f call 0x27f16 ; 0x27f16 37e1e: dc 01 movw r26, r24 37e20: cb 01 movw r24, r22 37e22: 8c 19 sub r24, r12 37e24: 9d 09 sbc r25, r13 37e26: ae 09 sbc r26, r14 37e28: bf 09 sbc r27, r15 37e2a: bf 93 push r27 37e2c: af 93 push r26 37e2e: 9f 93 push r25 37e30: 8f 93 push r24 37e32: 84 e5 ldi r24, 0x54 ; 84 37e34: 91 e7 ldi r25, 0x71 ; 113 37e36: 9f 93 push r25 37e38: 8f 93 push r24 37e3a: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 WRITE(BEEPER,HIGH); 37e3e: 9f b7 in r25, 0x3f ; 63 37e40: f8 94 cli 37e42: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37e46: 84 60 ori r24, 0x04 ; 4 37e48: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 37e4c: 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(); 37e4e: 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; 37e50: 0f 90 pop r0 37e52: 0f 90 pop r0 37e54: 0f 90 pop r0 37e56: 0f 90 pop r0 37e58: 0f 90 pop r0 37e5a: 0f 90 pop r0 37e5c: 20 e0 ldi r18, 0x00 ; 0 37e5e: 30 e0 ldi r19, 0x00 ; 0 37e60: 4f ef ldi r20, 0xFF ; 255 37e62: 52 e4 ldi r21, 0x42 ; 66 37e64: 60 91 43 07 lds r22, 0x0743 ; 0x800743 37e68: 70 91 44 07 lds r23, 0x0744 ; 0x800744 37e6c: 80 91 45 07 lds r24, 0x0745 ; 0x800745 37e70: 90 91 46 07 lds r25, 0x0746 ; 0x800746 37e74: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 37e78: 87 fd sbrc r24, 7 37e7a: 1f c0 rjmp .+62 ; 0x37eba <__vector_5+0x60a> 37e7c: 80 e0 ldi r24, 0x00 ; 0 37e7e: 90 e0 ldi r25, 0x00 ; 0 37e80: af e7 ldi r26, 0x7F ; 127 37e82: b3 e4 ldi r27, 0x43 ; 67 37e84: 80 93 43 07 sts 0x0743, r24 ; 0x800743 37e88: 90 93 44 07 sts 0x0744, r25 ; 0x800744 37e8c: a0 93 45 07 sts 0x0745, r26 ; 0x800745 37e90: b0 93 46 07 sts 0x0746, r27 ; 0x800746 plan_buffer_line_curposXYZE(500); 37e94: 60 e0 ldi r22, 0x00 ; 0 37e96: 70 e0 ldi r23, 0x00 ; 0 37e98: 8a ef ldi r24, 0xFA ; 250 37e9a: 93 e4 ldi r25, 0x43 ; 67 37e9c: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 37ea0: 0f 94 2c 59 call 0x2b258 ; 0x2b258 37ea4: 88 e1 ldi r24, 0x18 ; 24 37ea6: 9e e0 ldi r25, 0x0E ; 14 37ea8: 0f b6 in r0, 0x3f ; 63 37eaa: f8 94 cli 37eac: a8 95 wdr 37eae: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37eb2: 0f be out 0x3f, r0 ; 63 37eb4: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 37eb8: ff cf rjmp .-2 ; 0x37eb8 <__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; 37eba: 80 e0 ldi r24, 0x00 ; 0 37ebc: 90 e0 ldi r25, 0x00 ; 0 37ebe: dc 01 movw r26, r24 37ec0: e1 cf rjmp .-62 ; 0x37e84 <__vector_5+0x5d4> while(1); } static void uvlo_tiny() { unsigned long time_start = _millis(); 37ec2: 0f 94 8b 3f call 0x27f16 ; 0x27f16 37ec6: 6b 01 movw r12, r22 37ec8: 7c 01 movw r14, r24 // Conserve power as soon as possible. disable_x(); 37eca: 17 9a sbi 0x02, 7 ; 2 37ecc: 10 92 40 07 sts 0x0740, r1 ; 0x800740 disable_y(); 37ed0: 16 9a sbi 0x02, 6 ; 2 37ed2: 10 92 41 07 sts 0x0741, r1 ; 0x800741 disable_e0(); 37ed6: 14 9a sbi 0x02, 4 ; 2 #ifdef TMC2130 currents[Z_AXIS].setiHold(20); 37ed8: 64 e1 ldi r22, 0x14 ; 20 37eda: 83 e6 ldi r24, 0x63 ; 99 37edc: 92 e0 ldi r25, 0x02 ; 2 37ede: 0e 94 b3 68 call 0xd166 ; 0xd166 currents[Z_AXIS].setiRun(20); 37ee2: 64 e1 ldi r22, 0x14 ; 20 37ee4: 83 e6 ldi r24, 0x63 ; 99 37ee6: 92 e0 ldi r25, 0x02 ; 2 37ee8: 0e 94 bb 68 call 0xd176 ; 0xd176 tmc2130_setup_chopper(Z_AXIS, tmc2130_mres[Z_AXIS]); 37eec: 50 e0 ldi r21, 0x00 ; 0 37eee: 40 e0 ldi r20, 0x00 ; 0 37ef0: 60 91 fa 04 lds r22, 0x04FA ; 0x8004fa 37ef4: 82 e0 ldi r24, 0x02 ; 2 37ef6: 0f 94 4a 3a call 0x27494 ; 0x27494 #endif //TMC2130 // Stop all heaters disable_heater(); 37efa: 0f 94 57 45 call 0x28aae ; 0x28aae // 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; 37efe: 10 92 a0 13 sts 0x13A0, r1 ; 0x8013a0 planner_abort_hard(); 37f02: 0f 94 0d bc call 0x3781a ; 0x3781a // 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]) 37f06: 80 90 4b 07 lds r8, 0x074B ; 0x80074b 37f0a: 90 90 4c 07 lds r9, 0x074C ; 0x80074c 37f0e: a0 90 4d 07 lds r10, 0x074D ; 0x80074d 37f12: b0 90 4e 07 lds r11, 0x074E ; 0x80074e 37f16: 8a ed ldi r24, 0xDA ; 218 37f18: 9e e0 ldi r25, 0x0E ; 14 37f1a: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 37f1e: 9b 01 movw r18, r22 37f20: ac 01 movw r20, r24 37f22: c5 01 movw r24, r10 37f24: b4 01 movw r22, r8 37f26: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 37f2a: 4b 01 movw r8, r22 37f2c: 5c 01 movw r10, r24 37f2e: e8 94 clt 37f30: b7 f8 bld r11, 7 37f32: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37f36: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37f3a: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 37f3e: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 37f42: 60 e0 ldi r22, 0x00 ; 0 37f44: 70 e0 ldi r23, 0x00 ; 0 37f46: 80 e8 ldi r24, 0x80 ; 128 37f48: 9f e3 ldi r25, 0x3F ; 63 37f4a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 37f4e: 9b 01 movw r18, r22 37f50: ac 01 movw r20, r24 37f52: c5 01 movw r24, r10 37f54: b4 01 movw r22, r8 37f56: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 37f5a: 87 fd sbrc r24, 7 37f5c: 61 c0 rjmp .+194 ; 0x38020 <__vector_5+0x770> { // Clean the input command queue, inhibit serial processing using saved_printing cmdqueue_reset(); 37f5e: 0e 94 cf 80 call 0x1019e ; 0x1019e card.sdprinting = false; 37f62: 10 92 6e 14 sts 0x146E, r1 ; 0x80146e saved_printing = true; 37f66: 81 e0 ldi r24, 0x01 ; 1 37f68: 80 93 5a 0e sts 0x0E5A, r24 ; 0x800e5a // Enable stepper driver interrupt to move Z axis. This should be fine as the planner and // command queues are empty, SD card printing is disabled, usb is inhibited. planner_aborted = false; 37f6c: 10 92 5d 0e sts 0x0E5D, r1 ; 0x800e5d sei(); 37f70: 78 94 sei 37f72: 80 91 fa 04 lds r24, 0x04FA ; 0x8004fa 37f76: c0 e0 ldi r28, 0x00 ; 0 37f78: d1 e0 ldi r29, 0x01 ; 1 37f7a: 02 c0 rjmp .+4 ; 0x37f80 <__vector_5+0x6d0> 37f7c: d6 95 lsr r29 37f7e: c7 95 ror r28 37f80: 8a 95 dec r24 37f82: e2 f7 brpl .-8 ; 0x37f7c <__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); 37f84: 82 e0 ldi r24, 0x02 ; 2 37f86: 0f 94 30 3a call 0x27460 ; 0x27460 current_position[Z_AXIS] += float(1024 - z_microsteps) 37f8a: 60 e0 ldi r22, 0x00 ; 0 37f8c: 74 e0 ldi r23, 0x04 ; 4 37f8e: 68 1b sub r22, r24 37f90: 79 0b sbc r23, r25 37f92: 90 e0 ldi r25, 0x00 ; 0 37f94: 80 e0 ldi r24, 0x00 ; 0 37f96: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 37f9a: 4b 01 movw r8, r22 37f9c: 5c 01 movw r10, r24 / (z_res * cs.axis_steps_per_mm[Z_AXIS]) 37f9e: be 01 movw r22, r28 37fa0: 90 e0 ldi r25, 0x00 ; 0 37fa2: 80 e0 ldi r24, 0x00 ; 0 37fa4: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 37fa8: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 37fac: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 37fb0: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 37fb4: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 37fb8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 37fbc: 9b 01 movw r18, r22 37fbe: ac 01 movw r20, r24 37fc0: c5 01 movw r24, r10 37fc2: b4 01 movw r22, r8 37fc4: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> + UVLO_TINY_Z_AXIS_SHIFT; 37fc8: 2a e0 ldi r18, 0x0A ; 10 37fca: 37 ed ldi r19, 0xD7 ; 215 37fcc: 43 e2 ldi r20, 0x23 ; 35 37fce: 5e e3 ldi r21, 0x3E ; 62 37fd0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__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) 37fd4: 20 91 4b 07 lds r18, 0x074B ; 0x80074b 37fd8: 30 91 4c 07 lds r19, 0x074C ; 0x80074c 37fdc: 40 91 4d 07 lds r20, 0x074D ; 0x80074d 37fe0: 50 91 4e 07 lds r21, 0x074E ; 0x80074e 37fe4: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 37fe8: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 37fec: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 37ff0: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 37ff4: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e / (z_res * cs.axis_steps_per_mm[Z_AXIS]) + UVLO_TINY_Z_AXIS_SHIFT; plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS]/60); 37ff8: 65 e5 ldi r22, 0x55 ; 85 37ffa: 75 e5 ldi r23, 0x55 ; 85 37ffc: 85 e5 ldi r24, 0x55 ; 85 37ffe: 91 e4 ldi r25, 0x41 ; 65 38000: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 38004: 0f 94 2c 59 call 0x2b258 ; 0x2b258 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 38008: 40 91 4b 07 lds r20, 0x074B ; 0x80074b 3800c: 50 91 4c 07 lds r21, 0x074C ; 0x80074c 38010: 60 91 4d 07 lds r22, 0x074D ; 0x80074d 38014: 70 91 4e 07 lds r23, 0x074E ; 0x80074e 38018: 8a ed ldi r24, 0xDA ; 218 3801a: 9e e0 ldi r25, 0x0E ; 14 3801c: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 38020: 62 e0 ldi r22, 0x02 ; 2 38022: 85 ea ldi r24, 0xA5 ; 165 38024: 9f e0 ldi r25, 0x0F ; 15 38026: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a // 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); 3802a: 84 e6 ldi r24, 0x64 ; 100 3802c: 9f e0 ldi r25, 0x0F ; 15 3802e: 0e 94 b3 77 call 0xef66 ; 0xef66 eeprom_increment_word((uint16_t*)EEPROM_POWER_COUNT_TOT); 38032: 8f ef ldi r24, 0xFF ; 255 38034: 9e e0 ldi r25, 0x0E ; 14 38036: 0e 94 a6 77 call 0xef4c ; 0xef4c printf_P(_N("UVLO_TINY - end %d\n"), _millis() - time_start); 3803a: 0f 94 8b 3f call 0x27f16 ; 0x27f16 3803e: dc 01 movw r26, r24 38040: cb 01 movw r24, r22 38042: 8c 19 sub r24, r12 38044: 9d 09 sbc r25, r13 38046: ae 09 sbc r26, r14 38048: bf 09 sbc r27, r15 3804a: bf 93 push r27 3804c: af 93 push r26 3804e: 9f 93 push r25 38050: 8f 93 push r24 38052: 83 e6 ldi r24, 0x63 ; 99 38054: 91 e7 ldi r25, 0x71 ; 113 38056: 9f 93 push r25 38058: 8f 93 push r24 3805a: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 uvlo_drain_reset(); 3805e: 0f 94 3a aa call 0x35474 ; 0x35474 // 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(); } } 38062: ff 91 pop r31 38064: ef 91 pop r30 38066: df 91 pop r29 38068: cf 91 pop r28 3806a: bf 91 pop r27 3806c: af 91 pop r26 3806e: 9f 91 pop r25 38070: 8f 91 pop r24 38072: 7f 91 pop r23 38074: 6f 91 pop r22 38076: 5f 91 pop r21 38078: 4f 91 pop r20 3807a: 3f 91 pop r19 3807c: 2f 91 pop r18 3807e: 1f 91 pop r17 38080: 0f 91 pop r16 38082: ff 90 pop r15 38084: ef 90 pop r14 38086: df 90 pop r13 38088: cf 90 pop r12 3808a: bf 90 pop r11 3808c: af 90 pop r10 3808e: 9f 90 pop r9 38090: 8f 90 pop r8 38092: 0f 90 pop r0 38094: 0b be out 0x3b, r0 ; 59 38096: 0f 90 pop r0 38098: 0f be out 0x3f, r0 ; 63 3809a: 0f 90 pop r0 3809c: 1f 90 pop r1 3809e: 18 95 reti 000380a0 : extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 380a0: 84 b1 in r24, 0x04 ; 4 380a2: 81 7f andi r24, 0xF1 ; 241 380a4: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 380a6: 84 b1 in r24, 0x04 ; 4 380a8: 87 60 ori r24, 0x07 ; 7 380aa: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 380ac: 85 b1 in r24, 0x05 ; 5 380ae: 81 7f andi r24, 0xF1 ; 241 380b0: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 380b2: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 380b4: 80 e5 ldi r24, 0x50 ; 80 380b6: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 380b8: 1d bc out 0x2d, r1 ; 45 } 380ba: 08 95 ret 000380bc : //! @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() { 380bc: 2f 92 push r2 380be: 3f 92 push r3 380c0: 4f 92 push r4 380c2: 5f 92 push r5 380c4: 6f 92 push r6 380c6: 7f 92 push r7 380c8: 8f 92 push r8 380ca: 9f 92 push r9 380cc: af 92 push r10 380ce: bf 92 push r11 380d0: cf 92 push r12 380d2: df 92 push r13 380d4: ef 92 push r14 380d6: ff 92 push r15 380d8: 0f 93 push r16 380da: 1f 93 push r17 380dc: cf 93 push r28 380de: df 93 push r29 380e0: cd b7 in r28, 0x3d ; 61 380e2: de b7 in r29, 0x3e ; 62 380e4: c6 50 subi r28, 0x06 ; 6 380e6: d1 40 sbci r29, 0x01 ; 1 380e8: 0f b6 in r0, 0x3f ; 63 380ea: f8 94 cli 380ec: de bf out 0x3e, r29 ; 62 380ee: 0f be out 0x3f, r0 ; 63 380f0: 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; 380f2: 80 91 fc 1f lds r24, 0x1FFC ; 0x801ffc <__bss_end+0x7e3> 380f6: 90 91 fd 1f lds r25, 0x1FFD ; 0x801ffd <__bss_end+0x7e4> 380fa: a0 91 fe 1f lds r26, 0x1FFE ; 0x801ffe <__bss_end+0x7e5> 380fe: b0 91 ff 1f lds r27, 0x1FFF ; 0x801fff <__bss_end+0x7e6> 38102: 8a 3a cpi r24, 0xAA ; 170 38104: 95 45 sbci r25, 0x55 ; 85 38106: aa 4a sbci r26, 0xAA ; 170 38108: b5 45 sbci r27, 0x55 ; 85 3810a: 21 f4 brne .+8 ; 0x38114 3810c: 80 91 fb 1f lds r24, 0x1FFB ; 0x801ffb <__bss_end+0x7e2> 38110: 87 fd sbrc r24, 7 38112: c2 c1 rjmp .+900 ; 0x38498 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(); 38114: a8 95 wdr const char *ptr = entry_magic_send; const char *end = strlen_P(entry_magic_send) + ptr; const uint8_t selectedSerialPort_bak = selectedSerialPort; 38116: d0 90 21 05 lds r13, 0x0521 ; 0x800521 // Flush the serial line. while (RECV_READY) { 3811a: 80 91 c0 00 lds r24, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> 3811e: 87 ff sbrs r24, 7 38120: 04 c0 rjmp .+8 ; 0x3812a wdt_reset(); 38122: a8 95 wdr // Dummy register read (discard) (void)(*(char *)UDR0); 38124: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 38128: f8 cf rjmp .-16 ; 0x3811a } selectedSerialPort = 0; //switch to Serial0 3812a: 10 92 21 05 sts 0x0521, r1 ; 0x800521 // don't reverse this or there may be problems if the RX interrupt // occurs after reading the value of rx_buffer_head but before writing // the value to rx_buffer_tail; the previous value of rx_buffer_head // may be written to rx_buffer_tail, making it appear as if the buffer // were full, not empty. rx_buffer.head = rx_buffer.tail; 3812e: 00 91 95 04 lds r16, 0x0495 ; 0x800495 38132: 10 91 96 04 lds r17, 0x0496 ; 0x800496 38136: 10 93 94 04 sts 0x0494, r17 ; 0x800494 3813a: 00 93 93 04 sts 0x0493, r16 ; 0x800493 3813e: 51 e9 ldi r21, 0x91 ; 145 38140: e5 2e mov r14, r21 38142: 5b ea ldi r21, 0xAB ; 171 38144: f5 2e mov r15, r21 38146: 67 e9 ldi r22, 0x97 ; 151 38148: a6 2e mov r10, r22 3814a: 6b ea ldi r22, 0xAB ; 171 3814c: 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 ++)); 3814e: f7 01 movw r30, r14 38150: 84 91 lpm r24, Z 38152: 0f 94 68 a1 call 0x342d0 ; 0x342d0 38156: ff ef ldi r31, 0xFF ; 255 38158: ef 1a sub r14, r31 3815a: 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) 3815c: ae 14 cp r10, r14 3815e: bf 04 cpc r11, r15 38160: b1 f7 brne .-20 ; 0x3814e putch(pgm_read_byte(ptr ++)); wdt_reset(); 38162: a8 95 wdr 38164: 8f e0 ldi r24, 0x0F ; 15 38166: 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) 38168: 20 e9 ldi r18, 0x90 ; 144 3816a: 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(); 3816c: 40 e8 ldi r20, 0x80 ; 128 3816e: 54 e8 ldi r21, 0x84 ; 132 38170: 6e e1 ldi r22, 0x1E ; 30 38172: 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) { 38174: e0 91 93 04 lds r30, 0x0493 ; 0x800493 38178: f0 91 94 04 lds r31, 0x0494 ; 0x800494 3817c: e0 17 cp r30, r16 3817e: f1 07 cpc r31, r17 38180: 19 f5 brne .+70 ; 0x381c8 wdt_reset(); 38182: a8 95 wdr 38184: 41 50 subi r20, 0x01 ; 1 38186: 51 09 sbc r21, r1 38188: 61 09 sbc r22, r1 3818a: 71 09 sbc r23, r1 if ( --boot_timer == 0) { 3818c: 99 f7 brne .-26 ; 0x38174 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 3818e: d0 92 21 05 sts 0x0521, r13 ; 0x800521 return 0; 38192: 80 e0 ldi r24, 0x00 ; 0 // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); } } 38194: ca 5f subi r28, 0xFA ; 250 38196: de 4f sbci r29, 0xFE ; 254 38198: 0f b6 in r0, 0x3f ; 63 3819a: f8 94 cli 3819c: de bf out 0x3e, r29 ; 62 3819e: 0f be out 0x3f, r0 ; 63 381a0: cd bf out 0x3d, r28 ; 61 381a2: df 91 pop r29 381a4: cf 91 pop r28 381a6: 1f 91 pop r17 381a8: 0f 91 pop r16 381aa: ff 90 pop r15 381ac: ef 90 pop r14 381ae: df 90 pop r13 381b0: cf 90 pop r12 381b2: bf 90 pop r11 381b4: af 90 pop r10 381b6: 9f 90 pop r9 381b8: 8f 90 pop r8 381ba: 7f 90 pop r7 381bc: 6f 90 pop r6 381be: 5f 90 pop r5 381c0: 4f 90 pop r4 381c2: 3f 90 pop r3 381c4: 2f 90 pop r2 381c6: 08 95 ret // Timeout expired, continue with the application. selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } } ch = rx_buffer.buffer[SerialHead]; 381c8: f8 01 movw r30, r16 381ca: ed 5e subi r30, 0xED ; 237 381cc: fb 4f sbci r31, 0xFB ; 251 381ce: 40 81 ld r20, Z SerialHead = (unsigned int)(SerialHead + 1) % RX_BUFFER_SIZE; 381d0: 0f 5f subi r16, 0xFF ; 255 381d2: 1f 4f sbci r17, 0xFF ; 255 381d4: 0f 77 andi r16, 0x7F ; 127 381d6: 11 27 eor r17, r17 if (pgm_read_byte(ptr ++) != ch) 381d8: f9 01 movw r30, r18 381da: e8 1b sub r30, r24 381dc: f9 0b sbc r31, r25 381de: e4 91 lpm r30, Z 381e0: 4e 13 cpse r20, r30 381e2: d5 cf rjmp .-86 ; 0x3818e { // Magic was not received correctly, continue with the application selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); 381e4: a8 95 wdr 381e6: 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) { 381e8: 09 f0 breq .+2 ; 0x381ec 381ea: c0 cf rjmp .-128 ; 0x3816c selectedSerialPort = selectedSerialPort_bak; //revert Serial setting return 0; } wdt_reset(); } cbi(UCSR0B, RXCIE0); //disable the MarlinSerial0 interrupt 381ec: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 381f0: 8f 77 andi r24, 0x7F ; 127 381f2: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 381f6: 03 e7 ldi r16, 0x73 ; 115 381f8: 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 ++)); 381fa: f8 01 movw r30, r16 381fc: 84 91 lpm r24, Z 381fe: 0f 94 68 a1 call 0x342d0 ; 0x342d0 38202: 0f 5f subi r16, 0xFF ; 255 38204: 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) 38206: fb ea ldi r31, 0xAB ; 171 38208: 00 38 cpi r16, 0x80 ; 128 3820a: 1f 07 cpc r17, r31 3820c: b1 f7 brne .-20 ; 0x381fa putch(pgm_read_byte(ptr ++)); } spi_init(); 3820e: 0f 94 50 c0 call 0x380a0 ; 0x380a0 xflash_init(); 38212: 0e 94 96 e4 call 0x1c92c ; 0x1c92c "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" ); 38216: 0f b6 in r0, 0x3f ; 63 38218: f8 94 cli 3821a: a8 95 wdr 3821c: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38220: 88 61 ori r24, 0x18 ; 24 38222: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38226: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 3822a: 0f be out 0x3f, r0 ; 63 wdt_disable(); lcd_clear(); 3822c: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 1, PSTR(" Upgrading xflash\n Do not disconnect!")); 38230: 4d e4 ldi r20, 0x4D ; 77 38232: 5b ea ldi r21, 0xAB ; 171 38234: 61 e0 ldi r22, 0x01 ; 1 38236: 80 e0 ldi r24, 0x00 ; 0 38238: 0e 94 a9 6f call 0xdf52 ; 0xdf52 boot_app_magic = 0; //disable the bootapp if a watchdog reset is going to be used 3823c: 10 92 fc 1f sts 0x1FFC, r1 ; 0x801ffc <__bss_end+0x7e3> 38240: 10 92 fd 1f sts 0x1FFD, r1 ; 0x801ffd <__bss_end+0x7e4> 38244: 10 92 fe 1f sts 0x1FFE, r1 ; 0x801ffe <__bss_end+0x7e5> 38248: 10 92 ff 1f sts 0x1FFF, r1 ; 0x801fff <__bss_end+0x7e6> pagelen_t length; // Use the planner's queue for the receive / transmit buffers. // uint8_t *buff = (uint8_t*)block_buffer; uint8_t buff[260]; // bitmap of pages to be written. Bit is set to 1 if the page has already been erased. uint8_t pages_erased = 0; 3824c: cb 5f subi r28, 0xFB ; 251 3824e: de 4f sbci r29, 0xFE ; 254 38250: 18 82 st Y, r1 38252: c5 50 subi r28, 0x05 ; 5 38254: 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; 38256: 10 e0 ldi r17, 0x00 ; 0 38258: 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; 3825a: 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); 3825c: ae 01 movw r20, r28 3825e: 4f 5f subi r20, 0xFF ; 255 38260: 5f 4f sbci r21, 0xFF ; 255 38262: 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(); 38264: 0f 94 6f a1 call 0x342de ; 0x342de if(ch == STK_GET_PARAMETER) { 38268: 81 34 cpi r24, 0x41 ; 65 3826a: a9 f4 brne .+42 ; 0x38296 unsigned char which = getch(); 3826c: 0f 94 6f a1 call 0x342de ; 0x342de 38270: e8 2e mov r14, r24 verifySpace(); 38272: 0f 94 e7 a3 call 0x347ce ; 0x347ce /* * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ if (which == STK_SW_MINOR) { 38276: 52 e8 ldi r21, 0x82 ; 130 putch(optiboot_version & 0xFF); 38278: 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) { 3827a: e5 16 cp r14, r21 3827c: 21 f0 breq .+8 ; 0x38286 putch(optiboot_version & 0xFF); } else if (which == STK_SW_MAJOR) { 3827e: 81 e8 ldi r24, 0x81 ; 129 38280: e8 12 cpse r14, r24 38282: 07 c0 rjmp .+14 ; 0x38292 putch(optiboot_version >> 8); 38284: 86 e0 ldi r24, 0x06 ; 6 38286: 0f 94 68 a1 call 0x342d0 ; 0x342d0 } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); } putch(STK_OK); 3828a: 80 e1 ldi r24, 0x10 ; 16 3828c: 0f 94 68 a1 call 0x342d0 ; 0x342d0 38290: e9 cf rjmp .-46 ; 0x38264 } else { /* * GET PARAMETER returns a generic 0x03 reply for * other parameters - enough to keep Avrdude happy */ putch(0x03); 38292: 83 e0 ldi r24, 0x03 ; 3 38294: f8 cf rjmp .-16 ; 0x38286 } } else if(ch == STK_SET_DEVICE) { 38296: 82 34 cpi r24, 0x42 ; 66 38298: 21 f4 brne .+8 ; 0x382a2 // SET DEVICE is ignored getNch(20); 3829a: 84 e1 ldi r24, 0x14 ; 20 } else if(ch == STK_SET_DEVICE_EXT) { // SET DEVICE EXT is ignored getNch(5); 3829c: 0f 94 f3 a3 call 0x347e6 ; 0x347e6 382a0: f4 cf rjmp .-24 ; 0x3828a } else if(ch == STK_SET_DEVICE) { // SET DEVICE is ignored getNch(20); } else if(ch == STK_SET_DEVICE_EXT) { 382a2: 85 34 cpi r24, 0x45 ; 69 382a4: 11 f4 brne .+4 ; 0x382aa // SET DEVICE EXT is ignored getNch(5); 382a6: 85 e0 ldi r24, 0x05 ; 5 382a8: f9 cf rjmp .-14 ; 0x3829c } else if(ch == STK_LOAD_ADDRESS) { 382aa: 85 35 cpi r24, 0x55 ; 85 382ac: c9 f4 brne .+50 ; 0x382e0 // 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(); 382ae: 0f 94 6f a1 call 0x342de ; 0x342de 382b2: 08 2f mov r16, r24 newAddress |= getch(); 382b4: 0f 94 6f a1 call 0x342de ; 0x342de 382b8: 08 2b or r16, r24 382ba: 10 e0 ldi r17, 0x00 ; 0 newAddress |= (((uint16_t)getch()) << 8); 382bc: 0f 94 6f a1 call 0x342de ; 0x342de 382c0: 18 2b or r17, r24 newAddress |= (((uint16_t)getch()) << 8); 382c2: 0f 94 6f a1 call 0x342de ; 0x342de 382c6: 18 2b or r17, r24 // Transfer top bit to LSB in rampz if (newAddress & 0x8000) 382c8: 17 ff sbrs r17, 7 382ca: 07 c0 rjmp .+14 ; 0x382da rampz |= 0x01; 382cc: 68 94 set 382ce: f0 f8 bld r15, 0 else rampz &= 0xFE; newAddress += newAddress; // Convert from word address to byte address 382d0: 00 0f add r16, r16 382d2: 11 1f adc r17, r17 wdt_enable(WATCHDOG_SOFT_RESET_VALUE); verifySpace(); } else { // This covers the response to commands like STK_ENTER_PROGMODE verifySpace(); 382d4: 0f 94 e7 a3 call 0x347ce ; 0x347ce 382d8: d8 cf rjmp .-80 ; 0x3828a newAddress |= (((uint16_t)getch()) << 8); // Transfer top bit to LSB in rampz if (newAddress & 0x8000) rampz |= 0x01; else rampz &= 0xFE; 382da: e8 94 clt 382dc: f0 f8 bld r15, 0 382de: f8 cf rjmp .-16 ; 0x382d0 newAddress += newAddress; // Convert from word address to byte address address = newAddress; verifySpace(); } else if(ch == STK_UNIVERSAL) { 382e0: 86 35 cpi r24, 0x56 ; 86 382e2: a1 f4 brne .+40 ; 0x3830c // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB if ( AVR_OP_LOAD_EXT_ADDR == getch() ) { 382e4: 0f 94 6f a1 call 0x342de ; 0x342de 382e8: 8d 34 cpi r24, 0x4D ; 77 382ea: 71 f4 brne .+28 ; 0x38308 // get address getch(); // get '0' 382ec: 0f 94 6f a1 call 0x342de ; 0x342de rampz = (rampz & 0x01) | ((getch() << 1) & 0xff); // get address and put it in rampz 382f0: 0f 94 6f a1 call 0x342de ; 0x342de 382f4: 9f 2d mov r25, r15 382f6: 91 70 andi r25, 0x01 ; 1 382f8: f9 2e mov r15, r25 382fa: 88 0f add r24, r24 382fc: f8 2a or r15, r24 getNch(1); // get last '0' 382fe: 81 e0 ldi r24, 0x01 ; 1 // response putch(0x00); } else { // everything else is ignored getNch(3); 38300: 0f 94 f3 a3 call 0x347e6 ; 0x347e6 putch(0x00); 38304: 80 e0 ldi r24, 0x00 ; 0 38306: bf cf rjmp .-130 ; 0x38286 // response putch(0x00); } else { // everything else is ignored getNch(3); 38308: 83 e0 ldi r24, 0x03 ; 3 3830a: fa cf rjmp .-12 ; 0x38300 putch(0x00); } } /* Write memory, length is big endian and is in bytes */ else if(ch == STK_PROG_PAGE) { 3830c: 84 36 cpi r24, 0x64 ; 100 3830e: 09 f0 breq .+2 ; 0x38312 38310: 77 c0 rjmp .+238 ; 0x38400 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; 38312: 0f 94 6f a1 call 0x342de ; 0x342de 38316: b8 2e mov r11, r24 length |= ((pagelen_t)getch()) << 8; 38318: 0f 94 6f a1 call 0x342de ; 0x342de 3831c: c8 2e mov r12, r24 length |= getch(); 3831e: 0f 94 6f a1 call 0x342de ; 0x342de 38322: e8 2e mov r14, r24 length |= getch(); 38324: 0f 94 6f a1 call 0x342de ; 0x342de 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; 38328: d1 2c mov r13, r1 3832a: dc 2c mov r13, r12 3832c: cc 24 eor r12, r12 3832e: db 28 or r13, r11 length |= getch(); length |= getch(); 38330: 8e 29 or r24, r14 38332: c8 2a or r12, r24 savelength = length; // Read the destination type. It should always be 'F' as flash. desttype = getch(); 38334: 0f 94 6f a1 call 0x342de ; 0x342de 38338: 58 2e mov r5, r24 3833a: fe 01 movw r30, r28 3833c: 31 96 adiw r30, 0x01 ; 1 3833e: 5f 01 movw r10, r30 38340: 46 01 movw r8, r12 38342: 8e 0e add r8, r30 38344: 9f 1e adc r9, r31 38346: ee 2e mov r14, r30 38348: ca 5f subi r28, 0xFA ; 250 3834a: de 4f sbci r29, 0xFE ; 254 3834c: b8 82 st Y, r11 3834e: c6 50 subi r28, 0x06 ; 6 38350: d1 40 sbci r29, 0x01 ; 1 // read a page worth of contents bufPtr = buff; do *bufPtr++ = getch(); 38352: 0f 94 6f a1 call 0x342de ; 0x342de 38356: f5 01 movw r30, r10 38358: 81 93 st Z+, r24 3835a: 5f 01 movw r10, r30 while (--length); 3835c: 8e 16 cp r8, r30 3835e: 9f 06 cpc r9, r31 38360: c1 f7 brne .-16 ; 0x38352 // Read command terminator, start reply verifySpace(); 38362: 0f 94 e7 a3 call 0x347ce ; 0x347ce if (desttype == 'E') { 38366: f5 e4 ldi r31, 0x45 ; 69 38368: 5f 12 cpse r5, r31 3836a: 01 c0 rjmp .+2 ; 0x3836e 3836c: ff cf rjmp .-2 ; 0x3836c while (1) ; // Error: wait for WDT } else { uint32_t addr = (((uint32_t)rampz) << 16) | address; 3836e: 18 01 movw r2, r16 38370: 51 2c mov r5, r1 38372: 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) { 38374: 01 15 cp r16, r1 38376: 11 05 cpc r17, r1 38378: 61 f5 brne .+88 ; 0x383d2 3837a: 42 01 movw r8, r4 3837c: aa 24 eor r10, r10 3837e: bb 24 eor r11, r11 38380: cb 5f subi r28, 0xFB ; 251 38382: de 4f sbci r29, 0xFE ; 254 38384: 28 81 ld r18, Y 38386: c5 50 subi r28, 0x05 ; 5 38388: d1 40 sbci r29, 0x01 ; 1 3838a: 82 2f mov r24, r18 3838c: 90 e0 ldi r25, 0x00 ; 0 3838e: 08 2c mov r0, r8 38390: 02 c0 rjmp .+4 ; 0x38396 38392: 95 95 asr r25 38394: 87 95 ror r24 38396: 0a 94 dec r0 38398: e2 f7 brpl .-8 ; 0x38392 3839a: 80 fd sbrc r24, 0 3839c: 1a c0 rjmp .+52 ; 0x383d2 xflash_wait_busy(); 3839e: 0e 94 23 e3 call 0x1c646 ; 0x1c646 xflash_enable_wr(); 383a2: 0e 94 bf e3 call 0x1c77e ; 0x1c77e return xflash_erase(_CMD_BLOCK32_ERASE, addr); } void xflash_block64_erase(uint32_t addr) { return xflash_erase(_CMD_BLOCK64_ERASE, addr); 383a6: b2 01 movw r22, r4 383a8: a8 01 movw r20, r16 383aa: 88 ed ldi r24, 0xD8 ; 216 383ac: 0e 94 41 e3 call 0x1c682 ; 0x1c682 xflash_block64_erase(addr); pages_erased |= (1 << (addr >> 16)); 383b0: 81 e0 ldi r24, 0x01 ; 1 383b2: 90 e0 ldi r25, 0x00 ; 0 383b4: 01 c0 rjmp .+2 ; 0x383b8 383b6: 88 0f add r24, r24 383b8: 8a 94 dec r8 383ba: ea f7 brpl .-6 ; 0x383b6 383bc: cb 5f subi r28, 0xFB ; 251 383be: de 4f sbci r29, 0xFE ; 254 383c0: 48 81 ld r20, Y 383c2: c5 50 subi r28, 0x05 ; 5 383c4: d1 40 sbci r29, 0x01 ; 1 383c6: 48 2b or r20, r24 383c8: cb 5f subi r28, 0xFB ; 251 383ca: de 4f sbci r29, 0xFE ; 254 383cc: 48 83 st Y, r20 383ce: c5 50 subi r28, 0x05 ; 5 383d0: d1 40 sbci r29, 0x01 ; 1 } xflash_wait_busy(); 383d2: 0e 94 23 e3 call 0x1c646 ; 0x1c646 xflash_enable_wr(); 383d6: 0e 94 bf e3 call 0x1c77e ; 0x1c77e xflash_page_program(addr, buff, savelength); 383da: 96 01 movw r18, r12 383dc: 4e 2d mov r20, r14 383de: ca 5f subi r28, 0xFA ; 250 383e0: de 4f sbci r29, 0xFE ; 254 383e2: 58 81 ld r21, Y 383e4: c6 50 subi r28, 0x06 ; 6 383e6: d1 40 sbci r29, 0x01 ; 1 383e8: c2 01 movw r24, r4 383ea: b1 01 movw r22, r2 383ec: 0e 94 46 e3 call 0x1c68c ; 0x1c68c xflash_wait_busy(); 383f0: 0e 94 23 e3 call 0x1c646 ; 0x1c646 _CS_HIGH(); } void xflash_disable_wr(void) { _CS_LOW(); 383f4: 45 98 cbi 0x08, 5 ; 8 _SPI_TX(_CMD_DISABLE_WR); // send command 0x04 383f6: 84 e0 ldi r24, 0x04 ; 4 383f8: 0e 94 1d e3 call 0x1c63a ; 0x1c63a _CS_HIGH(); 383fc: 45 9a sbi 0x08, 5 ; 8 383fe: 45 cf rjmp .-374 ; 0x3828a xflash_disable_wr(); } } /* Read memory block mode, length is big endian. */ else if(ch == STK_READ_PAGE) { 38400: 84 37 cpi r24, 0x74 ; 116 38402: 81 f5 brne .+96 ; 0x38464 uint32_t addr = (((uint32_t)rampz) << 16) | address; 38404: b1 2c mov r11, r1 38406: 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; 38408: 0f 94 6f a1 call 0x342de ; 0x342de 3840c: d8 2e mov r13, r24 length |= ((pagelen_t)getch()) << 8; 3840e: 0f 94 6f a1 call 0x342de ; 0x342de 38412: c8 2e mov r12, r24 length |= getch(); 38414: 0f 94 6f a1 call 0x342de ; 0x342de 38418: e8 2e mov r14, r24 length |= getch(); 3841a: 0f 94 6f a1 call 0x342de ; 0x342de 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; 3841e: 2c 2d mov r18, r12 38420: 30 e0 ldi r19, 0x00 ; 0 38422: 32 2f mov r19, r18 38424: 22 27 eor r18, r18 38426: f9 01 movw r30, r18 38428: fd 29 or r31, r13 3842a: 6f 01 movw r12, r30 length |= getch(); length |= getch(); 3842c: 8e 29 or r24, r14 3842e: c8 2a or r12, r24 // Read the destination type. It should always be 'F' as flash. It is not checked. (void)getch(); 38430: 0f 94 6f a1 call 0x342de ; 0x342de verifySpace(); 38434: 0f 94 e7 a3 call 0x347ce ; 0x347ce xflash_wait_busy(); 38438: 0e 94 23 e3 call 0x1c646 ; 0x1c646 xflash_rd_data(addr, buff, length); 3843c: 96 01 movw r18, r12 3843e: a3 01 movw r20, r6 38440: c5 01 movw r24, r10 38442: b8 01 movw r22, r16 38444: 0e 94 66 e3 call 0x1c6cc ; 0x1c6cc 38448: 53 01 movw r10, r6 for (i = 0; i < length; ++ i) 3844a: c5 01 movw r24, r10 3844c: 86 19 sub r24, r6 3844e: 97 09 sbc r25, r7 38450: 8c 15 cp r24, r12 38452: 9d 05 cpc r25, r13 38454: 08 f0 brcs .+2 ; 0x38458 38456: 19 cf rjmp .-462 ; 0x3828a putch(buff[i]); 38458: f5 01 movw r30, r10 3845a: 81 91 ld r24, Z+ 3845c: 5f 01 movw r10, r30 3845e: 0f 94 68 a1 call 0x342d0 ; 0x342d0 38462: f3 cf rjmp .-26 ; 0x3844a } /* Get device signature bytes */ else if(ch == STK_READ_SIGN) { 38464: 85 37 cpi r24, 0x75 ; 117 38466: 51 f4 brne .+20 ; 0x3847c // READ SIGN - return what Avrdude wants to hear verifySpace(); 38468: 0f 94 e7 a3 call 0x347ce ; 0x347ce putch(XFLASH_SIGNATURE_0); 3846c: 8e e1 ldi r24, 0x1E ; 30 3846e: 0f 94 68 a1 call 0x342d0 ; 0x342d0 putch(XFLASH_SIGNATURE_1); 38472: 88 e9 ldi r24, 0x98 ; 152 38474: 0f 94 68 a1 call 0x342d0 ; 0x342d0 putch(XFLASH_SIGNATURE_2); 38478: 81 e0 ldi r24, 0x01 ; 1 3847a: 05 cf rjmp .-502 ; 0x38286 } else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */ 3847c: 81 35 cpi r24, 0x51 ; 81 3847e: 09 f0 breq .+2 ; 0x38482 38480: 29 cf rjmp .-430 ; 0x382d4 : "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" ); 38482: f8 e1 ldi r31, 0x18 ; 24 38484: 28 e0 ldi r18, 0x08 ; 8 38486: 0f b6 in r0, 0x3f ; 63 38488: f8 94 cli 3848a: a8 95 wdr 3848c: f0 93 60 00 sts 0x0060, r31 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38490: 0f be out 0x3f, r0 ; 63 38492: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 38496: 1e cf rjmp .-452 ; 0x382d4 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; 38498: 81 e0 ldi r24, 0x01 ; 1 3849a: 7c ce rjmp .-776 ; 0x38194 0003849c : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 3849c: 81 e0 ldi r24, 0x01 ; 1 3849e: 0c 94 da 6f jmp 0xdfb4 ; 0xdfb4 000384a2 : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 384a2: 0f 93 push r16 384a4: 1f 93 push r17 384a6: cf 93 push r28 384a8: 8c 01 movw r16, r24 384aa: c6 2f mov r28, r22 lcd_update_enable(false); 384ac: 80 e0 ldi r24, 0x00 ; 0 384ae: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); 384b2: 0e 94 c8 6f call 0xdf90 ; 0xdf90 lcd_puts_at_P(0, 1, pgmS); 384b6: a8 01 movw r20, r16 384b8: 61 e0 ldi r22, 0x01 ; 1 384ba: 80 e0 ldi r24, 0x00 ; 0 384bc: 0e 94 a9 6f call 0xdf52 ; 0xdf52 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 384c0: 80 e2 ldi r24, 0x20 ; 32 384c2: 0e 94 44 70 call 0xe088 ; 0xe088 lcd_print(' '); lcd_print(slot + 1); 384c6: 6c 2f mov r22, r28 384c8: 70 e0 ldi r23, 0x00 ; 0 384ca: 6f 5f subi r22, 0xFF ; 255 384cc: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 384ce: 07 2e mov r0, r23 384d0: 00 0c add r0, r0 384d2: 88 0b sbc r24, r24 384d4: 99 0b sbc r25, r25 } 384d6: cf 91 pop r28 384d8: 1f 91 pop r17 384da: 0f 91 pop r16 384dc: 0c 94 4e 71 jmp 0xe29c ; 0xe29c 000384e0 : 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); 384e0: 82 ed ldi r24, 0xD2 ; 210 384e2: 9e e0 ldi r25, 0x0E ; 14 384e4: 0e 94 b3 77 call 0xef66 ; 0xef66 eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 384e8: 83 ed ldi r24, 0xD3 ; 211 384ea: 9e e0 ldi r25, 0x0E ; 14 384ec: 0c 94 a6 77 jmp 0xef4c ; 0xef4c 000384f0 : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 384f0: 41 e0 ldi r20, 0x01 ; 1 384f2: 80 91 6e 13 lds r24, 0x136E ; 0x80136e 384f6: 81 11 cpse r24, r1 384f8: 01 c0 rjmp .+2 ; 0x384fc 384fa: 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'); 384fc: 40 5d subi r20, 0xD0 ; 208 384fe: 62 e0 ldi r22, 0x02 ; 2 38500: 83 e0 ldi r24, 0x03 ; 3 38502: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 38506: 0e 94 bc e4 call 0x1c978 ; 0x1c978 3850a: 40 e3 ldi r20, 0x30 ; 48 3850c: 48 0f add r20, r24 3850e: 62 e0 ldi r22, 0x02 ; 2 38510: 88 e0 ldi r24, 0x08 ; 8 38512: 0e 94 b5 6f call 0xdf6a ; 0xdf6a // print active/changing filament slot lcd_set_cursor(10, 2); 38516: 62 e0 ldi r22, 0x02 ; 2 38518: 8a e0 ldi r24, 0x0A ; 10 3851a: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcdui_print_extruder(); 3851e: 0f 94 a9 37 call 0x26f52 ; 0x26f52 // Print active extruder temperature lcd_set_cursor(16, 2); 38522: 62 e0 ldi r22, 0x02 ; 2 38524: 80 e1 ldi r24, 0x10 ; 16 38526: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 3852a: 20 e0 ldi r18, 0x00 ; 0 3852c: 30 e0 ldi r19, 0x00 ; 0 3852e: 40 e0 ldi r20, 0x00 ; 0 38530: 5f e3 ldi r21, 0x3F ; 63 38532: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 38536: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 3853a: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 3853e: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 38542: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 38546: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> 3854a: 7f 93 push r23 3854c: 6f 93 push r22 3854e: 8b e3 ldi r24, 0x3B ; 59 38550: 9a ea ldi r25, 0xAA ; 170 38552: 9f 93 push r25 38554: 8f 93 push r24 38556: 0e 94 6e 6f call 0xdedc ; 0xdedc 3855a: 0f 90 pop r0 3855c: 0f 90 pop r0 3855e: 0f 90 pop r0 38560: 0f 90 pop r0 } 38562: 08 95 ret 00038564 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 38564: 8a 30 cpi r24, 0x0A ; 10 38566: 20 f0 brcs .+8 ; 0x38570 38568: 80 31 cpi r24, 0x10 ; 16 3856a: 20 f4 brcc .+8 ; 0x38574 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 3856c: 89 5a subi r24, 0xA9 ; 169 3856e: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 38570: 80 5d subi r24, 0xD0 ; 208 38572: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 38574: 80 e0 ldi r24, 0x00 ; 0 } } 38576: 08 95 ret 00038578 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 38578: 0f 93 push r16 3857a: 1f 93 push r17 3857c: cf 93 push r28 3857e: df 93 push r29 38580: 08 2f mov r16, r24 38582: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 38584: 90 e0 ldi r25, 0x00 ; 0 38586: 24 e0 ldi r18, 0x04 ; 4 38588: 95 95 asr r25 3858a: 87 95 ror r24 3858c: 2a 95 dec r18 3858e: e1 f7 brne .-8 ; 0x38588 uint8_t charsOut = 1; 38590: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 38592: 00 97 sbiw r24, 0x00 ; 0 38594: 21 f0 breq .+8 ; 0x3859e *dst = Nibble2Char(v); 38596: 0f 94 b2 c2 call 0x38564 ; 0x38564 3859a: 89 93 st Y+, r24 ++dst; charsOut = 2; 3859c: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 3859e: 80 2f mov r24, r16 385a0: 8f 70 andi r24, 0x0F ; 15 385a2: 0f 94 b2 c2 call 0x38564 ; 0x38564 385a6: 88 83 st Y, r24 return charsOut; } 385a8: 81 2f mov r24, r17 385aa: df 91 pop r29 385ac: cf 91 pop r28 385ae: 1f 91 pop r17 385b0: 0f 91 pop r16 385b2: 08 95 ret 000385b4 : } 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) { 385b4: 80 33 cpi r24, 0x30 ; 48 385b6: 30 f0 brcs .+12 ; 0x385c4 385b8: 8a 33 cpi r24, 0x3A ; 58 385ba: 30 f0 brcs .+12 ; 0x385c8 385bc: 9f e9 ldi r25, 0x9F ; 159 385be: 98 0f add r25, r24 385c0: 96 30 cpi r25, 0x06 ; 6 385c2: 20 f0 brcs .+8 ; 0x385cc case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 385c4: 80 e0 ldi r24, 0x00 ; 0 } } 385c6: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 385c8: 80 53 subi r24, 0x30 ; 48 385ca: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 385cc: 87 55 subi r24, 0x57 ; 87 385ce: 08 95 ret 000385d0 : /// 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 { 385d0: cf 93 push r28 385d2: df 93 push r29 385d4: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 385d6: 68 81 ld r22, Y 385d8: 80 e0 ldi r24, 0x00 ; 0 385da: 0f 94 7b a1 call 0x342f6 ; 0x342f6 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 385de: 69 81 ldd r22, Y+1 ; 0x01 385e0: 0f 94 7b a1 call 0x342f6 ; 0x342f6 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 385e4: 6a 81 ldd r22, Y+2 ; 0x02 385e6: 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]); 385e8: 0f 94 7b a1 call 0x342f6 ; 0x342f6 385ec: 6c 2f mov r22, r28 return crc; } 385ee: df 91 pop r29 385f0: cf 91 pop r28 385f2: 0d 94 7b a1 jmp 0x342f6 ; 0x342f6 000385f6 : 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 { 385f6: cf 93 push r28 385f8: df 93 push r29 385fa: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 385fc: 0f 94 e8 c2 call 0x385d0 ; 0x385d0 crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 38600: 6d 81 ldd r22, Y+5 ; 0x05 38602: 0f 94 7b a1 call 0x342f6 ; 0x342f6 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 38606: 6e 81 ldd r22, Y+6 ; 0x06 38608: cf 81 ldd r28, Y+7 ; 0x07 3860a: 0f 94 7b a1 call 0x342f6 ; 0x342f6 3860e: 6c 2f mov r22, r28 return crc; } 38610: df 91 pop r29 38612: cf 91 pop r28 38614: 0d 94 7b a1 jmp 0x342f6 ; 0x342f6 00038618 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 38618: cf 93 push r28 3861a: df 93 push r29 3861c: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 3861e: 68 83 st Y, r22 38620: 49 83 std Y+1, r20 ; 0x01 38622: 1b 82 std Y+3, r1 ; 0x03 38624: 1a 82 std Y+2, r1 ; 0x02 38626: 0f 94 e8 c2 call 0x385d0 ; 0x385d0 3862a: 8c 83 std Y+4, r24 ; 0x04 } 3862c: df 91 pop r29 3862e: cf 91 pop r28 38630: 08 95 ret 00038632 : void power_off() { } void reset() { #ifdef MMU_HWRESET // HW - pulse reset pin WRITE(MMU_RST_PIN, 0); 38632: 9f b7 in r25, 0x3f ; 63 38634: f8 94 cli 38636: e5 e0 ldi r30, 0x05 ; 5 38638: f1 e0 ldi r31, 0x01 ; 1 3863a: 80 81 ld r24, Z 3863c: 8f 7d andi r24, 0xDF ; 223 3863e: 80 83 st Z, r24 38640: 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); 38642: 8f e8 ldi r24, 0x8F ; 143 38644: 91 e0 ldi r25, 0x01 ; 1 38646: 01 97 sbiw r24, 0x01 ; 1 38648: f1 f7 brne .-4 ; 0x38646 3864a: 00 c0 rjmp .+0 ; 0x3864c 3864c: 00 00 nop _delay_us(100); WRITE(MMU_RST_PIN, 1); 3864e: 9f b7 in r25, 0x3f ; 63 38650: f8 94 cli 38652: 80 81 ld r24, Z 38654: 80 62 ori r24, 0x20 ; 32 38656: 80 83 st Z, r24 38658: 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 } 3865a: 08 95 ret 0003865c : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 3865c: 14 9a sbi 0x02, 4 ; 2 } 3865e: 08 95 ret 00038660 : 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) { 38660: cf 92 push r12 38662: df 92 push r13 38664: ef 92 push r14 38666: ff 92 push r15 38668: cf 93 push r28 3866a: df 93 push r29 3866c: 69 01 movw r12, r18 3866e: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 38670: c3 e4 ldi r28, 0x43 ; 67 38672: d7 e0 ldi r29, 0x07 ; 7 38674: 9b 01 movw r18, r22 38676: ac 01 movw r20, r24 38678: 6c 85 ldd r22, Y+12 ; 0x0c 3867a: 7d 85 ldd r23, Y+13 ; 0x0d 3867c: 8e 85 ldd r24, Y+14 ; 0x0e 3867e: 9f 85 ldd r25, Y+15 ; 0x0f 38680: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 38684: 6c 87 std Y+12, r22 ; 0x0c 38686: 7d 87 std Y+13, r23 ; 0x0d 38688: 8e 87 std Y+14, r24 ; 0x0e 3868a: 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); 3868c: c7 01 movw r24, r14 3868e: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 38690: df 91 pop r29 38692: cf 91 pop r28 38694: ff 90 pop r15 38696: ef 90 pop r14 38698: df 90 pop r13 3869a: 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); 3869c: 0d 94 93 ba jmp 0x37526 ; 0x37526 000386a0 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 386a0: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 386a4: 0d 94 2c 59 jmp 0x2b258 ; 0x2b258 000386a8 : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 386a8: cf 93 push r28 386aa: df 93 push r29 386ac: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 386ae: 82 ef ldi r24, 0xF2 ; 242 386b0: 99 ea ldi r25, 0xA9 ; 169 386b2: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_MMU2(); 386b6: 85 e3 ldi r24, 0x35 ; 53 386b8: 9a ea ldi r25, 0xAA ; 170 386ba: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 SERIAL_ECHOLNRPGM(msg); 386be: ce 01 movw r24, r28 } 386c0: df 91 pop r29 386c2: 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); 386c4: 0c 94 06 7b jmp 0xf60c ; 0xf60c 000386c8 : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 386c8: 0c 94 bc e4 jmp 0x1c978 ; 0x1c978 000386cc : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 386cc: 89 32 cpi r24, 0x29 ; 41 386ce: 20 e8 ldi r18, 0x80 ; 128 386d0: 92 07 cpc r25, r18 386d2: 09 f4 brne .+2 ; 0x386d6 386d4: 97 c0 rjmp .+302 ; 0x38804 386d6: 08 f0 brcs .+2 ; 0x386da 386d8: 48 c0 rjmp .+144 ; 0x3876a 386da: 86 30 cpi r24, 0x06 ; 6 386dc: 60 e8 ldi r22, 0x80 ; 128 386de: 96 07 cpc r25, r22 386e0: 09 f4 brne .+2 ; 0x386e4 386e2: 9a c0 rjmp .+308 ; 0x38818 386e4: 30 f5 brcc .+76 ; 0x38732 386e6: 83 30 cpi r24, 0x03 ; 3 386e8: 40 e8 ldi r20, 0x80 ; 128 386ea: 94 07 cpc r25, r20 386ec: 09 f4 brne .+2 ; 0x386f0 386ee: 80 c0 rjmp .+256 ; 0x387f0 386f0: a8 f4 brcc .+42 ; 0x3871c 386f2: 81 30 cpi r24, 0x01 ; 1 386f4: 20 e8 ldi r18, 0x80 ; 128 386f6: 92 07 cpc r25, r18 386f8: 09 f4 brne .+2 ; 0x386fc 386fa: 17 c1 rjmp .+558 ; 0x3892a 386fc: 82 30 cpi r24, 0x02 ; 2 386fe: 40 e8 ldi r20, 0x80 ; 128 38700: 94 07 cpc r25, r20 38702: 09 f4 brne .+2 ; 0x38706 38704: 73 c0 rjmp .+230 ; 0x387ec 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); 38706: 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)) { 38708: 86 ff sbrs r24, 6 3870a: 8e c0 rjmp .+284 ; 0x38828 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); 3870c: 22 27 eor r18, r18 3870e: 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) { 38710: 21 15 cp r18, r1 38712: 32 4c sbci r19, 0xC2 ; 194 38714: 09 f0 breq .+2 ; 0x38718 38716: 9e c0 rjmp .+316 ; 0x38854 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 38718: 8e e1 ldi r24, 0x1E ; 30 3871a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3871c: 84 30 cpi r24, 0x04 ; 4 3871e: 60 e8 ldi r22, 0x80 ; 128 38720: 96 07 cpc r25, r22 38722: 09 f4 brne .+2 ; 0x38726 38724: 67 c0 rjmp .+206 ; 0x387f4 38726: 85 30 cpi r24, 0x05 ; 5 38728: 20 e8 ldi r18, 0x80 ; 128 3872a: 92 07 cpc r25, r18 3872c: 61 f7 brne .-40 ; 0x38706 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); 3872e: 84 e2 ldi r24, 0x24 ; 36 38730: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38732: 8a 30 cpi r24, 0x0A ; 10 38734: 40 e8 ldi r20, 0x80 ; 128 38736: 94 07 cpc r25, r20 38738: 09 f4 brne .+2 ; 0x3873c 3873a: 5e c0 rjmp .+188 ; 0x387f8 3873c: 58 f4 brcc .+22 ; 0x38754 3873e: 88 30 cpi r24, 0x08 ; 8 38740: 20 e8 ldi r18, 0x80 ; 128 38742: 92 07 cpc r25, r18 38744: 09 f4 brne .+2 ; 0x38748 38746: 6e c0 rjmp .+220 ; 0x38824 38748: 89 30 cpi r24, 0x09 ; 9 3874a: 40 e8 ldi r20, 0x80 ; 128 3874c: 94 07 cpc r25, r20 3874e: d9 f6 brne .-74 ; 0x38706 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); 38750: 85 e0 ldi r24, 0x05 ; 5 38752: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38754: 8c 30 cpi r24, 0x0C ; 12 38756: 60 e8 ldi r22, 0x80 ; 128 38758: 96 07 cpc r25, r22 3875a: 09 f4 brne .+2 ; 0x3875e 3875c: 51 c0 rjmp .+162 ; 0x38800 3875e: 8d 30 cpi r24, 0x0D ; 13 38760: 20 e8 ldi r18, 0x80 ; 128 38762: 92 07 cpc r25, r18 38764: 81 f6 brne .-96 ; 0x38706 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); 38766: 81 e2 ldi r24, 0x21 ; 33 38768: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 3876a: 8f 32 cpi r24, 0x2F ; 47 3876c: 40 e8 ldi r20, 0x80 ; 128 3876e: 94 07 cpc r25, r20 38770: 09 f4 brne .+2 ; 0x38774 38772: 56 c0 rjmp .+172 ; 0x38820 38774: e0 f4 brcc .+56 ; 0x387ae 38776: 8c 32 cpi r24, 0x2C ; 44 38778: 20 e8 ldi r18, 0x80 ; 128 3877a: 92 07 cpc r25, r18 3877c: 09 f4 brne .+2 ; 0x38780 3877e: 4e c0 rjmp .+156 ; 0x3881c 38780: 58 f4 brcc .+22 ; 0x38798 38782: 8a 32 cpi r24, 0x2A ; 42 38784: 60 e8 ldi r22, 0x80 ; 128 38786: 96 07 cpc r25, r22 38788: c9 f1 breq .+114 ; 0x387fc 3878a: 8b 32 cpi r24, 0x2B ; 43 3878c: 20 e8 ldi r18, 0x80 ; 128 3878e: 92 07 cpc r25, r18 38790: 09 f0 breq .+2 ; 0x38794 38792: b9 cf rjmp .-142 ; 0x38706 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); 38794: 86 e2 ldi r24, 0x26 ; 38 38796: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 38798: 8d 32 cpi r24, 0x2D ; 45 3879a: 40 e8 ldi r20, 0x80 ; 128 3879c: 94 07 cpc r25, r20 3879e: d1 f1 breq .+116 ; 0x38814 387a0: 8e 32 cpi r24, 0x2E ; 46 387a2: 60 e8 ldi r22, 0x80 ; 128 387a4: 96 07 cpc r25, r22 387a6: 09 f0 breq .+2 ; 0x387aa 387a8: ae cf rjmp .-164 ; 0x38706 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); 387aa: 82 e2 ldi r24, 0x22 ; 34 387ac: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 387ae: 87 38 cpi r24, 0x87 ; 135 387b0: 20 e8 ldi r18, 0x80 ; 128 387b2: 92 07 cpc r25, r18 387b4: 49 f1 breq .+82 ; 0x38808 387b6: 58 f4 brcc .+22 ; 0x387ce 387b8: 87 34 cpi r24, 0x47 ; 71 387ba: 60 e8 ldi r22, 0x80 ; 128 387bc: 96 07 cpc r25, r22 387be: 29 f0 breq .+10 ; 0x387ca 387c0: 8b 34 cpi r24, 0x4B ; 75 387c2: 20 e8 ldi r18, 0x80 ; 128 387c4: 92 07 cpc r25, r18 387c6: 09 f0 breq .+2 ; 0x387ca 387c8: 9e cf rjmp .-196 ; 0x38706 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); 387ca: 84 e0 ldi r24, 0x04 ; 4 387cc: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 387ce: 87 30 cpi r24, 0x07 ; 7 387d0: 41 e8 ldi r20, 0x81 ; 129 387d2: 94 07 cpc r25, r20 387d4: d9 f0 breq .+54 ; 0x3880c 387d6: 8b 30 cpi r24, 0x0B ; 11 387d8: 61 e8 ldi r22, 0x81 ; 129 387da: 96 07 cpc r25, r22 387dc: c9 f0 breq .+50 ; 0x38810 387de: 8b 38 cpi r24, 0x8B ; 139 387e0: 20 e8 ldi r18, 0x80 ; 128 387e2: 92 07 cpc r25, r18 387e4: 09 f0 breq .+2 ; 0x387e8 387e6: 8f cf rjmp .-226 ; 0x38706 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); 387e8: 89 e0 ldi r24, 0x09 ; 9 387ea: 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); 387ec: 81 e0 ldi r24, 0x01 ; 1 387ee: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 387f0: 82 e0 ldi r24, 0x02 ; 2 387f2: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 387f4: 83 e0 ldi r24, 0x03 ; 3 387f6: 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); 387f8: 86 e0 ldi r24, 0x06 ; 6 387fa: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 387fc: 87 e0 ldi r24, 0x07 ; 7 387fe: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 38800: 8a e2 ldi r24, 0x2A ; 42 38802: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 38804: 8b e2 ldi r24, 0x2B ; 43 38806: 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); 38808: 88 e0 ldi r24, 0x08 ; 8 3880a: 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); 3880c: 8a e0 ldi r24, 0x0A ; 10 3880e: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 38810: 8b e0 ldi r24, 0x0B ; 11 38812: 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); 38814: 83 e2 ldi r24, 0x23 ; 35 38816: 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); 38818: 85 e2 ldi r24, 0x25 ; 37 3881a: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 3881c: 87 e2 ldi r24, 0x27 ; 39 3881e: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 38820: 88 e2 ldi r24, 0x28 ; 40 38822: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 38824: 89 e2 ldi r24, 0x29 ; 41 38826: 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)) { 38828: 87 ff sbrs r24, 7 3882a: 07 c0 rjmp .+14 ; 0x3883a 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); 3882c: 22 27 eor r18, r18 3882e: 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) { 38830: 21 15 cp r18, r1 38832: 32 4c sbci r19, 0xC2 ; 194 38834: a1 f5 brne .+104 ; 0x3889e return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 38836: 8f e1 ldi r24, 0x1F ; 31 38838: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 3883a: 22 27 eor r18, r18 3883c: 31 70 andi r19, 0x01 ; 1 3883e: 90 ff sbrs r25, 0 38840: 52 c0 rjmp .+164 ; 0x388e6 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); 38842: ac 01 movw r20, r24 38844: 44 27 eor r20, r20 38846: 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) { 38848: 41 15 cp r20, r1 3884a: 52 4c sbci r21, 0xC2 ; 194 3884c: 09 f0 breq .+2 ; 0x38850 3884e: 4b c0 rjmp .+150 ; 0x388e6 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 38850: 80 e2 ldi r24, 0x20 ; 32 38852: 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; 38854: 9c 01 movw r18, r24 38856: 22 27 eor r18, r18 38858: 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)) { 3885a: 23 2b or r18, r19 3885c: 09 f0 breq .+2 ; 0x38860 3885e: 67 c0 rjmp .+206 ; 0x3892e constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 38860: 9c 01 movw r18, r24 38862: 22 27 eor r18, r18 38864: 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)) { 38866: 23 2b or r18, r19 38868: 09 f0 breq .+2 ; 0x3886c 3886a: 63 c0 rjmp .+198 ; 0x38932 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 3886c: 9c 01 movw r18, r24 3886e: 22 27 eor r18, r18 38870: 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)) { 38872: 23 2b or r18, r19 38874: 09 f0 breq .+2 ; 0x38878 38876: 5f c0 rjmp .+190 ; 0x38936 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 38878: 9c 01 movw r18, r24 3887a: 22 27 eor r18, r18 3887c: 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)) { 3887e: 23 2b or r18, r19 38880: 09 f0 breq .+2 ; 0x38884 38882: 5b c0 rjmp .+182 ; 0x3893a constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 38884: 9c 01 movw r18, r24 38886: 22 27 eor r18, r18 38888: 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)) { 3888a: 23 2b or r18, r19 3888c: 09 f0 breq .+2 ; 0x38890 3888e: 57 c0 rjmp .+174 ; 0x3893e constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 38890: 88 27 eor r24, r24 38892: 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)) { 38894: 89 2b or r24, r25 38896: 09 f4 brne .+2 ; 0x3889a 38898: 68 c0 rjmp .+208 ; 0x3896a return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 3889a: 8f e0 ldi r24, 0x0F ; 15 3889c: 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; 3889e: 9c 01 movw r18, r24 388a0: 22 27 eor r18, r18 388a2: 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)) { 388a4: 23 2b or r18, r19 388a6: 09 f0 breq .+2 ; 0x388aa 388a8: 4c c0 rjmp .+152 ; 0x38942 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 388aa: 9c 01 movw r18, r24 388ac: 22 27 eor r18, r18 388ae: 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)) { 388b0: 23 2b or r18, r19 388b2: 09 f0 breq .+2 ; 0x388b6 388b4: 48 c0 rjmp .+144 ; 0x38946 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 388b6: 9c 01 movw r18, r24 388b8: 22 27 eor r18, r18 388ba: 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)) { 388bc: 23 2b or r18, r19 388be: 09 f0 breq .+2 ; 0x388c2 388c0: 44 c0 rjmp .+136 ; 0x3894a constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 388c2: 9c 01 movw r18, r24 388c4: 22 27 eor r18, r18 388c6: 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)) { 388c8: 23 2b or r18, r19 388ca: 09 f0 breq .+2 ; 0x388ce 388cc: 40 c0 rjmp .+128 ; 0x3894e constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 388ce: 9c 01 movw r18, r24 388d0: 22 27 eor r18, r18 388d2: 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)) { 388d4: 23 2b or r18, r19 388d6: e9 f5 brne .+122 ; 0x38952 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 388d8: 88 27 eor r24, r24 388da: 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)) { 388dc: 89 2b or r24, r25 388de: 09 f4 brne .+2 ; 0x388e2 388e0: 44 c0 rjmp .+136 ; 0x3896a return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 388e2: 80 e1 ldi r24, 0x10 ; 16 388e4: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 388e6: 23 2b or r18, r19 388e8: 09 f4 brne .+2 ; 0x388ec 388ea: 3f c0 rjmp .+126 ; 0x3896a 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; 388ec: 9c 01 movw r18, r24 388ee: 22 27 eor r18, r18 388f0: 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)) { 388f2: 23 2b or r18, r19 388f4: 81 f5 brne .+96 ; 0x38956 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 388f6: 9c 01 movw r18, r24 388f8: 22 27 eor r18, r18 388fa: 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)) { 388fc: 23 2b or r18, r19 388fe: 69 f5 brne .+90 ; 0x3895a constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 38900: 9c 01 movw r18, r24 38902: 22 27 eor r18, r18 38904: 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)) { 38906: 23 2b or r18, r19 38908: 51 f5 brne .+84 ; 0x3895e 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; 3890a: 9c 01 movw r18, r24 3890c: 22 27 eor r18, r18 3890e: 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)) { 38910: 23 2b or r18, r19 38912: 39 f5 brne .+78 ; 0x38962 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; 38914: 9c 01 movw r18, r24 38916: 22 27 eor r18, r18 38918: 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)) { 3891a: 23 2b or r18, r19 3891c: 21 f5 brne .+72 ; 0x38966 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; 3891e: 88 27 eor r24, r24 38920: 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)) { 38922: 89 2b or r24, r25 38924: 11 f1 breq .+68 ; 0x3896a return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 38926: 81 e1 ldi r24, 0x11 ; 17 38928: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 3892a: 80 e0 ldi r24, 0x00 ; 0 3892c: 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); 3892e: 82 e1 ldi r24, 0x12 ; 18 38930: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 38932: 85 e1 ldi r24, 0x15 ; 21 38934: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 38936: 88 e1 ldi r24, 0x18 ; 24 38938: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 3893a: 8b e1 ldi r24, 0x1B ; 27 3893c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 3893e: 8c e0 ldi r24, 0x0C ; 12 38940: 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); 38942: 83 e1 ldi r24, 0x13 ; 19 38944: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 38946: 86 e1 ldi r24, 0x16 ; 22 38948: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 3894a: 89 e1 ldi r24, 0x19 ; 25 3894c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 3894e: 8c e1 ldi r24, 0x1C ; 28 38950: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 38952: 8d e0 ldi r24, 0x0D ; 13 38954: 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); 38956: 84 e1 ldi r24, 0x14 ; 20 38958: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 3895a: 87 e1 ldi r24, 0x17 ; 23 3895c: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 3895e: 8a e1 ldi r24, 0x1A ; 26 38960: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 38962: 8d e1 ldi r24, 0x1D ; 29 38964: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 38966: 8e e0 ldi r24, 0x0E ; 14 38968: 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); 3896a: 8c e2 ldi r24, 0x2C ; 44 } 3896c: 08 95 ret 0003896e : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 3896e: cf 92 push r12 38970: df 92 push r13 38972: ef 92 push r14 38974: ff 92 push r15 38976: 0f 93 push r16 38978: 1f 93 push r17 3897a: cf 93 push r28 3897c: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 3897e: 20 91 69 13 lds r18, 0x1369 ; 0x801369 38982: 30 91 6a 13 lds r19, 0x136A ; 0x80136a 38986: 21 30 cpi r18, 0x01 ; 1 38988: 31 05 cpc r19, r1 3898a: 39 f4 brne .+14 ; 0x3899a 3898c: 20 91 92 13 lds r18, 0x1392 ; 0x801392 38990: 21 30 cpi r18, 0x01 ; 1 38992: 19 f4 brne .+6 ; 0x3899a // 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; 38994: 22 e0 ldi r18, 0x02 ; 2 38996: 20 93 d2 17 sts 0x17D2, r18 ; 0x8017d2 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 3899a: 0f 94 66 c3 call 0x386cc ; 0x386cc 3899e: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 389a0: 80 91 d2 17 lds r24, 0x17D2 ; 0x8017d2 389a4: 81 30 cpi r24, 0x01 ; 1 389a6: 09 f4 brne .+2 ; 0x389aa 389a8: 64 c0 rjmp .+200 ; 0x38a72 389aa: 60 f0 brcs .+24 ; 0x389c4 389ac: 82 30 cpi r24, 0x02 ; 2 389ae: 09 f4 brne .+2 ; 0x389b2 389b0: f4 c0 rjmp .+488 ; 0x38b9a ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 389b2: df 91 pop r29 389b4: cf 91 pop r28 389b6: 1f 91 pop r17 389b8: 0f 91 pop r16 389ba: ff 90 pop r15 389bc: ef 90 pop r14 389be: df 90 pop r13 389c0: cf 90 pop r12 389c2: 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); 389c4: 84 e0 ldi r24, 0x04 ; 4 389c6: 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); 389ca: 0d 2f mov r16, r29 389cc: 10 e0 ldi r17, 0x00 ; 0 389ce: f8 01 movw r30, r16 389d0: e1 56 subi r30, 0x61 ; 97 389d2: f5 45 sbci r31, 0x55 ; 85 389d4: 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); 389d6: fc 2e mov r15, r28 389d8: f2 94 swap r15 389da: 6f e0 ldi r22, 0x0F ; 15 389dc: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 389de: 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); 389e0: 80 e0 ldi r24, 0x00 ; 0 389e2: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_clear(); 389e6: 0e 94 c8 6f call 0xdf90 ; 0xdf90 // 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); 389ea: 00 0f add r16, r16 389ec: 11 1f adc r17, r17 389ee: f8 01 movw r30, r16 389f0: e4 53 subi r30, 0x34 ; 52 389f2: f5 45 sbci r31, 0x55 ; 85 389f4: c5 90 lpm r12, Z+ 389f6: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 389f8: 05 55 subi r16, 0x55 ; 85 389fa: 18 45 sbci r17, 0x58 ; 88 389fc: f8 01 movw r30, r16 389fe: 85 91 lpm r24, Z+ 38a00: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 38a02: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 38a06: df 92 push r13 38a08: cf 92 push r12 38a0a: 9f 93 push r25 38a0c: 8f 93 push r24 38a0e: 88 e3 ldi r24, 0x38 ; 56 38a10: 9b ea ldi r25, 0xAB ; 171 38a12: 9f 93 push r25 38a14: 8f 93 push r24 38a16: 0e 94 6e 6f call 0xdedc ; 0xdedc 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)); 38a1a: 43 e2 ldi r20, 0x23 ; 35 38a1c: 58 ea ldi r21, 0xA8 ; 168 38a1e: 62 e0 ldi r22, 0x02 ; 2 38a20: 80 e0 ldi r24, 0x00 ; 0 38a22: 0e 94 a9 6f call 0xdf52 ; 0xdf52 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()); 38a26: 0f 90 pop r0 38a28: 0f 90 pop r0 38a2a: 0f 90 pop r0 38a2c: 0f 90 pop r0 38a2e: 0f 90 pop r0 38a30: 0f 90 pop r0 38a32: f1 10 cpse r15, r1 38a34: c6 c0 rjmp .+396 ; 0x38bc2 38a36: 10 e0 ldi r17, 0x00 ; 0 38a38: 00 e0 ldi r16, 0x00 ; 0 38a3a: 42 e1 ldi r20, 0x12 ; 18 38a3c: e4 2e mov r14, r20 38a3e: 58 ef ldi r21, 0xF8 ; 248 38a40: c5 2e mov r12, r21 38a42: 50 e7 ldi r21, 0x70 ; 112 38a44: 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); 38a46: ec 2f mov r30, r28 38a48: f0 e0 ldi r31, 0x00 ; 0 38a4a: ee 0f add r30, r30 38a4c: ff 1f adc r31, r31 38a4e: ec 5d subi r30, 0xDC ; 220 38a50: f4 45 sbci r31, 0x54 ; 84 38a52: 85 91 lpm r24, Z+ 38a54: 94 91 lpm r25, Z 38a56: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 38a5a: bc 01 movw r22, r24 38a5c: 81 e0 ldi r24, 0x01 ; 1 38a5e: f1 10 cpse r15, r1 38a60: 01 c0 rjmp .+2 ; 0x38a64 38a62: 80 e0 ldi r24, 0x00 ; 0 38a64: 2e 2d mov r18, r14 38a66: a6 01 movw r20, r12 38a68: 0f 94 34 35 call 0x26a68 ; 0x26a68 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 38a6c: 81 e0 ldi r24, 0x01 ; 1 38a6e: 80 93 d2 17 sts 0x17D2, r24 ; 0x8017d2 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 38a72: 81 e0 ldi r24, 0x01 ; 1 38a74: 80 93 74 07 sts 0x0774, r24 ; 0x800774 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.509> ReportErrorHookDynamicRender(); // Render dynamic characters 38a78: 0f 94 78 c2 call 0x384f0 ; 0x384f0 sound_wait_for_user(); 38a7c: 0f 94 45 6b call 0x2d68a ; 0x2d68a 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); 38a80: 0d 2f mov r16, r29 38a82: 10 e0 ldi r17, 0x00 ; 0 38a84: f8 01 movw r30, r16 38a86: e1 56 subi r30, 0x61 ; 97 38a88: f5 45 sbci r31, 0x55 ; 85 38a8a: 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); 38a8c: dc 2f mov r29, r28 38a8e: d2 95 swap r29 38a90: 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; 38a92: 80 91 ca 17 lds r24, 0x17CA ; 0x8017ca 38a96: 81 11 cpse r24, r1 38a98: 09 c0 rjmp .+18 ; 0x38aac 38a9a: 81 e0 ldi r24, 0x01 ; 1 38a9c: d1 11 cpse r29, r1 38a9e: 01 c0 rjmp .+2 ; 0x38aa2 38aa0: 80 e0 ldi r24, 0x00 ; 0 38aa2: 80 93 c9 17 sts 0x17C9, r24 ; 0x8017c9 38aa6: 81 e0 ldi r24, 0x01 ; 1 38aa8: 80 93 ca 17 sts 0x17CA, r24 ; 0x8017ca static int8_t choice_selected = -1; if (reset_button_selection) { 38aac: 80 91 c8 17 lds r24, 0x17C8 ; 0x8017c8 38ab0: 88 23 and r24, r24 38ab2: 41 f0 breq .+16 ; 0x38ac4 // 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; 38ab4: 81 e0 ldi r24, 0x01 ; 1 38ab6: d1 11 cpse r29, r1 38ab8: 01 c0 rjmp .+2 ; 0x38abc 38aba: 80 e0 ldi r24, 0x00 ; 0 38abc: 80 93 c9 17 sts 0x17C9, r24 ; 0x8017c9 choice_selected = -1; reset_button_selection = 0; 38ac0: 10 92 c8 17 sts 0x17C8, r1 ; 0x8017c8 } // Check if knob was rotated if (lcd_encoder) { 38ac4: 20 91 37 05 lds r18, 0x0537 ; 0x800537 38ac8: 30 91 38 05 lds r19, 0x0538 ; 0x800538 38acc: 21 15 cp r18, r1 38ace: 31 05 cpc r19, r1 38ad0: b9 f1 breq .+110 ; 0x38b40 38ad2: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 38ad6: dd 23 and r29, r29 38ad8: 61 f0 breq .+24 ; 0x38af2 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38ada: 37 ff sbrs r19, 7 38adc: 06 c0 rjmp .+12 ; 0x38aea 38ade: 88 23 and r24, r24 38ae0: 69 f0 breq .+26 ; 0x38afc // Rotating knob counter clockwise current_selection--; 38ae2: 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; 38ae4: 80 93 c9 17 sts 0x17C9, r24 ; 0x8017c9 38ae8: 09 c0 rjmp .+18 ; 0x38afc 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) { 38aea: 82 30 cpi r24, 0x02 ; 2 38aec: 39 f0 breq .+14 ; 0x38afc // Rotating knob clockwise current_selection++; 38aee: 8f 5f subi r24, 0xFF ; 255 38af0: f9 cf rjmp .-14 ; 0x38ae4 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 38af2: 37 ff sbrs r19, 7 38af4: 41 c0 rjmp .+130 ; 0x38b78 38af6: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 38af8: 10 92 c9 17 sts 0x17C9, r1 ; 0x8017c9 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 38afc: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 38b00: 4e e3 ldi r20, 0x3E ; 62 38b02: 81 11 cpse r24, r1 38b04: 40 e2 ldi r20, 0x20 ; 32 38b06: 63 e0 ldi r22, 0x03 ; 3 38b08: 80 e0 ldi r24, 0x00 ; 0 38b0a: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 38b0e: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 if (two_choices == false) 38b12: dd 23 and r29, r29 38b14: b1 f1 breq .+108 ; 0x38b82 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38b16: 4e e3 ldi r20, 0x3E ; 62 38b18: 81 30 cpi r24, 0x01 ; 1 38b1a: 09 f0 breq .+2 ; 0x38b1e 38b1c: 40 e2 ldi r20, 0x20 ; 32 38b1e: 63 e0 ldi r22, 0x03 ; 3 38b20: 89 e0 ldi r24, 0x09 ; 9 38b22: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 38b26: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 38b2a: 82 30 cpi r24, 0x02 ; 2 38b2c: 61 f5 brne .+88 ; 0x38b86 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 38b2e: 4e e3 ldi r20, 0x3E ; 62 38b30: 63 e0 ldi r22, 0x03 ; 3 38b32: 82 e1 ldi r24, 0x12 ; 18 38b34: 0e 94 b5 6f call 0xdf6a ; 0xdf6a } // Consume rotation event lcd_encoder = 0; 38b38: 10 92 38 05 sts 0x0538, r1 ; 0x800538 38b3c: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } // Check if knob was clicked and consume the event if (lcd_clicked()) { 38b40: 0e 94 b2 71 call 0xe364 ; 0xe364 38b44: 88 23 and r24, r24 38b46: 09 f4 brne .+2 ; 0x38b4a 38b48: 34 cf rjmp .-408 ; 0x389b2 choice_selected = current_selection; 38b4a: 80 91 c9 17 lds r24, 0x17C9 ; 0x8017c9 } else { // continue monitoring return ret; } if ((two_choices && choice_selected == LCD_MIDDLE_BUTTON_CHOICE) // Two choices and middle button selected 38b4e: d1 11 cpse r29, r1 38b50: 1c c0 rjmp .+56 ; 0x38b8a 38b52: 81 30 cpi r24, 0x01 ; 1 38b54: 89 f5 brne .+98 ; 0x38bb8 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); 38b56: f8 01 movw r30, r16 38b58: ee 0f add r30, r30 38b5a: ff 1f adc r31, r31 38b5c: eb 5b subi r30, 0xBB ; 187 38b5e: f5 45 sbci r31, 0x55 ; 85 38b60: 85 91 lpm r24, Z+ 38b62: 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))); 38b64: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 38b68: 0f 94 0c 36 call 0x26c18 ; 0x26c18 SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b6c: 81 e0 ldi r24, 0x01 ; 1 38b6e: 80 93 c8 17 sts 0x17C8, r24 ; 0x8017c8 lcd_return_to_status(); sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; KEEPALIVE_STATE(IN_HANDLER); ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; 38b72: 10 92 d2 17 sts 0x17D2, r1 ; 0x8017d2 38b76: 1d cf rjmp .-454 ; 0x389b2 } } 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) { 38b78: 81 30 cpi r24, 0x01 ; 1 38b7a: 09 f4 brne .+2 ; 0x38b7e 38b7c: bf cf rjmp .-130 ; 0x38afc // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 38b7e: 81 e0 ldi r24, 0x01 ; 1 38b80: b1 cf rjmp .-158 ; 0x38ae4 { 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 ? '>': ' '); 38b82: 81 30 cpi r24, 0x01 ; 1 38b84: a1 f2 breq .-88 ; 0x38b2e 38b86: 40 e2 ldi r20, 0x20 ; 32 38b88: d3 cf rjmp .-90 ; 0x38b30 // 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 38b8a: 82 30 cpi r24, 0x02 ; 2 38b8c: 21 f3 breq .-56 ; 0x38b56 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 38b8e: 81 30 cpi r24, 0x01 ; 1 38b90: 99 f4 brne .+38 ; 0x38bb8 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 38b92: d0 93 5f 0e sts 0x0E5F, r29 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38b96: 80 93 c8 17 sts 0x17C8, r24 ; 0x8017c8 // More button selected, change state ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; case 2: // Exit error screen and enable lcd updates lcd_update_enable(true); 38b9a: 81 e0 ldi r24, 0x01 ; 1 38b9c: 0e 94 da 6f call 0xdfb4 ; 0xdfb4 lcd_return_to_status(); 38ba0: 0f 94 53 27 call 0x24ea6 ; 0x24ea6 38ba4: 10 92 6c 05 sts 0x056C, r1 ; 0x80056c <_ZL10beep_timer.lto_priv.513> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 38ba8: 10 92 6f 05 sts 0x056F, r1 ; 0x80056f <_ZL6bFirst.lto_priv.514> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 38bac: 10 92 74 07 sts 0x0774, r1 ; 0x800774 <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.509> KEEPALIVE_STATE(IN_HANDLER); 38bb0: 82 e0 ldi r24, 0x02 ; 2 38bb2: 80 93 96 02 sts 0x0296, r24 ; 0x800296 38bb6: dd cf rjmp .-70 ; 0x38b72 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); 38bb8: cf 70 andi r28, 0x0F ; 15 38bba: c0 93 5f 0e sts 0x0E5F, r28 ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 38bbe: 81 e0 ldi r24, 0x01 ; 1 38bc0: ea cf rjmp .-44 ; 0x38b96 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); 38bc2: ef 2d mov r30, r15 38bc4: f0 e0 ldi r31, 0x00 ; 0 38bc6: ee 0f add r30, r30 38bc8: ff 1f adc r31, r31 38bca: ec 5d subi r30, 0xDC ; 220 38bcc: f4 45 sbci r31, 0x54 ; 84 38bce: 85 91 lpm r24, Z+ 38bd0: 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()); 38bd2: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 38bd6: 6c 01 movw r12, r24 38bd8: 08 ef ldi r16, 0xF8 ; 248 38bda: 10 e7 ldi r17, 0x70 ; 112 38bdc: 99 e0 ldi r25, 0x09 ; 9 38bde: e9 2e mov r14, r25 38be0: 32 cf rjmp .-412 ; 0x38a46 00038be2 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 38be2: 0f 94 66 c3 call 0x386cc ; 0x386cc // 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); 38be6: e8 2f mov r30, r24 38be8: f0 e0 ldi r31, 0x00 ; 0 38bea: ee 0f add r30, r30 38bec: ff 1f adc r31, r31 38bee: e4 53 subi r30, 0x34 ; 52 38bf0: f5 45 sbci r31, 0x55 ; 85 38bf2: 25 91 lpm r18, Z+ 38bf4: 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) ) { 38bf6: 23 33 cpi r18, 0x33 ; 51 38bf8: 81 e0 ldi r24, 0x01 ; 1 38bfa: 38 07 cpc r19, r24 38bfc: 08 f0 brcs .+2 ; 0x38c00 38bfe: 41 c0 rjmp .+130 ; 0x38c82 38c00: 2d 32 cpi r18, 0x2D ; 45 38c02: 81 e0 ldi r24, 0x01 ; 1 38c04: 38 07 cpc r19, r24 38c06: 78 f5 brcc .+94 ; 0x38c66 38c08: 2e 37 cpi r18, 0x7E ; 126 38c0a: 31 05 cpc r19, r1 38c0c: 09 f4 brne .+2 ; 0x38c10 38c0e: 83 c0 rjmp .+262 ; 0x38d16 38c10: f0 f4 brcc .+60 ; 0x38c4e 38c12: 2c 36 cpi r18, 0x6C ; 108 38c14: 31 05 cpc r19, r1 38c16: 09 f4 brne .+2 ; 0x38c1a 38c18: 85 c0 rjmp .+266 ; 0x38d24 38c1a: 30 f4 brcc .+12 ; 0x38c28 38c1c: 25 36 cpi r18, 0x65 ; 101 38c1e: 31 05 cpc r19, r1 38c20: 08 f0 brcs .+2 ; 0x38c24 38c22: 79 c0 rjmp .+242 ; 0x38d16 default: break; } return Buttons::NoButton; 38c24: 8f ef ldi r24, 0xFF ; 255 38c26: 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) ) { 38c28: 24 37 cpi r18, 0x74 ; 116 38c2a: 31 05 cpc r19, r1 38c2c: 09 f4 brne .+2 ; 0x38c30 38c2e: 73 c0 rjmp .+230 ; 0x38d16 38c30: 2d 37 cpi r18, 0x7D ; 125 38c32: 31 05 cpc r19, r1 38c34: 19 f0 breq .+6 ; 0x38c3c 38c36: 23 37 cpi r18, 0x73 ; 115 38c38: 31 05 cpc r19, r1 38c3a: a1 f7 brne .-24 ; 0x38c24 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 38c3c: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38c40: 81 30 cpi r24, 0x01 ; 1 38c42: 09 f4 brne .+2 ; 0x38c46 38c44: 6d c0 rjmp .+218 ; 0x38d20 38c46: 87 30 cpi r24, 0x07 ; 7 38c48: 69 f7 brne .-38 ; 0x38c24 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 38c4a: 88 e0 ldi r24, 0x08 ; 8 38c4c: 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) ) { 38c4e: 23 3d cpi r18, 0xD3 ; 211 38c50: 31 05 cpc r19, r1 38c52: 09 f4 brne .+2 ; 0x38c56 38c54: 6e c0 rjmp .+220 ; 0x38d32 38c56: 50 f4 brcc .+20 ; 0x38c6c 38c58: 29 3c cpi r18, 0xC9 ; 201 38c5a: 31 05 cpc r19, r1 38c5c: 09 f4 brne .+2 ; 0x38c60 38c5e: 69 c0 rjmp .+210 ; 0x38d32 38c60: 2a 3c cpi r18, 0xCA ; 202 38c62: 31 05 cpc r19, r1 38c64: f9 f6 brne .-66 ; 0x38c24 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) { 38c66: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38c6a: 67 c0 rjmp .+206 ; 0x38d3a // 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) ) { 38c6c: 2d 3d cpi r18, 0xDD ; 221 38c6e: 31 05 cpc r19, r1 38c70: 09 f4 brne .+2 ; 0x38c74 38c72: 5f c0 rjmp .+190 ; 0x38d32 38c74: 2e 3d cpi r18, 0xDE ; 222 38c76: 31 05 cpc r19, r1 38c78: b1 f3 breq .-20 ; 0x38c66 38c7a: 24 3d cpi r18, 0xD4 ; 212 38c7c: 31 05 cpc r19, r1 38c7e: 91 f6 brne .-92 ; 0x38c24 38c80: f2 cf rjmp .-28 ; 0x38c66 38c82: 25 3f cpi r18, 0xF5 ; 245 38c84: 81 e0 ldi r24, 0x01 ; 1 38c86: 38 07 cpc r19, r24 38c88: 09 f4 brne .+2 ; 0x38c8c 38c8a: 5c c0 rjmp .+184 ; 0x38d44 38c8c: f8 f4 brcc .+62 ; 0x38ccc 38c8e: 26 34 cpi r18, 0x46 ; 70 38c90: 81 e0 ldi r24, 0x01 ; 1 38c92: 38 07 cpc r19, r24 38c94: 58 f4 brcc .+22 ; 0x38cac 38c96: 21 34 cpi r18, 0x41 ; 65 38c98: 81 e0 ldi r24, 0x01 ; 1 38c9a: 38 07 cpc r19, r24 38c9c: 20 f7 brcc .-56 ; 0x38c66 38c9e: 27 53 subi r18, 0x37 ; 55 38ca0: 31 40 sbci r19, 0x01 ; 1 38ca2: 25 30 cpi r18, 0x05 ; 5 38ca4: 31 05 cpc r19, r1 38ca6: 08 f0 brcs .+2 ; 0x38caa 38ca8: bd cf rjmp .-134 ; 0x38c24 38caa: dd cf rjmp .-70 ; 0x38c66 38cac: 21 59 subi r18, 0x91 ; 145 38cae: 31 40 sbci r19, 0x01 ; 1 38cb0: 22 30 cpi r18, 0x02 ; 2 38cb2: 31 05 cpc r19, r1 38cb4: 08 f0 brcs .+2 ; 0x38cb8 38cb6: b6 cf rjmp .-148 ; 0x38c24 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 38cb8: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38cbc: 83 30 cpi r24, 0x03 ; 3 38cbe: 09 f4 brne .+2 ; 0x38cc2 38cc0: 3f c0 rjmp .+126 ; 0x38d40 38cc2: 89 30 cpi r24, 0x09 ; 9 38cc4: 09 f0 breq .+2 ; 0x38cc8 38cc6: ae cf rjmp .-164 ; 0x38c24 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 38cc8: 87 e0 ldi r24, 0x07 ; 7 38cca: 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) ) { 38ccc: 29 3f cpi r18, 0xF9 ; 249 38cce: 81 e0 ldi r24, 0x01 ; 1 38cd0: 38 07 cpc r19, r24 38cd2: 49 f2 breq .-110 ; 0x38c66 38cd4: 70 f4 brcc .+28 ; 0x38cf2 38cd6: 27 3f cpi r18, 0xF7 ; 247 38cd8: 81 e0 ldi r24, 0x01 ; 1 38cda: 38 07 cpc r19, r24 38cdc: 21 f2 breq .-120 ; 0x38c66 38cde: 60 f7 brcc .-40 ; 0x38cb8 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 38ce0: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38ce4: 83 30 cpi r24, 0x03 ; 3 38ce6: 61 f1 breq .+88 ; 0x38d40 38ce8: 88 30 cpi r24, 0x08 ; 8 38cea: 09 f0 breq .+2 ; 0x38cee 38cec: 9b cf rjmp .-202 ; 0x38c24 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 38cee: 86 e0 ldi r24, 0x06 ; 6 38cf0: 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) ) { 38cf2: 2b 3f cpi r18, 0xFB ; 251 38cf4: 81 e0 ldi r24, 0x01 ; 1 38cf6: 38 07 cpc r19, r24 38cf8: a9 f0 breq .+42 ; 0x38d24 38cfa: 68 f0 brcs .+26 ; 0x38d16 38cfc: 2c 3f cpi r18, 0xFC ; 252 38cfe: 31 40 sbci r19, 0x01 ; 1 38d00: 09 f0 breq .+2 ; 0x38d04 38d02: 90 cf rjmp .-224 ; 0x38c24 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 38d04: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d08: 85 30 cpi r24, 0x05 ; 5 38d0a: 89 f0 breq .+34 ; 0x38d2e 38d0c: 86 30 cpi r24, 0x06 ; 6 38d0e: 09 f0 breq .+2 ; 0x38d12 38d10: 89 cf rjmp .-238 ; 0x38c24 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 38d12: 85 e0 ldi r24, 0x05 ; 5 38d14: 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) { 38d16: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d1a: 81 30 cpi r24, 0x01 ; 1 38d1c: 09 f0 breq .+2 ; 0x38d20 38d1e: 82 cf rjmp .-252 ; 0x38c24 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; 38d20: 81 e0 ldi r24, 0x01 ; 1 38d22: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 38d24: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d28: 82 30 cpi r24, 0x02 ; 2 38d2a: d1 f3 breq .-12 ; 0x38d20 38d2c: 7b cf rjmp .-266 ; 0x38c24 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 38d2e: 84 e0 ldi r24, 0x04 ; 4 38d30: 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) { 38d32: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d36: 82 30 cpi r24, 0x02 ; 2 38d38: 61 f0 breq .+24 ; 0x38d52 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) { 38d3a: 83 30 cpi r24, 0x03 ; 3 38d3c: 09 f0 breq .+2 ; 0x38d40 38d3e: 72 cf rjmp .-284 ; 0x38c24 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; 38d40: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 38d42: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 38d44: 80 91 5f 0e lds r24, 0x0E5F ; 0x800e5f <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.512> 38d48: 82 30 cpi r24, 0x02 ; 2 38d4a: 29 f0 breq .+10 ; 0x38d56 38d4c: 84 30 cpi r24, 0x04 ; 4 38d4e: 09 f0 breq .+2 ; 0x38d52 38d50: 69 cf rjmp .-302 ; 0x38c24 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; 38d52: 82 e0 ldi r24, 0x02 ; 2 38d54: 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; 38d56: 80 e0 ldi r24, 0x00 ; 0 38d58: 08 95 ret 00038d5a (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 38d5a: cf 93 push r28 38d5c: df 93 push r29 38d5e: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 38d60: 60 91 61 0e lds r22, 0x0E61 ; 0x800e61 38d64: 70 91 62 0e lds r23, 0x0E62 ; 0x800e62 38d68: 80 91 63 0e lds r24, 0x0E63 ; 0x800e63 38d6c: 90 91 64 0e lds r25, 0x0E64 ; 0x800e64 38d70: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 38d74: 20 91 6d 0e lds r18, 0x0E6D ; 0x800e6d 38d78: 30 91 6e 0e lds r19, 0x0E6E ; 0x800e6e 38d7c: c9 01 movw r24, r18 38d7e: 86 1b sub r24, r22 38d80: 97 0b sbc r25, r23 38d82: 06 97 sbiw r24, 0x06 ; 6 38d84: 24 f0 brlt .+8 ; 0x38d8e (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); 38d86: ce 01 movw r24, r28 38d88: 0e 94 87 8e call 0x11d0e ; 0x11d0e 38d8c: e9 cf rjmp .-46 ; 0x38d60 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.381]+0x6> f(); safe_delay_keep_alive(delay); } } 38d8e: df 91 pop r29 38d90: cf 91 pop r28 38d92: 08 95 ret 00038d94 : } //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) { 38d94: cf 93 push r28 38d96: df 93 push r29 38d98: 00 d0 rcall .+0 ; 0x38d9a 38d9a: 00 d0 rcall .+0 ; 0x38d9c 38d9c: 1f 92 push r1 38d9e: cd b7 in r28, 0x3d ; 61 38da0: 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)) 38da2: 87 30 cpi r24, 0x07 ; 7 38da4: 50 f5 brcc .+84 ; 0x38dfa 38da6: 67 30 cpi r22, 0x07 ; 7 38da8: 40 f5 brcc .+80 ; 0x38dfa return false; uint8_t valid_points_mask[7] = { 38daa: 97 e0 ldi r25, 0x07 ; 7 38dac: e6 ec ldi r30, 0xC6 ; 198 38dae: f2 e0 ldi r31, 0x02 ; 2 38db0: de 01 movw r26, r28 38db2: 11 96 adiw r26, 0x01 ; 1 38db4: 01 90 ld r0, Z+ 38db6: 0d 92 st X+, r0 38db8: 9a 95 dec r25 38dba: e1 f7 brne .-8 ; 0x38db4 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 38dbc: 46 e0 ldi r20, 0x06 ; 6 38dbe: 50 e0 ldi r21, 0x00 ; 0 38dc0: fa 01 movw r30, r20 38dc2: e6 1b sub r30, r22 38dc4: f1 09 sbc r31, r1 38dc6: 21 e0 ldi r18, 0x01 ; 1 38dc8: 30 e0 ldi r19, 0x00 ; 0 38dca: 2c 0f add r18, r28 38dcc: 3d 1f adc r19, r29 38dce: e2 0f add r30, r18 38dd0: f3 1f adc r31, r19 38dd2: 20 81 ld r18, Z 38dd4: 30 e0 ldi r19, 0x00 ; 0 38dd6: 48 1b sub r20, r24 38dd8: 51 09 sbc r21, r1 38dda: c9 01 movw r24, r18 38ddc: 02 c0 rjmp .+4 ; 0x38de2 38dde: 95 95 asr r25 38de0: 87 95 ror r24 38de2: 4a 95 dec r20 38de4: e2 f7 brpl .-8 ; 0x38dde 38de6: 81 70 andi r24, 0x01 ; 1 } 38de8: 27 96 adiw r28, 0x07 ; 7 38dea: 0f b6 in r0, 0x3f ; 63 38dec: f8 94 cli 38dee: de bf out 0x3e, r29 ; 62 38df0: 0f be out 0x3f, r0 ; 63 38df2: cd bf out 0x3d, r28 ; 61 38df4: df 91 pop r29 38df6: cf 91 pop r28 38df8: 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; 38dfa: 80 e0 ldi r24, 0x00 ; 0 38dfc: f5 cf rjmp .-22 ; 0x38de8 00038dfe : // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 38dfe: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.516+0x1> 38e02: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.516> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 38e06: 80 e1 ldi r24, 0x10 ; 16 38e08: 0e 94 4b f9 call 0x1f296 ; 0x1f296 38e0c: 88 23 and r24, r24 38e0e: 91 f0 breq .+36 ; 0x38e34 { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 38e10: 0e 94 0a 7b call 0xf614 ; 0xf614 // 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))); 38e14: 81 ea ldi r24, 0xA1 ; 161 38e16: 9d e0 ldi r25, 0x0D ; 13 38e18: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 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-> 38e1c: 2b e0 ldi r18, 0x0B ; 11 38e1e: 82 9f mul r24, r18 38e20: c0 01 movw r24, r0 38e22: 11 24 eor r1, r1 38e24: 80 5b subi r24, 0xB0 ; 176 38e26: 92 4f sbci r25, 0xF2 ; 242 38e28: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 38e2c: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.516+0x1> 38e30: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.516> SERIAL_ECHO("correction: "); SERIAL_ECHO(float(babystepLoadZ) / float(axis_steps_per_mm[Z_AXIS])); SERIAL_ECHOLN(""); #endif } } 38e34: 08 95 ret 00038e36 : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 38e36: 0f 93 push r16 38e38: 1f 93 push r17 38e3a: cf 93 push r28 38e3c: df 93 push r29 38e3e: 00 d0 rcall .+0 ; 0x38e40 38e40: 1f 92 push r1 38e42: cd b7 in r28, 0x3d ; 61 38e44: de b7 in r29, 0x3e ; 62 38e46: 9b 01 movw r18, r22 38e48: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 38e4a: 03 e4 ldi r16, 0x43 ; 67 38e4c: 17 e0 ldi r17, 0x07 ; 7 38e4e: f8 01 movw r30, r16 38e50: 60 85 ldd r22, Z+8 ; 0x08 38e52: 71 85 ldd r23, Z+9 ; 0x09 38e54: 82 85 ldd r24, Z+10 ; 0x0a 38e56: 93 85 ldd r25, Z+11 ; 0x0b 38e58: 69 83 std Y+1, r22 ; 0x01 38e5a: 7a 83 std Y+2, r23 ; 0x02 38e5c: 8b 83 std Y+3, r24 ; 0x03 38e5e: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 38e60: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 38e64: f8 01 movw r30, r16 38e66: 60 87 std Z+8, r22 ; 0x08 38e68: 71 87 std Z+9, r23 ; 0x09 38e6a: 82 87 std Z+10, r24 ; 0x0a 38e6c: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 38e6e: 65 e5 ldi r22, 0x55 ; 85 38e70: 75 e5 ldi r23, 0x55 ; 85 38e72: 85 e5 ldi r24, 0x55 ; 85 38e74: 91 e4 ldi r25, 0x41 ; 65 38e76: 0f 94 93 ba call 0x37526 ; 0x37526 st_synchronize(); 38e7a: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[Z_AXIS] = curpos_z; 38e7e: 89 81 ldd r24, Y+1 ; 0x01 38e80: 9a 81 ldd r25, Y+2 ; 0x02 38e82: ab 81 ldd r26, Y+3 ; 0x03 38e84: bc 81 ldd r27, Y+4 ; 0x04 38e86: f8 01 movw r30, r16 38e88: 80 87 std Z+8, r24 ; 0x08 38e8a: 91 87 std Z+9, r25 ; 0x09 38e8c: a2 87 std Z+10, r26 ; 0x0a 38e8e: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 38e90: ce 01 movw r24, r28 38e92: 01 96 adiw r24, 0x01 ; 1 38e94: 0f 94 17 ab call 0x3562e ; 0x3562e } 38e98: 0f 90 pop r0 38e9a: 0f 90 pop r0 38e9c: 0f 90 pop r0 38e9e: 0f 90 pop r0 38ea0: df 91 pop r29 38ea2: cf 91 pop r28 38ea4: 1f 91 pop r17 38ea6: 0f 91 pop r16 38ea8: 08 95 ret 00038eaa : 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])); 38eaa: 60 91 6a 05 lds r22, 0x056A ; 0x80056a <_ZL13babystepLoadZ.lto_priv.516> 38eae: 70 91 6b 05 lds r23, 0x056B ; 0x80056b <_ZL13babystepLoadZ.lto_priv.516+0x1> 38eb2: 07 2e mov r0, r23 38eb4: 00 0c add r0, r0 38eb6: 88 0b sbc r24, r24 38eb8: 99 0b sbc r25, r25 38eba: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 38ebe: 20 91 7a 06 lds r18, 0x067A ; 0x80067a 38ec2: 30 91 7b 06 lds r19, 0x067B ; 0x80067b 38ec6: 40 91 7c 06 lds r20, 0x067C ; 0x80067c 38eca: 50 91 7d 06 lds r21, 0x067D ; 0x80067d 38ece: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 38ed2: 0f 94 1b c7 call 0x38e36 ; 0x38e36 babystepLoadZ = 0; 38ed6: 10 92 6b 05 sts 0x056B, r1 ; 0x80056b <_ZL13babystepLoadZ.lto_priv.516+0x1> 38eda: 10 92 6a 05 sts 0x056A, r1 ; 0x80056a <_ZL13babystepLoadZ.lto_priv.516> } 38ede: 08 95 ret 00038ee0 : return sampled; } void go_home_with_z_lift() { 38ee0: cf 93 push r28 38ee2: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38ee4: 0e 94 78 67 call 0xcef0 ; 0xcef0 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 38ee8: c3 e4 ldi r28, 0x43 ; 67 38eea: d7 e0 ldi r29, 0x07 ; 7 38eec: 80 e0 ldi r24, 0x00 ; 0 38eee: 90 e0 ldi r25, 0x00 ; 0 38ef0: a0 ea ldi r26, 0xA0 ; 160 38ef2: b0 e4 ldi r27, 0x40 ; 64 38ef4: 88 87 std Y+8, r24 ; 0x08 38ef6: 99 87 std Y+9, r25 ; 0x09 38ef8: aa 87 std Y+10, r26 ; 0x0a 38efa: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38efc: 65 e5 ldi r22, 0x55 ; 85 38efe: 75 e5 ldi r23, 0x55 ; 85 38f00: 85 e5 ldi r24, 0x55 ; 85 38f02: 91 e4 ldi r25, 0x41 ; 65 38f04: 0f 94 50 c3 call 0x386a0 ; 0x386a0 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; 38f08: 8d ec ldi r24, 0xCD ; 205 38f0a: 9c ec ldi r25, 0xCC ; 204 38f0c: ac e4 ldi r26, 0x4C ; 76 38f0e: be e3 ldi r27, 0x3E ; 62 38f10: 88 83 st Y, r24 38f12: 99 83 std Y+1, r25 ; 0x01 38f14: aa 83 std Y+2, r26 ; 0x02 38f16: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; 38f18: 83 e3 ldi r24, 0x33 ; 51 38f1a: 93 e3 ldi r25, 0x33 ; 51 38f1c: a3 e7 ldi r26, 0x73 ; 115 38f1e: b0 ec ldi r27, 0xC0 ; 192 38f20: 8c 83 std Y+4, r24 ; 0x04 38f22: 9d 83 std Y+5, r25 ; 0x05 38f24: ae 83 std Y+6, r26 ; 0x06 38f26: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 38f28: 67 e4 ldi r22, 0x47 ; 71 38f2a: 77 e0 ldi r23, 0x07 ; 7 38f2c: ce 01 movw r24, r28 38f2e: 0e 94 5f 6b call 0xd6be ; 0xd6be go_to_current((3 * homing_feedrate[X_AXIS]) / 60); 38f32: 60 e0 ldi r22, 0x00 ; 0 38f34: 70 e0 ldi r23, 0x00 ; 0 38f36: 86 e1 ldi r24, 0x16 ; 22 38f38: 93 e4 ldi r25, 0x43 ; 67 38f3a: 0f 94 50 c3 call 0x386a0 ; 0x386a0 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; 38f3e: 8a e9 ldi r24, 0x9A ; 154 38f40: 99 e9 ldi r25, 0x99 ; 153 38f42: a9 e1 ldi r26, 0x19 ; 25 38f44: be e3 ldi r27, 0x3E ; 62 38f46: 88 87 std Y+8, r24 ; 0x08 38f48: 99 87 std Y+9, r25 ; 0x09 38f4a: aa 87 std Y+10, r26 ; 0x0a 38f4c: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); 38f4e: 65 e5 ldi r22, 0x55 ; 85 38f50: 75 e5 ldi r23, 0x55 ; 85 38f52: 85 e5 ldi r24, 0x55 ; 85 38f54: 91 e4 ldi r25, 0x41 ; 65 } 38f56: df 91 pop r29 38f58: 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); 38f5a: 0d 94 50 c3 jmp 0x386a0 ; 0x386a0 00038f5e : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); 38f5e: 68 2f mov r22, r24 38f60: 70 e0 ldi r23, 0x00 ; 0 38f62: 90 e0 ldi r25, 0x00 ; 0 38f64: 80 e0 ldi r24, 0x00 ; 0 38f66: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 38f6a: 20 e0 ldi r18, 0x00 ; 0 38f6c: 30 e0 ldi r19, 0x00 ; 0 38f6e: 48 e0 ldi r20, 0x08 ; 8 38f70: 52 e4 ldi r21, 0x42 ; 66 38f72: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 38f76: 20 e0 ldi r18, 0x00 ; 0 38f78: 30 e0 ldi r19, 0x00 ; 0 38f7a: 40 e8 ldi r20, 0x80 ; 128 38f7c: 5f e3 ldi r21, 0x3F ; 63 38f7e: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> } 38f82: 08 95 ret 00038f84 : // 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() { 38f84: 2f 92 push r2 38f86: 3f 92 push r3 38f88: 4f 92 push r4 38f8a: 5f 92 push r5 38f8c: 6f 92 push r6 38f8e: 7f 92 push r7 38f90: 8f 92 push r8 38f92: 9f 92 push r9 38f94: af 92 push r10 38f96: bf 92 push r11 38f98: cf 92 push r12 38f9a: df 92 push r13 38f9c: ef 92 push r14 38f9e: ff 92 push r15 38fa0: 0f 93 push r16 38fa2: 1f 93 push r17 38fa4: cf 93 push r28 38fa6: df 93 push r29 38fa8: 00 d0 rcall .+0 ; 0x38faa 38faa: 00 d0 rcall .+0 ; 0x38fac 38fac: cd b7 in r28, 0x3d ; 61 38fae: de b7 in r29, 0x3e ; 62 bool result = false; #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); 38fb0: 84 e0 ldi r24, 0x04 ; 4 38fb2: 0f 94 93 3b call 0x27726 ; 0x27726 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 38fb6: 80 91 8f 02 lds r24, 0x028F ; 0x80028f <_ZL14check_endstops.lto_priv.389> 38fba: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 38fbc: 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); 38fc0: 80 e0 ldi r24, 0x00 ; 0 38fc2: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 38fc6: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 38fc8: 0e 94 78 67 call 0xcef0 ; 0xcef0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 38fcc: 85 ee ldi r24, 0xE5 ; 229 38fce: 98 e4 ldi r25, 0x48 ; 72 38fd0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 38fd4: 0f 94 85 35 call 0x26b0a ; 0x26b0a // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 38fd8: 44 ef ldi r20, 0xF4 ; 244 38fda: 50 e7 ldi r21, 0x70 ; 112 38fdc: 63 e0 ldi r22, 0x03 ; 3 38fde: 80 e0 ldi r24, 0x00 ; 0 38fe0: 0e 94 a9 6f call 0xdf52 ; 0xdf52 38fe4: 81 e0 ldi r24, 0x01 ; 1 38fe6: 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; 38fea: 80 e0 ldi r24, 0x00 ; 0 38fec: 90 e0 ldi r25, 0x00 ; 0 38fee: a0 ea ldi r26, 0xA0 ; 160 38ff0: b0 e4 ldi r27, 0x40 ; 64 38ff2: 80 93 4b 07 sts 0x074B, r24 ; 0x80074b 38ff6: 90 93 4c 07 sts 0x074C, r25 ; 0x80074c 38ffa: a0 93 4d 07 sts 0x074D, r26 ; 0x80074d 38ffe: b0 93 4e 07 sts 0x074E, r27 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/60); 39002: 65 e5 ldi r22, 0x55 ; 85 39004: 75 e5 ldi r23, 0x55 ; 85 39006: 85 e5 ldi r24, 0x55 ; 85 39008: 91 e4 ldi r25, 0x41 ; 65 3900a: 0f 94 50 c3 call 0x386a0 ; 0x386a0 #ifdef TMC2130 check_Z_crash(); 3900e: 0e 94 bc 7b call 0xf778 ; 0xf778 39012: 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; 39016: 80 e0 ldi r24, 0x00 ; 0 39018: 90 e0 ldi r25, 0x00 ; 0 3901a: a0 e8 ldi r26, 0x80 ; 128 3901c: bf e3 ldi r27, 0x3F ; 63 3901e: 80 93 43 07 sts 0x0743, r24 ; 0x800743 39022: 90 93 44 07 sts 0x0744, r25 ; 0x800744 39026: a0 93 45 07 sts 0x0745, r26 ; 0x800745 3902a: b0 93 46 07 sts 0x0746, r27 ; 0x800746 current_position[Y_AXIS] = BED_Y0; 3902e: 80 93 47 07 sts 0x0747, r24 ; 0x800747 39032: 90 93 48 07 sts 0x0748, r25 ; 0x800748 39036: a0 93 49 07 sts 0x0749, r26 ; 0x800749 3903a: b0 93 4a 07 sts 0x074A, r27 ; 0x80074a world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 3903e: 67 e4 ldi r22, 0x47 ; 71 39040: 77 e0 ldi r23, 0x07 ; 7 39042: 83 e4 ldi r24, 0x43 ; 67 39044: 97 e0 ldi r25, 0x07 ; 7 39046: 0e 94 5f 6b call 0xd6be ; 0xd6be go_to_current(homing_feedrate[X_AXIS]/60); 3904a: 60 e0 ldi r22, 0x00 ; 0 3904c: 70 e0 ldi r23, 0x00 ; 0 3904e: 88 e4 ldi r24, 0x48 ; 72 39050: 92 e4 ldi r25, 0x42 ; 66 39052: 0f 94 50 c3 call 0x386a0 ; 0x386a0 set_destination_to_current(); 39056: 0e 94 ef 68 call 0xd1de ; 0xd1de homeaxis(Z_AXIS); 3905a: 50 e0 ldi r21, 0x00 ; 0 3905c: 40 e0 ldi r20, 0x00 ; 0 3905e: 61 e0 ldi r22, 0x01 ; 1 39060: 82 e0 ldi r24, 0x02 ; 2 39062: 0e 94 f6 7b call 0xf7ec ; 0xf7ec if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 39066: 43 e0 ldi r20, 0x03 ; 3 39068: 60 e0 ldi r22, 0x00 ; 0 3906a: 70 e0 ldi r23, 0x00 ; 0 3906c: 80 e2 ldi r24, 0x20 ; 32 3906e: 91 ec ldi r25, 0xC1 ; 193 39070: 0f 94 29 8c call 0x31852 ; 0x31852 39074: 81 11 cpse r24, r1 39076: 06 c0 rjmp .+12 ; 0x39084 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)); 39078: 80 ec ldi r24, 0xC0 ; 192 3907a: 94 e6 ldi r25, 0x64 ; 100 3907c: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 39080: 0e 94 95 7b call 0xf72a ; 0xf72a float get_z(float x, float y); void set_z(uint8_t ix, uint8_t iy, float z) { z_values[iy][ix] = z; } 39084: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 39088: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 3908c: a0 91 4d 07 lds r26, 0x074D ; 0x80074d 39090: b0 91 4e 07 lds r27, 0x074E ; 0x80074e 39094: 80 93 a1 13 sts 0x13A1, r24 ; 0x8013a1 39098: 90 93 a2 13 sts 0x13A2, r25 ; 0x8013a2 3909c: a0 93 a3 13 sts 0x13A3, r26 ; 0x8013a3 390a0: b0 93 a4 13 sts 0x13A4, r27 ; 0x8013a4 390a4: e2 e0 ldi r30, 0x02 ; 2 390a6: f0 e0 ldi r31, 0x00 ; 0 390a8: fa 83 std Y+2, r31 ; 0x02 390aa: 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; 390ac: c1 2c mov r12, r1 390ae: d1 2c mov r13, r1 390b0: 30 ea ldi r19, 0xA0 ; 160 390b2: e3 2e mov r14, r19 390b4: 30 e4 ldi r19, 0x40 ; 64 390b6: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 390b8: 43 e0 ldi r20, 0x03 ; 3 390ba: 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 390bc: 52 e0 ldi r21, 0x02 ; 2 390be: 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); 390c0: 00 e3 ldi r16, 0x30 ; 48 390c2: 1a ea ldi r17, 0xAA ; 170 390c4: 67 e0 ldi r22, 0x07 ; 7 390c6: 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(); 390c8: 0e 94 78 67 call 0xcef0 ; 0xcef0 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 390cc: c0 92 4b 07 sts 0x074B, r12 ; 0x80074b 390d0: d0 92 4c 07 sts 0x074C, r13 ; 0x80074c 390d4: e0 92 4d 07 sts 0x074D, r14 ; 0x80074d 390d8: f0 92 4e 07 sts 0x074E, r15 ; 0x80074e go_to_current(homing_feedrate[Z_AXIS]/60); 390dc: 65 e5 ldi r22, 0x55 ; 85 390de: 75 e5 ldi r23, 0x55 ; 85 390e0: 85 e5 ldi r24, 0x55 ; 85 390e2: 91 e4 ldi r25, 0x41 ; 65 390e4: 0f 94 50 c3 call 0x386a0 ; 0x386a0 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 390e8: 29 81 ldd r18, Y+1 ; 0x01 390ea: 21 50 subi r18, 0x01 ; 1 390ec: 82 2f mov r24, r18 390ee: 6b 2d mov r22, r11 390f0: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 390f4: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 390f6: 82 2f mov r24, r18 390f8: 0f 94 4c de call 0x3bc98 ; 0x3bc98 <__divmodqi4> 390fc: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 390fe: 80 ff sbrs r24, 0 39100: 03 c0 rjmp .+6 ; 0x39108 39102: f9 2d mov r31, r9 39104: f8 19 sub r31, r8 39106: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 39108: 88 2d mov r24, r8 3910a: 88 0f add r24, r24 3910c: 88 0d add r24, r8 3910e: 0f 94 af c7 call 0x38f5e ; 0x38f5e 39112: 60 93 43 07 sts 0x0743, r22 ; 0x800743 39116: 70 93 44 07 sts 0x0744, r23 ; 0x800744 3911a: 80 93 45 07 sts 0x0745, r24 ; 0x800745 3911e: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = BED_Y(iy * 3); 39122: 87 2d mov r24, r7 39124: 88 0f add r24, r24 39126: 87 0d add r24, r7 39128: 0f 94 af c7 call 0x38f5e ; 0x38f5e 3912c: 60 93 47 07 sts 0x0747, r22 ; 0x800747 39130: 70 93 48 07 sts 0x0748, r23 ; 0x800748 39134: 80 93 49 07 sts 0x0749, r24 ; 0x800749 39138: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 3913c: 67 e4 ldi r22, 0x47 ; 71 3913e: 77 e0 ldi r23, 0x07 ; 7 39140: 83 e4 ldi r24, 0x43 ; 67 39142: 97 e0 ldi r25, 0x07 ; 7 39144: 0e 94 5f 6b call 0xd6be ; 0xd6be go_to_current(homing_feedrate[X_AXIS]/60); 39148: 60 e0 ldi r22, 0x00 ; 0 3914a: 70 e0 ldi r23, 0x00 ; 0 3914c: 88 e4 ldi r24, 0x48 ; 72 3914e: 92 e4 ldi r25, 0x42 ; 66 39150: 0f 94 50 c3 call 0x386a0 ; 0x386a0 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 39154: 63 e0 ldi r22, 0x03 ; 3 39156: 80 e0 ldi r24, 0x00 ; 0 39158: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_printf_P(PSTR("%d/9"),mesh_point+1); 3915c: 8a 81 ldd r24, Y+2 ; 0x02 3915e: 8f 93 push r24 39160: 99 81 ldd r25, Y+1 ; 0x01 39162: 9f 93 push r25 39164: 1f 93 push r17 39166: 0f 93 push r16 39168: 0e 94 6e 6f call 0xdedc ; 0xdedc #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 3916c: 43 e0 ldi r20, 0x03 ; 3 3916e: 60 e0 ldi r22, 0x00 ; 0 39170: 70 e0 ldi r23, 0x00 ; 0 39172: 80 e2 ldi r24, 0x20 ; 32 39174: 91 ec ldi r25, 0xC1 ; 193 39176: 0f 94 29 8c call 0x31852 ; 0x31852 3917a: 58 2e mov r5, r24 3917c: 0f 90 pop r0 3917e: 0f 90 pop r0 39180: 0f 90 pop r0 39182: 0f 90 pop r0 39184: 88 23 and r24, r24 39186: 09 f4 brne .+2 ; 0x3918a 39188: 77 cf rjmp .-274 ; 0x39078 3918a: a7 9c mul r10, r7 3918c: f0 01 movw r30, r0 3918e: 11 24 eor r1, r1 39190: e8 0d add r30, r8 39192: f1 1d adc r31, r1 39194: ee 0f add r30, r30 39196: ff 1f adc r31, r31 39198: ee 0f add r30, r30 3919a: ff 1f adc r31, r31 3919c: e0 56 subi r30, 0x60 ; 96 3919e: fc 4e sbci r31, 0xEC ; 236 391a0: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 391a4: 90 91 4c 07 lds r25, 0x074C ; 0x80074c 391a8: a0 91 4d 07 lds r26, 0x074D ; 0x80074d 391ac: b0 91 4e 07 lds r27, 0x074E ; 0x80074e 391b0: 81 83 std Z+1, r24 ; 0x01 391b2: 92 83 std Z+2, r25 ; 0x02 391b4: a3 83 std Z+3, r26 ; 0x03 391b6: b4 83 std Z+4, r27 ; 0x04 391b8: e9 81 ldd r30, Y+1 ; 0x01 391ba: fa 81 ldd r31, Y+2 ; 0x02 391bc: 31 96 adiw r30, 0x01 ; 1 391be: fa 83 std Y+2, r31 ; 0x02 391c0: 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) { 391c2: 3a 97 sbiw r30, 0x0a ; 10 391c4: 09 f0 breq .+2 ; 0x391c8 391c6: 80 cf rjmp .-256 ; 0x390c8 mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 391c8: 60 90 a1 13 lds r6, 0x13A1 ; 0x8013a1 391cc: 70 90 a2 13 lds r7, 0x13A2 ; 0x8013a2 391d0: 80 90 a3 13 lds r8, 0x13A3 ; 0x8013a3 391d4: 90 90 a4 13 lds r9, 0x13A4 ; 0x8013a4 float zmax = zmin; 391d8: 46 2c mov r4, r6 391da: a7 2c mov r10, r7 391dc: b8 2c mov r11, r8 391de: 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]; 391e0: 1e 82 std Y+6, r1 ; 0x06 391e2: 1d 82 std Y+5, r1 ; 0x05 391e4: 00 ea ldi r16, 0xA0 ; 160 391e6: 13 e1 ldi r17, 0x13 ; 19 391e8: 8d 81 ldd r24, Y+5 ; 0x05 391ea: 9e 81 ldd r25, Y+6 ; 0x06 391ec: 8f 55 subi r24, 0x5F ; 95 391ee: 9c 4e sbci r25, 0xEC ; 236 391f0: 9a 83 std Y+2, r25 ; 0x02 391f2: 89 83 std Y+1, r24 ; 0x01 391f4: 93 e0 ldi r25, 0x03 ; 3 391f6: 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]); 391f8: e9 81 ldd r30, Y+1 ; 0x01 391fa: fa 81 ldd r31, Y+2 ; 0x02 391fc: c1 90 ld r12, Z+ 391fe: d1 90 ld r13, Z+ 39200: e1 90 ld r14, Z+ 39202: f1 90 ld r15, Z+ 39204: fa 83 std Y+2, r31 ; 0x02 39206: e9 83 std Y+1, r30 ; 0x01 39208: 93 01 movw r18, r6 3920a: a4 01 movw r20, r8 3920c: c7 01 movw r24, r14 3920e: b6 01 movw r22, r12 39210: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 39214: 18 16 cp r1, r24 39216: 14 f0 brlt .+4 ; 0x3921c 39218: 36 01 movw r6, r12 3921a: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 3921c: 24 2d mov r18, r4 3921e: 3a 2d mov r19, r10 39220: 4b 2d mov r20, r11 39222: 52 2d mov r21, r2 39224: c7 01 movw r24, r14 39226: b6 01 movw r22, r12 39228: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3922c: 87 fd sbrc r24, 7 3922e: 04 c0 rjmp .+8 ; 0x39238 39230: 4c 2c mov r4, r12 39232: ad 2c mov r10, r13 39234: be 2c mov r11, r14 39236: 2f 2c mov r2, r15 39238: 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) { 3923a: 31 10 cpse r3, r1 3923c: dd cf rjmp .-70 ; 0x391f8 3923e: 8d 81 ldd r24, Y+5 ; 0x05 39240: 9e 81 ldd r25, Y+6 ; 0x06 39242: 4c 96 adiw r24, 0x1c ; 28 39244: 9e 83 std Y+6, r25 ; 0x06 39246: 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) 39248: 84 35 cpi r24, 0x54 ; 84 3924a: 91 05 cpc r25, r1 3924c: 59 f6 brne .-106 ; 0x391e4 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) { 3924e: 93 01 movw r18, r6 39250: a4 01 movw r20, r8 39252: 64 2d mov r22, r4 39254: 7a 2d mov r23, r10 39256: 8b 2d mov r24, r11 39258: 92 2d mov r25, r2 3925a: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 3925e: 20 e0 ldi r18, 0x00 ; 0 39260: 30 e0 ldi r19, 0x00 ; 0 39262: 40 e4 ldi r20, 0x40 ; 64 39264: 50 e4 ldi r21, 0x40 ; 64 39266: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 3926a: 18 16 cp r1, r24 3926c: 3c f5 brge .+78 ; 0x392bc // 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!"); 3926e: 83 e1 ldi r24, 0x13 ; 19 39270: 9a ea ldi r25, 0xAA ; 170 39272: 0e 94 06 7b call 0xf60c ; 0xf60c // 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; 39276: 51 2c mov r5, r1 39278: fc 81 ldd r31, Y+4 ; 0x04 3927a: 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); 3927e: 8b 81 ldd r24, Y+3 ; 0x03 39280: 0f 94 5a 64 call 0x2c8b4 ; 0x2c8b4 #ifdef TMC2130 tmc2130_home_exit(); 39284: 0f 94 64 3b call 0x276c8 ; 0x276c8 #endif return result; } 39288: 85 2d mov r24, r5 3928a: 26 96 adiw r28, 0x06 ; 6 3928c: 0f b6 in r0, 0x3f ; 63 3928e: f8 94 cli 39290: de bf out 0x3e, r29 ; 62 39292: 0f be out 0x3f, r0 ; 63 39294: cd bf out 0x3d, r28 ; 61 39296: df 91 pop r29 39298: cf 91 pop r28 3929a: 1f 91 pop r17 3929c: 0f 91 pop r16 3929e: ff 90 pop r15 392a0: ef 90 pop r14 392a2: df 90 pop r13 392a4: cf 90 pop r12 392a6: bf 90 pop r11 392a8: af 90 pop r10 392aa: 9f 90 pop r9 392ac: 8f 90 pop r8 392ae: 7f 90 pop r7 392b0: 6f 90 pop r6 392b2: 5f 90 pop r5 392b4: 4f 90 pop r4 392b6: 3f 90 pop r3 392b8: 2f 90 pop r2 392ba: 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) 392bc: 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; 392be: 85 ec ldi r24, 0xC5 ; 197 392c0: e8 2e mov r14, r24 392c2: 8f e0 ldi r24, 0x0F ; 15 392c4: f8 2e mov r15, r24 392c6: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 392c8: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 392ca: 9d 81 ldd r25, Y+5 ; 0x05 392cc: 91 11 cpse r25, r1 392ce: 03 c0 rjmp .+6 ; 0x392d6 392d0: e9 81 ldd r30, Y+1 ; 0x01 392d2: ee 23 and r30, r30 392d4: 29 f1 breq .+74 ; 0x39320 continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 392d6: 20 91 a1 13 lds r18, 0x13A1 ; 0x8013a1 392da: 30 91 a2 13 lds r19, 0x13A2 ; 0x8013a2 392de: 40 91 a3 13 lds r20, 0x13A3 ; 0x8013a3 392e2: 50 91 a4 13 lds r21, 0x13A4 ; 0x8013a4 392e6: f6 01 movw r30, r12 392e8: 61 81 ldd r22, Z+1 ; 0x01 392ea: 72 81 ldd r23, Z+2 ; 0x02 392ec: 83 81 ldd r24, Z+3 ; 0x03 392ee: 94 81 ldd r25, Z+4 ; 0x04 392f0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 392f4: 20 e0 ldi r18, 0x00 ; 0 392f6: 30 e0 ldi r19, 0x00 ; 0 392f8: 48 ec ldi r20, 0xC8 ; 200 392fa: 52 e4 ldi r21, 0x42 ; 66 392fc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 39300: 20 e0 ldi r18, 0x00 ; 0 39302: 30 e0 ldi r19, 0x00 ; 0 39304: 40 e0 ldi r20, 0x00 ; 0 39306: 5f e3 ldi r21, 0x3F ; 63 39308: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3930c: 0f 94 60 e0 call 0x3c0c0 ; 0x3c0c0 39310: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 39314: c7 01 movw r24, r14 39316: 0f 94 d3 dd call 0x3bba6 ; 0x3bba6 SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 3931a: f2 e0 ldi r31, 0x02 ; 2 3931c: ef 0e add r14, r31 3931e: f1 1c adc r15, r1 39320: 84 e0 ldi r24, 0x04 ; 4 39322: c8 0e add r12, r24 39324: d1 1c adc r13, r1 39326: 9d 81 ldd r25, Y+5 ; 0x05 39328: 9f 5f subi r25, 0xFF ; 255 3932a: 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) { 3932c: 93 30 cpi r25, 0x03 ; 3 3932e: 69 f6 brne .-102 ; 0x392ca 39330: 04 5e subi r16, 0xE4 ; 228 39332: 1f 4f sbci r17, 0xFF ; 255 39334: e9 81 ldd r30, Y+1 ; 0x01 39336: ef 5f subi r30, 0xFF ; 255 39338: 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) 3933a: e3 30 cpi r30, 0x03 ; 3 3933c: 21 f6 brne .-120 ; 0x392c6 #endif addr += 2; } } mbl.reset(); 3933e: 0f 94 1f 8c call 0x3183e ; 0x3183e go_home_with_z_lift(); 39342: 0f 94 70 c7 call 0x38ee0 ; 0x38ee0 39346: 98 cf rjmp .-208 ; 0x39278 00039348 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 39348: 82 e0 ldi r24, 0x02 ; 2 3934a: 0f 94 18 59 call 0x2b230 ; 0x2b230 3934e: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 39352: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 39356: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3935a: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e plan_set_z_position(current_position[Z_AXIS]); 3935e: 8b e4 ldi r24, 0x4B ; 75 39360: 97 e0 ldi r25, 0x07 ; 7 39362: 0d 94 17 ab jmp 0x3562e ; 0x3562e 00039366 : * 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() { 39366: 4f 92 push r4 39368: 5f 92 push r5 3936a: 6f 92 push r6 3936c: 7f 92 push r7 3936e: 8f 92 push r8 39370: 9f 92 push r9 39372: af 92 push r10 39374: bf 92 push r11 39376: cf 92 push r12 39378: df 92 push r13 3937a: ef 92 push r14 3937c: ff 92 push r15 3937e: 0f 93 push r16 39380: 1f 93 push r17 39382: cf 93 push r28 39384: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; 39386: 03 e4 ldi r16, 0x43 ; 67 39388: 17 e0 ldi r17, 0x07 ; 7 3938a: c3 ee ldi r28, 0xE3 ; 227 3938c: d7 e1 ldi r29, 0x17 ; 23 3938e: 28 81 ld r18, Y 39390: 39 81 ldd r19, Y+1 ; 0x01 39392: 4a 81 ldd r20, Y+2 ; 0x02 39394: 5b 81 ldd r21, Y+3 ; 0x03 39396: f8 01 movw r30, r16 39398: 60 81 ld r22, Z 3939a: 71 81 ldd r23, Z+1 ; 0x01 3939c: 82 81 ldd r24, Z+2 ; 0x02 3939e: 93 81 ldd r25, Z+3 ; 0x03 393a0: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 393a4: 4b 01 movw r8, r22 393a6: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; 393a8: 2c 81 ldd r18, Y+4 ; 0x04 393aa: 3d 81 ldd r19, Y+5 ; 0x05 393ac: 4e 81 ldd r20, Y+6 ; 0x06 393ae: 5f 81 ldd r21, Y+7 ; 0x07 393b0: f8 01 movw r30, r16 393b2: 64 81 ldd r22, Z+4 ; 0x04 393b4: 75 81 ldd r23, Z+5 ; 0x05 393b6: 86 81 ldd r24, Z+6 ; 0x06 393b8: 97 81 ldd r25, Z+7 ; 0x07 393ba: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 393be: 6b 01 movw r12, r22 393c0: 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; 393c2: c3 ed ldi r28, 0xD3 ; 211 393c4: d7 e1 ldi r29, 0x17 ; 23 393c6: 28 81 ld r18, Y 393c8: 39 81 ldd r19, Y+1 ; 0x01 393ca: 4a 81 ldd r20, Y+2 ; 0x02 393cc: 5b 81 ldd r21, Y+3 ; 0x03 393ce: c5 01 movw r24, r10 393d0: b4 01 movw r22, r8 393d2: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 393d6: 2b 01 movw r4, r22 393d8: 3c 01 movw r6, r24 393da: 2c 81 ldd r18, Y+4 ; 0x04 393dc: 3d 81 ldd r19, Y+5 ; 0x05 393de: 4e 81 ldd r20, Y+6 ; 0x06 393e0: 5f 81 ldd r21, Y+7 ; 0x07 393e2: c7 01 movw r24, r14 393e4: b6 01 movw r22, r12 393e6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 393ea: 9b 01 movw r18, r22 393ec: ac 01 movw r20, r24 393ee: c3 01 movw r24, r6 393f0: b2 01 movw r22, r4 393f2: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 393f6: f8 01 movw r30, r16 393f8: 60 83 st Z, r22 393fa: 71 83 std Z+1, r23 ; 0x01 393fc: 82 83 std Z+2, r24 ; 0x02 393fe: 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; 39400: 28 85 ldd r18, Y+8 ; 0x08 39402: 39 85 ldd r19, Y+9 ; 0x09 39404: 4a 85 ldd r20, Y+10 ; 0x0a 39406: 5b 85 ldd r21, Y+11 ; 0x0b 39408: c5 01 movw r24, r10 3940a: b4 01 movw r22, r8 3940c: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 39410: 4b 01 movw r8, r22 39412: 5c 01 movw r10, r24 39414: 2c 85 ldd r18, Y+12 ; 0x0c 39416: 3d 85 ldd r19, Y+13 ; 0x0d 39418: 4e 85 ldd r20, Y+14 ; 0x0e 3941a: 5f 85 ldd r21, Y+15 ; 0x0f 3941c: c7 01 movw r24, r14 3941e: b6 01 movw r22, r12 39420: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 39424: 9b 01 movw r18, r22 39426: ac 01 movw r20, r24 39428: c5 01 movw r24, r10 3942a: b4 01 movw r22, r8 3942c: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 39430: f8 01 movw r30, r16 39432: 64 83 std Z+4, r22 ; 0x04 39434: 75 83 std Z+5, r23 ; 0x05 39436: 86 83 std Z+6, r24 ; 0x06 39438: 97 83 std Z+7, r25 ; 0x07 } 3943a: df 91 pop r29 3943c: cf 91 pop r28 3943e: 1f 91 pop r17 39440: 0f 91 pop r16 39442: ff 90 pop r15 39444: ef 90 pop r14 39446: df 90 pop r13 39448: cf 90 pop r12 3944a: bf 90 pop r11 3944c: af 90 pop r10 3944e: 9f 90 pop r9 39450: 8f 90 pop r8 39452: 7f 90 pop r7 39454: 6f 90 pop r6 39456: 5f 90 pop r5 39458: 4f 90 pop r4 3945a: 08 95 ret 0003945c : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { 3945c: 4f 92 push r4 3945e: 5f 92 push r5 39460: 6f 92 push r6 39462: 7f 92 push r7 39464: 8f 92 push r8 39466: 9f 92 push r9 39468: af 92 push r10 3946a: bf 92 push r11 3946c: cf 92 push r12 3946e: df 92 push r13 39470: ef 92 push r14 39472: ff 92 push r15 39474: 0f 93 push r16 39476: 1f 93 push r17 39478: cf 93 push r28 3947a: df 93 push r29 3947c: 00 d0 rcall .+0 ; 0x3947e 3947e: 00 d0 rcall .+0 ; 0x39480 39480: 1f 92 push r1 39482: 1f 92 push r1 39484: cd b7 in r28, 0x3d ; 61 39486: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; 39488: dc 01 movw r26, r24 3948a: cd 90 ld r12, X+ 3948c: dd 90 ld r13, X+ 3948e: ed 90 ld r14, X+ 39490: fc 90 ld r15, X 39492: 13 97 sbiw r26, 0x03 ; 3 39494: c0 92 b8 17 sts 0x17B8, r12 ; 0x8017b8 39498: d0 92 b9 17 sts 0x17B9, r13 ; 0x8017b9 3949c: e0 92 ba 17 sts 0x17BA, r14 ; 0x8017ba 394a0: f0 92 bb 17 sts 0x17BB, r15 ; 0x8017bb world2machine_rotation_and_skew[1][0] = vec_x[1]; 394a4: 14 96 adiw r26, 0x04 ; 4 394a6: 0d 91 ld r16, X+ 394a8: 1d 91 ld r17, X+ 394aa: 2d 91 ld r18, X+ 394ac: 3c 91 ld r19, X 394ae: 17 97 sbiw r26, 0x07 ; 7 394b0: 09 83 std Y+1, r16 ; 0x01 394b2: 1a 83 std Y+2, r17 ; 0x02 394b4: 2b 83 std Y+3, r18 ; 0x03 394b6: 3c 83 std Y+4, r19 ; 0x04 394b8: 00 93 c0 17 sts 0x17C0, r16 ; 0x8017c0 394bc: 10 93 c1 17 sts 0x17C1, r17 ; 0x8017c1 394c0: 20 93 c2 17 sts 0x17C2, r18 ; 0x8017c2 394c4: 30 93 c3 17 sts 0x17C3, r19 ; 0x8017c3 world2machine_rotation_and_skew[0][1] = vec_y[0]; 394c8: db 01 movw r26, r22 394ca: 0d 91 ld r16, X+ 394cc: 1d 91 ld r17, X+ 394ce: 2d 91 ld r18, X+ 394d0: 3c 91 ld r19, X 394d2: 13 97 sbiw r26, 0x03 ; 3 394d4: 0d 83 std Y+5, r16 ; 0x05 394d6: 1e 83 std Y+6, r17 ; 0x06 394d8: 2f 83 std Y+7, r18 ; 0x07 394da: 38 87 std Y+8, r19 ; 0x08 394dc: 00 93 bc 17 sts 0x17BC, r16 ; 0x8017bc 394e0: 10 93 bd 17 sts 0x17BD, r17 ; 0x8017bd 394e4: 20 93 be 17 sts 0x17BE, r18 ; 0x8017be 394e8: 30 93 bf 17 sts 0x17BF, r19 ; 0x8017bf world2machine_rotation_and_skew[1][1] = vec_y[1]; 394ec: 14 96 adiw r26, 0x04 ; 4 394ee: 4d 90 ld r4, X+ 394f0: 5d 90 ld r5, X+ 394f2: 6d 90 ld r6, X+ 394f4: 7c 90 ld r7, X 394f6: 17 97 sbiw r26, 0x07 ; 7 394f8: 40 92 c4 17 sts 0x17C4, r4 ; 0x8017c4 394fc: 50 92 c5 17 sts 0x17C5, r5 ; 0x8017c5 39500: 60 92 c6 17 sts 0x17C6, r6 ; 0x8017c6 39504: 70 92 c7 17 sts 0x17C7, r7 ; 0x8017c7 world2machine_shift[0] = cntr[0]; 39508: fa 01 movw r30, r20 3950a: 60 81 ld r22, Z 3950c: 71 81 ldd r23, Z+1 ; 0x01 3950e: 82 81 ldd r24, Z+2 ; 0x02 39510: 93 81 ldd r25, Z+3 ; 0x03 39512: 60 93 e3 17 sts 0x17E3, r22 ; 0x8017e3 39516: 70 93 e4 17 sts 0x17E4, r23 ; 0x8017e4 3951a: 80 93 e5 17 sts 0x17E5, r24 ; 0x8017e5 3951e: 90 93 e6 17 sts 0x17E6, r25 ; 0x8017e6 world2machine_shift[1] = cntr[1]; 39522: 84 80 ldd r8, Z+4 ; 0x04 39524: 95 80 ldd r9, Z+5 ; 0x05 39526: a6 80 ldd r10, Z+6 ; 0x06 39528: b7 80 ldd r11, Z+7 ; 0x07 3952a: 80 92 e7 17 sts 0x17E7, r8 ; 0x8017e7 3952e: 90 92 e8 17 sts 0x17E8, r9 ; 0x8017e8 39532: a0 92 e9 17 sts 0x17E9, r10 ; 0x8017e9 39536: b0 92 ea 17 sts 0x17EA, r11 ; 0x8017ea // No correction. world2machine_correction_mode = WORLD2MACHINE_CORRECTION_NONE; if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) 3953a: 20 e0 ldi r18, 0x00 ; 0 3953c: 30 e0 ldi r19, 0x00 ; 0 3953e: a9 01 movw r20, r18 39540: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 39544: 81 11 cpse r24, r1 39546: aa c0 rjmp .+340 ; 0x3969c 39548: 20 e0 ldi r18, 0x00 ; 0 3954a: 30 e0 ldi r19, 0x00 ; 0 3954c: a9 01 movw r20, r18 3954e: c5 01 movw r24, r10 39550: b4 01 movw r22, r8 39552: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 39556: 81 11 cpse r24, r1 39558: a1 c0 rjmp .+322 ; 0x3969c 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; 3955a: 10 92 eb 17 sts 0x17EB, r1 ; 0x8017eb if (world2machine_shift[0] != 0.f || world2machine_shift[1] != 0.f) // Shift correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SHIFT; if (world2machine_rotation_and_skew[0][0] != 1.f || world2machine_rotation_and_skew[0][1] != 0.f || 3955e: 20 e0 ldi r18, 0x00 ; 0 39560: 30 e0 ldi r19, 0x00 ; 0 39562: 40 e8 ldi r20, 0x80 ; 128 39564: 5f e3 ldi r21, 0x3F ; 63 39566: c7 01 movw r24, r14 39568: b6 01 movw r22, r12 3956a: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3956e: 81 11 cpse r24, r1 39570: 21 c0 rjmp .+66 ; 0x395b4 39572: 20 e0 ldi r18, 0x00 ; 0 39574: 30 e0 ldi r19, 0x00 ; 0 39576: a9 01 movw r20, r18 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: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 39584: 81 11 cpse r24, r1 39586: 16 c0 rjmp .+44 ; 0x395b4 39588: 20 e0 ldi r18, 0x00 ; 0 3958a: 30 e0 ldi r19, 0x00 ; 0 3958c: a9 01 movw r20, r18 3958e: 69 81 ldd r22, Y+1 ; 0x01 39590: 7a 81 ldd r23, Y+2 ; 0x02 39592: 8b 81 ldd r24, Y+3 ; 0x03 39594: 9c 81 ldd r25, Y+4 ; 0x04 39596: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3959a: 81 11 cpse r24, r1 3959c: 0b c0 rjmp .+22 ; 0x395b4 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { 3959e: 20 e0 ldi r18, 0x00 ; 0 395a0: 30 e0 ldi r19, 0x00 ; 0 395a2: 40 e8 ldi r20, 0x80 ; 128 395a4: 5f e3 ldi r21, 0x3F ; 63 395a6: c3 01 movw r24, r6 395a8: b2 01 movw r22, r4 395aa: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 395ae: 88 23 and r24, r24 395b0: 09 f4 brne .+2 ; 0x395b4 395b2: 78 c0 rjmp .+240 ; 0x396a4 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; 395b4: 80 91 eb 17 lds r24, 0x17EB ; 0x8017eb 395b8: 82 60 ori r24, 0x02 ; 2 395ba: 80 93 eb 17 sts 0x17EB, r24 ; 0x8017eb // Invert the world2machine matrix. float d = world2machine_rotation_and_skew[0][0] * world2machine_rotation_and_skew[1][1] - world2machine_rotation_and_skew[1][0] * world2machine_rotation_and_skew[0][1]; 395be: a3 01 movw r20, r6 395c0: 92 01 movw r18, r4 395c2: c7 01 movw r24, r14 395c4: b6 01 movw r22, r12 395c6: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 395ca: 4b 01 movw r8, r22 395cc: 5c 01 movw r10, r24 395ce: 2d 81 ldd r18, Y+5 ; 0x05 395d0: 3e 81 ldd r19, Y+6 ; 0x06 395d2: 4f 81 ldd r20, Y+7 ; 0x07 395d4: 58 85 ldd r21, Y+8 ; 0x08 395d6: 69 81 ldd r22, Y+1 ; 0x01 395d8: 7a 81 ldd r23, Y+2 ; 0x02 395da: 8b 81 ldd r24, Y+3 ; 0x03 395dc: 9c 81 ldd r25, Y+4 ; 0x04 395de: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 395e2: 9b 01 movw r18, r22 395e4: ac 01 movw r20, r24 395e6: c5 01 movw r24, r10 395e8: b4 01 movw r22, r8 395ea: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 395ee: 4b 01 movw r8, r22 395f0: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; 395f2: ac 01 movw r20, r24 395f4: 9b 01 movw r18, r22 395f6: c3 01 movw r24, r6 395f8: b2 01 movw r22, r4 395fa: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 395fe: 60 93 d3 17 sts 0x17D3, r22 ; 0x8017d3 39602: 70 93 d4 17 sts 0x17D4, r23 ; 0x8017d4 39606: 80 93 d5 17 sts 0x17D5, r24 ; 0x8017d5 3960a: 90 93 d6 17 sts 0x17D6, r25 ; 0x8017d6 world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; 3960e: 6d 81 ldd r22, Y+5 ; 0x05 39610: 7e 81 ldd r23, Y+6 ; 0x06 39612: 8f 81 ldd r24, Y+7 ; 0x07 39614: 98 85 ldd r25, Y+8 ; 0x08 39616: 90 58 subi r25, 0x80 ; 128 39618: a5 01 movw r20, r10 3961a: 94 01 movw r18, r8 3961c: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 39620: 60 93 d7 17 sts 0x17D7, r22 ; 0x8017d7 39624: 70 93 d8 17 sts 0x17D8, r23 ; 0x8017d8 39628: 80 93 d9 17 sts 0x17D9, r24 ; 0x8017d9 3962c: 90 93 da 17 sts 0x17DA, r25 ; 0x8017da world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; 39630: 69 81 ldd r22, Y+1 ; 0x01 39632: 7a 81 ldd r23, Y+2 ; 0x02 39634: 8b 81 ldd r24, Y+3 ; 0x03 39636: 9c 81 ldd r25, Y+4 ; 0x04 39638: 90 58 subi r25, 0x80 ; 128 3963a: a5 01 movw r20, r10 3963c: 94 01 movw r18, r8 3963e: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 39642: 60 93 db 17 sts 0x17DB, r22 ; 0x8017db 39646: 70 93 dc 17 sts 0x17DC, r23 ; 0x8017dc 3964a: 80 93 dd 17 sts 0x17DD, r24 ; 0x8017dd 3964e: 90 93 de 17 sts 0x17DE, r25 ; 0x8017de world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; 39652: a5 01 movw r20, r10 39654: 94 01 movw r18, r8 39656: c7 01 movw r24, r14 39658: b6 01 movw r22, r12 3965a: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__divsf3> 3965e: 60 93 df 17 sts 0x17DF, r22 ; 0x8017df 39662: 70 93 e0 17 sts 0x17E0, r23 ; 0x8017e0 39666: 80 93 e1 17 sts 0x17E1, r24 ; 0x8017e1 3966a: 90 93 e2 17 sts 0x17E2, r25 ; 0x8017e2 world2machine_rotation_and_skew_inv[0][0] = 1.f; world2machine_rotation_and_skew_inv[0][1] = 0.f; world2machine_rotation_and_skew_inv[1][0] = 0.f; world2machine_rotation_and_skew_inv[1][1] = 1.f; } } 3966e: 28 96 adiw r28, 0x08 ; 8 39670: 0f b6 in r0, 0x3f ; 63 39672: f8 94 cli 39674: de bf out 0x3e, r29 ; 62 39676: 0f be out 0x3f, r0 ; 63 39678: cd bf out 0x3d, r28 ; 61 3967a: df 91 pop r29 3967c: cf 91 pop r28 3967e: 1f 91 pop r17 39680: 0f 91 pop r16 39682: ff 90 pop r15 39684: ef 90 pop r14 39686: df 90 pop r13 39688: cf 90 pop r12 3968a: bf 90 pop r11 3968c: af 90 pop r10 3968e: 9f 90 pop r9 39690: 8f 90 pop r8 39692: 7f 90 pop r7 39694: 6f 90 pop r6 39696: 5f 90 pop r5 39698: 4f 90 pop r4 3969a: 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; 3969c: 81 e0 ldi r24, 0x01 ; 1 3969e: 80 93 eb 17 sts 0x17EB, r24 ; 0x8017eb 396a2: 5d cf rjmp .-326 ; 0x3955e 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; 396a4: 80 e0 ldi r24, 0x00 ; 0 396a6: 90 e0 ldi r25, 0x00 ; 0 396a8: a0 e8 ldi r26, 0x80 ; 128 396aa: bf e3 ldi r27, 0x3F ; 63 396ac: 80 93 d3 17 sts 0x17D3, r24 ; 0x8017d3 396b0: 90 93 d4 17 sts 0x17D4, r25 ; 0x8017d4 396b4: a0 93 d5 17 sts 0x17D5, r26 ; 0x8017d5 396b8: b0 93 d6 17 sts 0x17D6, r27 ; 0x8017d6 world2machine_rotation_and_skew_inv[0][1] = 0.f; 396bc: 10 92 d7 17 sts 0x17D7, r1 ; 0x8017d7 396c0: 10 92 d8 17 sts 0x17D8, r1 ; 0x8017d8 396c4: 10 92 d9 17 sts 0x17D9, r1 ; 0x8017d9 396c8: 10 92 da 17 sts 0x17DA, r1 ; 0x8017da world2machine_rotation_and_skew_inv[1][0] = 0.f; 396cc: 10 92 db 17 sts 0x17DB, r1 ; 0x8017db 396d0: 10 92 dc 17 sts 0x17DC, r1 ; 0x8017dc 396d4: 10 92 dd 17 sts 0x17DD, r1 ; 0x8017dd 396d8: 10 92 de 17 sts 0x17DE, r1 ; 0x8017de world2machine_rotation_and_skew_inv[1][1] = 1.f; 396dc: 80 93 df 17 sts 0x17DF, r24 ; 0x8017df 396e0: 90 93 e0 17 sts 0x17E0, r25 ; 0x8017e0 396e4: a0 93 e1 17 sts 0x17E1, r26 ; 0x8017e1 396e8: b0 93 e2 17 sts 0x17E2, r27 ; 0x8017e2 396ec: c0 cf rjmp .-128 ; 0x3966e 000396ee : * * 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() { 396ee: cf 93 push r28 396f0: df 93 push r29 396f2: cd b7 in r28, 0x3d ; 61 396f4: de b7 in r29, 0x3e ; 62 396f6: 68 97 sbiw r28, 0x18 ; 24 396f8: 0f b6 in r0, 0x3f ; 63 396fa: f8 94 cli 396fc: de bf out 0x3e, r29 ; 62 396fe: 0f be out 0x3f, r0 ; 63 39700: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; 39702: 80 e0 ldi r24, 0x00 ; 0 39704: 90 e0 ldi r25, 0x00 ; 0 39706: a0 e8 ldi r26, 0x80 ; 128 39708: bf e3 ldi r27, 0x3F ; 63 3970a: 89 83 std Y+1, r24 ; 0x01 3970c: 9a 83 std Y+2, r25 ; 0x02 3970e: ab 83 std Y+3, r26 ; 0x03 39710: bc 83 std Y+4, r27 ; 0x04 39712: 1d 82 std Y+5, r1 ; 0x05 39714: 1e 82 std Y+6, r1 ; 0x06 39716: 1f 82 std Y+7, r1 ; 0x07 39718: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; 3971a: 19 86 std Y+9, r1 ; 0x09 3971c: 1a 86 std Y+10, r1 ; 0x0a 3971e: 1b 86 std Y+11, r1 ; 0x0b 39720: 1c 86 std Y+12, r1 ; 0x0c 39722: 8d 87 std Y+13, r24 ; 0x0d 39724: 9e 87 std Y+14, r25 ; 0x0e 39726: af 87 std Y+15, r26 ; 0x0f 39728: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; 3972a: 19 8a std Y+17, r1 ; 0x11 3972c: 1a 8a std Y+18, r1 ; 0x12 3972e: 1b 8a std Y+19, r1 ; 0x13 39730: 1c 8a std Y+20, r1 ; 0x14 39732: 1d 8a std Y+21, r1 ; 0x15 39734: 1e 8a std Y+22, r1 ; 0x16 39736: 1f 8a std Y+23, r1 ; 0x17 39738: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); 3973a: ae 01 movw r20, r28 3973c: 4f 5e subi r20, 0xEF ; 239 3973e: 5f 4f sbci r21, 0xFF ; 255 39740: be 01 movw r22, r28 39742: 67 5f subi r22, 0xF7 ; 247 39744: 7f 4f sbci r23, 0xFF ; 255 39746: ce 01 movw r24, r28 39748: 01 96 adiw r24, 0x01 ; 1 3974a: 0f 94 2e ca call 0x3945c ; 0x3945c } 3974e: 68 96 adiw r28, 0x18 ; 24 39750: 0f b6 in r0, 0x3f ; 63 39752: f8 94 cli 39754: de bf out 0x3e, r29 ; 62 39756: 0f be out 0x3f, r0 ; 63 39758: cd bf out 0x3d, r28 ; 61 3975a: df 91 pop r29 3975c: cf 91 pop r28 3975e: 08 95 ret 00039760 : * * 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) { 39760: 80 91 eb 17 lds r24, 0x17EB ; 0x8017eb 39764: 88 23 and r24, r24 39766: d1 f0 breq .+52 ; 0x3979c world2machine_reset(); 39768: 0f 94 77 cb call 0x396ee ; 0x396ee st_synchronize(); 3976c: 0f 94 2c 59 call 0x2b258 ; 0x2b258 current_position[X_AXIS] = st_get_position_mm(X_AXIS); 39770: 80 e0 ldi r24, 0x00 ; 0 39772: 0f 94 18 59 call 0x2b230 ; 0x2b230 39776: 60 93 43 07 sts 0x0743, r22 ; 0x800743 3977a: 70 93 44 07 sts 0x0744, r23 ; 0x800744 3977e: 80 93 45 07 sts 0x0745, r24 ; 0x800745 39782: 90 93 46 07 sts 0x0746, r25 ; 0x800746 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 39786: 81 e0 ldi r24, 0x01 ; 1 39788: 0f 94 18 59 call 0x2b230 ; 0x2b230 3978c: 60 93 47 07 sts 0x0747, r22 ; 0x800747 39790: 70 93 48 07 sts 0x0748, r23 ; 0x800748 39794: 80 93 49 07 sts 0x0749, r24 ; 0x800749 39798: 90 93 4a 07 sts 0x074A, r25 ; 0x80074a } } 3979c: 08 95 ret 0003979e : if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); 3979e: 4f ef ldi r20, 0xFF ; 255 397a0: 5f ef ldi r21, 0xFF ; 255 397a2: ba 01 movw r22, r20 397a4: 85 ee ldi r24, 0xE5 ; 229 397a6: 9f e0 ldi r25, 0x0F ; 15 397a8: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 397ac: 4f ef ldi r20, 0xFF ; 255 397ae: 5f ef ldi r21, 0xFF ; 255 397b0: ba 01 movw r22, r20 397b2: 89 ee ldi r24, 0xE9 ; 233 397b4: 9f e0 ldi r25, 0x0F ; 15 397b6: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 397ba: 4f ef ldi r20, 0xFF ; 255 397bc: 5f ef ldi r21, 0xFF ; 255 397be: ba 01 movw r22, r20 397c0: 8d ed ldi r24, 0xDD ; 221 397c2: 9f e0 ldi r25, 0x0F ; 15 397c4: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 397c8: 4f ef ldi r20, 0xFF ; 255 397ca: 5f ef ldi r21, 0xFF ; 255 397cc: ba 01 movw r22, r20 397ce: 81 ee ldi r24, 0xE1 ; 225 397d0: 9f e0 ldi r25, 0x0F ; 15 397d2: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 397d6: 4f ef ldi r20, 0xFF ; 255 397d8: 5f ef ldi r21, 0xFF ; 255 397da: ba 01 movw r22, r20 397dc: 85 ed ldi r24, 0xD5 ; 213 397de: 9f e0 ldi r25, 0x0F ; 15 397e0: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 397e4: 4f ef ldi r20, 0xFF ; 255 397e6: 5f ef ldi r21, 0xFF ; 255 397e8: ba 01 movw r22, r20 397ea: 89 ed ldi r24, 0xD9 ; 217 397ec: 9f e0 ldi r25, 0x0F ; 15 397ee: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 397f2: 4f ef ldi r20, 0xFF ; 255 397f4: 5f ef ldi r21, 0xFF ; 255 397f6: ba 01 movw r22, r20 397f8: 85 ec ldi r24, 0xC5 ; 197 397fa: 9f e0 ldi r25, 0x0F ; 15 397fc: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 39800: 4f ef ldi r20, 0xFF ; 255 39802: 5f ef ldi r21, 0xFF ; 255 39804: ba 01 movw r22, r20 39806: 89 ec ldi r24, 0xC9 ; 201 39808: 9f e0 ldi r25, 0x0F ; 15 3980a: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 3980e: 4f ef ldi r20, 0xFF ; 255 39810: 5f ef ldi r21, 0xFF ; 255 39812: ba 01 movw r22, r20 39814: 8d ec ldi r24, 0xCD ; 205 39816: 9f e0 ldi r25, 0x0F ; 15 39818: 0f 94 c7 dd call 0x3bb8e ; 0x3bb8e 3981c: 4f ef ldi r20, 0xFF ; 255 3981e: 5f ef ldi r21, 0xFF ; 255 39820: ba 01 movw r22, r20 39822: 81 ed ldi r24, 0xD1 ; 209 39824: 9f e0 ldi r25, 0x0F ; 15 39826: 0d 94 c7 dd jmp 0x3bb8e ; 0x3bb8e 0003982a : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { 3982a: 4f 92 push r4 3982c: 5f 92 push r5 3982e: 6f 92 push r6 39830: 7f 92 push r7 39832: 8f 92 push r8 39834: 9f 92 push r9 39836: af 92 push r10 39838: bf 92 push r11 3983a: cf 92 push r12 3983c: df 92 push r13 3983e: ef 92 push r14 39840: ff 92 push r15 39842: 1f 93 push r17 39844: cf 93 push r28 39846: df 93 push r29 39848: cd b7 in r28, 0x3d ; 61 3984a: de b7 in r29, 0x3e ; 62 3984c: a8 97 sbiw r28, 0x28 ; 40 3984e: 0f b6 in r0, 0x3f ; 63 39850: f8 94 cli 39852: de bf out 0x3e, r29 ; 62 39854: 0f be out 0x3f, r0 ; 63 39856: 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); 39858: 48 e0 ldi r20, 0x08 ; 8 3985a: 50 e0 ldi r21, 0x00 ; 0 3985c: 6d ed ldi r22, 0xDD ; 221 3985e: 7f e0 ldi r23, 0x0F ; 15 39860: ce 01 movw r24, r28 39862: 01 96 adiw r24, 0x01 ; 1 39864: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 39868: 48 e0 ldi r20, 0x08 ; 8 3986a: 50 e0 ldi r21, 0x00 ; 0 3986c: 65 ed ldi r22, 0xD5 ; 213 3986e: 7f e0 ldi r23, 0x0F ; 15 39870: ce 01 movw r24, r28 39872: 09 96 adiw r24, 0x09 ; 9 39874: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); 39878: 48 e0 ldi r20, 0x08 ; 8 3987a: 50 e0 ldi r21, 0x00 ; 0 3987c: 65 ee ldi r22, 0xE5 ; 229 3987e: 7f e0 ldi r23, 0x0F ; 15 39880: ce 01 movw r24, r28 39882: 41 96 adiw r24, 0x11 ; 17 39884: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; 39888: 89 89 ldd r24, Y+17 ; 0x11 3988a: 9a 89 ldd r25, Y+18 ; 0x12 3988c: ab 89 ldd r26, Y+19 ; 0x13 3988e: bc 89 ldd r27, Y+20 ; 0x14 39890: 89 a3 std Y+33, r24 ; 0x21 39892: 9a a3 std Y+34, r25 ; 0x22 39894: ab a3 std Y+35, r26 ; 0x23 39896: bc a3 std Y+36, r27 ; 0x24 39898: 8f 3f cpi r24, 0xFF ; 255 3989a: 9f 4f sbci r25, 0xFF ; 255 3989c: af 4f sbci r26, 0xFF ; 255 3989e: bf 4f sbci r27, 0xFF ; 255 398a0: 09 f4 brne .+2 ; 0x398a4 398a2: b1 c0 rjmp .+354 ; 0x39a06 398a4: 8d 89 ldd r24, Y+21 ; 0x15 398a6: 9e 89 ldd r25, Y+22 ; 0x16 398a8: af 89 ldd r26, Y+23 ; 0x17 398aa: b8 8d ldd r27, Y+24 ; 0x18 398ac: 8d a3 std Y+37, r24 ; 0x25 398ae: 9e a3 std Y+38, r25 ; 0x26 398b0: af a3 std Y+39, r26 ; 0x27 398b2: b8 a7 std Y+40, r27 ; 0x28 398b4: 8f 3f cpi r24, 0xFF ; 255 398b6: 9f 4f sbci r25, 0xFF ; 255 398b8: af 4f sbci r26, 0xFF ; 255 398ba: bf 4f sbci r27, 0xFF ; 255 398bc: 09 f4 brne .+2 ; 0x398c0 398be: a3 c0 rjmp .+326 ; 0x39a06 398c0: 89 80 ldd r8, Y+1 ; 0x01 398c2: 9a 80 ldd r9, Y+2 ; 0x02 398c4: ab 80 ldd r10, Y+3 ; 0x03 398c6: bc 80 ldd r11, Y+4 ; 0x04 398c8: 8f ef ldi r24, 0xFF ; 255 398ca: 88 16 cp r8, r24 398cc: 98 06 cpc r9, r24 398ce: a8 06 cpc r10, r24 398d0: b8 06 cpc r11, r24 398d2: 09 f4 brne .+2 ; 0x398d6 398d4: 98 c0 rjmp .+304 ; 0x39a06 398d6: 8d 81 ldd r24, Y+5 ; 0x05 398d8: 9e 81 ldd r25, Y+6 ; 0x06 398da: af 81 ldd r26, Y+7 ; 0x07 398dc: b8 85 ldd r27, Y+8 ; 0x08 398de: 89 8f std Y+25, r24 ; 0x19 398e0: 9a 8f std Y+26, r25 ; 0x1a 398e2: ab 8f std Y+27, r26 ; 0x1b 398e4: bc 8f std Y+28, r27 ; 0x1c 398e6: 8f 3f cpi r24, 0xFF ; 255 398e8: 9f 4f sbci r25, 0xFF ; 255 398ea: af 4f sbci r26, 0xFF ; 255 398ec: bf 4f sbci r27, 0xFF ; 255 398ee: 09 f4 brne .+2 ; 0x398f2 398f0: 8a c0 rjmp .+276 ; 0x39a06 398f2: c9 84 ldd r12, Y+9 ; 0x09 398f4: da 84 ldd r13, Y+10 ; 0x0a 398f6: eb 84 ldd r14, Y+11 ; 0x0b 398f8: fc 84 ldd r15, Y+12 ; 0x0c 398fa: 8f ef ldi r24, 0xFF ; 255 398fc: c8 16 cp r12, r24 398fe: d8 06 cpc r13, r24 39900: e8 06 cpc r14, r24 39902: f8 06 cpc r15, r24 39904: 09 f4 brne .+2 ; 0x39908 39906: 7f c0 rjmp .+254 ; 0x39a06 39908: 8d 85 ldd r24, Y+13 ; 0x0d 3990a: 9e 85 ldd r25, Y+14 ; 0x0e 3990c: af 85 ldd r26, Y+15 ; 0x0f 3990e: b8 89 ldd r27, Y+16 ; 0x10 39910: 8d 8f std Y+29, r24 ; 0x1d 39912: 9e 8f std Y+30, r25 ; 0x1e 39914: af 8f std Y+31, r26 ; 0x1f 39916: b8 a3 std Y+32, r27 ; 0x20 39918: 8f 3f cpi r24, 0xFF ; 255 3991a: 9f 4f sbci r25, 0xFF ; 255 3991c: af 4f sbci r26, 0xFF ; 255 3991e: bf 4f sbci r27, 0xFF ; 255 39920: 09 f4 brne .+2 ; 0x39924 39922: 71 c0 rjmp .+226 ; 0x39a06 reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); 39924: 29 8d ldd r18, Y+25 ; 0x19 39926: 3a 8d ldd r19, Y+26 ; 0x1a 39928: 4b 8d ldd r20, Y+27 ; 0x1b 3992a: 5c 8d ldd r21, Y+28 ; 0x1c 3992c: c5 01 movw r24, r10 3992e: b4 01 movw r22, r8 39930: 0f 94 55 e1 call 0x3c2aa ; 0x3c2aa 39934: 2b 01 movw r4, r22 39936: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39938: 26 e6 ldi r18, 0x66 ; 102 3993a: 36 e6 ldi r19, 0x66 ; 102 3993c: 46 e6 ldi r20, 0x66 ; 102 3993e: 5f e3 ldi r21, 0x3F ; 63 39940: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__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; 39944: 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) 39946: 87 fd sbrc r24, 7 39948: 0b c0 rjmp .+22 ; 0x39960 3994a: 2d ec ldi r18, 0xCD ; 205 3994c: 3c ec ldi r19, 0xCC ; 204 3994e: 4c e8 ldi r20, 0x8C ; 140 39950: 5f e3 ldi r21, 0x3F ; 63 39952: c3 01 movw r24, r6 39954: b2 01 movw r22, r4 39956: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 3995a: 18 16 cp r1, r24 3995c: 0c f0 brlt .+2 ; 0x39960 3995e: 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]); 39960: 2d 8d ldd r18, Y+29 ; 0x1d 39962: 3e 8d ldd r19, Y+30 ; 0x1e 39964: 4f 8d ldd r20, Y+31 ; 0x1f 39966: 58 a1 ldd r21, Y+32 ; 0x20 39968: c7 01 movw r24, r14 3996a: b6 01 movw r22, r12 3996c: 0f 94 55 e1 call 0x3c2aa ; 0x3c2aa 39970: 2b 01 movw r4, r22 39972: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) 39974: 26 e6 ldi r18, 0x66 ; 102 39976: 36 e6 ldi r19, 0x66 ; 102 39978: 46 e6 ldi r20, 0x66 ; 102 3997a: 5f e3 ldi r21, 0x3F ; 63 3997c: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 39980: 87 fd sbrc r24, 7 39982: 7f c0 rjmp .+254 ; 0x39a82 39984: 2d ec ldi r18, 0xCD ; 205 39986: 3c ec ldi r19, 0xCC ; 204 39988: 4c e8 ldi r20, 0x8C ; 140 3998a: 5f e3 ldi r21, 0x3F ; 63 3998c: c3 01 movw r24, r6 3998e: b2 01 movw r22, r4 39990: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 39994: 18 16 cp r1, r24 39996: 0c f4 brge .+2 ; 0x3999a 39998: 74 c0 rjmp .+232 ; 0x39a82 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]); 3999a: 2d a1 ldd r18, Y+37 ; 0x25 3999c: 3e a1 ldd r19, Y+38 ; 0x26 3999e: 4f a1 ldd r20, Y+39 ; 0x27 399a0: 58 a5 ldd r21, Y+40 ; 0x28 399a2: 69 a1 ldd r22, Y+33 ; 0x21 399a4: 7a a1 ldd r23, Y+34 ; 0x22 399a6: 8b a1 ldd r24, Y+35 ; 0x23 399a8: 9c a1 ldd r25, Y+36 ; 0x24 399aa: 0f 94 55 e1 call 0x3c2aa ; 0x3c2aa if (l > 15.f) 399ae: 20 e0 ldi r18, 0x00 ; 0 399b0: 30 e0 ldi r19, 0x00 ; 0 399b2: 40 e7 ldi r20, 0x70 ; 112 399b4: 51 e4 ldi r21, 0x41 ; 65 399b6: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 399ba: 18 16 cp r1, r24 399bc: 0c f4 brge .+2 ; 0x399c0 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; 399be: 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]; 399c0: a5 01 movw r20, r10 399c2: 94 01 movw r18, r8 399c4: c7 01 movw r24, r14 399c6: b6 01 movw r22, r12 399c8: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 399cc: 6b 01 movw r12, r22 399ce: 7c 01 movw r14, r24 399d0: 2d 8d ldd r18, Y+29 ; 0x1d 399d2: 3e 8d ldd r19, Y+30 ; 0x1e 399d4: 4f 8d ldd r20, Y+31 ; 0x1f 399d6: 58 a1 ldd r21, Y+32 ; 0x20 399d8: 69 8d ldd r22, Y+25 ; 0x19 399da: 7a 8d ldd r23, Y+26 ; 0x1a 399dc: 8b 8d ldd r24, Y+27 ; 0x1b 399de: 9c 8d ldd r25, Y+28 ; 0x1c 399e0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 399e4: 9b 01 movw r18, r22 399e6: ac 01 movw r20, r24 399e8: c7 01 movw r24, r14 399ea: b6 01 movw r22, r12 399ec: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> if (fabs(l) > 0.1f) 399f0: 9f 77 andi r25, 0x7F ; 127 399f2: 2d ec ldi r18, 0xCD ; 205 399f4: 3c ec ldi r19, 0xCC ; 204 399f6: 4c ec ldi r20, 0xCC ; 204 399f8: 5d e3 ldi r21, 0x3D ; 61 399fa: 0f 94 42 e1 call 0x3c284 ; 0x3c284 <__gesf2> 399fe: 18 16 cp r1, r24 39a00: 14 f0 brlt .+4 ; 0x39a06 #endif reset = true; } } if (reset) 39a02: 11 23 and r17, r17 39a04: f1 f0 breq .+60 ; 0x39a42 { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); 39a06: 0f 94 cf cb call 0x3979e ; 0x3979e * @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; 39a0a: 80 e0 ldi r24, 0x00 ; 0 39a0c: 90 e0 ldi r25, 0x00 ; 0 39a0e: a0 e8 ldi r26, 0x80 ; 128 39a10: bf e3 ldi r27, 0x3F ; 63 39a12: 89 83 std Y+1, r24 ; 0x01 39a14: 9a 83 std Y+2, r25 ; 0x02 39a16: ab 83 std Y+3, r26 ; 0x03 39a18: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; 39a1a: 1d 82 std Y+5, r1 ; 0x05 39a1c: 1e 82 std Y+6, r1 ; 0x06 39a1e: 1f 82 std Y+7, r1 ; 0x07 39a20: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; 39a22: 19 86 std Y+9, r1 ; 0x09 39a24: 1a 86 std Y+10, r1 ; 0x0a 39a26: 1b 86 std Y+11, r1 ; 0x0b 39a28: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; 39a2a: 8d 87 std Y+13, r24 ; 0x0d 39a2c: 9e 87 std Y+14, r25 ; 0x0e 39a2e: af 87 std Y+15, r26 ; 0x0f 39a30: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; 39a32: 19 8a std Y+17, r1 ; 0x11 39a34: 1a 8a std Y+18, r1 ; 0x12 39a36: 1b 8a std Y+19, r1 ; 0x13 39a38: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; 39a3a: 1d 8a std Y+21, r1 ; 0x15 39a3c: 1e 8a std Y+22, r1 ; 0x16 39a3e: 1f 8a std Y+23, r1 ; 0x17 39a40: 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); 39a42: ae 01 movw r20, r28 39a44: 4f 5e subi r20, 0xEF ; 239 39a46: 5f 4f sbci r21, 0xFF ; 255 39a48: be 01 movw r22, r28 39a4a: 67 5f subi r22, 0xF7 ; 247 39a4c: 7f 4f sbci r23, 0xFF ; 255 39a4e: ce 01 movw r24, r28 39a50: 01 96 adiw r24, 0x01 ; 1 39a52: 0f 94 2e ca call 0x3945c ; 0x3945c MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } 39a56: a8 96 adiw r28, 0x28 ; 40 39a58: 0f b6 in r0, 0x3f ; 63 39a5a: f8 94 cli 39a5c: de bf out 0x3e, r29 ; 62 39a5e: 0f be out 0x3f, r0 ; 63 39a60: cd bf out 0x3d, r28 ; 61 39a62: df 91 pop r29 39a64: cf 91 pop r28 39a66: 1f 91 pop r17 39a68: ff 90 pop r15 39a6a: ef 90 pop r14 39a6c: df 90 pop r13 39a6e: cf 90 pop r12 39a70: bf 90 pop r11 39a72: af 90 pop r10 39a74: 9f 90 pop r9 39a76: 8f 90 pop r8 39a78: 7f 90 pop r7 39a7a: 6f 90 pop r6 39a7c: 5f 90 pop r5 39a7e: 4f 90 pop r4 39a80: 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; 39a82: 11 e0 ldi r17, 0x01 ; 1 39a84: 8a cf rjmp .-236 ; 0x3999a 00039a86 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { 39a86: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; 39a88: 24 e1 ldi r18, 0x14 ; 20 39a8a: ac 01 movw r20, r24 39a8c: 24 9f mul r18, r20 39a8e: c0 01 movw r24, r0 39a90: 25 9f mul r18, r21 39a92: 90 0d add r25, r0 39a94: 11 24 eor r1, r1 39a96: 60 91 b6 17 lds r22, 0x17B6 ; 0x8017b6 39a9a: 70 91 b7 17 lds r23, 0x17B7 ; 0x8017b7 39a9e: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 39aa2: c6 2f mov r28, r22 39aa4: 65 31 cpi r22, 0x15 ; 21 39aa6: 08 f0 brcs .+2 ; 0x39aaa 39aa8: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) 39aaa: 80 91 b5 17 lds r24, 0x17B5 ; 0x8017b5 39aae: 8c 17 cp r24, r28 39ab0: 48 f4 brcc .+18 ; 0x39ac4 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 39ab2: 8f ef ldi r24, 0xFF ; 255 39ab4: 0e 94 44 70 call 0xe088 ; 0xe088 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; 39ab8: 80 91 b5 17 lds r24, 0x17B5 ; 0x8017b5 39abc: 8f 5f subi r24, 0xFF ; 255 39abe: 80 93 b5 17 sts 0x17B5, r24 ; 0x8017b5 39ac2: f3 cf rjmp .-26 ; 0x39aaa } } 39ac4: cf 91 pop r28 39ac6: 08 95 ret 00039ac8 : void menu_progressbar_finish(void) { progressbar_total = 1; 39ac8: 81 e0 ldi r24, 0x01 ; 1 39aca: 90 e0 ldi r25, 0x00 ; 0 39acc: 90 93 b7 17 sts 0x17B7, r25 ; 0x8017b7 39ad0: 80 93 b6 17 sts 0x17B6, r24 ; 0x8017b6 menu_progressbar_update(1); 39ad4: 0f 94 43 cd call 0x39a86 ; 0x39a86 _delay(300); 39ad8: 6c e2 ldi r22, 0x2C ; 44 39ada: 71 e0 ldi r23, 0x01 ; 1 39adc: 80 e0 ldi r24, 0x00 ; 0 39ade: 90 e0 ldi r25, 0x00 ; 0 39ae0: 0d 94 92 3d jmp 0x27b24 ; 0x27b24 00039ae4 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { 39ae4: 0f 93 push r16 39ae6: 1f 93 push r17 39ae8: cf 93 push r28 39aea: df 93 push r29 39aec: 8c 01 movw r16, r24 39aee: eb 01 movw r28, r22 lcd_clear(); 39af0: 0e 94 c8 6f call 0xdf90 ; 0xdf90 progressbar_block_count = 0; 39af4: 10 92 b5 17 sts 0x17B5, r1 ; 0x8017b5 progressbar_total = total; 39af8: 10 93 b7 17 sts 0x17B7, r17 ; 0x8017b7 39afc: 00 93 b6 17 sts 0x17B6, r16 ; 0x8017b6 lcd_set_cursor(0, 1); 39b00: 61 e0 ldi r22, 0x01 ; 1 39b02: 80 e0 ldi r24, 0x00 ; 0 39b04: 0e 94 95 6f call 0xdf2a ; 0xdf2a lcd_print_pad_P(title, LCD_WIDTH); 39b08: 64 e1 ldi r22, 0x14 ; 20 39b0a: ce 01 movw r24, r28 39b0c: 0e 94 6a 71 call 0xe2d4 ; 0xe2d4 lcd_set_cursor(0, 2); 39b10: 62 e0 ldi r22, 0x02 ; 2 39b12: 80 e0 ldi r24, 0x00 ; 0 } 39b14: df 91 pop r29 39b16: cf 91 pop r28 39b18: 1f 91 pop r17 39b1a: 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); 39b1c: 0c 94 95 6f jmp 0xdf2a ; 0xdf2a 00039b20 : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; 39b20: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39b24: 90 91 17 05 lds r25, 0x0517 ; 0x800517 39b28: 89 13 cpse r24, r25 39b2a: 0b c0 rjmp .+22 ; 0x39b42 39b2c: 90 91 16 05 lds r25, 0x0516 ; 0x800516 39b30: 99 23 and r25, r25 39b32: 39 f0 breq .+14 ; 0x39b42 39b34: 20 91 37 05 lds r18, 0x0537 ; 0x800537 39b38: 30 91 38 05 lds r19, 0x0538 ; 0x800538 39b3c: 82 17 cp r24, r18 39b3e: 13 06 cpc r1, r19 39b40: 39 f0 breq .+14 ; 0x39b50 39b42: 81 e0 ldi r24, 0x01 ; 1 39b44: 90 91 d3 03 lds r25, 0x03D3 ; 0x8003d3 39b48: 91 11 cpse r25, r1 39b4a: 03 c0 rjmp .+6 ; 0x39b52 39b4c: 80 e0 ldi r24, 0x00 ; 0 39b4e: 08 95 ret 39b50: 81 e0 ldi r24, 0x01 ; 1 } 39b52: 08 95 ret 00039b54 : //! @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) { 39b54: 0f 93 push r16 39b56: 1f 93 push r17 39b58: cf 93 push r28 39b5a: df 93 push r29 39b5c: 8c 01 movw r16, r24 39b5e: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); 39b60: 8b e9 ldi r24, 0x9B ; 155 39b62: 93 e4 ldi r25, 0x43 ; 67 39b64: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 39b68: 9f 93 push r25 39b6a: 8f 93 push r24 39b6c: 88 e0 ldi r24, 0x08 ; 8 39b6e: 9a ea ldi r25, 0xAA ; 170 39b70: 9f 93 push r25 39b72: 8f 93 push r24 39b74: df 93 push r29 39b76: cf 93 push r28 39b78: 0f 94 a8 dc call 0x3b950 ; 0x3b950 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); 39b7c: c8 0f add r28, r24 39b7e: d1 1d adc r29, r1 39b80: 47 e0 ldi r20, 0x07 ; 7 39b82: 50 e0 ldi r21, 0x00 ; 0 39b84: b8 01 movw r22, r16 39b86: ce 01 movw r24, r28 39b88: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 //index += 7; buffer.c[index + 7] = '\0'; 39b8c: 1f 82 std Y+7, r1 ; 0x07 39b8e: 0f 90 pop r0 39b90: 0f 90 pop r0 39b92: 0f 90 pop r0 39b94: 0f 90 pop r0 39b96: 0f 90 pop r0 39b98: 0f 90 pop r0 } 39b9a: df 91 pop r29 39b9c: cf 91 pop r28 39b9e: 1f 91 pop r17 39ba0: 0f 91 pop r16 39ba2: 08 95 ret 00039ba4 : 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)?'>':' '; 39ba4: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39ba8: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39bac: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39bb0: 28 17 cp r18, r24 39bb2: 19 06 cpc r1, r25 39bb4: 11 f0 breq .+4 ; 0x39bba 39bb6: 80 e2 ldi r24, 0x20 ; 32 39bb8: 08 95 ret 39bba: 8e e3 ldi r24, 0x3E ; 62 } 39bbc: 08 95 ret 00039bbe : static void menu_draw_item_puts_P(char type_char, const char* str) { 39bbe: 0f 93 push r16 39bc0: 1f 93 push r17 39bc2: cf 93 push r28 39bc4: c8 2f mov r28, r24 39bc6: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); 39bc8: 0f 94 d2 cd call 0x39ba4 ; 0x39ba4 39bcc: 48 2f mov r20, r24 39bce: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39bd2: 80 e0 ldi r24, 0x00 ; 0 39bd4: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_pad_P(str, LCD_WIDTH - 2); 39bd8: 62 e1 ldi r22, 0x12 ; 18 39bda: c8 01 movw r24, r16 39bdc: 0e 94 6a 71 call 0xe2d4 ; 0xe2d4 lcd_putc(type_char); 39be0: 8c 2f mov r24, r28 } 39be2: cf 91 pop r28 39be4: 1f 91 pop r17 39be6: 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); 39be8: 0c 94 84 6f jmp 0xdf08 ; 0xdf08 00039bec : } } void menu_item_ret(void) { lcd_draw_update = 2; 39bec: 82 e0 ldi r24, 0x02 ; 2 39bee: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d menu_item++; 39bf2: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39bf6: 8f 5f subi r24, 0xFF ; 255 39bf8: 80 93 18 05 sts 0x0518, r24 ; 0x800518 //prevent the rest of the menu items from rendering or getting clicked menu_row = LCD_HEIGHT; // early exit from the MENU_BEGIN() for loop at the end of the current cycle 39bfc: 84 e0 ldi r24, 0x04 ; 4 39bfe: 80 93 15 05 sts 0x0515, r24 ; 0x800515 menu_line = 0; // prevent subsequent menu items from rendering at all in the current MENU_BEGIN() for loop cycle 39c02: 10 92 17 05 sts 0x0517, r1 ; 0x800517 menu_clicked = 0; // prevent subsequent items from being able to be clicked in case the current menu or position was changed by the clicked menu item 39c06: 10 92 16 05 sts 0x0516, r1 ; 0x800516 } 39c0a: 08 95 ret 00039c0c : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 39c0c: cf 93 push r28 39c0e: df 93 push r29 if (menu_item == menu_line) 39c10: 30 91 18 05 lds r19, 0x0518 ; 0x800518 39c14: 20 91 17 05 lds r18, 0x0517 ; 0x800517 39c18: 32 13 cpse r19, r18 39c1a: 20 c0 rjmp .+64 ; 0x39c5c 39c1c: eb 01 movw r28, r22 39c1e: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39c20: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c24: 88 23 and r24, r24 39c26: 19 f0 breq .+6 ; 0x39c2e 39c28: 80 e2 ldi r24, 0x20 ; 32 39c2a: 0f 94 df cd call 0x39bbe ; 0x39bbe if (menu_clicked && (lcd_encoder == menu_item)) 39c2e: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39c32: 88 23 and r24, r24 39c34: 99 f0 breq .+38 ; 0x39c5c 39c36: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39c3a: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39c3e: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39c42: 28 17 cp r18, r24 39c44: 19 06 cpc r1, r25 39c46: 51 f4 brne .+20 ; 0x39c5c { if (str_gcode) enquecommand_P(str_gcode); 39c48: 20 97 sbiw r28, 0x00 ; 0 39c4a: 21 f0 breq .+8 ; 0x39c54 39c4c: 61 e0 ldi r22, 0x01 ; 1 39c4e: ce 01 movw r24, r28 39c50: 0e 94 4b 89 call 0x11296 ; 0x11296 menu_item_ret(); return; } } menu_item++; } 39c54: df 91 pop r29 39c56: 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(); 39c58: 0d 94 f6 cd jmp 0x39bec ; 0x39bec return; } } menu_item++; 39c5c: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39c60: 8f 5f subi r24, 0xFF ; 255 39c62: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39c66: df 91 pop r29 39c68: cf 91 pop r28 39c6a: 08 95 ret 00039c6c : //! @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) { 39c6c: ef 92 push r14 39c6e: ff 92 push r15 39c70: 0f 93 push r16 39c72: 1f 93 push r17 39c74: cf 93 push r28 39c76: df 93 push r29 if (menu_item == menu_line) 39c78: 70 91 18 05 lds r23, 0x0518 ; 0x800518 39c7c: 30 91 17 05 lds r19, 0x0517 ; 0x800517 39c80: 73 13 cpse r23, r19 39c82: 3f c0 rjmp .+126 ; 0x39d02 39c84: 12 2f mov r17, r18 39c86: ea 01 movw r28, r20 39c88: 06 2f mov r16, r22 39c8a: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); 39c8c: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39c90: 88 23 and r24, r24 39c92: d1 f0 breq .+52 ; 0x39cc8 } 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()); 39c94: 0f 94 d2 cd call 0x39ba4 ; 0x39ba4 39c98: 48 2f mov r20, r24 39c9a: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39c9e: 80 e0 ldi r24, 0x00 ; 0 39ca0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a uint8_t len = lcd_print_pad_P(str, max_strlen); 39ca4: 61 e1 ldi r22, 0x11 ; 17 39ca6: c7 01 movw r24, r14 39ca8: 0e 94 6a 71 call 0xe2d4 ; 0xe2d4 lcd_putc_at((max_strlen - len) + 2, menu_row, num); 39cac: 40 2f mov r20, r16 39cae: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39cb2: 93 e1 ldi r25, 0x13 ; 19 39cb4: 98 1b sub r25, r24 39cb6: 89 2f mov r24, r25 39cb8: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); 39cbc: 40 e2 ldi r20, 0x20 ; 32 39cbe: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39cc2: 83 e1 ldi r24, 0x13 ; 19 39cc4: 0e 94 b5 6f call 0xdf6a ; 0xdf6a 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)) 39cc8: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39ccc: 88 23 and r24, r24 39cce: c9 f0 breq .+50 ; 0x39d02 39cd0: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39cd4: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39cd8: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39cdc: 28 17 cp r18, r24 39cde: 19 06 cpc r1, r25 39ce0: 81 f4 brne .+32 ; 0x39d02 { lcd_update_enabled = 0; 39ce2: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(fn_par); 39ce6: 81 2f mov r24, r17 39ce8: fe 01 movw r30, r28 39cea: 19 95 eicall lcd_update_enabled = 1; 39cec: 81 e0 ldi r24, 0x01 ; 1 39cee: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39cf2: df 91 pop r29 39cf4: cf 91 pop r28 39cf6: 1f 91 pop r17 39cf8: 0f 91 pop r16 39cfa: ff 90 pop r15 39cfc: 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(); 39cfe: 0d 94 f6 cd jmp 0x39bec ; 0x39bec return; } } menu_item++; 39d02: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39d06: 8f 5f subi r24, 0xFF ; 255 39d08: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39d0c: df 91 pop r29 39d0e: cf 91 pop r28 39d10: 1f 91 pop r17 39d12: 0f 91 pop r16 39d14: ff 90 pop r15 39d16: ef 90 pop r14 39d18: 08 95 ret 00039d1a : 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) { 39d1a: cf 93 push r28 39d1c: df 93 push r29 if (menu_item == menu_line) 39d1e: 30 91 18 05 lds r19, 0x0518 ; 0x800518 39d22: 20 91 17 05 lds r18, 0x0517 ; 0x800517 39d26: 32 13 cpse r19, r18 39d28: 21 c0 rjmp .+66 ; 0x39d6c 39d2a: eb 01 movw r28, r22 39d2c: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39d2e: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39d32: 88 23 and r24, r24 39d34: 19 f0 breq .+6 ; 0x39d3c 39d36: 80 e2 ldi r24, 0x20 ; 32 39d38: 0f 94 df cd call 0x39bbe ; 0x39bbe if (menu_clicked && (lcd_encoder == menu_item)) 39d3c: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39d40: 88 23 and r24, r24 39d42: a1 f0 breq .+40 ; 0x39d6c 39d44: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39d48: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39d4c: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39d50: 28 17 cp r18, r24 39d52: 19 06 cpc r1, r25 39d54: 59 f4 brne .+22 ; 0x39d6c { lcd_update_enabled = 0; 39d56: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 39d5a: fe 01 movw r30, r28 39d5c: 19 95 eicall lcd_update_enabled = 1; 39d5e: 81 e0 ldi r24, 0x01 ; 1 39d60: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e menu_item_ret(); return; } } menu_item++; } 39d64: df 91 pop r29 39d66: 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(); 39d68: 0d 94 f6 cd jmp 0x39bec ; 0x39bec return; } } menu_item++; 39d6c: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39d70: 8f 5f subi r24, 0xFF ; 255 39d72: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39d76: df 91 pop r29 39d78: cf 91 pop r28 39d7a: 08 95 ret 00039d7c : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) 39d7c: 30 91 18 05 lds r19, 0x0518 ; 0x800518 39d80: 20 91 17 05 lds r18, 0x0517 ; 0x800517 39d84: 32 13 cpse r19, r18 39d86: 19 c0 rjmp .+50 ; 0x39dba 39d88: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 39d8a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39d8e: 88 23 and r24, r24 39d90: 19 f0 breq .+6 ; 0x39d98 39d92: 80 e2 ldi r24, 0x20 ; 32 39d94: 0f 94 df cd call 0x39bbe ; 0x39bbe if (menu_clicked && (lcd_encoder == menu_item)) 39d98: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39d9c: 88 23 and r24, r24 39d9e: 69 f0 breq .+26 ; 0x39dba 39da0: 20 91 18 05 lds r18, 0x0518 ; 0x800518 39da4: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39da8: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39dac: 28 17 cp r18, r24 39dae: 19 06 cpc r1, r25 39db0: 21 f4 brne .+8 ; 0x39dba { menu_item_ret(); 39db2: 0f 94 f6 cd call 0x39bec ; 0x39bec return 1; 39db6: 81 e0 ldi r24, 0x01 ; 1 39db8: 08 95 ret } } menu_item++; 39dba: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39dbe: 8f 5f subi r24, 0xFF ; 255 39dc0: 80 93 18 05 sts 0x0518, r24 ; 0x800518 return 0; 39dc4: 80 e0 ldi r24, 0x00 ; 0 } 39dc6: 08 95 ret 00039dc8 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) 39dc8: 80 91 15 05 lds r24, 0x0515 ; 0x800515 39dcc: 84 30 cpi r24, 0x04 ; 4 39dce: 38 f5 brcc .+78 ; 0x39e1e { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) 39dd0: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39dd4: 90 e0 ldi r25, 0x00 ; 0 39dd6: 20 91 37 05 lds r18, 0x0537 ; 0x800537 39dda: 30 91 38 05 lds r19, 0x0538 ; 0x800538 39dde: 28 17 cp r18, r24 39de0: 39 07 cpc r19, r25 39de2: 44 f0 brlt .+16 ; 0x39df4 { lcd_encoder = menu_item - 1; 39de4: 01 97 sbiw r24, 0x01 ; 1 39de6: 90 93 38 05 sts 0x0538, r25 ; 0x800538 39dea: 80 93 37 05 sts 0x0537, r24 ; 0x800537 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39dee: 87 e0 ldi r24, 0x07 ; 7 39df0: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) 39df4: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39df8: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 39dfc: 30 e0 ldi r19, 0x00 ; 0 39dfe: 2d 5f subi r18, 0xFD ; 253 39e00: 3f 4f sbci r19, 0xFF ; 255 39e02: 82 17 cp r24, r18 39e04: 13 06 cpc r1, r19 39e06: 59 f0 breq .+22 ; 0x39e1e 39e08: 54 f0 brlt .+20 ; 0x39e1e { menu_top = lcd_encoder - LCD_HEIGHT + 1; 39e0a: 9d ef ldi r25, 0xFD ; 253 39e0c: 98 0f add r25, r24 39e0e: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 menu_line = menu_top - 1; 39e12: 84 50 subi r24, 0x04 ; 4 39e14: 80 93 17 05 sts 0x0517, r24 ; 0x800517 menu_row = -1; 39e18: 8f ef ldi r24, 0xFF ; 255 39e1a: 80 93 15 05 sts 0x0515, r24 ; 0x800515 } } 39e1e: 08 95 ret 00039e20 : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) 39e20: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39e24: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39e28: 97 ff sbrs r25, 7 39e2a: 07 c0 rjmp .+14 ; 0x39e3a { lcd_encoder = 0; 39e2c: 10 92 38 05 sts 0x0538, r1 ; 0x800538 39e30: 10 92 37 05 sts 0x0537, r1 ; 0x800537 Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 39e34: 87 e0 ldi r24, 0x07 ; 7 39e36: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe } if (lcd_encoder < menu_top) 39e3a: 80 91 37 05 lds r24, 0x0537 ; 0x800537 39e3e: 90 91 38 05 lds r25, 0x0538 ; 0x800538 39e42: 20 91 a5 03 lds r18, 0x03A5 ; 0x8003a5 39e46: 28 17 cp r18, r24 39e48: 19 06 cpc r1, r25 39e4a: 19 f0 breq .+6 ; 0x39e52 39e4c: 14 f0 brlt .+4 ; 0x39e52 menu_top = lcd_encoder; 39e4e: 80 93 a5 03 sts 0x03A5, r24 ; 0x8003a5 menu_line = menu_top; 39e52: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 39e56: 80 93 17 05 sts 0x0517, r24 ; 0x800517 menu_clicked = lcd_clicked(); // Consume click event 39e5a: 0e 94 b2 71 call 0xe364 ; 0xe364 39e5e: 80 93 16 05 sts 0x0516, r24 ; 0x800516 } 39e62: 08 95 ret 00039e64 : 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)); 39e64: e9 ea ldi r30, 0xA9 ; 169 39e66: f3 e0 ldi r31, 0x03 ; 3 39e68: 80 e2 ldi r24, 0x20 ; 32 39e6a: df 01 movw r26, r30 39e6c: 1d 92 st X+, r1 39e6e: 8a 95 dec r24 39e70: e9 f7 brne .-6 ; 0x39e6c } 39e72: 08 95 ret 00039e74 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { 39e74: cf 93 push r28 CRITICAL_SECTION_START; 39e76: 3f b7 in r19, 0x3f ; 63 39e78: f8 94 cli if (menu_menu != menu) 39e7a: e0 91 69 0e lds r30, 0x0E69 ; 0x800e69 39e7e: f0 91 6a 0e lds r31, 0x0E6A ; 0x800e6a 39e82: e8 17 cp r30, r24 39e84: f9 07 cpc r31, r25 39e86: c9 f0 breq .+50 ; 0x39eba 39e88: c4 2f mov r28, r20 { menu_menu = menu; 39e8a: 90 93 6a 0e sts 0x0E6A, r25 ; 0x800e6a 39e8e: 80 93 69 0e sts 0x0E69, r24 ; 0x800e69 lcd_encoder = encoder; 39e92: 70 93 38 05 sts 0x0538, r23 ; 0x800538 39e96: 60 93 37 05 sts 0x0537, r22 ; 0x800537 menu_top = 0; //reset menu view. Needed if menu_back() is called from deep inside a menu, such as Support 39e9a: 10 92 a5 03 sts 0x03A5, r1 ; 0x8003a5 lcd_draw_update = 2; // Full LCD re-draw 39e9e: 82 e0 ldi r24, 0x02 ; 2 39ea0: 80 93 6d 02 sts 0x026D, r24 ; 0x80026d CRITICAL_SECTION_END; 39ea4: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); 39ea6: 22 23 and r18, r18 39ea8: 19 f0 breq .+6 ; 0x39eb0 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 39eaa: 80 e0 ldi r24, 0x00 ; 0 39eac: 0f 94 7f 64 call 0x2c8fe ; 0x2c8fe if (reset_menu_state) menu_data_reset(); 39eb0: cc 23 and r28, r28 39eb2: 21 f0 breq .+8 ; 0x39ebc } else CRITICAL_SECTION_END; } 39eb4: 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(); 39eb6: 0d 94 32 cf jmp 0x39e64 ; 0x39e64 } else CRITICAL_SECTION_END; 39eba: 3f bf out 0x3f, r19 ; 63 } 39ebc: cf 91 pop r28 39ebe: 08 95 ret 00039ec0 : 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) { 39ec0: 7f 92 push r7 39ec2: 8f 92 push r8 39ec4: 9f 92 push r9 39ec6: af 92 push r10 39ec8: bf 92 push r11 39eca: cf 92 push r12 39ecc: df 92 push r13 39ece: ef 92 push r14 39ed0: ff 92 push r15 39ed2: 0f 93 push r16 39ed4: 1f 93 push r17 39ed6: cf 93 push r28 39ed8: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) 39eda: e0 91 18 05 lds r30, 0x0518 ; 0x800518 39ede: 50 91 17 05 lds r21, 0x0517 ; 0x800517 39ee2: e5 13 cpse r30, r21 39ee4: 73 c0 rjmp .+230 ; 0x39fcc { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); 39ee6: fb 01 movw r30, r22 39ee8: 48 30 cpi r20, 0x08 ; 8 39eea: 09 f0 breq .+2 ; 0x39eee 39eec: 6c c0 rjmp .+216 ; 0x39fc6 39eee: c0 81 ld r28, Z 39ef0: d0 e0 ldi r29, 0x00 ; 0 39ef2: 49 01 movw r8, r18 39ef4: 74 2e mov r7, r20 39ef6: 6b 01 movw r12, r22 39ef8: 5c 01 movw r10, r24 if (lcd_draw_update) 39efa: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39efe: 88 23 and r24, r24 39f00: 59 f0 breq .+22 ; 0x39f18 { lcd_set_cursor(0, menu_row); 39f02: 60 91 15 05 lds r22, 0x0515 ; 0x800515 39f06: 80 e0 ldi r24, 0x00 ; 0 39f08: 0e 94 95 6f call 0xdf2a ; 0xdf2a menu_draw_P(menu_selection_mark(), str, cur_val); 39f0c: 0f 94 d2 cd call 0x39ba4 ; 0x39ba4 39f10: ae 01 movw r20, r28 39f12: b5 01 movw r22, r10 39f14: 0f 94 fc a3 call 0x347f8 ; 0x347f8 } if (menu_clicked && (lcd_encoder == menu_item)) 39f18: 80 91 16 05 lds r24, 0x0516 ; 0x800516 39f1c: 88 23 and r24, r24 39f1e: 09 f4 brne .+2 ; 0x39f22 39f20: 55 c0 rjmp .+170 ; 0x39fcc 39f22: 90 91 18 05 lds r25, 0x0518 ; 0x800518 39f26: 20 91 37 05 lds r18, 0x0537 ; 0x800537 39f2a: 30 91 38 05 lds r19, 0x0538 ; 0x800538 39f2e: 92 17 cp r25, r18 39f30: 13 06 cpc r1, r19 39f32: 09 f0 breq .+2 ; 0x39f36 39f34: 4b c0 rjmp .+150 ; 0x39fcc } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) 39f36: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 39f3a: 87 30 cpi r24, 0x07 ; 7 39f3c: d8 f4 brcc .+54 ; 0x39f74 { menu_stack[menu_depth].menu = menu_menu; 39f3e: 28 2f mov r18, r24 39f40: 30 e0 ldi r19, 0x00 ; 0 39f42: f9 01 movw r30, r18 39f44: ee 0f add r30, r30 39f46: ff 1f adc r31, r31 39f48: e2 0f add r30, r18 39f4a: f3 1f adc r31, r19 39f4c: e0 56 subi r30, 0x60 ; 96 39f4e: f8 4e sbci r31, 0xE8 ; 232 39f50: 20 91 69 0e lds r18, 0x0E69 ; 0x800e69 39f54: 30 91 6a 0e lds r19, 0x0E6A ; 0x800e6a 39f58: 31 83 std Z+1, r19 ; 0x01 39f5a: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; 39f5c: 8f 5f subi r24, 0xFF ; 255 39f5e: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 39f62: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); 39f64: 20 e0 ldi r18, 0x00 ; 0 39f66: 40 e0 ldi r20, 0x00 ; 0 39f68: 70 e0 ldi r23, 0x00 ; 0 39f6a: 60 e0 ldi r22, 0x00 ; 0 39f6c: 8c e8 ldi r24, 0x8C ; 140 39f6e: 99 e3 ldi r25, 0x39 ; 57 39f70: 0f 94 3a cf call 0x39e74 ; 0x39e74 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; 39f74: b0 92 aa 03 sts 0x03AA, r11 ; 0x8003aa 39f78: a0 92 a9 03 sts 0x03A9, r10 ; 0x8003a9 _md->editValuePtr = pval; 39f7c: d0 92 ad 03 sts 0x03AD, r13 ; 0x8003ad 39f80: c0 92 ac 03 sts 0x03AC, r12 ; 0x8003ac _md->editValueBits = pbits; 39f84: 70 92 ab 03 sts 0x03AB, r7 ; 0x8003ab _md->currentValue = cur_val; 39f88: d0 93 af 03 sts 0x03AF, r29 ; 0x8003af 39f8c: c0 93 ae 03 sts 0x03AE, r28 ; 0x8003ae _md->minEditValue = min_val; 39f90: 90 92 b1 03 sts 0x03B1, r9 ; 0x8003b1 39f94: 80 92 b0 03 sts 0x03B0, r8 ; 0x8003b0 _md->maxEditValue = max_val; 39f98: 10 93 b3 03 sts 0x03B3, r17 ; 0x8003b3 39f9c: 00 93 b2 03 sts 0x03B2, r16 ; 0x8003b2 _md->minJumpValue = jmp_val; 39fa0: f0 92 b5 03 sts 0x03B5, r15 ; 0x8003b5 39fa4: e0 92 b4 03 sts 0x03B4, r14 ; 0x8003b4 menu_item_ret(); return; } } menu_item++; } 39fa8: df 91 pop r29 39faa: cf 91 pop r28 39fac: 1f 91 pop r17 39fae: 0f 91 pop r16 39fb0: ff 90 pop r15 39fb2: ef 90 pop r14 39fb4: df 90 pop r13 39fb6: cf 90 pop r12 39fb8: bf 90 pop r11 39fba: af 90 pop r10 39fbc: 9f 90 pop r9 39fbe: 8f 90 pop r8 39fc0: 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(); 39fc2: 0d 94 f6 cd jmp 0x39bec ; 0x39bec 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)); 39fc6: c0 81 ld r28, Z 39fc8: d1 81 ldd r29, Z+1 ; 0x01 39fca: 93 cf rjmp .-218 ; 0x39ef2 _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; 39fcc: 80 91 18 05 lds r24, 0x0518 ; 0x800518 39fd0: 8f 5f subi r24, 0xFF ; 255 39fd2: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 39fd6: df 91 pop r29 39fd8: cf 91 pop r28 39fda: 1f 91 pop r17 39fdc: 0f 91 pop r16 39fde: ff 90 pop r15 39fe0: ef 90 pop r14 39fe2: df 90 pop r13 39fe4: cf 90 pop r12 39fe6: bf 90 pop r11 39fe8: af 90 pop r10 39fea: 9f 90 pop r9 39fec: 8f 90 pop r8 39fee: 7f 90 pop r7 39ff0: 08 95 ret 00039ff2 <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) 39ff2: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 39ff6: 88 23 and r24, r24 39ff8: 09 f4 brne .+2 ; 0x39ffc <_menu_edit_P()+0xa> 39ffa: 52 c0 rjmp .+164 ; 0x3a0a0 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { 39ffc: 20 91 b4 03 lds r18, 0x03B4 ; 0x8003b4 3a000: 30 91 b5 03 lds r19, 0x03B5 ; 0x8003b5 3a004: 80 91 b0 03 lds r24, 0x03B0 ; 0x8003b0 3a008: 90 91 b1 03 lds r25, 0x03B1 ; 0x8003b1 3a00c: 21 15 cp r18, r1 3a00e: 31 05 cpc r19, r1 3a010: d9 f0 breq .+54 ; 0x3a048 <_menu_edit_P()+0x56> 3a012: 40 91 37 05 lds r20, 0x0537 ; 0x800537 3a016: 50 91 38 05 lds r21, 0x0538 ; 0x800538 3a01a: 41 15 cp r20, r1 3a01c: 51 05 cpc r21, r1 3a01e: a1 f0 breq .+40 ; 0x3a048 <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { 3a020: 7c f0 brlt .+30 ; 0x3a040 <_menu_edit_P()+0x4e> 3a022: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a026: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a02a: 48 17 cp r20, r24 3a02c: 59 07 cpc r21, r25 3a02e: 41 f4 brne .+16 ; 0x3a040 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; 3a030: 30 93 af 03 sts 0x03AF, r19 ; 0x8003af 3a034: 20 93 ae 03 sts 0x03AE, r18 ; 0x8003ae lcd_encoder = 0; 3a038: 10 92 38 05 sts 0x0538, r1 ; 0x800538 3a03c: 10 92 37 05 sts 0x0537, r1 ; 0x800537 } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; 3a040: 10 92 b5 03 sts 0x03B5, r1 ; 0x8003b5 3a044: 10 92 b4 03 sts 0x03B4, r1 ; 0x8003b4 } _md->currentValue += lcd_encoder; 3a048: 20 91 ae 03 lds r18, 0x03AE ; 0x8003ae 3a04c: 30 91 af 03 lds r19, 0x03AF ; 0x8003af 3a050: 40 91 37 05 lds r20, 0x0537 ; 0x800537 3a054: 50 91 38 05 lds r21, 0x0538 ; 0x800538 3a058: 24 0f add r18, r20 3a05a: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event 3a05c: 10 92 38 05 sts 0x0538, r1 ; 0x800538 3a060: 10 92 37 05 sts 0x0537, r1 ; 0x800537 // Constrain the value in case it's outside the allowed limits _md->currentValue = constrain(_md->currentValue, _md->minEditValue, _md->maxEditValue); 3a064: 28 17 cp r18, r24 3a066: 39 07 cpc r19, r25 3a068: 44 f0 brlt .+16 ; 0x3a07a <_menu_edit_P()+0x88> 3a06a: 80 91 b2 03 lds r24, 0x03B2 ; 0x8003b2 3a06e: 90 91 b3 03 lds r25, 0x03B3 ; 0x8003b3 3a072: 28 17 cp r18, r24 3a074: 39 07 cpc r19, r25 3a076: 0c f4 brge .+2 ; 0x3a07a <_menu_edit_P()+0x88> 3a078: c9 01 movw r24, r18 3a07a: 90 93 af 03 sts 0x03AF, r25 ; 0x8003af 3a07e: 80 93 ae 03 sts 0x03AE, r24 ; 0x8003ae lcd_set_cursor(0, 1); 3a082: 61 e0 ldi r22, 0x01 ; 1 3a084: 80 e0 ldi r24, 0x00 ; 0 3a086: 0e 94 95 6f call 0xdf2a ; 0xdf2a menu_draw_P(' ', _md->editLabel, _md->currentValue); 3a08a: 40 91 ae 03 lds r20, 0x03AE ; 0x8003ae 3a08e: 50 91 af 03 lds r21, 0x03AF ; 0x8003af 3a092: 60 91 a9 03 lds r22, 0x03A9 ; 0x8003a9 3a096: 70 91 aa 03 lds r23, 0x03AA ; 0x8003aa 3a09a: 80 e2 ldi r24, 0x20 ; 32 3a09c: 0f 94 fc a3 call 0x347f8 ; 0x347f8 } if (lcd_clicked()) 3a0a0: 0e 94 b2 71 call 0xe364 ; 0xe364 3a0a4: 88 23 and r24, r24 3a0a6: 41 f1 breq .+80 ; 0x3a0f8 <_menu_edit_P()+0x106> 3a0a8: e0 91 ac 03 lds r30, 0x03AC ; 0x8003ac 3a0ac: f0 91 ad 03 lds r31, 0x03AD ; 0x8003ad 3a0b0: 80 91 ae 03 lds r24, 0x03AE ; 0x8003ae 3a0b4: 90 91 af 03 lds r25, 0x03AF ; 0x8003af { if (_md->editValueBits == 8) 3a0b8: 20 91 ab 03 lds r18, 0x03AB ; 0x8003ab *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; 3a0bc: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) 3a0be: 28 30 cpi r18, 0x08 ; 8 3a0c0: c9 f4 brne .+50 ; 0x3a0f4 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) 3a0c2: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 3a0c6: 88 23 and r24, r24 3a0c8: b9 f0 breq .+46 ; 0x3a0f8 <_menu_edit_P()+0x106> { menu_depth--; 3a0ca: 81 50 subi r24, 0x01 ; 1 3a0cc: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); 3a0d0: 90 e0 ldi r25, 0x00 ; 0 3a0d2: fc 01 movw r30, r24 3a0d4: ee 0f add r30, r30 3a0d6: ff 1f adc r31, r31 3a0d8: e8 0f add r30, r24 3a0da: f9 1f adc r31, r25 3a0dc: e0 56 subi r30, 0x60 ; 96 3a0de: f8 4e sbci r31, 0xE8 ; 232 3a0e0: 62 81 ldd r22, Z+2 ; 0x02 3a0e2: 06 2e mov r0, r22 3a0e4: 00 0c add r0, r0 3a0e6: 77 0b sbc r23, r23 3a0e8: 20 e0 ldi r18, 0x00 ; 0 3a0ea: 40 e0 ldi r20, 0x00 ; 0 3a0ec: 80 81 ld r24, Z 3a0ee: 91 81 ldd r25, Z+1 ; 0x01 3a0f0: 0d 94 3a cf jmp 0x39e74 ; 0x39e74 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; 3a0f4: 91 83 std Z+1, r25 ; 0x01 3a0f6: e5 cf rjmp .-54 ; 0x3a0c2 <_menu_edit_P()+0xd0> menu_back_no_reset(); } } 3a0f8: 08 95 ret 0003a0fa : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { 3a0fa: dc 01 movw r26, r24 3a0fc: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) 3a0fe: 90 91 f4 03 lds r25, 0x03F4 ; 0x8003f4 3a102: 97 30 cpi r25, 0x07 ; 7 3a104: d8 f4 brcc .+54 ; 0x3a13c { menu_stack[menu_depth].menu = menu_menu; 3a106: 49 2f mov r20, r25 3a108: 50 e0 ldi r21, 0x00 ; 0 3a10a: fa 01 movw r30, r20 3a10c: ee 0f add r30, r30 3a10e: ff 1f adc r31, r31 3a110: e4 0f add r30, r20 3a112: f5 1f adc r31, r21 3a114: e0 56 subi r30, 0x60 ; 96 3a116: f8 4e sbci r31, 0xE8 ; 232 3a118: 40 91 69 0e lds r20, 0x0E69 ; 0x800e69 3a11c: 50 91 6a 0e lds r21, 0x0E6A ; 0x800e6a 3a120: 51 83 std Z+1, r21 ; 0x01 3a122: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; 3a124: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a128: 9f 5f subi r25, 0xFF ; 255 3a12a: 90 93 f4 03 sts 0x03F4, r25 ; 0x8003f4 3a12e: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); 3a130: 41 e0 ldi r20, 0x01 ; 1 3a132: 70 e0 ldi r23, 0x00 ; 0 3a134: 60 e0 ldi r22, 0x00 ; 0 3a136: cd 01 movw r24, r26 3a138: 0d 94 3a cf jmp 0x39e74 ; 0x39e74 } } 3a13c: 08 95 ret 0003a13e : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { 3a13e: 8f 92 push r8 3a140: 9f 92 push r9 3a142: af 92 push r10 3a144: bf 92 push r11 3a146: cf 92 push r12 3a148: df 92 push r13 3a14a: ef 92 push r14 3a14c: ff 92 push r15 3a14e: 0f 93 push r16 3a150: 1f 93 push r17 3a152: cf 93 push r28 3a154: df 93 push r29 if (menu_item == menu_line) 3a156: e0 91 18 05 lds r30, 0x0518 ; 0x800518 3a15a: 30 91 17 05 lds r19, 0x0517 ; 0x800517 3a15e: e3 13 cpse r30, r19 3a160: 73 c0 rjmp .+230 ; 0x3a248 3a162: c2 2f mov r28, r18 3a164: 6a 01 movw r12, r20 3a166: 7b 01 movw r14, r22 3a168: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); 3a16a: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a16e: 88 23 and r24, r24 3a170: a1 f1 breq .+104 ; 0x3a1da 3a172: 0f 94 d2 cd call 0x39ba4 ; 0x39ba4 3a176: 01 e0 ldi r16, 0x01 ; 1 3a178: 8e 33 cpi r24, 0x3E ; 62 3a17a: 09 f0 breq .+2 ; 0x3a17e 3a17c: 00 e0 ldi r16, 0x00 ; 0 3a17e: 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; 3a180: 80 2f mov r24, r16 3a182: 82 70 andi r24, 0x02 ; 2 3a184: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; 3a186: e1 14 cp r14, r1 3a188: f1 04 cpc r15, r1 3a18a: 09 f4 brne .+2 ; 0x3a18e 3a18c: 6f c0 rjmp .+222 ; 0x3a26c 3a18e: e7 01 movw r28, r14 3a190: 90 e2 ldi r25, 0x20 ; 32 3a192: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); 3a194: 88 20 and r8, r8 3a196: 09 f4 brne .+2 ; 0x3a19a 3a198: 41 c0 rjmp .+130 ; 0x3a21c 3a19a: ce 01 movw r24, r28 3a19c: 0f 94 4f db call 0x3b69e ; 0x3b69e <__strlen_P> 3a1a0: 14 e0 ldi r17, 0x04 ; 4 3a1a2: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); 3a1a4: 4e e3 ldi r20, 0x3E ; 62 3a1a6: 00 ff sbrs r16, 0 3a1a8: 40 e2 ldi r20, 0x20 ; 32 3a1aa: 60 91 15 05 lds r22, 0x0515 ; 0x800515 3a1ae: 80 e0 ldi r24, 0x00 ; 0 3a1b0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_pad_P(str, LCD_WIDTH - len); 3a1b4: 64 e1 ldi r22, 0x14 ; 20 3a1b6: 61 1b sub r22, r17 3a1b8: c5 01 movw r24, r10 3a1ba: 0e 94 6a 71 call 0xe2d4 ; 0xe2d4 lcd_putc('['); 3a1be: 8b e5 ldi r24, 0x5B ; 91 3a1c0: 0e 94 84 6f call 0xdf08 ; 0xdf08 if (is_progmem) { lcd_puts_P(toggle); 3a1c4: 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) 3a1c6: 88 20 and r8, r8 3a1c8: 89 f1 breq .+98 ; 0x3a22c { lcd_puts_P(toggle); 3a1ca: 0e 94 80 6f call 0xdf00 ; 0xdf00 } else { lcd_print(toggle); } lcd_putc(']'); 3a1ce: 8d e5 ldi r24, 0x5D ; 93 3a1d0: 0e 94 84 6f call 0xdf08 ; 0xdf08 lcd_putc(eol); 3a1d4: 89 2d mov r24, r9 3a1d6: 0e 94 84 6f call 0xdf08 ; 0xdf08 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)) 3a1da: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a1de: 88 23 and r24, r24 3a1e0: 99 f1 breq .+102 ; 0x3a248 3a1e2: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a1e6: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a1ea: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a1ee: 28 17 cp r18, r24 3a1f0: 19 06 cpc r1, r25 3a1f2: 51 f5 brne .+84 ; 0x3a248 { if (toggle == NULL) // print N/A warning message 3a1f4: ef 28 or r14, r15 3a1f6: e9 f4 brne .+58 ; 0x3a232 { menu_submenu(func); 3a1f8: 60 e0 ldi r22, 0x00 ; 0 3a1fa: c6 01 movw r24, r12 3a1fc: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa menu_item_ret(); return; } } menu_item++; } 3a200: df 91 pop r29 3a202: cf 91 pop r28 3a204: 1f 91 pop r17 3a206: 0f 91 pop r16 3a208: ff 90 pop r15 3a20a: ef 90 pop r14 3a20c: df 90 pop r13 3a20e: cf 90 pop r12 3a210: bf 90 pop r11 3a212: af 90 pop r10 3a214: 9f 90 pop r9 3a216: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); 3a218: 0d 94 f6 cd jmp 0x39bec ; 0x39bec //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)); 3a21c: fe 01 movw r30, r28 3a21e: 01 90 ld r0, Z+ 3a220: 00 20 and r0, r0 3a222: e9 f7 brne .-6 ; 0x3a21e 3a224: ec 1b sub r30, r28 3a226: 13 e0 ldi r17, 0x03 ; 3 3a228: 1e 0f add r17, r30 3a22a: bc cf rjmp .-136 ; 0x3a1a4 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); 3a22c: 0e 94 9c 71 call 0xe338 ; 0xe338 3a230: ce cf rjmp .-100 ; 0x3a1ce { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; 3a232: 10 92 6e 02 sts 0x026E, r1 ; 0x80026e if (func) func(); 3a236: c1 14 cp r12, r1 3a238: d1 04 cpc r13, r1 3a23a: 11 f0 breq .+4 ; 0x3a240 3a23c: f6 01 movw r30, r12 3a23e: 19 95 eicall lcd_update_enabled = 1; 3a240: 81 e0 ldi r24, 0x01 ; 1 3a242: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 3a246: dc cf rjmp .-72 ; 0x3a200 } menu_item_ret(); return; } } menu_item++; 3a248: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a24c: 8f 5f subi r24, 0xFF ; 255 3a24e: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 3a252: df 91 pop r29 3a254: cf 91 pop r28 3a256: 1f 91 pop r17 3a258: 0f 91 pop r16 3a25a: ff 90 pop r15 3a25c: ef 90 pop r14 3a25e: df 90 pop r13 3a260: cf 90 pop r12 3a262: bf 90 pop r11 3a264: af 90 pop r10 3a266: 9f 90 pop r9 3a268: 8f 90 pop r8 3a26a: 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); 3a26c: 87 e0 ldi r24, 0x07 ; 7 3a26e: 9d e3 ldi r25, 0x3D ; 61 3a270: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 3a274: 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] : ' '; 3a276: 8e e7 ldi r24, 0x7E ; 126 3a278: 98 2e mov r9, r24 3a27a: 8c cf rjmp .-232 ; 0x3a194 0003a27c : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { 3a27c: 0f 93 push r16 3a27e: 1f 93 push r17 3a280: cf 93 push r28 3a282: df 93 push r29 3a284: cd b7 in r28, 0x3d ; 61 3a286: de b7 in r29, 0x3e ; 62 3a288: 63 97 sbiw r28, 0x13 ; 19 3a28a: 0f b6 in r0, 0x3f ; 63 3a28c: f8 94 cli 3a28e: de bf out 0x3e, r29 ; 62 3a290: 0f be out 0x3f, r0 ; 63 3a292: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) 3a294: 30 91 18 05 lds r19, 0x0518 ; 0x800518 3a298: 20 91 17 05 lds r18, 0x0517 ; 0x800517 3a29c: 32 13 cpse r19, r18 3a29e: 38 c0 rjmp .+112 ; 0x3a310 3a2a0: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); 3a2a2: 20 91 6d 02 lds r18, 0x026D ; 0x80026d 3a2a6: 22 23 and r18, r18 3a2a8: a9 f0 breq .+42 ; 0x3a2d4 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); 3a2aa: be 01 movw r22, r28 3a2ac: 6f 5f subi r22, 0xFF ; 255 3a2ae: 7f 4f sbci r23, 0xFF ; 255 3a2b0: 0f 94 aa cd call 0x39b54 ; 0x39b54 lcd_putc_at(0, menu_row, menu_selection_mark()); 3a2b4: 0f 94 d2 cd call 0x39ba4 ; 0x39ba4 3a2b8: 48 2f mov r20, r24 3a2ba: 60 91 15 05 lds r22, 0x0515 ; 0x800515 3a2be: 80 e0 ldi r24, 0x00 ; 0 3a2c0: 0e 94 b5 6f call 0xdf6a ; 0xdf6a lcd_print_pad(buffer.c, LCD_WIDTH - 2); 3a2c4: 62 e1 ldi r22, 0x12 ; 18 3a2c6: ce 01 movw r24, r28 3a2c8: 01 96 adiw r24, 0x01 ; 1 3a2ca: 0e 94 84 71 call 0xe308 ; 0xe308 lcd_putc(type_char); 3a2ce: 8e e7 ldi r24, 0x7E ; 126 3a2d0: 0e 94 84 6f call 0xdf08 ; 0xdf08 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)) 3a2d4: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a2d8: 88 23 and r24, r24 3a2da: d1 f0 breq .+52 ; 0x3a310 3a2dc: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a2e0: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a2e4: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a2e8: 28 17 cp r18, r24 3a2ea: 19 06 cpc r1, r25 3a2ec: 89 f4 brne .+34 ; 0x3a310 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); 3a2ee: 60 e0 ldi r22, 0x00 ; 0 3a2f0: c8 01 movw r24, r16 3a2f2: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa menu_item_ret(); 3a2f6: 0f 94 f6 cd call 0x39bec ; 0x39bec menu_item_ret(); return; } } menu_item++; } 3a2fa: 63 96 adiw r28, 0x13 ; 19 3a2fc: 0f b6 in r0, 0x3f ; 63 3a2fe: f8 94 cli 3a300: de bf out 0x3e, r29 ; 62 3a302: 0f be out 0x3f, r0 ; 63 3a304: cd bf out 0x3d, r28 ; 61 3a306: df 91 pop r29 3a308: cf 91 pop r28 3a30a: 1f 91 pop r17 3a30c: 0f 91 pop r16 3a30e: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; 3a310: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a314: 8f 5f subi r24, 0xFF ; 255 3a316: 80 93 18 05 sts 0x0518, r24 ; 0x800518 3a31a: ef cf rjmp .-34 ; 0x3a2fa 0003a31c : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { 3a31c: cf 93 push r28 3a31e: df 93 push r29 if (menu_item == menu_line) 3a320: 30 91 18 05 lds r19, 0x0518 ; 0x800518 3a324: 20 91 17 05 lds r18, 0x0517 ; 0x800517 3a328: 32 13 cpse r19, r18 3a32a: 1e c0 rjmp .+60 ; 0x3a368 3a32c: eb 01 movw r28, r22 3a32e: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); 3a330: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a334: 88 23 and r24, r24 3a336: 19 f0 breq .+6 ; 0x3a33e 3a338: 8e e7 ldi r24, 0x7E ; 126 3a33a: 0f 94 df cd call 0x39bbe ; 0x39bbe if (menu_clicked && (lcd_encoder == menu_item)) 3a33e: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a342: 88 23 and r24, r24 3a344: 89 f0 breq .+34 ; 0x3a368 3a346: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a34a: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a34e: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a352: 28 17 cp r18, r24 3a354: 19 06 cpc r1, r25 3a356: 41 f4 brne .+16 ; 0x3a368 { menu_submenu(submenu); 3a358: 60 e0 ldi r22, 0x00 ; 0 3a35a: ce 01 movw r24, r28 3a35c: 0f 94 7d d0 call 0x3a0fa ; 0x3a0fa menu_item_ret(); return; } } menu_item++; } 3a360: df 91 pop r29 3a362: 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(); 3a364: 0d 94 f6 cd jmp 0x39bec ; 0x39bec return; } } menu_item++; 3a368: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a36c: 8f 5f subi r24, 0xFF ; 255 3a36e: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 3a372: df 91 pop r29 3a374: cf 91 pop r28 3a376: 08 95 ret 0003a378 : menu_row = -1; } } void menu_back(uint8_t nLevel) { 3a378: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a37a: 80 91 f4 03 lds r24, 0x03F4 ; 0x8003f4 3a37e: 98 17 cp r25, r24 3a380: a8 f4 brcc .+42 ; 0x3a3ac 3a382: 89 1b sub r24, r25 3a384: 80 93 f4 03 sts 0x03F4, r24 ; 0x8003f4 menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); 3a388: 90 e0 ldi r25, 0x00 ; 0 3a38a: fc 01 movw r30, r24 3a38c: ee 0f add r30, r30 3a38e: ff 1f adc r31, r31 3a390: e8 0f add r30, r24 3a392: f9 1f adc r31, r25 3a394: e0 56 subi r30, 0x60 ; 96 3a396: f8 4e sbci r31, 0xE8 ; 232 3a398: 62 81 ldd r22, Z+2 ; 0x02 3a39a: 06 2e mov r0, r22 3a39c: 00 0c add r0, r0 3a39e: 77 0b sbc r23, r23 3a3a0: 20 e0 ldi r18, 0x00 ; 0 3a3a2: 41 e0 ldi r20, 0x01 ; 1 3a3a4: 80 81 ld r24, Z 3a3a6: 91 81 ldd r25, Z+1 ; 0x01 3a3a8: 0d 94 3a cf jmp 0x39e74 ; 0x39e74 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); 3a3ac: 80 e0 ldi r24, 0x00 ; 0 3a3ae: ea cf rjmp .-44 ; 0x3a384 0003a3b0 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); 3a3b0: 81 e0 ldi r24, 0x01 ; 1 3a3b2: 0d 94 bc d1 jmp 0x3a378 ; 0x3a378 0003a3b6 : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) 3a3b6: 30 91 18 05 lds r19, 0x0518 ; 0x800518 3a3ba: 20 91 17 05 lds r18, 0x0517 ; 0x800517 3a3be: 32 13 cpse r19, r18 3a3c0: 19 c0 rjmp .+50 ; 0x3a3f4 3a3c2: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); 3a3c4: 80 91 6d 02 lds r24, 0x026D ; 0x80026d 3a3c8: 88 23 and r24, r24 3a3ca: 19 f0 breq .+6 ; 0x3a3d2 3a3cc: 83 e8 ldi r24, 0x83 ; 131 3a3ce: 0f 94 df cd call 0x39bbe ; 0x39bbe if (menu_clicked && (lcd_encoder == menu_item)) 3a3d2: 80 91 16 05 lds r24, 0x0516 ; 0x800516 3a3d6: 88 23 and r24, r24 3a3d8: 69 f0 breq .+26 ; 0x3a3f4 3a3da: 20 91 18 05 lds r18, 0x0518 ; 0x800518 3a3de: 80 91 37 05 lds r24, 0x0537 ; 0x800537 3a3e2: 90 91 38 05 lds r25, 0x0538 ; 0x800538 3a3e6: 28 17 cp r18, r24 3a3e8: 19 06 cpc r1, r25 3a3ea: 21 f4 brne .+8 ; 0x3a3f4 { menu_back(); 3a3ec: 0f 94 d8 d1 call 0x3a3b0 ; 0x3a3b0 menu_item_ret(); 3a3f0: 0d 94 f6 cd jmp 0x39bec ; 0x39bec return; } } menu_item++; 3a3f4: 80 91 18 05 lds r24, 0x0518 ; 0x800518 3a3f8: 8f 5f subi r24, 0xFF ; 255 3a3fa: 80 93 18 05 sts 0x0518, r24 ; 0x800518 } 3a3fe: 08 95 ret 0003a400 : }; 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() { 3a400: ef 92 push r14 3a402: ff 92 push r15 3a404: 0f 93 push r16 3a406: 1f 93 push r17 3a408: cf 93 push r28 3a40a: df 93 push r29 3a40c: 10 92 d8 03 sts 0x03D8, r1 ; 0x8003d8 static constexpr _menu_tune_data_t * const _md = (_menu_tune_data_t*)&(menu_data[0]); // Do not timeout the screen, otherwise there will be FW crash (menu recursion) lcd_timeoutToStatus.stop(); if (_md->status == 0) 3a410: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 3a414: 81 11 cpse r24, r1 3a416: 23 c0 rjmp .+70 ; 0x3a45e { _md->status = 1; // Menu entered for the first time 3a418: 81 e0 ldi r24, 0x01 ; 1 3a41a: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 // Fetch the TuneItem from PROGMEM const uint8_t offset = (mmu2.MMUCurrentErrorCode() == ErrorCode::HOMING_IDLER_FAILED) ? 1 : 0; 3a41e: 81 e0 ldi r24, 0x01 ; 1 3a420: 90 e0 ldi r25, 0x00 ; 0 3a422: 20 91 69 13 lds r18, 0x1369 ; 0x801369 3a426: 30 91 6a 13 lds r19, 0x136A ; 0x80136a 3a42a: 27 30 cpi r18, 0x07 ; 7 3a42c: 31 48 sbci r19, 0x81 ; 129 3a42e: 11 f0 breq .+4 ; 0x3a434 3a430: 90 e0 ldi r25, 0x00 ; 0 3a432: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 3a434: bc 01 movw r22, r24 3a436: 66 0f add r22, r22 3a438: 77 1f adc r23, r23 3a43a: 68 0f add r22, r24 3a43c: 79 1f adc r23, r25 3a43e: 61 5c subi r22, 0xC1 ; 193 3a440: 75 45 sbci r23, 0x55 ; 85 3a442: 43 e0 ldi r20, 0x03 ; 3 3a444: 50 e0 ldi r21, 0x00 ; 0 3a446: 88 eb ldi r24, 0xB8 ; 184 3a448: 93 e0 ldi r25, 0x03 ; 3 3a44a: 0f 94 2b db call 0x3b656 ; 0x3b656 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 3a44e: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a452: 0f 94 d8 1d call 0x23bb0 ; 0x23bb0 _md->currentValue = mmu2.GetLastReadRegisterValue(); 3a456: 80 91 94 13 lds r24, 0x1394 ; 0x801394 3a45a: 80 93 b7 03 sts 0x03B7, r24 ; 0x8003b7 } MENU_BEGIN(); 3a45e: 0f 94 10 cf call 0x39e20 ; 0x39e20 3a462: 10 92 15 05 sts 0x0515, r1 ; 0x800515 3a466: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a46a: 84 30 cpi r24, 0x04 ; 4 3a46c: e0 f5 brcc .+120 ; 0x3a4e6 3a46e: 10 92 18 05 sts 0x0518, r1 ; 0x800518 ON_MENU_LEAVE( 3a472: 0f 94 90 cd call 0x39b20 ; 0x39b20 3a476: 88 23 and r24, r24 3a478: 89 f0 breq .+34 ; 0x3a49c 3a47a: 60 91 b7 03 lds r22, 0x03B7 ; 0x8003b7 3a47e: 70 e0 ldi r23, 0x00 ; 0 3a480: 80 91 b8 03 lds r24, 0x03B8 ; 0x8003b8 3a484: 0e 94 c3 de call 0x1bd86 ; 0x1bd86 3a488: 10 92 5e 0e sts 0x0E5E, r1 ; 0x800e5e <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.515> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a48c: df 91 pop r29 3a48e: cf 91 pop r28 3a490: 1f 91 pop r17 3a492: 0f 91 pop r16 3a494: ff 90 pop r15 3a496: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 3a498: 0d 94 53 27 jmp 0x24ea6 ; 0x24ea6 mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 3a49c: 81 e2 ldi r24, 0x21 ; 33 3a49e: 95 e6 ldi r25, 0x65 ; 101 3a4a0: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 3a4a4: 0f 94 db d1 call 0x3a3b6 ; 0x3a3b6 MENU_ITEM_EDIT_int3_P( 3a4a8: 00 91 ba 03 lds r16, 0x03BA ; 0x8003ba 3a4ac: 10 e0 ldi r17, 0x00 ; 0 3a4ae: c0 91 b9 03 lds r28, 0x03B9 ; 0x8003b9 3a4b2: d0 e0 ldi r29, 0x00 ; 0 3a4b4: 83 e1 ldi r24, 0x13 ; 19 3a4b6: 95 e6 ldi r25, 0x65 ; 101 3a4b8: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 3a4bc: f1 2c mov r15, r1 3a4be: e1 2c mov r14, r1 3a4c0: 9e 01 movw r18, r28 3a4c2: 48 e0 ldi r20, 0x08 ; 8 3a4c4: 67 eb ldi r22, 0xB7 ; 183 3a4c6: 73 e0 ldi r23, 0x03 ; 3 3a4c8: 0f 94 60 cf call 0x39ec0 ; 0x39ec0 _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 3a4cc: 0f 94 e4 ce call 0x39dc8 ; 0x39dc8 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 3a4d0: 80 91 15 05 lds r24, 0x0515 ; 0x800515 3a4d4: 8f 5f subi r24, 0xFF ; 255 3a4d6: 80 93 15 05 sts 0x0515, r24 ; 0x800515 3a4da: 80 91 17 05 lds r24, 0x0517 ; 0x800517 3a4de: 8f 5f subi r24, 0xFF ; 255 3a4e0: 80 93 17 05 sts 0x0517, r24 ; 0x800517 3a4e4: c0 cf rjmp .-128 ; 0x3a466 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 3a4e6: df 91 pop r29 3a4e8: cf 91 pop r28 3a4ea: 1f 91 pop r17 3a4ec: 0f 91 pop r16 3a4ee: ff 90 pop r15 3a4f0: ef 90 pop r14 3a4f2: 08 95 ret 0003a4f4 : } } void menu_back_if_clicked(void) { if (lcd_clicked()) 3a4f4: 0e 94 b2 71 call 0xe364 ; 0xe364 3a4f8: 81 11 cpse r24, r1 menu_back(); 3a4fa: 0d 94 d8 d1 jmp 0x3a3b0 ; 0x3a3b0 } 3a4fe: 08 95 ret 0003a500 : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { 3a500: 8f 92 push r8 3a502: 9f 92 push r9 3a504: af 92 push r10 3a506: bf 92 push r11 3a508: ef 92 push r14 3a50a: ff 92 push r15 3a50c: 0f 93 push r16 3a50e: 1f 93 push r17 3a510: cf 93 push r28 3a512: df 93 push r29 3a514: cd b7 in r28, 0x3d ; 61 3a516: de b7 in r29, 0x3e ; 62 3a518: a0 97 sbiw r28, 0x20 ; 32 3a51a: 0f b6 in r0, 0x3f ; 63 3a51c: f8 94 cli 3a51e: de bf out 0x3e, r29 ; 62 3a520: 0f be out 0x3f, r0 ; 63 3a522: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { 3a524: 61 15 cp r22, r1 3a526: 71 05 cpc r23, r1 3a528: 81 05 cpc r24, r1 3a52a: 91 05 cpc r25, r1 3a52c: 99 f4 brne .+38 ; 0x3a554 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a52e: 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)); } 3a530: a0 96 adiw r28, 0x20 ; 32 3a532: 0f b6 in r0, 0x3f ; 63 3a534: f8 94 cli 3a536: de bf out 0x3e, r29 ; 62 3a538: 0f be out 0x3f, r0 ; 63 3a53a: cd bf out 0x3d, r28 ; 61 3a53c: df 91 pop r29 3a53e: cf 91 pop r28 3a540: 1f 91 pop r17 3a542: 0f 91 pop r16 3a544: ff 90 pop r15 3a546: ef 90 pop r14 3a548: bf 90 pop r11 3a54a: af 90 pop r10 3a54c: 9f 90 pop r9 3a54e: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a550: 0c 94 c2 78 jmp 0xf184 ; 0xf184 // 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; 3a554: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a556: 84 2e mov r8, r20 3a558: 91 2c mov r9, r1 3a55a: b1 2c mov r11, r1 3a55c: a1 2c mov r10, r1 3a55e: 9e 01 movw r18, r28 3a560: 2f 5f subi r18, 0xFF ; 255 3a562: 3f 4f sbci r19, 0xFF ; 255 3a564: 79 01 movw r14, r18 3a566: a5 01 movw r20, r10 3a568: 94 01 movw r18, r8 3a56a: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 3a56e: f7 01 movw r30, r14 3a570: e0 0f add r30, r16 3a572: f1 1d adc r31, r1 3a574: 60 83 st Z, r22 n /= base; 3a576: b9 01 movw r22, r18 3a578: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; 3a57a: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { 3a57c: 61 15 cp r22, r1 3a57e: 71 05 cpc r23, r1 3a580: 81 05 cpc r24, r1 3a582: 91 05 cpc r25, r1 3a584: 81 f7 brne .-32 ; 0x3a566 3a586: 0e 0d add r16, r14 3a588: 1f 2d mov r17, r15 3a58a: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) 3a58c: e0 16 cp r14, r16 3a58e: f1 06 cpc r15, r17 3a590: 59 f0 breq .+22 ; 0x3a5a8 print((char) (buf[i - 1] < 10 ? 3a592: f8 01 movw r30, r16 3a594: 82 91 ld r24, -Z 3a596: 8f 01 movw r16, r30 3a598: 8a 30 cpi r24, 0x0A ; 10 3a59a: 20 f4 brcc .+8 ; 0x3a5a4 '0' + buf[i - 1] : 3a59c: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a59e: 0e 94 c2 78 call 0xf184 ; 0xf184 3a5a2: f4 cf rjmp .-24 ; 0x3a58c } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); 3a5a4: 89 5c subi r24, 0xC9 ; 201 3a5a6: fb cf rjmp .-10 ; 0x3a59e } 3a5a8: a0 96 adiw r28, 0x20 ; 32 3a5aa: 0f b6 in r0, 0x3f ; 63 3a5ac: f8 94 cli 3a5ae: de bf out 0x3e, r29 ; 62 3a5b0: 0f be out 0x3f, r0 ; 63 3a5b2: cd bf out 0x3d, r28 ; 61 3a5b4: df 91 pop r29 3a5b6: cf 91 pop r28 3a5b8: 1f 91 pop r17 3a5ba: 0f 91 pop r16 3a5bc: ff 90 pop r15 3a5be: ef 90 pop r14 3a5c0: bf 90 pop r11 3a5c2: af 90 pop r10 3a5c4: 9f 90 pop r9 3a5c6: 8f 90 pop r8 3a5c8: 08 95 ret 0003a5ca : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) 3a5ca: cf 92 push r12 3a5cc: df 92 push r13 3a5ce: ef 92 push r14 3a5d0: ff 92 push r15 3a5d2: 6b 01 movw r12, r22 3a5d4: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { 3a5d6: f7 fe sbrs r15, 7 3a5d8: 0b c0 rjmp .+22 ; 0x3a5f0 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3a5da: 8d e2 ldi r24, 0x2D ; 45 3a5dc: 0e 94 c2 78 call 0xf184 ; 0xf184 } else if (base == 10) { if (n < 0) { print('-'); n = -n; 3a5e0: f0 94 com r15 3a5e2: e0 94 com r14 3a5e4: d0 94 com r13 3a5e6: c0 94 com r12 3a5e8: c1 1c adc r12, r1 3a5ea: d1 1c adc r13, r1 3a5ec: e1 1c adc r14, r1 3a5ee: f1 1c adc r15, r1 } printNumber(n, 10); 3a5f0: 4a e0 ldi r20, 0x0A ; 10 3a5f2: c7 01 movw r24, r14 3a5f4: b6 01 movw r22, r12 } else { printNumber(n, base); } } 3a5f6: ff 90 pop r15 3a5f8: ef 90 pop r14 3a5fa: df 90 pop r13 3a5fc: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); 3a5fe: 0d 94 80 d2 jmp 0x3a500 ; 0x3a500 0003a602 : void recover_print(uint8_t automatic) { 3a602: 4f 92 push r4 3a604: 5f 92 push r5 3a606: 6f 92 push r6 3a608: 7f 92 push r7 3a60a: 8f 92 push r8 3a60c: 9f 92 push r9 3a60e: af 92 push r10 3a610: bf 92 push r11 3a612: cf 92 push r12 3a614: df 92 push r13 3a616: ef 92 push r14 3a618: ff 92 push r15 3a61a: 0f 93 push r16 3a61c: 1f 93 push r17 3a61e: cf 93 push r28 3a620: df 93 push r29 3a622: 1f 92 push r1 3a624: 1f 92 push r1 3a626: cd b7 in r28, 0x3d ; 61 3a628: de b7 in r29, 0x3e ; 62 3a62a: a8 2e mov r10, r24 lcd_setstatuspgm(_T(MSG_RECOVERING_PRINT)); 3a62c: 88 e2 ldi r24, 0x28 ; 40 3a62e: 95 e6 ldi r25, 0x65 ; 101 3a630: 0e 94 61 73 call 0xe6c2 ; 0xe6c2 3a634: 0f 94 ea 0b call 0x217d4 ; 0x217d4 gcode_M114(); } bool recover_machine_state_after_power_panic() { // 1) Preset some dummy values for the XY axes current_position[X_AXIS] = 0; 3a638: 10 92 43 07 sts 0x0743, r1 ; 0x800743 3a63c: 10 92 44 07 sts 0x0744, r1 ; 0x800744 3a640: 10 92 45 07 sts 0x0745, r1 ; 0x800745 3a644: 10 92 46 07 sts 0x0746, r1 ; 0x800746 current_position[Y_AXIS] = 0; 3a648: 10 92 47 07 sts 0x0747, r1 ; 0x800747 3a64c: 10 92 48 07 sts 0x0748, r1 ; 0x800748 3a650: 10 92 49 07 sts 0x0749, r1 ; 0x800749 3a654: 10 92 4a 07 sts 0x074A, r1 ; 0x80074a 3a658: 9e ea ldi r25, 0xAE ; 174 3a65a: e9 2e mov r14, r25 3a65c: 9d e0 ldi r25, 0x0D ; 13 3a65e: 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; 3a660: d1 2c mov r13, r1 for (int8_t mesh_point = 0; mesh_point < MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS; ++ mesh_point) { 3a662: c1 2c mov r12, r1 uint8_t ix = mesh_point % MESH_NUM_X_POINTS; // from 0 to MESH_NUM_X_POINTS - 1 3a664: 27 e0 ldi r18, 0x07 ; 7 3a666: b2 2e mov r11, r18 3a668: 8c 2d mov r24, r12 3a66a: 6b 2d mov r22, r11 3a66c: 0f 94 4c de call 0x3bc98 ; 0x3bc98 <__divmodqi4> 3a670: 08 2f mov r16, r24 3a672: 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); 3a674: 42 e0 ldi r20, 0x02 ; 2 3a676: 50 e0 ldi r21, 0x00 ; 0 3a678: b7 01 movw r22, r14 3a67a: ce 01 movw r24, r28 3a67c: 01 96 adiw r24, 0x01 ; 1 3a67e: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 if (v != 0) 3a682: 69 81 ldd r22, Y+1 ; 0x01 3a684: 7a 81 ldd r23, Y+2 ; 0x02 3a686: 61 15 cp r22, r1 3a688: 71 05 cpc r23, r1 3a68a: 11 f0 breq .+4 ; 0x3a690 mbl_was_active = true; 3a68c: dd 24 eor r13, r13 3a68e: d3 94 inc r13 mbl.z_values[iy][ix] = float(v) * 0.001f; 3a690: 2b 2d mov r18, r11 3a692: 02 03 mulsu r16, r18 3a694: 80 01 movw r16, r0 3a696: 11 24 eor r1, r1 3a698: 09 0d add r16, r9 3a69a: 11 1d adc r17, r1 3a69c: 97 fc sbrc r9, 7 3a69e: 1a 95 dec r17 3a6a0: 00 0f add r16, r16 3a6a2: 11 1f adc r17, r17 3a6a4: 00 0f add r16, r16 3a6a6: 11 1f adc r17, r17 3a6a8: 00 56 subi r16, 0x60 ; 96 3a6aa: 1c 4e sbci r17, 0xEC ; 236 3a6ac: 07 2e mov r0, r23 3a6ae: 00 0c add r0, r0 3a6b0: 88 0b sbc r24, r24 3a6b2: 99 0b sbc r25, r25 3a6b4: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3a6b8: 2f e6 ldi r18, 0x6F ; 111 3a6ba: 32 e1 ldi r19, 0x12 ; 18 3a6bc: 43 e8 ldi r20, 0x83 ; 131 3a6be: 5a e3 ldi r21, 0x3A ; 58 3a6c0: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3a6c4: f8 01 movw r30, r16 3a6c6: 61 83 std Z+1, r22 ; 0x01 3a6c8: 72 83 std Z+2, r23 ; 0x02 3a6ca: 83 83 std Z+3, r24 ; 0x03 3a6cc: 94 83 std Z+4, r25 ; 0x04 3a6ce: f2 e0 ldi r31, 0x02 ; 2 3a6d0: ef 0e add r14, r31 3a6d2: f1 1c adc r15, r1 3a6d4: 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) { 3a6d6: 21 e3 ldi r18, 0x31 ; 49 3a6d8: c2 12 cpse r12, r18 3a6da: c6 cf rjmp .-116 ; 0x3a668 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)); 3a6dc: 8a ed ldi r24, 0xDA ; 218 3a6de: 9e e0 ldi r25, 0x0E ; 14 3a6e0: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3a6e4: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 3a6e8: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 3a6ec: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3a6f0: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e // Recover last E axis position current_position[E_AXIS] = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3a6f4: 8e e6 ldi r24, 0x6E ; 110 3a6f6: 9f e0 ldi r25, 0x0F ; 15 3a6f8: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3a6fc: 60 93 4f 07 sts 0x074F, r22 ; 0x80074f 3a700: 70 93 50 07 sts 0x0750, r23 ; 0x800750 3a704: 80 93 51 07 sts 0x0751, r24 ; 0x800751 3a708: 90 93 52 07 sts 0x0752, r25 ; 0x800752 // 3) Initialize the logical to physical coordinate system transformation. world2machine_initialize(); 3a70c: 0f 94 15 cc call 0x3982a ; 0x3982a // 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(); 3a710: 0f 94 ff c6 call 0x38dfe ; 0x38dfe // 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); 3a714: 83 e4 ldi r24, 0x43 ; 67 3a716: 97 e0 ldi r25, 0x07 ; 7 3a718: 0e 94 7e 6c call 0xd8fc ; 0xd8fc set_destination_to_current(); 3a71c: 0e 94 ef 68 call 0xd1de ; 0xd1de plan_set_position_curposXYZE(); 3a720: 0f 94 53 b9 call 0x372a6 ; 0x372a6 SERIAL_ECHOPGM("recover_machine_state_after_power_panic, initial "); 3a724: 88 e9 ldi r24, 0x98 ; 152 3a726: 9b ea ldi r25, 0xAB ; 171 3a728: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 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]); 3a72c: 80 91 4e 07 lds r24, 0x074E ; 0x80074e 3a730: 8f 93 push r24 3a732: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 3a736: 8f 93 push r24 3a738: 80 91 4c 07 lds r24, 0x074C ; 0x80074c 3a73c: 8f 93 push r24 3a73e: 80 91 4b 07 lds r24, 0x074B ; 0x80074b 3a742: 8f 93 push r24 3a744: 80 91 4a 07 lds r24, 0x074A ; 0x80074a 3a748: 8f 93 push r24 3a74a: 80 91 49 07 lds r24, 0x0749 ; 0x800749 3a74e: 8f 93 push r24 3a750: 80 91 48 07 lds r24, 0x0748 ; 0x800748 3a754: 8f 93 push r24 3a756: 80 91 47 07 lds r24, 0x0747 ; 0x800747 3a75a: 8f 93 push r24 3a75c: 80 91 46 07 lds r24, 0x0746 ; 0x800746 3a760: 8f 93 push r24 3a762: 80 91 45 07 lds r24, 0x0745 ; 0x800745 3a766: 8f 93 push r24 3a768: 80 91 44 07 lds r24, 0x0744 ; 0x800744 3a76c: 8f 93 push r24 3a76e: 80 91 43 07 lds r24, 0x0743 ; 0x800743 3a772: 8f 93 push r24 3a774: 87 e7 ldi r24, 0x77 ; 119 3a776: 91 e7 ldi r25, 0x71 ; 113 3a778: 9f 93 push r25 3a77a: 8f 93 push r24 3a77c: 0f 94 53 dc call 0x3b8a6 ; 0x3b8a6 print_world_coordinates(); // 6) Power up the Z motors, mark their positions as known. axis_known_position[Z_AXIS] = true; 3a780: 81 e0 ldi r24, 0x01 ; 1 3a782: 80 93 42 07 sts 0x0742, r24 ; 0x800742 enable_z(); 3a786: 15 98 cbi 0x02, 5 ; 2 // 7) Recover the target temperatures. target_temperature[active_extruder] = eeprom_read_word((uint16_t*)EEPROM_UVLO_TARGET_HOTEND); 3a788: 88 ed ldi r24, 0xD8 ; 216 3a78a: 9e e0 ldi r25, 0x0E ; 14 3a78c: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 3a790: 90 93 6e 0e sts 0x0E6E, r25 ; 0x800e6e 3a794: 80 93 6d 0e sts 0x0E6D, r24 ; 0x800e6d target_temperature_bed = eeprom_read_byte((uint8_t*)EEPROM_UVLO_TARGET_BED); 3a798: 8b e8 ldi r24, 0x8B ; 139 3a79a: 9f e0 ldi r25, 0x0F ; 15 3a79c: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a7a0: 90 e0 ldi r25, 0x00 ; 0 3a7a2: 90 93 6c 0e sts 0x0E6C, r25 ; 0x800e6c 3a7a6: 80 93 6b 0e sts 0x0E6B, r24 ; 0x800e6b // 8) Recover extruder multipilers extruder_multiplier[0] = eeprom_read_float((float*)(EEPROM_EXTRUDER_MULTIPLIER_0)); 3a7aa: 88 ee ldi r24, 0xE8 ; 232 3a7ac: 9e e0 ldi r25, 0x0E ; 14 3a7ae: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3a7b2: 60 93 bb 02 sts 0x02BB, r22 ; 0x8002bb 3a7b6: 70 93 bc 02 sts 0x02BC, r23 ; 0x8002bc 3a7ba: 80 93 bd 02 sts 0x02BD, r24 ; 0x8002bd 3a7be: 90 93 be 02 sts 0x02BE, r25 ; 0x8002be extrudemultiply = (int)eeprom_read_word((uint16_t*)(EEPROM_EXTRUDEMULTIPLY)); 3a7c2: 8e ed ldi r24, 0xDE ; 222 3a7c4: 9e e0 ldi r25, 0x0E ; 14 3a7c6: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 3a7ca: 90 93 95 02 sts 0x0295, r25 ; 0x800295 3a7ce: 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)); 3a7d2: 40 e1 ldi r20, 0x10 ; 16 3a7d4: 50 e0 ldi r21, 0x00 ; 0 3a7d6: 67 e3 ldi r22, 0x37 ; 55 3a7d8: 7d e0 ldi r23, 0x0D ; 13 3a7da: 8b ea ldi r24, 0xAB ; 171 3a7dc: 92 e0 ldi r25, 0x02 ; 2 3a7de: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 saved_segment_idx = eeprom_read_word((uint16_t*)EEPROM_UVLO_SAVED_SEGMENT_IDX); 3a7e2: 8c e6 ldi r24, 0x6C ; 108 3a7e4: 9f e0 ldi r25, 0x0F ; 15 3a7e6: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 3a7ea: 90 93 0c 18 sts 0x180C, r25 ; 0x80180c 3a7ee: 80 93 0b 18 sts 0x180B, r24 ; 0x80180b #ifdef LIN_ADVANCE extruder_advance_K = eeprom_read_float((float*)EEPROM_UVLO_LA_K); 3a7f2: 8c e2 ldi r24, 0x2C ; 44 3a7f4: 9d e0 ldi r25, 0x0D ; 13 3a7f6: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3a7fa: 60 93 07 18 sts 0x1807, r22 ; 0x801807 3a7fe: 70 93 08 18 sts 0x1808, r23 ; 0x801808 3a802: 80 93 09 18 sts 0x1809, r24 ; 0x801809 3a806: 90 93 0a 18 sts 0x180A, r25 ; 0x80180a #endif #ifdef PREVENT_DANGEROUS_EXTRUDE extrude_min_temp = eeprom_read_word((uint16_t*)EEPROM_UVLO_EXTRUDE_MINTEMP); 3a80a: 8d e7 ldi r24, 0x7D ; 125 3a80c: 9c e0 ldi r25, 0x0C ; 12 3a80e: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 3a812: 90 93 6c 02 sts 0x026C, r25 ; 0x80026c 3a816: 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)); 3a81a: 40 e1 ldi r20, 0x10 ; 16 3a81c: 50 e0 ldi r21, 0x00 ; 0 3a81e: 6d e6 ldi r22, 0x6D ; 109 3a820: 7c e0 ldi r23, 0x0C ; 12 3a822: 82 e9 ldi r24, 0x92 ; 146 3a824: 96 e0 ldi r25, 0x06 ; 6 3a826: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 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)); 3a82a: 40 e1 ldi r20, 0x10 ; 16 3a82c: 50 e0 ldi r21, 0x00 ; 0 3a82e: 6d e5 ldi r22, 0x5D ; 93 3a830: 7c e0 ldi r23, 0x0C ; 12 3a832: 8a e1 ldi r24, 0x1A ; 26 3a834: 97 e0 ldi r25, 0x07 ; 7 3a836: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 eeprom_read_block(cs.max_feedrate_normal, (float *)EEPROM_UVLO_MAX_FEEDRATE_NORMAL, sizeof(cs.max_feedrate_normal)); 3a83a: 40 e1 ldi r20, 0x10 ; 16 3a83c: 50 e0 ldi r21, 0x00 ; 0 3a83e: 6d e4 ldi r22, 0x4D ; 77 3a840: 7c e0 ldi r23, 0x0C ; 12 3a842: 82 e8 ldi r24, 0x82 ; 130 3a844: 96 e0 ldi r25, 0x06 ; 6 3a846: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 eeprom_read_block(cs.max_feedrate_silent, (float *)EEPROM_UVLO_MAX_FEEDRATE_SILENT, sizeof(cs.max_feedrate_silent)); 3a84a: 40 e1 ldi r20, 0x10 ; 16 3a84c: 50 e0 ldi r21, 0x00 ; 0 3a84e: 6d e3 ldi r22, 0x3D ; 61 3a850: 7c e0 ldi r23, 0x0C ; 12 3a852: 8a e0 ldi r24, 0x0A ; 10 3a854: 97 e0 ldi r25, 0x07 ; 7 3a856: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 cs.minimumfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_FEEDRATE); 3a85a: 89 e3 ldi r24, 0x39 ; 57 3a85c: 9c e0 ldi r25, 0x0C ; 12 3a85e: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3a862: 60 93 aa 06 sts 0x06AA, r22 ; 0x8006aa 3a866: 70 93 ab 06 sts 0x06AB, r23 ; 0x8006ab 3a86a: 80 93 ac 06 sts 0x06AC, r24 ; 0x8006ac 3a86e: 90 93 ad 06 sts 0x06AD, r25 ; 0x8006ad cs.mintravelfeedrate = eeprom_read_float((float *)EEPROM_UVLO_MIN_TRAVEL_FEEDRATE); 3a872: 85 e3 ldi r24, 0x35 ; 53 3a874: 9c e0 ldi r25, 0x0C ; 12 3a876: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3a87a: 60 93 ae 06 sts 0x06AE, r22 ; 0x8006ae 3a87e: 70 93 af 06 sts 0x06AF, r23 ; 0x8006af 3a882: 80 93 b0 06 sts 0x06B0, r24 ; 0x8006b0 3a886: 90 93 b1 06 sts 0x06B1, r25 ; 0x8006b1 cs.min_segment_time_us = eeprom_read_dword((uint32_t *)EEPROM_UVLO_MIN_SEGMENT_TIME_US); 3a88a: 81 e3 ldi r24, 0x31 ; 49 3a88c: 9c e0 ldi r25, 0x0C ; 12 3a88e: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3a892: 60 93 b2 06 sts 0x06B2, r22 ; 0x8006b2 3a896: 70 93 b3 06 sts 0x06B3, r23 ; 0x8006b3 3a89a: 80 93 b4 06 sts 0x06B4, r24 ; 0x8006b4 3a89e: 90 93 b5 06 sts 0x06B5, r25 ; 0x8006b5 eeprom_read_block(cs.max_jerk, (float *)EEPROM_UVLO_MAX_JERK, sizeof(cs.max_jerk)); 3a8a2: 40 e1 ldi r20, 0x10 ; 16 3a8a4: 50 e0 ldi r21, 0x00 ; 0 3a8a6: 61 e2 ldi r22, 0x21 ; 33 3a8a8: 7c e0 ldi r23, 0x0C ; 12 3a8aa: 86 eb ldi r24, 0xB6 ; 182 3a8ac: 96 e0 ldi r25, 0x06 ; 6 3a8ae: 0f 94 81 dd call 0x3bb02 ; 0x3bb02 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 ) { 3a8b2: 8f e7 ldi r24, 0x7F ; 127 3a8b4: 9c e0 ldi r25, 0x0C ; 12 3a8b6: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a8ba: 0f b6 in r0, 0x3f ; 63 3a8bc: f8 94 cli 3a8be: de bf out 0x3e, r29 ; 62 3a8c0: 0f be out 0x3f, r0 ; 63 3a8c2: cd bf out 0x3d, r28 ; 61 3a8c4: 81 30 cpi r24, 0x01 ; 1 3a8c6: b1 f4 brne .+44 ; 0x3a8f4 current_position[Z_AXIS] += Z_PAUSE_LIFT; 3a8c8: 20 e0 ldi r18, 0x00 ; 0 3a8ca: 30 e0 ldi r19, 0x00 ; 0 3a8cc: 40 ea ldi r20, 0xA0 ; 160 3a8ce: 51 e4 ldi r21, 0x41 ; 65 3a8d0: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3a8d4: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 3a8d8: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 3a8dc: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3a8e0: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3a8e4: 60 93 4b 07 sts 0x074B, r22 ; 0x80074b 3a8e8: 70 93 4c 07 sts 0x074C, r23 ; 0x80074c 3a8ec: 80 93 4d 07 sts 0x074D, r24 ; 0x80074d 3a8f0: 90 93 4e 07 sts 0x074E, r25 ; 0x80074e } // Lift the print head ONCE plus Z_PAUSE_LIFT first to avoid collisions with oozed material with the print, if(eeprom_read_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED) == 0) { 3a8f4: 8f e7 ldi r24, 0x7F ; 127 3a8f6: 9c e0 ldi r25, 0x0C ; 12 3a8f8: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a8fc: 81 11 cpse r24, r1 3a8fe: 23 c0 rjmp .+70 ; 0x3a946 enquecommandf_P(PSTR("G1 Z%.3f F800"), current_position[Z_AXIS] + Z_PAUSE_LIFT); 3a900: 20 e0 ldi r18, 0x00 ; 0 3a902: 30 e0 ldi r19, 0x00 ; 0 3a904: 40 ea ldi r20, 0xA0 ; 160 3a906: 51 e4 ldi r21, 0x41 ; 65 3a908: 60 91 4b 07 lds r22, 0x074B ; 0x80074b 3a90c: 70 91 4c 07 lds r23, 0x074C ; 0x80074c 3a910: 80 91 4d 07 lds r24, 0x074D ; 0x80074d 3a914: 90 91 4e 07 lds r25, 0x074E ; 0x80074e 3a918: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3a91c: 9f 93 push r25 3a91e: 8f 93 push r24 3a920: 7f 93 push r23 3a922: 6f 93 push r22 3a924: 8d e9 ldi r24, 0x9D ; 157 3a926: 9c ea ldi r25, 0xAC ; 172 3a928: 9f 93 push r25 3a92a: 8f 93 push r24 3a92c: 0e 94 e9 89 call 0x113d2 ; 0x113d2 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 3a930: 61 e0 ldi r22, 0x01 ; 1 3a932: 8f e7 ldi r24, 0x7F ; 127 3a934: 9c e0 ldi r25, 0x0C ; 12 3a936: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 3a93a: 0f 90 pop r0 3a93c: 0f 90 pop r0 3a93e: 0f 90 pop r0 3a940: 0f 90 pop r0 3a942: 0f 90 pop r0 3a944: 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")); 3a946: 61 e0 ldi r22, 0x01 ; 1 3a948: 85 e9 ldi r24, 0x95 ; 149 3a94a: 9c ea ldi r25, 0xAC ; 172 3a94c: 0e 94 4b 89 call 0x11296 ; 0x11296 // Set the target bed and nozzle temperatures and wait. enquecommandf_P(PSTR("M104 S%d"), target_temperature[active_extruder]); 3a950: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 3a954: 8f 93 push r24 3a956: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 3a95a: 8f 93 push r24 3a95c: 8c e8 ldi r24, 0x8C ; 140 3a95e: 9c ea ldi r25, 0xAC ; 172 3a960: 9f 93 push r25 3a962: 8f 93 push r24 3a964: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(PSTR("M140 S%d"), target_temperature_bed); 3a968: 80 91 6c 0e lds r24, 0x0E6C ; 0x800e6c 3a96c: 8f 93 push r24 3a96e: 80 91 6b 0e lds r24, 0x0E6B ; 0x800e6b 3a972: 8f 93 push r24 3a974: 83 e8 ldi r24, 0x83 ; 131 3a976: 9c ea ldi r25, 0xAC ; 172 3a978: 9f 93 push r25 3a97a: 8f 93 push r24 3a97c: 0e 94 e9 89 call 0x113d2 ; 0x113d2 //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) { 3a980: 8c e8 ldi r24, 0x8C ; 140 3a982: 9f e0 ldi r25, 0x0F ; 15 3a984: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3a988: 0f b6 in r0, 0x3f ; 63 3a98a: f8 94 cli 3a98c: de bf out 0x3e, r29 ; 62 3a98e: 0f be out 0x3f, r0 ; 63 3a990: cd bf out 0x3d, r28 ; 61 3a992: 81 11 cpse r24, r1 3a994: 10 c0 rjmp .+32 ; 0x3a9b6 enquecommandf_P(PSTR("M109 S%d"), target_temperature[active_extruder]); 3a996: 80 91 6e 0e lds r24, 0x0E6E ; 0x800e6e 3a99a: 8f 93 push r24 3a99c: 80 91 6d 0e lds r24, 0x0E6D ; 0x800e6d 3a9a0: 8f 93 push r24 3a9a2: 8a e7 ldi r24, 0x7A ; 122 3a9a4: 9c ea ldi r25, 0xAC ; 172 3a9a6: 9f 93 push r25 3a9a8: 8f 93 push r24 3a9aa: 0e 94 e9 89 call 0x113d2 ; 0x113d2 3a9ae: 0f 90 pop r0 3a9b0: 0f 90 pop r0 3a9b2: 0f 90 pop r0 3a9b4: 0f 90 pop r0 } enquecommand_P(MSG_M83); //E axis relative mode 3a9b6: 61 e0 ldi r22, 0x01 ; 1 3a9b8: 8d e1 ldi r24, 0x1D ; 29 3a9ba: 9c e6 ldi r25, 0x6C ; 108 3a9bc: 0e 94 4b 89 call 0x11296 ; 0x11296 // If not automatically recoreverd (long power loss) if(automatic == 0){ 3a9c0: a1 10 cpse r10, r1 3a9c2: 17 c0 rjmp .+46 ; 0x3a9f2 //Extrude some filament to stabilize the pressure enquecommand_P(PSTR("G1 E5 F120")); 3a9c4: 61 e0 ldi r22, 0x01 ; 1 3a9c6: 8f e6 ldi r24, 0x6F ; 111 3a9c8: 9c ea ldi r25, 0xAC ; 172 3a9ca: 0e 94 4b 89 call 0x11296 ; 0x11296 // Retract to be consistent with a short pause enquecommandf_P(G1_E_F2700, default_retraction); 3a9ce: 8f e3 ldi r24, 0x3F ; 63 3a9d0: 8f 93 push r24 3a9d2: 80 e8 ldi r24, 0x80 ; 128 3a9d4: 8f 93 push r24 3a9d6: 1f 92 push r1 3a9d8: 1f 92 push r1 3a9da: 82 ed ldi r24, 0xD2 ; 210 3a9dc: 91 e7 ldi r25, 0x71 ; 113 3a9de: 9f 93 push r25 3a9e0: 8f 93 push r24 3a9e2: 0e 94 e9 89 call 0x113d2 ; 0x113d2 3a9e6: 0f 90 pop r0 3a9e8: 0f 90 pop r0 3a9ea: 0f 90 pop r0 3a9ec: 0f 90 pop r0 3a9ee: 0f 90 pop r0 3a9f0: 0f 90 pop r0 } puts_P(_N("Temperature Restored\n")); 3a9f2: 8c eb ldi r24, 0xBC ; 188 3a9f4: 91 e7 ldi r25, 0x71 ; 113 3a9f6: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 gcode_M114(); 3a9fa: 0e 94 d2 79 call 0xf3a4 ; 0xf3a4 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); 3a9fe: 88 e8 ldi r24, 0x88 ; 136 3aa00: 9f e0 ldi r25, 0x0F ; 15 3aa02: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3aa06: 88 2e mov r8, r24 feedrate_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDRATE); 3aa08: 89 e8 ldi r24, 0x89 ; 137 3aa0a: 9f e0 ldi r25, 0x0F ; 15 3aa0c: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 3aa10: 8c 01 movw r16, r24 feedmultiply_rec = eeprom_read_word((uint16_t*)EEPROM_UVLO_FEEDMULTIPLY); 3aa12: 85 e3 ldi r24, 0x35 ; 53 3aa14: 9d e0 ldi r25, 0x0D ; 13 3aa16: 0f 94 9f dd call 0x3bb3e ; 0x3bb3e 3aa1a: f8 2e mov r15, r24 3aa1c: e9 2e mov r14, r25 SERIAL_ECHOPGM("Feedrate:"); 3aa1e: 85 e6 ldi r24, 0x65 ; 101 3aa20: 9c ea ldi r25, 0xAC ; 172 3aa22: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3aa26: b8 01 movw r22, r16 3aa28: 01 2e mov r0, r17 3aa2a: 00 0c add r0, r0 3aa2c: 88 0b sbc r24, r24 3aa2e: 99 0b sbc r25, r25 3aa30: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca MYSERIAL.print(feedrate_rec); SERIAL_ECHOPGM(", feedmultiply:"); 3aa34: 85 e5 ldi r24, 0x55 ; 85 3aa36: 9c ea ldi r25, 0xAC ; 172 3aa38: 0e 94 db 78 call 0xf1b6 ; 0xf1b6 MYSERIAL.println(feedmultiply_rec); 3aa3c: 8f 2d mov r24, r15 3aa3e: 9e 2d mov r25, r14 3aa40: 0f 94 19 77 call 0x2ee32 ; 0x2ee32 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3aa44: 80 91 6a 02 lds r24, 0x026A ; 0x80026a 3aa48: 81 11 cpse r24, r1 3aa4a: 02 c0 rjmp .+4 ; 0x3aa50 { // M23 restore_file_from_sd(); 3aa4c: 0e 94 0e 8a call 0x1141c ; 0x1141c } // 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)); 3aa50: 8d e9 ldi r24, 0x9D ; 157 3aa52: 9f e0 ldi r25, 0x0F ; 15 3aa54: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3aa58: c6 2e mov r12, r22 3aa5a: b7 2e mov r11, r23 3aa5c: a8 2e mov r10, r24 3aa5e: 99 2e mov r9, r25 float pos_y = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION + 4)); 3aa60: 81 ea ldi r24, 0xA1 ; 161 3aa62: 9f e0 ldi r25, 0x0F ; 15 3aa64: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3aa68: 76 2e mov r7, r22 3aa6a: 67 2e mov r6, r23 3aa6c: 58 2e mov r5, r24 3aa6e: 49 2e mov r4, r25 if (pos_x != X_COORD_INVALID) { 3aa70: 20 e0 ldi r18, 0x00 ; 0 3aa72: 30 e0 ldi r19, 0x00 ; 0 3aa74: 40 e8 ldi r20, 0x80 ; 128 3aa76: 5f eb ldi r21, 0xBF ; 191 3aa78: 6c 2d mov r22, r12 3aa7a: 7b 2d mov r23, r11 3aa7c: 8a 2d mov r24, r10 3aa7e: 99 2d mov r25, r9 3aa80: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3aa84: 88 23 and r24, r24 3aa86: 99 f0 breq .+38 ; 0x3aaae enquecommandf_P(PSTR("G1 X%-.3f Y%-.3f F3000"), pos_x, pos_y); 3aa88: 4f 92 push r4 3aa8a: 5f 92 push r5 3aa8c: 6f 92 push r6 3aa8e: 7f 92 push r7 3aa90: 9f 92 push r9 3aa92: af 92 push r10 3aa94: bf 92 push r11 3aa96: cf 92 push r12 3aa98: 8e e3 ldi r24, 0x3E ; 62 3aa9a: 9c ea ldi r25, 0xAC ; 172 3aa9c: 9f 93 push r25 3aa9e: 8f 93 push r24 3aaa0: 0e 94 e9 89 call 0x113d2 ; 0x113d2 3aaa4: 0f b6 in r0, 0x3f ; 63 3aaa6: f8 94 cli 3aaa8: de bf out 0x3e, r29 ; 62 3aaaa: 0f be out 0x3f, r0 ; 63 3aaac: cd bf out 0x3d, r28 ; 61 } // Enable MBL and switch to logical positioning if (mbl_was_active) 3aaae: dd 20 and r13, r13 3aab0: 29 f0 breq .+10 ; 0x3aabc enquecommand_P(PSTR("PRUSA MBL V1")); 3aab2: 61 e0 ldi r22, 0x01 ; 1 3aab4: 81 e3 ldi r24, 0x31 ; 49 3aab6: 9c ea ldi r25, 0xAC ; 172 3aab8: 0e 94 4b 89 call 0x11296 ; 0x11296 // 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))); 3aabc: 8d e8 ldi r24, 0x8D ; 141 3aabe: 9f e0 ldi r25, 0x0F ; 15 3aac0: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3aac4: 9f 93 push r25 3aac6: 8f 93 push r24 3aac8: 7f 93 push r23 3aaca: 6f 93 push r22 3aacc: 87 e2 ldi r24, 0x27 ; 39 3aace: 9c ea ldi r25, 0xAC ; 172 3aad0: 9f 93 push r25 3aad2: 8f 93 push r24 3aad4: 0e 94 e9 89 call 0x113d2 ; 0x113d2 // Restore acceleration settings float acceleration = eeprom_read_float((float*)(EEPROM_UVLO_ACCELL)); 3aad8: 81 e1 ldi r24, 0x11 ; 17 3aada: 9d e0 ldi r25, 0x0D ; 13 3aadc: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3aae0: d6 2e mov r13, r22 3aae2: c7 2e mov r12, r23 3aae4: b8 2e mov r11, r24 3aae6: a9 2e mov r10, r25 float retract_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_RETRACT_ACCELL)); 3aae8: 8d e0 ldi r24, 0x0D ; 13 3aaea: 9d e0 ldi r25, 0x0D ; 13 3aaec: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 3aaf0: 96 2e mov r9, r22 3aaf2: 77 2e mov r7, r23 3aaf4: 68 2e mov r6, r24 3aaf6: 59 2e mov r5, r25 float travel_acceleration = eeprom_read_float((float*)(EEPROM_UVLO_TRAVEL_ACCELL)); 3aaf8: 89 e0 ldi r24, 0x09 ; 9 3aafa: 9d e0 ldi r25, 0x0D ; 13 3aafc: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 // 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); 3ab00: 9f 93 push r25 3ab02: 8f 93 push r24 3ab04: 7f 93 push r23 3ab06: 6f 93 push r22 3ab08: 5f 92 push r5 3ab0a: 6f 92 push r6 3ab0c: 7f 92 push r7 3ab0e: 9f 92 push r9 3ab10: af 92 push r10 3ab12: bf 92 push r11 3ab14: cf 92 push r12 3ab16: df 92 push r13 3ab18: 8d e0 ldi r24, 0x0D ; 13 3ab1a: 9c ea ldi r25, 0xAC ; 172 3ab1c: 9f 93 push r25 3ab1e: 8f 93 push r24 3ab20: 0e 94 e9 89 call 0x113d2 ; 0x113d2 // Unretract. enquecommandf_P(G1_E_F2700, default_retraction); 3ab24: 8f e3 ldi r24, 0x3F ; 63 3ab26: 8f 93 push r24 3ab28: 80 e8 ldi r24, 0x80 ; 128 3ab2a: 8f 93 push r24 3ab2c: 1f 92 push r1 3ab2e: 1f 92 push r1 3ab30: 82 ed ldi r24, 0xD2 ; 210 3ab32: 91 e7 ldi r25, 0x71 ; 113 3ab34: 9f 93 push r25 3ab36: 8f 93 push r24 3ab38: 0e 94 e9 89 call 0x113d2 ; 0x113d2 // Recover final E axis position and mode float pos_e = eeprom_read_float((float*)(EEPROM_UVLO_CURRENT_POSITION_E)); 3ab3c: 8e e6 ldi r24, 0x6E ; 110 3ab3e: 9f e0 ldi r25, 0x0F ; 15 3ab40: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 enquecommandf_P(PSTR("G92 E%-.3f"), pos_e); 3ab44: 9f 93 push r25 3ab46: 8f 93 push r24 3ab48: 7f 93 push r23 3ab4a: 6f 93 push r22 3ab4c: 82 e0 ldi r24, 0x02 ; 2 3ab4e: 9c ea ldi r25, 0xAC ; 172 3ab50: 9f 93 push r25 3ab52: 8f 93 push r24 3ab54: 0e 94 e9 89 call 0x113d2 ; 0x113d2 if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_E_ABS)) 3ab58: 0f b6 in r0, 0x3f ; 63 3ab5a: f8 94 cli 3ab5c: de bf out 0x3e, r29 ; 62 3ab5e: 0f be out 0x3f, r0 ; 63 3ab60: cd bf out 0x3d, r28 ; 61 3ab62: 82 e7 ldi r24, 0x72 ; 114 3ab64: 9f e0 ldi r25, 0x0F ; 15 3ab66: 0f 94 91 dd call 0x3bb22 ; 0x3bb22 3ab6a: 88 23 and r24, r24 3ab6c: 29 f0 breq .+10 ; 0x3ab78 enquecommand_P(PSTR("M82")); //E axis abslute mode 3ab6e: 61 e0 ldi r22, 0x01 ; 1 3ab70: 8e ef ldi r24, 0xFE ; 254 3ab72: 9b ea ldi r25, 0xAB ; 171 3ab74: 0e 94 4b 89 call 0x11296 ; 0x11296 // Set the feedrates saved at the power panic. enquecommandf_P(PSTR("G1 F%d"), feedrate_rec); 3ab78: 1f 93 push r17 3ab7a: 0f 93 push r16 3ab7c: 87 ef ldi r24, 0xF7 ; 247 3ab7e: 9b ea ldi r25, 0xAB ; 171 3ab80: 9f 93 push r25 3ab82: 8f 93 push r24 3ab84: 0e 94 e9 89 call 0x113d2 ; 0x113d2 enquecommandf_P(MSG_M220, feedmultiply_rec); 3ab88: ef 92 push r14 3ab8a: ff 92 push r15 3ab8c: 8e e9 ldi r24, 0x9E ; 158 3ab8e: 91 e7 ldi r25, 0x71 ; 113 3ab90: 9f 93 push r25 3ab92: 8f 93 push r24 3ab94: 0e 94 e9 89 call 0x113d2 ; 0x113d2 // Set the fan speed saved at the power panic. enquecommandf_P(PSTR("M106 S%u"), fan_speed_rec); 3ab98: 1f 92 push r1 3ab9a: 8f 92 push r8 3ab9c: 8e ee ldi r24, 0xEE ; 238 3ab9e: 9b ea ldi r25, 0xAB ; 171 3aba0: 9f 93 push r25 3aba2: 8f 93 push r24 3aba4: 0e 94 e9 89 call 0x113d2 ; 0x113d2 // SD: Position in file, USB: g-code line number uint32_t position = eeprom_read_dword((uint32_t*)(EEPROM_FILE_POSITION)); 3aba8: 81 e9 ldi r24, 0x91 ; 145 3abaa: 9f e0 ldi r25, 0x0F ; 15 3abac: 0f 94 99 dd call 0x3bb32 ; 0x3bb32 if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) 3abb0: 20 91 6a 02 lds r18, 0x026A ; 0x80026a 3abb4: 0f b6 in r0, 0x3f ; 63 3abb6: f8 94 cli 3abb8: de bf out 0x3e, r29 ; 62 3abba: 0f be out 0x3f, r0 ; 63 3abbc: cd bf out 0x3d, r28 ; 61 3abbe: 21 11 cpse r18, r1 3abc0: 33 c0 rjmp .+102 ; 0x3ac28 { // Set a position in the file. enquecommandf_P(PSTR("M26 S%lu"), position); 3abc2: 9f 93 push r25 3abc4: 8f 93 push r24 3abc6: 7f 93 push r23 3abc8: 6f 93 push r22 3abca: 85 ee ldi r24, 0xE5 ; 229 3abcc: 9b ea ldi r25, 0xAB ; 171 } else if (saved_printing_type == PowerPanic::PRINT_TYPE_HOST) { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3abce: 9f 93 push r25 3abd0: 8f 93 push r24 3abd2: 0e 94 e9 89 call 0x113d2 ; 0x113d2 3abd6: 0f 90 pop r0 3abd8: 0f 90 pop r0 3abda: 0f 90 pop r0 3abdc: 0f 90 pop r0 3abde: 0f 90 pop r0 3abe0: 0f 90 pop r0 } enquecommand_P(PSTR("G4 S0")); 3abe2: 61 e0 ldi r22, 0x01 ; 1 3abe4: 85 ed ldi r24, 0xD5 ; 213 3abe6: 9b ea ldi r25, 0xAB ; 171 3abe8: 0e 94 4b 89 call 0x11296 ; 0x11296 enquecommand_P(PSTR("PRUSA uvlo")); 3abec: 61 e0 ldi r22, 0x01 ; 1 3abee: 8a ec ldi r24, 0xCA ; 202 3abf0: 9b ea ldi r25, 0xAB ; 171 3abf2: 0e 94 4b 89 call 0x11296 ; 0x11296 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")); 3abf6: 87 ea ldi r24, 0xA7 ; 167 3abf8: 91 e7 ldi r25, 0x71 ; 113 3abfa: 0f 94 7a dc call 0x3b8f4 ; 0x3b8f4 gcode_M114(); 3abfe: 0e 94 d2 79 call 0xf3a4 ; 0xf3a4 } 3ac02: 0f 90 pop r0 3ac04: 0f 90 pop r0 3ac06: df 91 pop r29 3ac08: cf 91 pop r28 3ac0a: 1f 91 pop r17 3ac0c: 0f 91 pop r16 3ac0e: ff 90 pop r15 3ac10: ef 90 pop r14 3ac12: df 90 pop r13 3ac14: cf 90 pop r12 3ac16: bf 90 pop r11 3ac18: af 90 pop r10 3ac1a: 9f 90 pop r9 3ac1c: 8f 90 pop r8 3ac1e: 7f 90 pop r7 3ac20: 6f 90 pop r6 3ac22: 5f 90 pop r5 3ac24: 4f 90 pop r4 3ac26: 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) 3ac28: 21 30 cpi r18, 0x01 ; 1 3ac2a: d9 f6 brne .-74 ; 0x3abe2 { // Set line number enquecommandf_P(PSTR("M110 N%lu"), position); 3ac2c: 9f 93 push r25 3ac2e: 8f 93 push r24 3ac30: 7f 93 push r23 3ac32: 6f 93 push r22 3ac34: 8b ed ldi r24, 0xDB ; 219 3ac36: 9b ea ldi r25, 0xAB ; 171 3ac38: ca cf rjmp .-108 ; 0x3abce 0003ac3a : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { 3ac3a: 8f 92 push r8 3ac3c: 9f 92 push r9 3ac3e: af 92 push r10 3ac40: bf 92 push r11 3ac42: cf 92 push r12 3ac44: df 92 push r13 3ac46: ef 92 push r14 3ac48: ff 92 push r15 3ac4a: cf 93 push r28 3ac4c: 6b 01 movw r12, r22 3ac4e: 7c 01 movw r14, r24 3ac50: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) 3ac52: 20 e0 ldi r18, 0x00 ; 0 3ac54: 30 e0 ldi r19, 0x00 ; 0 3ac56: a9 01 movw r20, r18 3ac58: 0f 94 ae df call 0x3bf5c ; 0x3bf5c <__cmpsf2> 3ac5c: 87 ff sbrs r24, 7 3ac5e: 07 c0 rjmp .+14 ; 0x3ac6e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ac60: 8d e2 ldi r24, 0x2D ; 45 3ac62: 0e 94 c2 78 call 0xf184 ; 0xf184 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; 3ac66: f7 fa bst r15, 7 3ac68: f0 94 com r15 3ac6a: f7 f8 bld r15, 7 3ac6c: 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; 3ac7c: 20 e0 ldi r18, 0x00 ; 0 3ac7e: 30 e0 ldi r19, 0x00 ; 0 3ac80: 40 e2 ldi r20, 0x20 ; 32 3ac82: 51 e4 ldi r21, 0x41 ; 65 3ac84: 0f 94 b8 df call 0x3bf70 ; 0x3bf70 <__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; 3ac8c: 9b 01 movw r18, r22 3ac8e: ac 01 movw r20, r24 3ac90: c7 01 movw r24, r14 3ac92: b6 01 movw r22, r12 3ac94: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3ac98: 6b 01 movw r12, r22 3ac9a: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; 3ac9c: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 3aca0: 4b 01 movw r8, r22 3aca2: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 3aca4: 4a e0 ldi r20, 0x0A ; 10 3aca6: 0f 94 80 d2 call 0x3a500 ; 0x3a500 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) 3acaa: cc 23 and r28, r28 3acac: 91 f1 breq .+100 ; 0x3ad12 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; 3acae: c5 01 movw r24, r10 3acb0: b4 01 movw r22, r8 3acb2: 0f 94 1d d8 call 0x3b03a ; 0x3b03a <__floatunsisf> 3acb6: 9b 01 movw r18, r22 3acb8: ac 01 movw r20, r24 3acba: c7 01 movw r24, r14 3acbc: b6 01 movw r22, r12 3acbe: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 3acc2: 6b 01 movw r12, r22 3acc4: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3acc6: 8e e2 ldi r24, 0x2E ; 46 3acc8: 0e 94 c2 78 call 0xf184 ; 0xf184 // 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) 3accc: c1 50 subi r28, 0x01 ; 1 3acce: 08 f1 brcs .+66 ; 0x3ad12 { remainder *= 10.0; 3acd0: 20 e0 ldi r18, 0x00 ; 0 3acd2: 30 e0 ldi r19, 0x00 ; 0 3acd4: 40 e2 ldi r20, 0x20 ; 32 3acd6: 51 e4 ldi r21, 0x41 ; 65 3acd8: c7 01 movw r24, r14 3acda: b6 01 movw r22, r12 3acdc: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3ace0: 4b 01 movw r8, r22 3ace2: 5c 01 movw r10, r24 int toPrint = int(remainder); 3ace4: 0f 94 2a e0 call 0x3c054 ; 0x3c054 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 3ace8: 6b 01 movw r12, r22 3acea: 77 0f add r23, r23 3acec: ee 08 sbc r14, r14 3acee: ff 08 sbc r15, r15 3acf0: c7 01 movw r24, r14 3acf2: b6 01 movw r22, r12 3acf4: 0f 94 e5 d2 call 0x3a5ca ; 0x3a5ca while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; 3acf8: c7 01 movw r24, r14 3acfa: b6 01 movw r22, r12 3acfc: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3ad00: 9b 01 movw r18, r22 3ad02: ac 01 movw r20, r24 3ad04: c5 01 movw r24, r10 3ad06: b4 01 movw r22, r8 3ad08: 0f 94 b8 de call 0x3bd70 ; 0x3bd70 <__subsf3> 3ad0c: 6b 01 movw r12, r22 3ad0e: 7c 01 movw r14, r24 3ad10: dd cf rjmp .-70 ; 0x3accc } } 3ad12: cf 91 pop r28 3ad14: ff 90 pop r15 3ad16: ef 90 pop r14 3ad18: df 90 pop r13 3ad1a: cf 90 pop r12 3ad1c: bf 90 pop r11 3ad1e: af 90 pop r10 3ad20: 9f 90 pop r9 3ad22: 8f 90 pop r8 3ad24: 08 95 ret 0003ad26 : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 3ad26: 8a e0 ldi r24, 0x0A ; 10 3ad28: 0c 94 c2 78 jmp 0xf184 ; 0xf184 0003ad2c : 3ad2c: 0e 94 3f 89 call 0x1127e ; 0x1127e }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 3ad30: 0d 94 93 d6 jmp 0x3ad26 ; 0x3ad26 0003ad34 : } 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) { 3ad34: 20 91 95 04 lds r18, 0x0495 ; 0x800495 3ad38: 30 91 96 04 lds r19, 0x0496 ; 0x800496 3ad3c: 80 91 93 04 lds r24, 0x0493 ; 0x800493 3ad40: 90 91 94 04 lds r25, 0x0494 ; 0x800494 3ad44: 82 17 cp r24, r18 3ad46: 93 07 cpc r25, r19 3ad48: 71 f0 breq .+28 ; 0x3ad66 return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 3ad4a: f9 01 movw r30, r18 3ad4c: ed 5e subi r30, 0xED ; 237 3ad4e: fb 4f sbci r31, 0xFB ; 251 3ad50: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 3ad52: 2f 5f subi r18, 0xFF ; 255 3ad54: 3f 4f sbci r19, 0xFF ; 255 3ad56: 2f 77 andi r18, 0x7F ; 127 3ad58: 33 27 eor r19, r19 3ad5a: 30 93 96 04 sts 0x0496, r19 ; 0x800496 3ad5e: 20 93 95 04 sts 0x0495, r18 ; 0x800495 return c; 3ad62: 90 e0 ldi r25, 0x00 ; 0 3ad64: 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; 3ad66: 8f ef ldi r24, 0xFF ; 255 3ad68: 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; } } 3ad6a: 08 95 ret 0003ad6c <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { 3ad6c: 1f 92 push r1 3ad6e: 0f 92 push r0 3ad70: 0f b6 in r0, 0x3f ; 63 3ad72: 0f 92 push r0 3ad74: 11 24 eor r1, r1 3ad76: 0b b6 in r0, 0x3b ; 59 3ad78: 0f 92 push r0 3ad7a: 2f 93 push r18 3ad7c: 3f 93 push r19 3ad7e: 4f 93 push r20 3ad80: 6f 93 push r22 3ad82: 7f 93 push r23 3ad84: 8f 93 push r24 3ad86: 9f 93 push r25 3ad88: ef 93 push r30 3ad8a: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< 3ad90: 84 ff sbrs r24, 4 3ad92: 12 c0 rjmp .+36 ; 0x3adb8 <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); 3ad94: 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 } } 3ad98: ff 91 pop r31 3ad9a: ef 91 pop r30 3ad9c: 9f 91 pop r25 3ad9e: 8f 91 pop r24 3ada0: 7f 91 pop r23 3ada2: 6f 91 pop r22 3ada4: 4f 91 pop r20 3ada6: 3f 91 pop r19 3ada8: 2f 91 pop r18 3adaa: 0f 90 pop r0 3adac: 0b be out 0x3b, r0 ; 59 3adae: 0f 90 pop r0 3adb0: 0f be out 0x3f, r0 ; 63 3adb2: 0f 90 pop r0 3adb4: 1f 90 pop r1 3adb6: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; 3adb8: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) 3adbc: 80 91 21 05 lds r24, 0x0521 ; 0x800521 3adc0: 81 30 cpi r24, 0x01 ; 1 3adc2: 51 f7 brne .-44 ; 0x3ad98 <__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; 3adc4: 20 91 93 04 lds r18, 0x0493 ; 0x800493 3adc8: 30 91 94 04 lds r19, 0x0494 ; 0x800494 3adcc: c9 01 movw r24, r18 3adce: 01 96 adiw r24, 0x01 ; 1 3add0: 8f 77 andi r24, 0x7F ; 127 3add2: 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) { 3add4: 60 91 95 04 lds r22, 0x0495 ; 0x800495 3add8: 70 91 96 04 lds r23, 0x0496 ; 0x800496 3addc: 86 17 cp r24, r22 3adde: 97 07 cpc r25, r23 3ade0: d9 f2 breq .-74 ; 0x3ad98 <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ade2: 2d 5e subi r18, 0xED ; 237 3ade4: 3b 4f sbci r19, 0xFB ; 251 3ade6: f9 01 movw r30, r18 3ade8: 40 83 st Z, r20 rx_buffer.head = i; 3adea: 90 93 94 04 sts 0x0494, r25 ; 0x800494 3adee: 80 93 93 04 sts 0x0493, r24 ; 0x800493 3adf2: d2 cf rjmp .-92 ; 0x3ad98 <__vector_36+0x2c> 0003adf4 <__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) { 3adf4: 1f 92 push r1 3adf6: 0f 92 push r0 3adf8: 0f b6 in r0, 0x3f ; 63 3adfa: 0f 92 push r0 3adfc: 11 24 eor r1, r1 3adfe: 0b b6 in r0, 0x3b ; 59 3ae00: 0f 92 push r0 3ae02: 2f 93 push r18 3ae04: 3f 93 push r19 3ae06: 4f 93 push r20 3ae08: 6f 93 push r22 3ae0a: 7f 93 push r23 3ae0c: 8f 93 push r24 3ae0e: 9f 93 push r25 3ae10: ef 93 push r30 3ae12: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< 3ae18: 84 ff sbrs r24, 4 3ae1a: 12 c0 rjmp .+36 ; 0x3ae40 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); 3ae1c: 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 } } 3ae20: ff 91 pop r31 3ae22: ef 91 pop r30 3ae24: 9f 91 pop r25 3ae26: 8f 91 pop r24 3ae28: 7f 91 pop r23 3ae2a: 6f 91 pop r22 3ae2c: 4f 91 pop r20 3ae2e: 3f 91 pop r19 3ae30: 2f 91 pop r18 3ae32: 0f 90 pop r0 3ae34: 0b be out 0x3b, r0 ; 59 3ae36: 0f 90 pop r0 3ae38: 0f be out 0x3f, r0 ; 63 3ae3a: 0f 90 pop r0 3ae3c: 1f 90 pop r1 3ae3e: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; 3ae40: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) 3ae44: 80 91 21 05 lds r24, 0x0521 ; 0x800521 3ae48: 81 11 cpse r24, r1 3ae4a: ea cf rjmp .-44 ; 0x3ae20 <__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; 3ae4c: 20 91 93 04 lds r18, 0x0493 ; 0x800493 3ae50: 30 91 94 04 lds r19, 0x0494 ; 0x800494 3ae54: c9 01 movw r24, r18 3ae56: 01 96 adiw r24, 0x01 ; 1 3ae58: 8f 77 andi r24, 0x7F ; 127 3ae5a: 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) { 3ae5c: 60 91 95 04 lds r22, 0x0495 ; 0x800495 3ae60: 70 91 96 04 lds r23, 0x0496 ; 0x800496 3ae64: 86 17 cp r24, r22 3ae66: 97 07 cpc r25, r23 3ae68: d9 f2 breq .-74 ; 0x3ae20 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; 3ae6a: 2d 5e subi r18, 0xED ; 237 3ae6c: 3b 4f sbci r19, 0xFB ; 251 3ae6e: f9 01 movw r30, r18 3ae70: 40 83 st Z, r20 rx_buffer.head = i; 3ae72: 90 93 94 04 sts 0x0494, r25 ; 0x800494 3ae76: 80 93 93 04 sts 0x0493, r24 ; 0x800493 3ae7a: d2 cf rjmp .-92 ; 0x3ae20 <__vector_25+0x2c> 0003ae7c : * 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) { 3ae7c: 2f 92 push r2 3ae7e: 3f 92 push r3 3ae80: 4f 92 push r4 3ae82: 5f 92 push r5 3ae84: 6f 92 push r6 3ae86: 7f 92 push r7 3ae88: 8f 92 push r8 3ae8a: 9f 92 push r9 3ae8c: af 92 push r10 3ae8e: bf 92 push r11 3ae90: cf 92 push r12 3ae92: df 92 push r13 3ae94: ef 92 push r14 3ae96: ff 92 push r15 3ae98: 0f 93 push r16 3ae9a: 1f 93 push r17 3ae9c: cf 93 push r28 3ae9e: df 93 push r29 3aea0: cd b7 in r28, 0x3d ; 61 3aea2: de b7 in r29, 0x3e ; 62 3aea4: c2 54 subi r28, 0x42 ; 66 3aea6: d1 09 sbc r29, r1 3aea8: 0f b6 in r0, 0x3f ; 63 3aeaa: f8 94 cli 3aeac: de bf out 0x3e, r29 ; 62 3aeae: 0f be out 0x3f, r0 ; 63 3aeb0: cd bf out 0x3d, r28 ; 61 3aeb2: 4c 01 movw r8, r24 3aeb4: 5b 01 movw r10, r22 3aeb6: 6a 01 movw r12, r20 3aeb8: 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) {} 3aeba: 19 82 std Y+1, r1 ; 0x01 3aebc: 1c 82 std Y+4, r1 ; 0x04 3aebe: 1c 8e std Y+28, r1 ; 0x1c 3aec0: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 3aec2: 67 2b or r22, r23 3aec4: 21 f5 brne .+72 ; 0x3af0e sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 3aec6: 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; 3aec8: ce 01 movw r24, r28 3aeca: 4c 96 adiw r24, 0x1c ; 28 3aecc: 0e 94 bc 78 call 0xf178 ; 0xf178 3aed0: ce 01 movw r24, r28 3aed2: 01 96 adiw r24, 0x01 ; 1 3aed4: 0e 94 bc 78 call 0xf178 ; 0xf178 } return open(parent, dname, oflag); fail: return false; } 3aed8: 81 2f mov r24, r17 3aeda: ce 5b subi r28, 0xBE ; 190 3aedc: df 4f sbci r29, 0xFF ; 255 3aede: 0f b6 in r0, 0x3f ; 63 3aee0: f8 94 cli 3aee2: de bf out 0x3e, r29 ; 62 3aee4: 0f be out 0x3f, r0 ; 63 3aee6: cd bf out 0x3d, r28 ; 61 3aee8: df 91 pop r29 3aeea: cf 91 pop r28 3aeec: 1f 91 pop r17 3aeee: 0f 91 pop r16 3aef0: ff 90 pop r15 3aef2: ef 90 pop r14 3aef4: df 90 pop r13 3aef6: cf 90 pop r12 3aef8: bf 90 pop r11 3aefa: af 90 pop r10 3aefc: 9f 90 pop r9 3aefe: 8f 90 pop r8 3af00: 7f 90 pop r7 3af02: 6f 90 pop r6 3af04: 5f 90 pop r5 3af06: 4f 90 pop r4 3af08: 3f 90 pop r3 3af0a: 2f 90 pop r2 3af0c: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 3af0e: fc 01 movw r30, r24 3af10: 83 81 ldd r24, Z+3 ; 0x03 3af12: 81 11 cpse r24, r1 3af14: d8 cf rjmp .-80 ; 0x3aec6 if (*path == '/') { 3af16: fa 01 movw r30, r20 3af18: 80 81 ld r24, Z 3af1a: 8f 32 cpi r24, 0x2F ; 47 3af1c: c1 f4 brne .+48 ; 0x3af4e 3af1e: ca 01 movw r24, r20 3af20: 6c 01 movw r12, r24 3af22: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 3af24: f6 01 movw r30, r12 3af26: 20 81 ld r18, Z 3af28: 2f 32 cpi r18, 0x2F ; 47 3af2a: d1 f3 breq .-12 ; 0x3af20 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; 3af2c: f5 01 movw r30, r10 3af2e: 83 81 ldd r24, Z+3 ; 0x03 3af30: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 3af32: 82 30 cpi r24, 0x02 ; 2 3af34: 60 f0 brcs .+24 ; 0x3af4e if (!dir2.openRoot(dirFile->vol_)) goto fail; 3af36: 61 8d ldd r22, Z+25 ; 0x19 3af38: 72 8d ldd r23, Z+26 ; 0x1a 3af3a: ce 01 movw r24, r28 3af3c: 4c 96 adiw r24, 0x1c ; 28 3af3e: 0f 94 24 a4 call 0x34848 ; 0x34848 parent = &dir2; 3af42: 8e 01 movw r16, r28 3af44: 04 5e subi r16, 0xE4 ; 228 3af46: 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; 3af48: 81 11 cpse r24, r1 3af4a: 02 c0 rjmp .+4 ; 0x3af50 3af4c: bc cf rjmp .-136 ; 0x3aec6 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 3af4e: 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; 3af50: ce 01 movw r24, r28 3af52: 01 96 adiw r24, 0x01 ; 1 3af54: 7c 01 movw r14, r24 3af56: 3c 01 movw r6, r24 3af58: 2e 01 movw r4, r28 3af5a: 9c e1 ldi r25, 0x1C ; 28 3af5c: 49 0e add r4, r25 3af5e: 51 1c adc r5, r1 3af60: 23 96 adiw r28, 0x03 ; 3 3af62: ef ae std Y+63, r14 ; 0x3f 3af64: 23 97 sbiw r28, 0x03 ; 3 3af66: 2f 2c mov r2, r15 3af68: fe 01 movw r30, r28 3af6a: f7 96 adiw r30, 0x37 ; 55 3af6c: cf 01 movw r24, r30 3af6e: 0b 96 adiw r24, 0x0b ; 11 3af70: 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++] = ' '; 3af72: 20 e2 ldi r18, 0x20 ; 32 3af74: 21 93 st Z+, r18 3af76: e8 17 cp r30, r24 3af78: f9 07 cpc r31, r25 3af7a: d9 f7 brne .-10 ; 0x3af72 3af7c: 96 01 movw r18, r12 i = 0; 3af7e: 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 3af80: 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 != '/') { 3af82: d9 01 movw r26, r18 3af84: 8d 91 ld r24, X+ 3af86: 88 23 and r24, r24 3af88: 49 f1 breq .+82 ; 0x3afdc 3af8a: 8f 32 cpi r24, 0x2F ; 47 3af8c: 39 f1 breq .+78 ; 0x3afdc c = *str++; 3af8e: 28 2f mov r18, r24 if (c == '.') { 3af90: 8e 32 cpi r24, 0x2E ; 46 3af92: 39 f4 brne .+14 ; 0x3afa2 if (n == 10) goto fail; // only one dot allowed 3af94: 6a 30 cpi r22, 0x0A ; 10 3af96: 09 f4 brne .+2 ; 0x3af9a 3af98: 96 cf rjmp .-212 ; 0x3aec6 n = 10; // max index for full 8.3 name i = 8; // place for extension 3af9a: 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 3af9c: 6a e0 ldi r22, 0x0A ; 10 3af9e: 9d 01 movw r18, r26 3afa0: f0 cf rjmp .-32 ; 0x3af82 3afa2: eb ea ldi r30, 0xAB ; 171 3afa4: 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; 3afa6: 34 91 lpm r19, Z 3afa8: 33 23 and r19, r19 3afaa: 21 f0 breq .+8 ; 0x3afb4 3afac: 31 96 adiw r30, 0x01 ; 1 3afae: 83 13 cpse r24, r19 3afb0: fa cf rjmp .-12 ; 0x3afa6 3afb2: 89 cf rjmp .-238 ; 0x3aec6 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 3afb4: 69 17 cp r22, r25 3afb6: 08 f4 brcc .+2 ; 0x3afba 3afb8: 86 cf rjmp .-244 ; 0x3aec6 3afba: 3f ed ldi r19, 0xDF ; 223 3afbc: 38 0f add r19, r24 3afbe: 3e 35 cpi r19, 0x5E ; 94 3afc0: 08 f0 brcs .+2 ; 0x3afc4 3afc2: 81 cf rjmp .-254 ; 0x3aec6 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 3afc4: 3f e9 ldi r19, 0x9F ; 159 3afc6: 38 0f add r19, r24 3afc8: 3a 31 cpi r19, 0x1A ; 26 3afca: 10 f4 brcc .+4 ; 0x3afd0 3afcc: 20 ee ldi r18, 0xE0 ; 224 3afce: 28 0f add r18, r24 3afd0: fa 01 movw r30, r20 3afd2: e9 0f add r30, r25 3afd4: f1 1d adc r31, r1 3afd6: 20 83 st Z, r18 3afd8: 9f 5f subi r25, 0xFF ; 255 3afda: e1 cf rjmp .-62 ; 0x3af9e if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 3afdc: 8f a9 ldd r24, Y+55 ; 0x37 3afde: 80 32 cpi r24, 0x20 ; 32 3afe0: 09 f4 brne .+2 ; 0x3afe4 3afe2: 71 cf rjmp .-286 ; 0x3aec6 3afe4: 69 01 movw r12, r18 while (*path == '/') path++; 3afe6: f9 01 movw r30, r18 3afe8: 80 81 ld r24, Z 3afea: 2f 5f subi r18, 0xFF ; 255 3afec: 3f 4f sbci r19, 0xFF ; 255 3afee: 8f 32 cpi r24, 0x2F ; 47 3aff0: c9 f3 breq .-14 ; 0x3afe4 if (!*path) break; 3aff2: 88 23 and r24, r24 3aff4: d9 f0 breq .+54 ; 0x3b02c if (!sub->open(parent, dname, O_READ)) goto fail; 3aff6: 21 e0 ldi r18, 0x01 ; 1 3aff8: b8 01 movw r22, r16 3affa: c7 01 movw r24, r14 3affc: 0f 94 71 a8 call 0x350e2 ; 0x350e2 3b000: 88 23 and r24, r24 3b002: 09 f4 brne .+2 ; 0x3b006 3b004: 60 cf rjmp .-320 ; 0x3aec6 if (parent != dirFile) parent->close(); 3b006: 0a 15 cp r16, r10 3b008: 1b 05 cpc r17, r11 3b00a: 19 f0 breq .+6 ; 0x3b012 3b00c: c8 01 movw r24, r16 3b00e: 0f 94 74 a4 call 0x348e8 ; 0x348e8 parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 3b012: 94 2d mov r25, r4 3b014: 85 2d mov r24, r5 3b016: 6e 14 cp r6, r14 3b018: 7f 04 cpc r7, r15 3b01a: 21 f0 breq .+8 ; 0x3b024 3b01c: 23 96 adiw r28, 0x03 ; 3 3b01e: 9f ad ldd r25, Y+63 ; 0x3f 3b020: 23 97 sbiw r28, 0x03 ; 3 3b022: 82 2d mov r24, r2 3b024: 87 01 movw r16, r14 3b026: e9 2e mov r14, r25 3b028: f8 2e mov r15, r24 3b02a: 9e cf rjmp .-196 ; 0x3af68 } return open(parent, dname, oflag); 3b02c: 23 2d mov r18, r3 3b02e: b8 01 movw r22, r16 3b030: c4 01 movw r24, r8 3b032: 0f 94 71 a8 call 0x350e2 ; 0x350e2 3b036: 18 2f mov r17, r24 3b038: 47 cf rjmp .-370 ; 0x3aec8 0003b03a <__floatunsisf>: 3b03a: e8 94 clt 3b03c: 09 c0 rjmp .+18 ; 0x3b050 <__floatsisf+0x12> 0003b03e <__floatsisf>: 3b03e: 97 fb bst r25, 7 3b040: 3e f4 brtc .+14 ; 0x3b050 <__floatsisf+0x12> 3b042: 90 95 com r25 3b044: 80 95 com r24 3b046: 70 95 com r23 3b048: 61 95 neg r22 3b04a: 7f 4f sbci r23, 0xFF ; 255 3b04c: 8f 4f sbci r24, 0xFF ; 255 3b04e: 9f 4f sbci r25, 0xFF ; 255 3b050: 99 23 and r25, r25 3b052: a9 f0 breq .+42 ; 0x3b07e <__floatsisf+0x40> 3b054: f9 2f mov r31, r25 3b056: 96 e9 ldi r25, 0x96 ; 150 3b058: bb 27 eor r27, r27 3b05a: 93 95 inc r25 3b05c: f6 95 lsr r31 3b05e: 87 95 ror r24 3b060: 77 95 ror r23 3b062: 67 95 ror r22 3b064: b7 95 ror r27 3b066: f1 11 cpse r31, r1 3b068: f8 cf rjmp .-16 ; 0x3b05a <__floatsisf+0x1c> 3b06a: fa f4 brpl .+62 ; 0x3b0aa <__floatsisf+0x6c> 3b06c: bb 0f add r27, r27 3b06e: 11 f4 brne .+4 ; 0x3b074 <__floatsisf+0x36> 3b070: 60 ff sbrs r22, 0 3b072: 1b c0 rjmp .+54 ; 0x3b0aa <__floatsisf+0x6c> 3b074: 6f 5f subi r22, 0xFF ; 255 3b076: 7f 4f sbci r23, 0xFF ; 255 3b078: 8f 4f sbci r24, 0xFF ; 255 3b07a: 9f 4f sbci r25, 0xFF ; 255 3b07c: 16 c0 rjmp .+44 ; 0x3b0aa <__floatsisf+0x6c> 3b07e: 88 23 and r24, r24 3b080: 11 f0 breq .+4 ; 0x3b086 <__floatsisf+0x48> 3b082: 96 e9 ldi r25, 0x96 ; 150 3b084: 11 c0 rjmp .+34 ; 0x3b0a8 <__floatsisf+0x6a> 3b086: 77 23 and r23, r23 3b088: 21 f0 breq .+8 ; 0x3b092 <__floatsisf+0x54> 3b08a: 9e e8 ldi r25, 0x8E ; 142 3b08c: 87 2f mov r24, r23 3b08e: 76 2f mov r23, r22 3b090: 05 c0 rjmp .+10 ; 0x3b09c <__floatsisf+0x5e> 3b092: 66 23 and r22, r22 3b094: 71 f0 breq .+28 ; 0x3b0b2 <__floatsisf+0x74> 3b096: 96 e8 ldi r25, 0x86 ; 134 3b098: 86 2f mov r24, r22 3b09a: 70 e0 ldi r23, 0x00 ; 0 3b09c: 60 e0 ldi r22, 0x00 ; 0 3b09e: 2a f0 brmi .+10 ; 0x3b0aa <__floatsisf+0x6c> 3b0a0: 9a 95 dec r25 3b0a2: 66 0f add r22, r22 3b0a4: 77 1f adc r23, r23 3b0a6: 88 1f adc r24, r24 3b0a8: da f7 brpl .-10 ; 0x3b0a0 <__floatsisf+0x62> 3b0aa: 88 0f add r24, r24 3b0ac: 96 95 lsr r25 3b0ae: 87 95 ror r24 3b0b0: 97 f9 bld r25, 7 3b0b2: 08 95 ret 0003b0b4 : 3b0b4: 9b 01 movw r18, r22 3b0b6: ac 01 movw r20, r24 3b0b8: 0d 94 5e d8 jmp 0x3b0bc ; 0x3b0bc <__mulsf3> 0003b0bc <__mulsf3>: 3b0bc: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__mulsf3x> 3b0c0: 0d 94 e2 d8 jmp 0x3b1c4 ; 0x3b1c4 <__fp_round> 3b0c4: 0f 94 d4 d8 call 0x3b1a8 ; 0x3b1a8 <__fp_pscA> 3b0c8: 38 f0 brcs .+14 ; 0x3b0d8 <__mulsf3+0x1c> 3b0ca: 0f 94 db d8 call 0x3b1b6 ; 0x3b1b6 <__fp_pscB> 3b0ce: 20 f0 brcs .+8 ; 0x3b0d8 <__mulsf3+0x1c> 3b0d0: 95 23 and r25, r21 3b0d2: 11 f0 breq .+4 ; 0x3b0d8 <__mulsf3+0x1c> 3b0d4: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 3b0d8: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 3b0dc: 11 24 eor r1, r1 3b0de: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 0003b0e2 <__mulsf3x>: 3b0e2: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_split3> 3b0e6: 70 f3 brcs .-36 ; 0x3b0c4 <__mulsf3+0x8> 0003b0e8 <__mulsf3_pse>: 3b0e8: 95 9f mul r25, r21 3b0ea: c1 f3 breq .-16 ; 0x3b0dc <__mulsf3+0x20> 3b0ec: 95 0f add r25, r21 3b0ee: 50 e0 ldi r21, 0x00 ; 0 3b0f0: 55 1f adc r21, r21 3b0f2: 62 9f mul r22, r18 3b0f4: f0 01 movw r30, r0 3b0f6: 72 9f mul r23, r18 3b0f8: bb 27 eor r27, r27 3b0fa: f0 0d add r31, r0 3b0fc: b1 1d adc r27, r1 3b0fe: 63 9f mul r22, r19 3b100: aa 27 eor r26, r26 3b102: f0 0d add r31, r0 3b104: b1 1d adc r27, r1 3b106: aa 1f adc r26, r26 3b108: 64 9f mul r22, r20 3b10a: 66 27 eor r22, r22 3b10c: b0 0d add r27, r0 3b10e: a1 1d adc r26, r1 3b110: 66 1f adc r22, r22 3b112: 82 9f mul r24, r18 3b114: 22 27 eor r18, r18 3b116: b0 0d add r27, r0 3b118: a1 1d adc r26, r1 3b11a: 62 1f adc r22, r18 3b11c: 73 9f mul r23, r19 3b11e: b0 0d add r27, r0 3b120: a1 1d adc r26, r1 3b122: 62 1f adc r22, r18 3b124: 83 9f mul r24, r19 3b126: a0 0d add r26, r0 3b128: 61 1d adc r22, r1 3b12a: 22 1f adc r18, r18 3b12c: 74 9f mul r23, r20 3b12e: 33 27 eor r19, r19 3b130: a0 0d add r26, r0 3b132: 61 1d adc r22, r1 3b134: 23 1f adc r18, r19 3b136: 84 9f mul r24, r20 3b138: 60 0d add r22, r0 3b13a: 21 1d adc r18, r1 3b13c: 82 2f mov r24, r18 3b13e: 76 2f mov r23, r22 3b140: 6a 2f mov r22, r26 3b142: 11 24 eor r1, r1 3b144: 9f 57 subi r25, 0x7F ; 127 3b146: 50 40 sbci r21, 0x00 ; 0 3b148: 9a f0 brmi .+38 ; 0x3b170 <__mulsf3_pse+0x88> 3b14a: f1 f0 breq .+60 ; 0x3b188 <__mulsf3_pse+0xa0> 3b14c: 88 23 and r24, r24 3b14e: 4a f0 brmi .+18 ; 0x3b162 <__mulsf3_pse+0x7a> 3b150: ee 0f add r30, r30 3b152: ff 1f adc r31, r31 3b154: bb 1f adc r27, r27 3b156: 66 1f adc r22, r22 3b158: 77 1f adc r23, r23 3b15a: 88 1f adc r24, r24 3b15c: 91 50 subi r25, 0x01 ; 1 3b15e: 50 40 sbci r21, 0x00 ; 0 3b160: a9 f7 brne .-22 ; 0x3b14c <__mulsf3_pse+0x64> 3b162: 9e 3f cpi r25, 0xFE ; 254 3b164: 51 05 cpc r21, r1 3b166: 80 f0 brcs .+32 ; 0x3b188 <__mulsf3_pse+0xa0> 3b168: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 3b16c: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 3b170: 5f 3f cpi r21, 0xFF ; 255 3b172: e4 f3 brlt .-8 ; 0x3b16c <__mulsf3_pse+0x84> 3b174: 98 3e cpi r25, 0xE8 ; 232 3b176: d4 f3 brlt .-12 ; 0x3b16c <__mulsf3_pse+0x84> 3b178: 86 95 lsr r24 3b17a: 77 95 ror r23 3b17c: 67 95 ror r22 3b17e: b7 95 ror r27 3b180: f7 95 ror r31 3b182: e7 95 ror r30 3b184: 9f 5f subi r25, 0xFF ; 255 3b186: c1 f7 brne .-16 ; 0x3b178 <__mulsf3_pse+0x90> 3b188: fe 2b or r31, r30 3b18a: 88 0f add r24, r24 3b18c: 91 1d adc r25, r1 3b18e: 96 95 lsr r25 3b190: 87 95 ror r24 3b192: 97 f9 bld r25, 7 3b194: 08 95 ret 0003b196 <__fp_inf>: 3b196: 97 f9 bld r25, 7 3b198: 9f 67 ori r25, 0x7F ; 127 3b19a: 80 e8 ldi r24, 0x80 ; 128 3b19c: 70 e0 ldi r23, 0x00 ; 0 3b19e: 60 e0 ldi r22, 0x00 ; 0 3b1a0: 08 95 ret 0003b1a2 <__fp_nan>: 3b1a2: 9f ef ldi r25, 0xFF ; 255 3b1a4: 80 ec ldi r24, 0xC0 ; 192 3b1a6: 08 95 ret 0003b1a8 <__fp_pscA>: 3b1a8: 00 24 eor r0, r0 3b1aa: 0a 94 dec r0 3b1ac: 16 16 cp r1, r22 3b1ae: 17 06 cpc r1, r23 3b1b0: 18 06 cpc r1, r24 3b1b2: 09 06 cpc r0, r25 3b1b4: 08 95 ret 0003b1b6 <__fp_pscB>: 3b1b6: 00 24 eor r0, r0 3b1b8: 0a 94 dec r0 3b1ba: 12 16 cp r1, r18 3b1bc: 13 06 cpc r1, r19 3b1be: 14 06 cpc r1, r20 3b1c0: 05 06 cpc r0, r21 3b1c2: 08 95 ret 0003b1c4 <__fp_round>: 3b1c4: 09 2e mov r0, r25 3b1c6: 03 94 inc r0 3b1c8: 00 0c add r0, r0 3b1ca: 11 f4 brne .+4 ; 0x3b1d0 <__fp_round+0xc> 3b1cc: 88 23 and r24, r24 3b1ce: 52 f0 brmi .+20 ; 0x3b1e4 <__fp_round+0x20> 3b1d0: bb 0f add r27, r27 3b1d2: 40 f4 brcc .+16 ; 0x3b1e4 <__fp_round+0x20> 3b1d4: bf 2b or r27, r31 3b1d6: 11 f4 brne .+4 ; 0x3b1dc <__fp_round+0x18> 3b1d8: 60 ff sbrs r22, 0 3b1da: 04 c0 rjmp .+8 ; 0x3b1e4 <__fp_round+0x20> 3b1dc: 6f 5f subi r22, 0xFF ; 255 3b1de: 7f 4f sbci r23, 0xFF ; 255 3b1e0: 8f 4f sbci r24, 0xFF ; 255 3b1e2: 9f 4f sbci r25, 0xFF ; 255 3b1e4: 08 95 ret 0003b1e6 <__fp_split3>: 3b1e6: 57 fd sbrc r21, 7 3b1e8: 90 58 subi r25, 0x80 ; 128 3b1ea: 44 0f add r20, r20 3b1ec: 55 1f adc r21, r21 3b1ee: 59 f0 breq .+22 ; 0x3b206 <__fp_splitA+0x10> 3b1f0: 5f 3f cpi r21, 0xFF ; 255 3b1f2: 71 f0 breq .+28 ; 0x3b210 <__fp_splitA+0x1a> 3b1f4: 47 95 ror r20 0003b1f6 <__fp_splitA>: 3b1f6: 88 0f add r24, r24 3b1f8: 97 fb bst r25, 7 3b1fa: 99 1f adc r25, r25 3b1fc: 61 f0 breq .+24 ; 0x3b216 <__fp_splitA+0x20> 3b1fe: 9f 3f cpi r25, 0xFF ; 255 3b200: 79 f0 breq .+30 ; 0x3b220 <__fp_splitA+0x2a> 3b202: 87 95 ror r24 3b204: 08 95 ret 3b206: 12 16 cp r1, r18 3b208: 13 06 cpc r1, r19 3b20a: 14 06 cpc r1, r20 3b20c: 55 1f adc r21, r21 3b20e: f2 cf rjmp .-28 ; 0x3b1f4 <__fp_split3+0xe> 3b210: 46 95 lsr r20 3b212: f1 df rcall .-30 ; 0x3b1f6 <__fp_splitA> 3b214: 08 c0 rjmp .+16 ; 0x3b226 <__fp_splitA+0x30> 3b216: 16 16 cp r1, r22 3b218: 17 06 cpc r1, r23 3b21a: 18 06 cpc r1, r24 3b21c: 99 1f adc r25, r25 3b21e: f1 cf rjmp .-30 ; 0x3b202 <__fp_splitA+0xc> 3b220: 86 95 lsr r24 3b222: 71 05 cpc r23, r1 3b224: 61 05 cpc r22, r1 3b226: 08 94 sec 3b228: 08 95 ret 0003b22a <__fp_zero>: 3b22a: e8 94 clt 0003b22c <__fp_szero>: 3b22c: bb 27 eor r27, r27 3b22e: 66 27 eor r22, r22 3b230: 77 27 eor r23, r23 3b232: cb 01 movw r24, r22 3b234: 97 f9 bld r25, 7 3b236: 08 95 ret 0003b238 : 3b238: 3f 92 push r3 3b23a: 4f 92 push r4 3b23c: 5f 92 push r5 3b23e: 6f 92 push r6 3b240: 7f 92 push r7 3b242: 8f 92 push r8 3b244: 9f 92 push r9 3b246: af 92 push r10 3b248: bf 92 push r11 3b24a: cf 92 push r12 3b24c: df 92 push r13 3b24e: ef 92 push r14 3b250: ff 92 push r15 3b252: 0f 93 push r16 3b254: 1f 93 push r17 3b256: cf 93 push r28 3b258: df 93 push r29 3b25a: 5c 01 movw r10, r24 3b25c: 6b 01 movw r12, r22 3b25e: 7a 01 movw r14, r20 3b260: 61 15 cp r22, r1 3b262: 71 05 cpc r23, r1 3b264: 19 f0 breq .+6 ; 0x3b26c 3b266: fb 01 movw r30, r22 3b268: 91 83 std Z+1, r25 ; 0x01 3b26a: 80 83 st Z, r24 3b26c: e1 14 cp r14, r1 3b26e: f1 04 cpc r15, r1 3b270: 51 f0 breq .+20 ; 0x3b286 3b272: c7 01 movw r24, r14 3b274: 02 97 sbiw r24, 0x02 ; 2 3b276: 83 97 sbiw r24, 0x23 ; 35 3b278: 30 f0 brcs .+12 ; 0x3b286 3b27a: 40 e0 ldi r20, 0x00 ; 0 3b27c: 30 e0 ldi r19, 0x00 ; 0 3b27e: 20 e0 ldi r18, 0x00 ; 0 3b280: 90 e0 ldi r25, 0x00 ; 0 3b282: 6b c0 rjmp .+214 ; 0x3b35a 3b284: 5e 01 movw r10, r28 3b286: e5 01 movw r28, r10 3b288: 21 96 adiw r28, 0x01 ; 1 3b28a: f5 01 movw r30, r10 3b28c: 10 81 ld r17, Z 3b28e: 81 2f mov r24, r17 3b290: 90 e0 ldi r25, 0x00 ; 0 3b292: 0f 94 22 db call 0x3b644 ; 0x3b644 3b296: 89 2b or r24, r25 3b298: a9 f7 brne .-22 ; 0x3b284 3b29a: 1d 32 cpi r17, 0x2D ; 45 3b29c: 01 f5 brne .+64 ; 0x3b2de 3b29e: 21 96 adiw r28, 0x01 ; 1 3b2a0: f5 01 movw r30, r10 3b2a2: 11 81 ldd r17, Z+1 ; 0x01 3b2a4: 01 e0 ldi r16, 0x01 ; 1 3b2a6: e1 14 cp r14, r1 3b2a8: f1 04 cpc r15, r1 3b2aa: 09 f4 brne .+2 ; 0x3b2ae 3b2ac: e6 c0 rjmp .+460 ; 0x3b47a 3b2ae: f0 e1 ldi r31, 0x10 ; 16 3b2b0: ef 16 cp r14, r31 3b2b2: f1 04 cpc r15, r1 3b2b4: 09 f0 breq .+2 ; 0x3b2b8 3b2b6: 88 c0 rjmp .+272 ; 0x3b3c8 3b2b8: 10 33 cpi r17, 0x30 ; 48 3b2ba: 59 f4 brne .+22 ; 0x3b2d2 3b2bc: 88 81 ld r24, Y 3b2be: 8f 7d andi r24, 0xDF ; 223 3b2c0: 88 35 cpi r24, 0x58 ; 88 3b2c2: 09 f0 breq .+2 ; 0x3b2c6 3b2c4: 7c c0 rjmp .+248 ; 0x3b3be 3b2c6: 19 81 ldd r17, Y+1 ; 0x01 3b2c8: 22 96 adiw r28, 0x02 ; 2 3b2ca: 02 60 ori r16, 0x02 ; 2 3b2cc: f0 e1 ldi r31, 0x10 ; 16 3b2ce: ef 2e mov r14, r31 3b2d0: f1 2c mov r15, r1 3b2d2: 81 2c mov r8, r1 3b2d4: 91 2c mov r9, r1 3b2d6: a1 2c mov r10, r1 3b2d8: 88 e0 ldi r24, 0x08 ; 8 3b2da: b8 2e mov r11, r24 3b2dc: 92 c0 rjmp .+292 ; 0x3b402 3b2de: 1b 32 cpi r17, 0x2B ; 43 3b2e0: 21 f4 brne .+8 ; 0x3b2ea 3b2e2: e5 01 movw r28, r10 3b2e4: 22 96 adiw r28, 0x02 ; 2 3b2e6: f5 01 movw r30, r10 3b2e8: 11 81 ldd r17, Z+1 ; 0x01 3b2ea: 00 e0 ldi r16, 0x00 ; 0 3b2ec: dc cf rjmp .-72 ; 0x3b2a6 3b2ee: ea e0 ldi r30, 0x0A ; 10 3b2f0: ee 16 cp r14, r30 3b2f2: f1 04 cpc r15, r1 3b2f4: 09 f4 brne .+2 ; 0x3b2f8 3b2f6: c7 c0 rjmp .+398 ; 0x3b486 3b2f8: f0 e1 ldi r31, 0x10 ; 16 3b2fa: ef 16 cp r14, r31 3b2fc: f1 04 cpc r15, r1 3b2fe: 09 f0 breq .+2 ; 0x3b302 3b300: 73 c0 rjmp .+230 ; 0x3b3e8 3b302: e7 cf rjmp .-50 ; 0x3b2d2 3b304: 78 e0 ldi r23, 0x08 ; 8 3b306: e7 2e mov r14, r23 3b308: f1 2c mov r15, r1 3b30a: 81 2c mov r8, r1 3b30c: 91 2c mov r9, r1 3b30e: a1 2c mov r10, r1 3b310: 60 e1 ldi r22, 0x10 ; 16 3b312: b6 2e mov r11, r22 3b314: 76 c0 rjmp .+236 ; 0x3b402 3b316: 21 e0 ldi r18, 0x01 ; 1 3b318: ad c0 rjmp .+346 ; 0x3b474 3b31a: 30 2f mov r19, r16 3b31c: 31 70 andi r19, 0x01 ; 1 3b31e: c1 14 cp r12, r1 3b320: d1 04 cpc r13, r1 3b322: 31 f0 breq .+12 ; 0x3b330 3b324: 22 23 and r18, r18 3b326: 71 f1 breq .+92 ; 0x3b384 3b328: 21 97 sbiw r28, 0x01 ; 1 3b32a: f6 01 movw r30, r12 3b32c: d1 83 std Z+1, r29 ; 0x01 3b32e: c0 83 st Z, r28 3b330: 27 ff sbrs r18, 7 3b332: 2e c0 rjmp .+92 ; 0x3b390 3b334: 60 e0 ldi r22, 0x00 ; 0 3b336: 70 e0 ldi r23, 0x00 ; 0 3b338: 80 e0 ldi r24, 0x00 ; 0 3b33a: 90 e8 ldi r25, 0x80 ; 128 3b33c: 31 11 cpse r19, r1 3b33e: 04 c0 rjmp .+8 ; 0x3b348 3b340: 6f ef ldi r22, 0xFF ; 255 3b342: 7f ef ldi r23, 0xFF ; 255 3b344: 8f ef ldi r24, 0xFF ; 255 3b346: 9f e7 ldi r25, 0x7F ; 127 3b348: 22 e2 ldi r18, 0x22 ; 34 3b34a: 30 e0 ldi r19, 0x00 ; 0 3b34c: 30 93 0e 18 sts 0x180E, r19 ; 0x80180e 3b350: 20 93 0d 18 sts 0x180D, r18 ; 0x80180d 3b354: 46 2f mov r20, r22 3b356: 37 2f mov r19, r23 3b358: 28 2f mov r18, r24 3b35a: 64 2f mov r22, r20 3b35c: 73 2f mov r23, r19 3b35e: 82 2f mov r24, r18 3b360: df 91 pop r29 3b362: cf 91 pop r28 3b364: 1f 91 pop r17 3b366: 0f 91 pop r16 3b368: ff 90 pop r15 3b36a: ef 90 pop r14 3b36c: df 90 pop r13 3b36e: cf 90 pop r12 3b370: bf 90 pop r11 3b372: af 90 pop r10 3b374: 9f 90 pop r9 3b376: 8f 90 pop r8 3b378: 7f 90 pop r7 3b37a: 6f 90 pop r6 3b37c: 5f 90 pop r5 3b37e: 4f 90 pop r4 3b380: 3f 90 pop r3 3b382: 08 95 ret 3b384: 01 ff sbrs r16, 1 3b386: 04 c0 rjmp .+8 ; 0x3b390 3b388: 22 97 sbiw r28, 0x02 ; 2 3b38a: f6 01 movw r30, r12 3b38c: d1 83 std Z+1, r29 ; 0x01 3b38e: c0 83 st Z, r28 3b390: 33 23 and r19, r19 3b392: 41 f0 breq .+16 ; 0x3b3a4 3b394: 90 95 com r25 3b396: 80 95 com r24 3b398: 70 95 com r23 3b39a: 61 95 neg r22 3b39c: 7f 4f sbci r23, 0xFF ; 255 3b39e: 8f 4f sbci r24, 0xFF ; 255 3b3a0: 9f 4f sbci r25, 0xFF ; 255 3b3a2: d8 cf rjmp .-80 ; 0x3b354 3b3a4: 97 ff sbrs r25, 7 3b3a6: d6 cf rjmp .-84 ; 0x3b354 3b3a8: 82 e2 ldi r24, 0x22 ; 34 3b3aa: 90 e0 ldi r25, 0x00 ; 0 3b3ac: 90 93 0e 18 sts 0x180E, r25 ; 0x80180e 3b3b0: 80 93 0d 18 sts 0x180D, r24 ; 0x80180d 3b3b4: 6f ef ldi r22, 0xFF ; 255 3b3b6: 7f ef ldi r23, 0xFF ; 255 3b3b8: 8f ef ldi r24, 0xFF ; 255 3b3ba: 9f e7 ldi r25, 0x7F ; 127 3b3bc: cb cf rjmp .-106 ; 0x3b354 3b3be: 10 e3 ldi r17, 0x30 ; 48 3b3c0: e1 14 cp r14, r1 3b3c2: f1 04 cpc r15, r1 3b3c4: 09 f4 brne .+2 ; 0x3b3c8 3b3c6: 9e cf rjmp .-196 ; 0x3b304 3b3c8: 28 e0 ldi r18, 0x08 ; 8 3b3ca: e2 16 cp r14, r18 3b3cc: f1 04 cpc r15, r1 3b3ce: 09 f4 brne .+2 ; 0x3b3d2 3b3d0: 9c cf rjmp .-200 ; 0x3b30a 3b3d2: 0c f0 brlt .+2 ; 0x3b3d6 3b3d4: 8c cf rjmp .-232 ; 0x3b2ee 3b3d6: 81 2c mov r8, r1 3b3d8: 91 2c mov r9, r1 3b3da: a1 2c mov r10, r1 3b3dc: e0 e4 ldi r30, 0x40 ; 64 3b3de: be 2e mov r11, r30 3b3e0: 82 e0 ldi r24, 0x02 ; 2 3b3e2: e8 16 cp r14, r24 3b3e4: f1 04 cpc r15, r1 3b3e6: 69 f0 breq .+26 ; 0x3b402 3b3e8: 60 e0 ldi r22, 0x00 ; 0 3b3ea: 70 e0 ldi r23, 0x00 ; 0 3b3ec: 80 e0 ldi r24, 0x00 ; 0 3b3ee: 90 e8 ldi r25, 0x80 ; 128 3b3f0: 97 01 movw r18, r14 3b3f2: 0f 2c mov r0, r15 3b3f4: 00 0c add r0, r0 3b3f6: 44 0b sbc r20, r20 3b3f8: 55 0b sbc r21, r21 3b3fa: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 3b3fe: 49 01 movw r8, r18 3b400: 5a 01 movw r10, r20 3b402: 20 e0 ldi r18, 0x00 ; 0 3b404: 60 e0 ldi r22, 0x00 ; 0 3b406: 70 e0 ldi r23, 0x00 ; 0 3b408: cb 01 movw r24, r22 3b40a: 27 01 movw r4, r14 3b40c: 0f 2c mov r0, r15 3b40e: 00 0c add r0, r0 3b410: 66 08 sbc r6, r6 3b412: 77 08 sbc r7, r7 3b414: fe 01 movw r30, r28 3b416: 50 ed ldi r21, 0xD0 ; 208 3b418: 35 2e mov r3, r21 3b41a: 31 0e add r3, r17 3b41c: 39 e0 ldi r19, 0x09 ; 9 3b41e: 33 15 cp r19, r3 3b420: 70 f4 brcc .+28 ; 0x3b43e 3b422: 3f eb ldi r19, 0xBF ; 191 3b424: 31 0f add r19, r17 3b426: 49 ec ldi r20, 0xC9 ; 201 3b428: 34 2e mov r3, r20 3b42a: 3a 31 cpi r19, 0x1A ; 26 3b42c: 38 f0 brcs .+14 ; 0x3b43c 3b42e: 3f e9 ldi r19, 0x9F ; 159 3b430: 31 0f add r19, r17 3b432: 3a 31 cpi r19, 0x1A ; 26 3b434: 08 f0 brcs .+2 ; 0x3b438 3b436: 71 cf rjmp .-286 ; 0x3b31a 3b438: 39 ea ldi r19, 0xA9 ; 169 3b43a: 33 2e mov r3, r19 3b43c: 31 0e add r3, r17 3b43e: 3e 14 cp r3, r14 3b440: 1f 04 cpc r1, r15 3b442: 0c f0 brlt .+2 ; 0x3b446 3b444: 6a cf rjmp .-300 ; 0x3b31a 3b446: 27 fd sbrc r18, 7 3b448: 15 c0 rjmp .+42 ; 0x3b474 3b44a: 86 16 cp r8, r22 3b44c: 97 06 cpc r9, r23 3b44e: a8 06 cpc r10, r24 3b450: b9 06 cpc r11, r25 3b452: 78 f0 brcs .+30 ; 0x3b472 3b454: a3 01 movw r20, r6 3b456: 92 01 movw r18, r4 3b458: 0f 94 f4 dd call 0x3bbe8 ; 0x3bbe8 <__mulsi3> 3b45c: 63 0d add r22, r3 3b45e: 71 1d adc r23, r1 3b460: 81 1d adc r24, r1 3b462: 91 1d adc r25, r1 3b464: 61 30 cpi r22, 0x01 ; 1 3b466: 71 05 cpc r23, r1 3b468: 81 05 cpc r24, r1 3b46a: 20 e8 ldi r18, 0x80 ; 128 3b46c: 92 07 cpc r25, r18 3b46e: 08 f4 brcc .+2 ; 0x3b472 3b470: 52 cf rjmp .-348 ; 0x3b316 3b472: 2f ef ldi r18, 0xFF ; 255 3b474: 21 96 adiw r28, 0x01 ; 1 3b476: 10 81 ld r17, Z 3b478: cd cf rjmp .-102 ; 0x3b414 3b47a: 10 33 cpi r17, 0x30 ; 48 3b47c: 09 f4 brne .+2 ; 0x3b480 3b47e: 1e cf rjmp .-452 ; 0x3b2bc 3b480: 2a e0 ldi r18, 0x0A ; 10 3b482: e2 2e mov r14, r18 3b484: f1 2c mov r15, r1 3b486: 9c ec ldi r25, 0xCC ; 204 3b488: 89 2e mov r8, r25 3b48a: 98 2c mov r9, r8 3b48c: a8 2c mov r10, r8 3b48e: 9c e0 ldi r25, 0x0C ; 12 3b490: b9 2e mov r11, r25 3b492: b7 cf rjmp .-146 ; 0x3b402 0003b494 <__ftoa_engine>: 3b494: 28 30 cpi r18, 0x08 ; 8 3b496: 08 f0 brcs .+2 ; 0x3b49a <__ftoa_engine+0x6> 3b498: 27 e0 ldi r18, 0x07 ; 7 3b49a: 33 27 eor r19, r19 3b49c: da 01 movw r26, r20 3b49e: 99 0f add r25, r25 3b4a0: 31 1d adc r19, r1 3b4a2: 87 fd sbrc r24, 7 3b4a4: 91 60 ori r25, 0x01 ; 1 3b4a6: 00 96 adiw r24, 0x00 ; 0 3b4a8: 61 05 cpc r22, r1 3b4aa: 71 05 cpc r23, r1 3b4ac: 39 f4 brne .+14 ; 0x3b4bc <__ftoa_engine+0x28> 3b4ae: 32 60 ori r19, 0x02 ; 2 3b4b0: 2e 5f subi r18, 0xFE ; 254 3b4b2: 3d 93 st X+, r19 3b4b4: 30 e3 ldi r19, 0x30 ; 48 3b4b6: 2a 95 dec r18 3b4b8: e1 f7 brne .-8 ; 0x3b4b2 <__ftoa_engine+0x1e> 3b4ba: 08 95 ret 3b4bc: 9f 3f cpi r25, 0xFF ; 255 3b4be: 30 f0 brcs .+12 ; 0x3b4cc <__ftoa_engine+0x38> 3b4c0: 80 38 cpi r24, 0x80 ; 128 3b4c2: 71 05 cpc r23, r1 3b4c4: 61 05 cpc r22, r1 3b4c6: 09 f0 breq .+2 ; 0x3b4ca <__ftoa_engine+0x36> 3b4c8: 3c 5f subi r19, 0xFC ; 252 3b4ca: 3c 5f subi r19, 0xFC ; 252 3b4cc: 3d 93 st X+, r19 3b4ce: 91 30 cpi r25, 0x01 ; 1 3b4d0: 08 f0 brcs .+2 ; 0x3b4d4 <__ftoa_engine+0x40> 3b4d2: 80 68 ori r24, 0x80 ; 128 3b4d4: 91 1d adc r25, r1 3b4d6: df 93 push r29 3b4d8: cf 93 push r28 3b4da: 1f 93 push r17 3b4dc: 0f 93 push r16 3b4de: ff 92 push r15 3b4e0: ef 92 push r14 3b4e2: 19 2f mov r17, r25 3b4e4: 98 7f andi r25, 0xF8 ; 248 3b4e6: 96 95 lsr r25 3b4e8: e9 2f mov r30, r25 3b4ea: 96 95 lsr r25 3b4ec: 96 95 lsr r25 3b4ee: e9 0f add r30, r25 3b4f0: ff 27 eor r31, r31 3b4f2: e6 5b subi r30, 0xB6 ; 182 3b4f4: f8 48 sbci r31, 0x88 ; 136 3b4f6: 99 27 eor r25, r25 3b4f8: 33 27 eor r19, r19 3b4fa: ee 24 eor r14, r14 3b4fc: ff 24 eor r15, r15 3b4fe: a7 01 movw r20, r14 3b500: e7 01 movw r28, r14 3b502: 05 90 lpm r0, Z+ 3b504: 08 94 sec 3b506: 07 94 ror r0 3b508: 28 f4 brcc .+10 ; 0x3b514 <__ftoa_engine+0x80> 3b50a: 36 0f add r19, r22 3b50c: e7 1e adc r14, r23 3b50e: f8 1e adc r15, r24 3b510: 49 1f adc r20, r25 3b512: 51 1d adc r21, r1 3b514: 66 0f add r22, r22 3b516: 77 1f adc r23, r23 3b518: 88 1f adc r24, r24 3b51a: 99 1f adc r25, r25 3b51c: 06 94 lsr r0 3b51e: a1 f7 brne .-24 ; 0x3b508 <__ftoa_engine+0x74> 3b520: 05 90 lpm r0, Z+ 3b522: 07 94 ror r0 3b524: 28 f4 brcc .+10 ; 0x3b530 <__ftoa_engine+0x9c> 3b526: e7 0e add r14, r23 3b528: f8 1e adc r15, r24 3b52a: 49 1f adc r20, r25 3b52c: 56 1f adc r21, r22 3b52e: c1 1d adc r28, r1 3b530: 77 0f add r23, r23 3b532: 88 1f adc r24, r24 3b534: 99 1f adc r25, r25 3b536: 66 1f adc r22, r22 3b538: 06 94 lsr r0 3b53a: a1 f7 brne .-24 ; 0x3b524 <__ftoa_engine+0x90> 3b53c: 05 90 lpm r0, Z+ 3b53e: 07 94 ror r0 3b540: 28 f4 brcc .+10 ; 0x3b54c <__ftoa_engine+0xb8> 3b542: f8 0e add r15, r24 3b544: 49 1f adc r20, r25 3b546: 56 1f adc r21, r22 3b548: c7 1f adc r28, r23 3b54a: d1 1d adc r29, r1 3b54c: 88 0f add r24, r24 3b54e: 99 1f adc r25, r25 3b550: 66 1f adc r22, r22 3b552: 77 1f adc r23, r23 3b554: 06 94 lsr r0 3b556: a1 f7 brne .-24 ; 0x3b540 <__ftoa_engine+0xac> 3b558: 05 90 lpm r0, Z+ 3b55a: 07 94 ror r0 3b55c: 20 f4 brcc .+8 ; 0x3b566 <__ftoa_engine+0xd2> 3b55e: 49 0f add r20, r25 3b560: 56 1f adc r21, r22 3b562: c7 1f adc r28, r23 3b564: d8 1f adc r29, r24 3b566: 99 0f add r25, r25 3b568: 66 1f adc r22, r22 3b56a: 77 1f adc r23, r23 3b56c: 88 1f adc r24, r24 3b56e: 06 94 lsr r0 3b570: a9 f7 brne .-22 ; 0x3b55c <__ftoa_engine+0xc8> 3b572: 84 91 lpm r24, Z 3b574: 10 95 com r17 3b576: 17 70 andi r17, 0x07 ; 7 3b578: 41 f0 breq .+16 ; 0x3b58a <__ftoa_engine+0xf6> 3b57a: d6 95 lsr r29 3b57c: c7 95 ror r28 3b57e: 57 95 ror r21 3b580: 47 95 ror r20 3b582: f7 94 ror r15 3b584: e7 94 ror r14 3b586: 1a 95 dec r17 3b588: c1 f7 brne .-16 ; 0x3b57a <__ftoa_engine+0xe6> 3b58a: e0 ef ldi r30, 0xF0 ; 240 3b58c: f6 e7 ldi r31, 0x76 ; 118 3b58e: 68 94 set 3b590: 15 90 lpm r1, Z+ 3b592: 15 91 lpm r17, Z+ 3b594: 35 91 lpm r19, Z+ 3b596: 65 91 lpm r22, Z+ 3b598: 95 91 lpm r25, Z+ 3b59a: 05 90 lpm r0, Z+ 3b59c: 7f e2 ldi r23, 0x2F ; 47 3b59e: 73 95 inc r23 3b5a0: e1 18 sub r14, r1 3b5a2: f1 0a sbc r15, r17 3b5a4: 43 0b sbc r20, r19 3b5a6: 56 0b sbc r21, r22 3b5a8: c9 0b sbc r28, r25 3b5aa: d0 09 sbc r29, r0 3b5ac: c0 f7 brcc .-16 ; 0x3b59e <__ftoa_engine+0x10a> 3b5ae: e1 0c add r14, r1 3b5b0: f1 1e adc r15, r17 3b5b2: 43 1f adc r20, r19 3b5b4: 56 1f adc r21, r22 3b5b6: c9 1f adc r28, r25 3b5b8: d0 1d adc r29, r0 3b5ba: 7e f4 brtc .+30 ; 0x3b5da <__ftoa_engine+0x146> 3b5bc: 70 33 cpi r23, 0x30 ; 48 3b5be: 11 f4 brne .+4 ; 0x3b5c4 <__ftoa_engine+0x130> 3b5c0: 8a 95 dec r24 3b5c2: e6 cf rjmp .-52 ; 0x3b590 <__ftoa_engine+0xfc> 3b5c4: e8 94 clt 3b5c6: 01 50 subi r16, 0x01 ; 1 3b5c8: 30 f0 brcs .+12 ; 0x3b5d6 <__ftoa_engine+0x142> 3b5ca: 08 0f add r16, r24 3b5cc: 0a f4 brpl .+2 ; 0x3b5d0 <__ftoa_engine+0x13c> 3b5ce: 00 27 eor r16, r16 3b5d0: 02 17 cp r16, r18 3b5d2: 08 f4 brcc .+2 ; 0x3b5d6 <__ftoa_engine+0x142> 3b5d4: 20 2f mov r18, r16 3b5d6: 23 95 inc r18 3b5d8: 02 2f mov r16, r18 3b5da: 7a 33 cpi r23, 0x3A ; 58 3b5dc: 28 f0 brcs .+10 ; 0x3b5e8 <__ftoa_engine+0x154> 3b5de: 79 e3 ldi r23, 0x39 ; 57 3b5e0: 7d 93 st X+, r23 3b5e2: 2a 95 dec r18 3b5e4: e9 f7 brne .-6 ; 0x3b5e0 <__ftoa_engine+0x14c> 3b5e6: 10 c0 rjmp .+32 ; 0x3b608 <__ftoa_engine+0x174> 3b5e8: 7d 93 st X+, r23 3b5ea: 2a 95 dec r18 3b5ec: 89 f6 brne .-94 ; 0x3b590 <__ftoa_engine+0xfc> 3b5ee: 06 94 lsr r0 3b5f0: 97 95 ror r25 3b5f2: 67 95 ror r22 3b5f4: 37 95 ror r19 3b5f6: 17 95 ror r17 3b5f8: 17 94 ror r1 3b5fa: e1 18 sub r14, r1 3b5fc: f1 0a sbc r15, r17 3b5fe: 43 0b sbc r20, r19 3b600: 56 0b sbc r21, r22 3b602: c9 0b sbc r28, r25 3b604: d0 09 sbc r29, r0 3b606: 98 f0 brcs .+38 ; 0x3b62e <__ftoa_engine+0x19a> 3b608: 23 95 inc r18 3b60a: 7e 91 ld r23, -X 3b60c: 73 95 inc r23 3b60e: 7a 33 cpi r23, 0x3A ; 58 3b610: 08 f0 brcs .+2 ; 0x3b614 <__ftoa_engine+0x180> 3b612: 70 e3 ldi r23, 0x30 ; 48 3b614: 7c 93 st X, r23 3b616: 20 13 cpse r18, r16 3b618: b8 f7 brcc .-18 ; 0x3b608 <__ftoa_engine+0x174> 3b61a: 7e 91 ld r23, -X 3b61c: 70 61 ori r23, 0x10 ; 16 3b61e: 7d 93 st X+, r23 3b620: 30 f0 brcs .+12 ; 0x3b62e <__ftoa_engine+0x19a> 3b622: 83 95 inc r24 3b624: 71 e3 ldi r23, 0x31 ; 49 3b626: 7d 93 st X+, r23 3b628: 70 e3 ldi r23, 0x30 ; 48 3b62a: 2a 95 dec r18 3b62c: e1 f7 brne .-8 ; 0x3b626 <__ftoa_engine+0x192> 3b62e: 11 24 eor r1, r1 3b630: ef 90 pop r14 3b632: ff 90 pop r15 3b634: 0f 91 pop r16 3b636: 1f 91 pop r17 3b638: cf 91 pop r28 3b63a: df 91 pop r29 3b63c: 99 27 eor r25, r25 3b63e: 87 fd sbrc r24, 7 3b640: 90 95 com r25 3b642: 08 95 ret 0003b644 : 3b644: 91 11 cpse r25, r1 3b646: 0d 94 7e dd jmp 0x3bafc ; 0x3bafc <__ctype_isfalse> 3b64a: 80 32 cpi r24, 0x20 ; 32 3b64c: 19 f0 breq .+6 ; 0x3b654 3b64e: 89 50 subi r24, 0x09 ; 9 3b650: 85 50 subi r24, 0x05 ; 5 3b652: c8 f7 brcc .-14 ; 0x3b646 3b654: 08 95 ret 0003b656 : 3b656: fb 01 movw r30, r22 3b658: dc 01 movw r26, r24 3b65a: 02 c0 rjmp .+4 ; 0x3b660 3b65c: 05 90 lpm r0, Z+ 3b65e: 0d 92 st X+, r0 3b660: 41 50 subi r20, 0x01 ; 1 3b662: 50 40 sbci r21, 0x00 ; 0 3b664: d8 f7 brcc .-10 ; 0x3b65c 3b666: 08 95 ret 0003b668 : 3b668: fb 01 movw r30, r22 3b66a: dc 01 movw r26, r24 3b66c: 0d 90 ld r0, X+ 3b66e: 00 20 and r0, r0 3b670: e9 f7 brne .-6 ; 0x3b66c 3b672: 11 97 sbiw r26, 0x01 ; 1 3b674: 05 90 lpm r0, Z+ 3b676: 0d 92 st X+, r0 3b678: 00 20 and r0, r0 3b67a: e1 f7 brne .-8 ; 0x3b674 3b67c: 08 95 ret 0003b67e : 3b67e: fb 01 movw r30, r22 3b680: dc 01 movw r26, r24 3b682: 8d 91 ld r24, X+ 3b684: 05 90 lpm r0, Z+ 3b686: 80 19 sub r24, r0 3b688: 01 10 cpse r0, r1 3b68a: d9 f3 breq .-10 ; 0x3b682 3b68c: 99 0b sbc r25, r25 3b68e: 08 95 ret 0003b690 : 3b690: fb 01 movw r30, r22 3b692: dc 01 movw r26, r24 3b694: 05 90 lpm r0, Z+ 3b696: 0d 92 st X+, r0 3b698: 00 20 and r0, r0 3b69a: e1 f7 brne .-8 ; 0x3b694 3b69c: 08 95 ret 0003b69e <__strlen_P>: 3b69e: fc 01 movw r30, r24 3b6a0: 05 90 lpm r0, Z+ 3b6a2: 00 20 and r0, r0 3b6a4: e9 f7 brne .-6 ; 0x3b6a0 <__strlen_P+0x2> 3b6a6: 80 95 com r24 3b6a8: 90 95 com r25 3b6aa: 8e 0f add r24, r30 3b6ac: 9f 1f adc r25, r31 3b6ae: 08 95 ret 0003b6b0 : 3b6b0: fb 01 movw r30, r22 3b6b2: dc 01 movw r26, r24 3b6b4: 41 50 subi r20, 0x01 ; 1 3b6b6: 50 40 sbci r21, 0x00 ; 0 3b6b8: 88 f0 brcs .+34 ; 0x3b6dc 3b6ba: 8d 91 ld r24, X+ 3b6bc: 81 34 cpi r24, 0x41 ; 65 3b6be: 1c f0 brlt .+6 ; 0x3b6c6 3b6c0: 8b 35 cpi r24, 0x5B ; 91 3b6c2: 0c f4 brge .+2 ; 0x3b6c6 3b6c4: 80 5e subi r24, 0xE0 ; 224 3b6c6: 65 91 lpm r22, Z+ 3b6c8: 61 34 cpi r22, 0x41 ; 65 3b6ca: 1c f0 brlt .+6 ; 0x3b6d2 3b6cc: 6b 35 cpi r22, 0x5B ; 91 3b6ce: 0c f4 brge .+2 ; 0x3b6d2 3b6d0: 60 5e subi r22, 0xE0 ; 224 3b6d2: 86 1b sub r24, r22 3b6d4: 61 11 cpse r22, r1 3b6d6: 71 f3 breq .-36 ; 0x3b6b4 3b6d8: 99 0b sbc r25, r25 3b6da: 08 95 ret 3b6dc: 88 1b sub r24, r24 3b6de: fc cf rjmp .-8 ; 0x3b6d8 0003b6e0 : 3b6e0: fb 01 movw r30, r22 3b6e2: dc 01 movw r26, r24 3b6e4: 41 50 subi r20, 0x01 ; 1 3b6e6: 50 40 sbci r21, 0x00 ; 0 3b6e8: 30 f0 brcs .+12 ; 0x3b6f6 3b6ea: 8d 91 ld r24, X+ 3b6ec: 05 90 lpm r0, Z+ 3b6ee: 80 19 sub r24, r0 3b6f0: 19 f4 brne .+6 ; 0x3b6f8 3b6f2: 00 20 and r0, r0 3b6f4: b9 f7 brne .-18 ; 0x3b6e4 3b6f6: 88 1b sub r24, r24 3b6f8: 99 0b sbc r25, r25 3b6fa: 08 95 ret 0003b6fc : 3b6fc: fb 01 movw r30, r22 3b6fe: dc 01 movw r26, r24 3b700: 41 50 subi r20, 0x01 ; 1 3b702: 50 40 sbci r21, 0x00 ; 0 3b704: 48 f0 brcs .+18 ; 0x3b718 3b706: 05 90 lpm r0, Z+ 3b708: 0d 92 st X+, r0 3b70a: 00 20 and r0, r0 3b70c: c9 f7 brne .-14 ; 0x3b700 3b70e: 01 c0 rjmp .+2 ; 0x3b712 3b710: 1d 92 st X+, r1 3b712: 41 50 subi r20, 0x01 ; 1 3b714: 50 40 sbci r21, 0x00 ; 0 3b716: e0 f7 brcc .-8 ; 0x3b710 3b718: 08 95 ret 0003b71a : 3b71a: fc 01 movw r30, r24 3b71c: 05 90 lpm r0, Z+ 3b71e: 61 50 subi r22, 0x01 ; 1 3b720: 70 40 sbci r23, 0x00 ; 0 3b722: 01 10 cpse r0, r1 3b724: d8 f7 brcc .-10 ; 0x3b71c 3b726: 80 95 com r24 3b728: 90 95 com r25 3b72a: 8e 0f add r24, r30 3b72c: 9f 1f adc r25, r31 3b72e: 08 95 ret 0003b730 : 3b730: fb 01 movw r30, r22 3b732: 55 91 lpm r21, Z+ 3b734: 55 23 and r21, r21 3b736: a9 f0 breq .+42 ; 0x3b762 3b738: bf 01 movw r22, r30 3b73a: dc 01 movw r26, r24 3b73c: 4d 91 ld r20, X+ 3b73e: 45 17 cp r20, r21 3b740: 41 11 cpse r20, r1 3b742: e1 f7 brne .-8 ; 0x3b73c 3b744: 59 f4 brne .+22 ; 0x3b75c 3b746: cd 01 movw r24, r26 3b748: 05 90 lpm r0, Z+ 3b74a: 00 20 and r0, r0 3b74c: 49 f0 breq .+18 ; 0x3b760 3b74e: 4d 91 ld r20, X+ 3b750: 40 15 cp r20, r0 3b752: 41 11 cpse r20, r1 3b754: c9 f3 breq .-14 ; 0x3b748 3b756: fb 01 movw r30, r22 3b758: 41 11 cpse r20, r1 3b75a: ef cf rjmp .-34 ; 0x3b73a 3b75c: 81 e0 ldi r24, 0x01 ; 1 3b75e: 90 e0 ldi r25, 0x00 ; 0 3b760: 01 97 sbiw r24, 0x01 ; 1 3b762: 08 95 ret 0003b764 : 3b764: fc 01 movw r30, r24 3b766: 61 50 subi r22, 0x01 ; 1 3b768: 70 40 sbci r23, 0x00 ; 0 3b76a: 01 90 ld r0, Z+ 3b76c: 01 10 cpse r0, r1 3b76e: d8 f7 brcc .-10 ; 0x3b766 3b770: 80 95 com r24 3b772: 90 95 com r25 3b774: 8e 0f add r24, r30 3b776: 9f 1f adc r25, r31 3b778: 08 95 ret 0003b77a : 3b77a: cf 93 push r28 3b77c: df 93 push r29 3b77e: ec 01 movw r28, r24 3b780: 2b 81 ldd r18, Y+3 ; 0x03 3b782: 20 ff sbrs r18, 0 3b784: 1a c0 rjmp .+52 ; 0x3b7ba 3b786: 26 ff sbrs r18, 6 3b788: 0c c0 rjmp .+24 ; 0x3b7a2 3b78a: 2f 7b andi r18, 0xBF ; 191 3b78c: 2b 83 std Y+3, r18 ; 0x03 3b78e: 8e 81 ldd r24, Y+6 ; 0x06 3b790: 9f 81 ldd r25, Y+7 ; 0x07 3b792: 01 96 adiw r24, 0x01 ; 1 3b794: 9f 83 std Y+7, r25 ; 0x07 3b796: 8e 83 std Y+6, r24 ; 0x06 3b798: 8a 81 ldd r24, Y+2 ; 0x02 3b79a: 90 e0 ldi r25, 0x00 ; 0 3b79c: df 91 pop r29 3b79e: cf 91 pop r28 3b7a0: 08 95 ret 3b7a2: 22 ff sbrs r18, 2 3b7a4: 18 c0 rjmp .+48 ; 0x3b7d6 3b7a6: e8 81 ld r30, Y 3b7a8: f9 81 ldd r31, Y+1 ; 0x01 3b7aa: 80 81 ld r24, Z 3b7ac: 08 2e mov r0, r24 3b7ae: 00 0c add r0, r0 3b7b0: 99 0b sbc r25, r25 3b7b2: 00 97 sbiw r24, 0x00 ; 0 3b7b4: 29 f4 brne .+10 ; 0x3b7c0 3b7b6: 20 62 ori r18, 0x20 ; 32 3b7b8: 2b 83 std Y+3, r18 ; 0x03 3b7ba: 8f ef ldi r24, 0xFF ; 255 3b7bc: 9f ef ldi r25, 0xFF ; 255 3b7be: ee cf rjmp .-36 ; 0x3b79c 3b7c0: 31 96 adiw r30, 0x01 ; 1 3b7c2: f9 83 std Y+1, r31 ; 0x01 3b7c4: e8 83 st Y, r30 3b7c6: 2e 81 ldd r18, Y+6 ; 0x06 3b7c8: 3f 81 ldd r19, Y+7 ; 0x07 3b7ca: 2f 5f subi r18, 0xFF ; 255 3b7cc: 3f 4f sbci r19, 0xFF ; 255 3b7ce: 3f 83 std Y+7, r19 ; 0x07 3b7d0: 2e 83 std Y+6, r18 ; 0x06 3b7d2: 99 27 eor r25, r25 3b7d4: e3 cf rjmp .-58 ; 0x3b79c 3b7d6: ea 85 ldd r30, Y+10 ; 0x0a 3b7d8: fb 85 ldd r31, Y+11 ; 0x0b 3b7da: 19 95 eicall 3b7dc: 97 ff sbrs r25, 7 3b7de: f3 cf rjmp .-26 ; 0x3b7c6 3b7e0: 2b 81 ldd r18, Y+3 ; 0x03 3b7e2: 01 96 adiw r24, 0x01 ; 1 3b7e4: 21 f0 breq .+8 ; 0x3b7ee 3b7e6: 80 e2 ldi r24, 0x20 ; 32 3b7e8: 82 2b or r24, r18 3b7ea: 8b 83 std Y+3, r24 ; 0x03 3b7ec: e6 cf rjmp .-52 ; 0x3b7ba 3b7ee: 80 e1 ldi r24, 0x10 ; 16 3b7f0: fb cf rjmp .-10 ; 0x3b7e8 0003b7f2 : 3b7f2: 0f 93 push r16 3b7f4: 1f 93 push r17 3b7f6: cf 93 push r28 3b7f8: df 93 push r29 3b7fa: 18 2f mov r17, r24 3b7fc: 09 2f mov r16, r25 3b7fe: eb 01 movw r28, r22 3b800: 8b 81 ldd r24, Y+3 ; 0x03 3b802: 81 fd sbrc r24, 1 3b804: 09 c0 rjmp .+18 ; 0x3b818 3b806: 1f ef ldi r17, 0xFF ; 255 3b808: 0f ef ldi r16, 0xFF ; 255 3b80a: 81 2f mov r24, r17 3b80c: 90 2f mov r25, r16 3b80e: df 91 pop r29 3b810: cf 91 pop r28 3b812: 1f 91 pop r17 3b814: 0f 91 pop r16 3b816: 08 95 ret 3b818: 82 ff sbrs r24, 2 3b81a: 14 c0 rjmp .+40 ; 0x3b844 3b81c: 2e 81 ldd r18, Y+6 ; 0x06 3b81e: 3f 81 ldd r19, Y+7 ; 0x07 3b820: 8c 81 ldd r24, Y+4 ; 0x04 3b822: 9d 81 ldd r25, Y+5 ; 0x05 3b824: 28 17 cp r18, r24 3b826: 39 07 cpc r19, r25 3b828: 3c f4 brge .+14 ; 0x3b838 3b82a: e8 81 ld r30, Y 3b82c: f9 81 ldd r31, Y+1 ; 0x01 3b82e: cf 01 movw r24, r30 3b830: 01 96 adiw r24, 0x01 ; 1 3b832: 99 83 std Y+1, r25 ; 0x01 3b834: 88 83 st Y, r24 3b836: 10 83 st Z, r17 3b838: 8e 81 ldd r24, Y+6 ; 0x06 3b83a: 9f 81 ldd r25, Y+7 ; 0x07 3b83c: 01 96 adiw r24, 0x01 ; 1 3b83e: 9f 83 std Y+7, r25 ; 0x07 3b840: 8e 83 std Y+6, r24 ; 0x06 3b842: e3 cf rjmp .-58 ; 0x3b80a 3b844: e8 85 ldd r30, Y+8 ; 0x08 3b846: f9 85 ldd r31, Y+9 ; 0x09 3b848: 81 2f mov r24, r17 3b84a: 19 95 eicall 3b84c: 89 2b or r24, r25 3b84e: a1 f3 breq .-24 ; 0x3b838 3b850: da cf rjmp .-76 ; 0x3b806 0003b852 : 3b852: ef 92 push r14 3b854: ff 92 push r15 3b856: 0f 93 push r16 3b858: 1f 93 push r17 3b85a: cf 93 push r28 3b85c: df 93 push r29 3b85e: 8c 01 movw r16, r24 3b860: 7b 01 movw r14, r22 3b862: db 01 movw r26, r22 3b864: 13 96 adiw r26, 0x03 ; 3 3b866: 8c 91 ld r24, X 3b868: d0 e0 ldi r29, 0x00 ; 0 3b86a: c0 e0 ldi r28, 0x00 ; 0 3b86c: 81 fd sbrc r24, 1 3b86e: 0f c0 rjmp .+30 ; 0x3b88e 3b870: cf ef ldi r28, 0xFF ; 255 3b872: df ef ldi r29, 0xFF ; 255 3b874: 10 c0 rjmp .+32 ; 0x3b896 3b876: d7 01 movw r26, r14 3b878: 18 96 adiw r26, 0x08 ; 8 3b87a: ed 91 ld r30, X+ 3b87c: fc 91 ld r31, X 3b87e: b7 01 movw r22, r14 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: 81 11 cpse r24, r1 3b894: f0 cf rjmp .-32 ; 0x3b876 3b896: ce 01 movw r24, r28 3b898: df 91 pop r29 3b89a: cf 91 pop r28 3b89c: 1f 91 pop r17 3b89e: 0f 91 pop r16 3b8a0: ff 90 pop r15 3b8a2: ef 90 pop r14 3b8a4: 08 95 ret 0003b8a6 : 3b8a6: 0f 93 push r16 3b8a8: 1f 93 push r17 3b8aa: cf 93 push r28 3b8ac: df 93 push r29 3b8ae: cd b7 in r28, 0x3d ; 61 3b8b0: de b7 in r29, 0x3e ; 62 3b8b2: ae 01 movw r20, r28 3b8b4: 48 5f subi r20, 0xF8 ; 248 3b8b6: 5f 4f sbci r21, 0xFF ; 255 3b8b8: da 01 movw r26, r20 3b8ba: 6d 91 ld r22, X+ 3b8bc: 7d 91 ld r23, X+ 3b8be: ad 01 movw r20, r26 3b8c0: 03 e1 ldi r16, 0x13 ; 19 3b8c2: 18 e1 ldi r17, 0x18 ; 24 3b8c4: f8 01 movw r30, r16 3b8c6: 82 81 ldd r24, Z+2 ; 0x02 3b8c8: 93 81 ldd r25, Z+3 ; 0x03 3b8ca: dc 01 movw r26, r24 3b8cc: 13 96 adiw r26, 0x03 ; 3 3b8ce: 2c 91 ld r18, X 3b8d0: 13 97 sbiw r26, 0x03 ; 3 3b8d2: 28 60 ori r18, 0x08 ; 8 3b8d4: 13 96 adiw r26, 0x03 ; 3 3b8d6: 2c 93 st X, r18 3b8d8: 0e 94 8f 57 call 0xaf1e ; 0xaf1e 3b8dc: d8 01 movw r26, r16 3b8de: 12 96 adiw r26, 0x02 ; 2 3b8e0: ed 91 ld r30, X+ 3b8e2: fc 91 ld r31, X 3b8e4: 23 81 ldd r18, Z+3 ; 0x03 3b8e6: 27 7f andi r18, 0xF7 ; 247 3b8e8: 23 83 std Z+3, r18 ; 0x03 3b8ea: df 91 pop r29 3b8ec: cf 91 pop r28 3b8ee: 1f 91 pop r17 3b8f0: 0f 91 pop r16 3b8f2: 08 95 ret 0003b8f4 : 3b8f4: 0f 93 push r16 3b8f6: 1f 93 push r17 3b8f8: cf 93 push r28 3b8fa: df 93 push r29 3b8fc: 8c 01 movw r16, r24 3b8fe: e0 91 15 18 lds r30, 0x1815 ; 0x801815 <__iob+0x2> 3b902: f0 91 16 18 lds r31, 0x1816 ; 0x801816 <__iob+0x3> 3b906: 83 81 ldd r24, Z+3 ; 0x03 3b908: d0 e0 ldi r29, 0x00 ; 0 3b90a: c0 e0 ldi r28, 0x00 ; 0 3b90c: 81 fd sbrc r24, 1 3b90e: 0a c0 rjmp .+20 ; 0x3b924 3b910: cf ef ldi r28, 0xFF ; 255 3b912: df ef ldi r29, 0xFF ; 255 3b914: 17 c0 rjmp .+46 ; 0x3b944 3b916: 19 95 eicall 3b918: 89 2b or r24, r25 3b91a: 11 f0 breq .+4 ; 0x3b920 3b91c: cf ef ldi r28, 0xFF ; 255 3b91e: df ef ldi r29, 0xFF ; 255 3b920: 0f 5f subi r16, 0xFF ; 255 3b922: 1f 4f sbci r17, 0xFF ; 255 3b924: f8 01 movw r30, r16 3b926: 84 91 lpm r24, Z 3b928: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 3b92c: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 3b930: db 01 movw r26, r22 3b932: 18 96 adiw r26, 0x08 ; 8 3b934: ed 91 ld r30, X+ 3b936: fc 91 ld r31, X 3b938: 81 11 cpse r24, r1 3b93a: ed cf rjmp .-38 ; 0x3b916 3b93c: 8a e0 ldi r24, 0x0A ; 10 3b93e: 19 95 eicall 3b940: 89 2b or r24, r25 3b942: 31 f7 brne .-52 ; 0x3b910 3b944: ce 01 movw r24, r28 3b946: df 91 pop r29 3b948: cf 91 pop r28 3b94a: 1f 91 pop r17 3b94c: 0f 91 pop r16 3b94e: 08 95 ret 0003b950 : 3b950: 0f 93 push r16 3b952: 1f 93 push r17 3b954: cf 93 push r28 3b956: df 93 push r29 3b958: cd b7 in r28, 0x3d ; 61 3b95a: de b7 in r29, 0x3e ; 62 3b95c: 2e 97 sbiw r28, 0x0e ; 14 3b95e: 0f b6 in r0, 0x3f ; 63 3b960: f8 94 cli 3b962: de bf out 0x3e, r29 ; 62 3b964: 0f be out 0x3f, r0 ; 63 3b966: cd bf out 0x3d, r28 ; 61 3b968: 0e 89 ldd r16, Y+22 ; 0x16 3b96a: 1f 89 ldd r17, Y+23 ; 0x17 3b96c: 8e e0 ldi r24, 0x0E ; 14 3b96e: 8c 83 std Y+4, r24 ; 0x04 3b970: 1a 83 std Y+2, r17 ; 0x02 3b972: 09 83 std Y+1, r16 ; 0x01 3b974: 8f ef ldi r24, 0xFF ; 255 3b976: 9f e7 ldi r25, 0x7F ; 127 3b978: 9e 83 std Y+6, r25 ; 0x06 3b97a: 8d 83 std Y+5, r24 ; 0x05 3b97c: ae 01 movw r20, r28 3b97e: 46 5e subi r20, 0xE6 ; 230 3b980: 5f 4f sbci r21, 0xFF ; 255 3b982: 68 8d ldd r22, Y+24 ; 0x18 3b984: 79 8d ldd r23, Y+25 ; 0x19 3b986: ce 01 movw r24, r28 3b988: 01 96 adiw r24, 0x01 ; 1 3b98a: 0e 94 8f 57 call 0xaf1e ; 0xaf1e 3b98e: 2f 81 ldd r18, Y+7 ; 0x07 3b990: 38 85 ldd r19, Y+8 ; 0x08 3b992: 02 0f add r16, r18 3b994: 13 1f adc r17, r19 3b996: f8 01 movw r30, r16 3b998: 10 82 st Z, r1 3b99a: 2e 96 adiw r28, 0x0e ; 14 3b99c: 0f b6 in r0, 0x3f ; 63 3b99e: f8 94 cli 3b9a0: de bf out 0x3e, r29 ; 62 3b9a2: 0f be out 0x3f, r0 ; 63 3b9a4: cd bf out 0x3d, r28 ; 61 3b9a6: df 91 pop r29 3b9a8: cf 91 pop r28 3b9aa: 1f 91 pop r17 3b9ac: 0f 91 pop r16 3b9ae: 08 95 ret 0003b9b0 : 3b9b0: cf 93 push r28 3b9b2: df 93 push r29 3b9b4: ec 01 movw r28, r24 3b9b6: 8b 81 ldd r24, Y+3 ; 0x03 3b9b8: 88 60 ori r24, 0x08 ; 8 3b9ba: 8b 83 std Y+3, r24 ; 0x03 3b9bc: ce 01 movw r24, r28 3b9be: 0e 94 8f 57 call 0xaf1e ; 0xaf1e 3b9c2: 2b 81 ldd r18, Y+3 ; 0x03 3b9c4: 27 7f andi r18, 0xF7 ; 247 3b9c6: 2b 83 std Y+3, r18 ; 0x03 3b9c8: df 91 pop r29 3b9ca: cf 91 pop r28 3b9cc: 08 95 ret 0003b9ce : 3b9ce: 0f 93 push r16 3b9d0: 1f 93 push r17 3b9d2: cf 93 push r28 3b9d4: df 93 push r29 3b9d6: cd b7 in r28, 0x3d ; 61 3b9d8: de b7 in r29, 0x3e ; 62 3b9da: 2e 97 sbiw r28, 0x0e ; 14 3b9dc: 0f b6 in r0, 0x3f ; 63 3b9de: f8 94 cli 3b9e0: de bf out 0x3e, r29 ; 62 3b9e2: 0f be out 0x3f, r0 ; 63 3b9e4: cd bf out 0x3d, r28 ; 61 3b9e6: 8c 01 movw r16, r24 3b9e8: fa 01 movw r30, r20 3b9ea: 8e e0 ldi r24, 0x0E ; 14 3b9ec: 8c 83 std Y+4, r24 ; 0x04 3b9ee: 1a 83 std Y+2, r17 ; 0x02 3b9f0: 09 83 std Y+1, r16 ; 0x01 3b9f2: 77 ff sbrs r23, 7 3b9f4: 02 c0 rjmp .+4 ; 0x3b9fa 3b9f6: 60 e0 ldi r22, 0x00 ; 0 3b9f8: 70 e8 ldi r23, 0x80 ; 128 3b9fa: 61 50 subi r22, 0x01 ; 1 3b9fc: 71 09 sbc r23, r1 3b9fe: 7e 83 std Y+6, r23 ; 0x06 3ba00: 6d 83 std Y+5, r22 ; 0x05 3ba02: a9 01 movw r20, r18 3ba04: bf 01 movw r22, r30 3ba06: ce 01 movw r24, r28 3ba08: 01 96 adiw r24, 0x01 ; 1 3ba0a: 0e 94 8f 57 call 0xaf1e ; 0xaf1e 3ba0e: 4d 81 ldd r20, Y+5 ; 0x05 3ba10: 5e 81 ldd r21, Y+6 ; 0x06 3ba12: 57 fd sbrc r21, 7 3ba14: 0a c0 rjmp .+20 ; 0x3ba2a 3ba16: 2f 81 ldd r18, Y+7 ; 0x07 3ba18: 38 85 ldd r19, Y+8 ; 0x08 3ba1a: 42 17 cp r20, r18 3ba1c: 53 07 cpc r21, r19 3ba1e: 0c f4 brge .+2 ; 0x3ba22 3ba20: 9a 01 movw r18, r20 3ba22: 02 0f add r16, r18 3ba24: 13 1f adc r17, r19 3ba26: f8 01 movw r30, r16 3ba28: 10 82 st Z, r1 3ba2a: 2e 96 adiw r28, 0x0e ; 14 3ba2c: 0f b6 in r0, 0x3f ; 63 3ba2e: f8 94 cli 3ba30: de bf out 0x3e, r29 ; 62 3ba32: 0f be out 0x3f, r0 ; 63 3ba34: cd bf out 0x3d, r28 ; 61 3ba36: df 91 pop r29 3ba38: cf 91 pop r28 3ba3a: 1f 91 pop r17 3ba3c: 0f 91 pop r16 3ba3e: 08 95 ret 0003ba40 <__ultoa_invert>: 3ba40: fa 01 movw r30, r20 3ba42: aa 27 eor r26, r26 3ba44: 28 30 cpi r18, 0x08 ; 8 3ba46: 51 f1 breq .+84 ; 0x3ba9c <__ultoa_invert+0x5c> 3ba48: 20 31 cpi r18, 0x10 ; 16 3ba4a: 81 f1 breq .+96 ; 0x3baac <__ultoa_invert+0x6c> 3ba4c: e8 94 clt 3ba4e: 6f 93 push r22 3ba50: 6e 7f andi r22, 0xFE ; 254 3ba52: 6e 5f subi r22, 0xFE ; 254 3ba54: 7f 4f sbci r23, 0xFF ; 255 3ba56: 8f 4f sbci r24, 0xFF ; 255 3ba58: 9f 4f sbci r25, 0xFF ; 255 3ba5a: af 4f sbci r26, 0xFF ; 255 3ba5c: b1 e0 ldi r27, 0x01 ; 1 3ba5e: 3e d0 rcall .+124 ; 0x3badc <__ultoa_invert+0x9c> 3ba60: b4 e0 ldi r27, 0x04 ; 4 3ba62: 3c d0 rcall .+120 ; 0x3badc <__ultoa_invert+0x9c> 3ba64: 67 0f add r22, r23 3ba66: 78 1f adc r23, r24 3ba68: 89 1f adc r24, r25 3ba6a: 9a 1f adc r25, r26 3ba6c: a1 1d adc r26, r1 3ba6e: 68 0f add r22, r24 3ba70: 79 1f adc r23, r25 3ba72: 8a 1f adc r24, r26 3ba74: 91 1d adc r25, r1 3ba76: a1 1d adc r26, r1 3ba78: 6a 0f add r22, r26 3ba7a: 71 1d adc r23, r1 3ba7c: 81 1d adc r24, r1 3ba7e: 91 1d adc r25, r1 3ba80: a1 1d adc r26, r1 3ba82: 20 d0 rcall .+64 ; 0x3bac4 <__ultoa_invert+0x84> 3ba84: 09 f4 brne .+2 ; 0x3ba88 <__ultoa_invert+0x48> 3ba86: 68 94 set 3ba88: 3f 91 pop r19 3ba8a: 2a e0 ldi r18, 0x0A ; 10 3ba8c: 26 9f mul r18, r22 3ba8e: 11 24 eor r1, r1 3ba90: 30 19 sub r19, r0 3ba92: 30 5d subi r19, 0xD0 ; 208 3ba94: 31 93 st Z+, r19 3ba96: de f6 brtc .-74 ; 0x3ba4e <__ultoa_invert+0xe> 3ba98: cf 01 movw r24, r30 3ba9a: 08 95 ret 3ba9c: 46 2f mov r20, r22 3ba9e: 47 70 andi r20, 0x07 ; 7 3baa0: 40 5d subi r20, 0xD0 ; 208 3baa2: 41 93 st Z+, r20 3baa4: b3 e0 ldi r27, 0x03 ; 3 3baa6: 0f d0 rcall .+30 ; 0x3bac6 <__ultoa_invert+0x86> 3baa8: c9 f7 brne .-14 ; 0x3ba9c <__ultoa_invert+0x5c> 3baaa: f6 cf rjmp .-20 ; 0x3ba98 <__ultoa_invert+0x58> 3baac: 46 2f mov r20, r22 3baae: 4f 70 andi r20, 0x0F ; 15 3bab0: 40 5d subi r20, 0xD0 ; 208 3bab2: 4a 33 cpi r20, 0x3A ; 58 3bab4: 18 f0 brcs .+6 ; 0x3babc <__ultoa_invert+0x7c> 3bab6: 49 5d subi r20, 0xD9 ; 217 3bab8: 31 fd sbrc r19, 1 3baba: 40 52 subi r20, 0x20 ; 32 3babc: 41 93 st Z+, r20 3babe: 02 d0 rcall .+4 ; 0x3bac4 <__ultoa_invert+0x84> 3bac0: a9 f7 brne .-22 ; 0x3baac <__ultoa_invert+0x6c> 3bac2: ea cf rjmp .-44 ; 0x3ba98 <__ultoa_invert+0x58> 3bac4: b4 e0 ldi r27, 0x04 ; 4 3bac6: a6 95 lsr r26 3bac8: 97 95 ror r25 3baca: 87 95 ror r24 3bacc: 77 95 ror r23 3bace: 67 95 ror r22 3bad0: ba 95 dec r27 3bad2: c9 f7 brne .-14 ; 0x3bac6 <__ultoa_invert+0x86> 3bad4: 00 97 sbiw r24, 0x00 ; 0 3bad6: 61 05 cpc r22, r1 3bad8: 71 05 cpc r23, r1 3bada: 08 95 ret 3badc: 9b 01 movw r18, r22 3bade: ac 01 movw r20, r24 3bae0: 0a 2e mov r0, r26 3bae2: 06 94 lsr r0 3bae4: 57 95 ror r21 3bae6: 47 95 ror r20 3bae8: 37 95 ror r19 3baea: 27 95 ror r18 3baec: ba 95 dec r27 3baee: c9 f7 brne .-14 ; 0x3bae2 <__ultoa_invert+0xa2> 3baf0: 62 0f add r22, r18 3baf2: 73 1f adc r23, r19 3baf4: 84 1f adc r24, r20 3baf6: 95 1f adc r25, r21 3baf8: a0 1d adc r26, r0 3bafa: 08 95 ret 0003bafc <__ctype_isfalse>: 3bafc: 99 27 eor r25, r25 3bafe: 88 27 eor r24, r24 0003bb00 <__ctype_istrue>: 3bb00: 08 95 ret 0003bb02 : 3bb02: dc 01 movw r26, r24 3bb04: cb 01 movw r24, r22 0003bb06 : 3bb06: fc 01 movw r30, r24 3bb08: f9 99 sbic 0x1f, 1 ; 31 3bb0a: fe cf rjmp .-4 ; 0x3bb08 3bb0c: 06 c0 rjmp .+12 ; 0x3bb1a 3bb0e: f2 bd out 0x22, r31 ; 34 3bb10: e1 bd out 0x21, r30 ; 33 3bb12: f8 9a sbi 0x1f, 0 ; 31 3bb14: 31 96 adiw r30, 0x01 ; 1 3bb16: 00 b4 in r0, 0x20 ; 32 3bb18: 0d 92 st X+, r0 3bb1a: 41 50 subi r20, 0x01 ; 1 3bb1c: 50 40 sbci r21, 0x00 ; 0 3bb1e: b8 f7 brcc .-18 ; 0x3bb0e 3bb20: 08 95 ret 0003bb22 : 3bb22: f9 99 sbic 0x1f, 1 ; 31 3bb24: fe cf rjmp .-4 ; 0x3bb22 3bb26: 92 bd out 0x22, r25 ; 34 3bb28: 81 bd out 0x21, r24 ; 33 3bb2a: f8 9a sbi 0x1f, 0 ; 31 3bb2c: 99 27 eor r25, r25 3bb2e: 80 b5 in r24, 0x20 ; 32 3bb30: 08 95 ret 0003bb32 : 3bb32: a6 e1 ldi r26, 0x16 ; 22 3bb34: b0 e0 ldi r27, 0x00 ; 0 3bb36: 44 e0 ldi r20, 0x04 ; 4 3bb38: 50 e0 ldi r21, 0x00 ; 0 3bb3a: 0d 94 83 dd jmp 0x3bb06 ; 0x3bb06 0003bb3e : 3bb3e: a8 e1 ldi r26, 0x18 ; 24 3bb40: b0 e0 ldi r27, 0x00 ; 0 3bb42: 42 e0 ldi r20, 0x02 ; 2 3bb44: 50 e0 ldi r21, 0x00 ; 0 3bb46: 0d 94 83 dd jmp 0x3bb06 ; 0x3bb06 0003bb4a : 3bb4a: dc 01 movw r26, r24 3bb4c: a4 0f add r26, r20 3bb4e: b5 1f adc r27, r21 3bb50: 41 50 subi r20, 0x01 ; 1 3bb52: 50 40 sbci r21, 0x00 ; 0 3bb54: 48 f0 brcs .+18 ; 0x3bb68 3bb56: cb 01 movw r24, r22 3bb58: 84 0f add r24, r20 3bb5a: 95 1f adc r25, r21 3bb5c: 2e 91 ld r18, -X 3bb5e: 0f 94 b6 dd call 0x3bb6c ; 0x3bb6c 3bb62: 41 50 subi r20, 0x01 ; 1 3bb64: 50 40 sbci r21, 0x00 ; 0 3bb66: d0 f7 brcc .-12 ; 0x3bb5c 3bb68: 08 95 ret 0003bb6a : 3bb6a: 26 2f mov r18, r22 0003bb6c : 3bb6c: f9 99 sbic 0x1f, 1 ; 31 3bb6e: fe cf rjmp .-4 ; 0x3bb6c 3bb70: 92 bd out 0x22, r25 ; 34 3bb72: 81 bd out 0x21, r24 ; 33 3bb74: f8 9a sbi 0x1f, 0 ; 31 3bb76: 01 97 sbiw r24, 0x01 ; 1 3bb78: 00 b4 in r0, 0x20 ; 32 3bb7a: 02 16 cp r0, r18 3bb7c: 39 f0 breq .+14 ; 0x3bb8c 3bb7e: 1f ba out 0x1f, r1 ; 31 3bb80: 20 bd out 0x20, r18 ; 32 3bb82: 0f b6 in r0, 0x3f ; 63 3bb84: f8 94 cli 3bb86: fa 9a sbi 0x1f, 2 ; 31 3bb88: f9 9a sbi 0x1f, 1 ; 31 3bb8a: 0f be out 0x3f, r0 ; 63 3bb8c: 08 95 ret 0003bb8e : 3bb8e: 03 96 adiw r24, 0x03 ; 3 3bb90: 27 2f mov r18, r23 3bb92: 0f 94 b6 dd call 0x3bb6c ; 0x3bb6c 3bb96: 0f 94 b5 dd call 0x3bb6a ; 0x3bb6a 3bb9a: 25 2f mov r18, r21 3bb9c: 0f 94 b6 dd call 0x3bb6c ; 0x3bb6c 3bba0: 24 2f mov r18, r20 3bba2: 0d 94 b6 dd jmp 0x3bb6c ; 0x3bb6c 0003bba6 : 3bba6: 01 96 adiw r24, 0x01 ; 1 3bba8: 27 2f mov r18, r23 3bbaa: 0f 94 b6 dd call 0x3bb6c ; 0x3bb6c 3bbae: 0d 94 b5 dd jmp 0x3bb6a ; 0x3bb6a 0003bbb2 : 3bbb2: 26 2f mov r18, r22 0003bbb4 : 3bbb4: f9 99 sbic 0x1f, 1 ; 31 3bbb6: fe cf rjmp .-4 ; 0x3bbb4 3bbb8: 1f ba out 0x1f, r1 ; 31 3bbba: 92 bd out 0x22, r25 ; 34 3bbbc: 81 bd out 0x21, r24 ; 33 3bbbe: 20 bd out 0x20, r18 ; 32 3bbc0: 0f b6 in r0, 0x3f ; 63 3bbc2: f8 94 cli 3bbc4: fa 9a sbi 0x1f, 2 ; 31 3bbc6: f9 9a sbi 0x1f, 1 ; 31 3bbc8: 0f be out 0x3f, r0 ; 63 3bbca: 01 96 adiw r24, 0x01 ; 1 3bbcc: 08 95 ret 0003bbce : 3bbce: 24 2f mov r18, r20 3bbd0: 0f 94 da dd call 0x3bbb4 ; 0x3bbb4 3bbd4: 25 2f mov r18, r21 3bbd6: 0f 94 da dd call 0x3bbb4 ; 0x3bbb4 3bbda: 0d 94 ef dd jmp 0x3bbde ; 0x3bbde 0003bbde : 3bbde: 0f 94 d9 dd call 0x3bbb2 ; 0x3bbb2 3bbe2: 27 2f mov r18, r23 3bbe4: 0d 94 da dd jmp 0x3bbb4 ; 0x3bbb4 0003bbe8 <__mulsi3>: 3bbe8: db 01 movw r26, r22 3bbea: 8f 93 push r24 3bbec: 9f 93 push r25 3bbee: 0f 94 26 de call 0x3bc4c ; 0x3bc4c <__muluhisi3> 3bbf2: bf 91 pop r27 3bbf4: af 91 pop r26 3bbf6: a2 9f mul r26, r18 3bbf8: 80 0d add r24, r0 3bbfa: 91 1d adc r25, r1 3bbfc: a3 9f mul r26, r19 3bbfe: 90 0d add r25, r0 3bc00: b2 9f mul r27, r18 3bc02: 90 0d add r25, r0 3bc04: 11 24 eor r1, r1 3bc06: 08 95 ret 0003bc08 <__udivmodsi4>: 3bc08: a1 e2 ldi r26, 0x21 ; 33 3bc0a: 1a 2e mov r1, r26 3bc0c: aa 1b sub r26, r26 3bc0e: bb 1b sub r27, r27 3bc10: fd 01 movw r30, r26 3bc12: 0d c0 rjmp .+26 ; 0x3bc2e <__udivmodsi4_ep> 0003bc14 <__udivmodsi4_loop>: 3bc14: aa 1f adc r26, r26 3bc16: bb 1f adc r27, r27 3bc18: ee 1f adc r30, r30 3bc1a: ff 1f adc r31, r31 3bc1c: a2 17 cp r26, r18 3bc1e: b3 07 cpc r27, r19 3bc20: e4 07 cpc r30, r20 3bc22: f5 07 cpc r31, r21 3bc24: 20 f0 brcs .+8 ; 0x3bc2e <__udivmodsi4_ep> 3bc26: a2 1b sub r26, r18 3bc28: b3 0b sbc r27, r19 3bc2a: e4 0b sbc r30, r20 3bc2c: f5 0b sbc r31, r21 0003bc2e <__udivmodsi4_ep>: 3bc2e: 66 1f adc r22, r22 3bc30: 77 1f adc r23, r23 3bc32: 88 1f adc r24, r24 3bc34: 99 1f adc r25, r25 3bc36: 1a 94 dec r1 3bc38: 69 f7 brne .-38 ; 0x3bc14 <__udivmodsi4_loop> 3bc3a: 60 95 com r22 3bc3c: 70 95 com r23 3bc3e: 80 95 com r24 3bc40: 90 95 com r25 3bc42: 9b 01 movw r18, r22 3bc44: ac 01 movw r20, r24 3bc46: bd 01 movw r22, r26 3bc48: cf 01 movw r24, r30 3bc4a: 08 95 ret 0003bc4c <__muluhisi3>: 3bc4c: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 3bc50: a5 9f mul r26, r21 3bc52: 90 0d add r25, r0 3bc54: b4 9f mul r27, r20 3bc56: 90 0d add r25, r0 3bc58: a4 9f mul r26, r20 3bc5a: 80 0d add r24, r0 3bc5c: 91 1d adc r25, r1 3bc5e: 11 24 eor r1, r1 3bc60: 08 95 ret 0003bc62 <__umulhisi3>: 3bc62: a2 9f mul r26, r18 3bc64: b0 01 movw r22, r0 3bc66: b3 9f mul r27, r19 3bc68: c0 01 movw r24, r0 3bc6a: a3 9f mul r26, r19 3bc6c: 70 0d add r23, r0 3bc6e: 81 1d adc r24, r1 3bc70: 11 24 eor r1, r1 3bc72: 91 1d adc r25, r1 3bc74: b2 9f mul r27, r18 3bc76: 70 0d add r23, r0 3bc78: 81 1d adc r24, r1 3bc7a: 11 24 eor r1, r1 3bc7c: 91 1d adc r25, r1 3bc7e: 08 95 ret 0003bc80 <__udivmodqi4>: 3bc80: 99 1b sub r25, r25 3bc82: 79 e0 ldi r23, 0x09 ; 9 3bc84: 04 c0 rjmp .+8 ; 0x3bc8e <__udivmodqi4_ep> 0003bc86 <__udivmodqi4_loop>: 3bc86: 99 1f adc r25, r25 3bc88: 96 17 cp r25, r22 3bc8a: 08 f0 brcs .+2 ; 0x3bc8e <__udivmodqi4_ep> 3bc8c: 96 1b sub r25, r22 0003bc8e <__udivmodqi4_ep>: 3bc8e: 88 1f adc r24, r24 3bc90: 7a 95 dec r23 3bc92: c9 f7 brne .-14 ; 0x3bc86 <__udivmodqi4_loop> 3bc94: 80 95 com r24 3bc96: 08 95 ret 0003bc98 <__divmodqi4>: 3bc98: 87 fb bst r24, 7 3bc9a: 08 2e mov r0, r24 3bc9c: 06 26 eor r0, r22 3bc9e: 87 fd sbrc r24, 7 3bca0: 81 95 neg r24 3bca2: 67 fd sbrc r22, 7 3bca4: 61 95 neg r22 3bca6: 0f 94 40 de call 0x3bc80 ; 0x3bc80 <__udivmodqi4> 3bcaa: 0e f4 brtc .+2 ; 0x3bcae <__divmodqi4_1> 3bcac: 91 95 neg r25 0003bcae <__divmodqi4_1>: 3bcae: 07 fc sbrc r0, 7 3bcb0: 81 95 neg r24 0003bcb2 <__divmodqi4_exit>: 3bcb2: 08 95 ret 0003bcb4 <__udivmodhi4>: 3bcb4: aa 1b sub r26, r26 3bcb6: bb 1b sub r27, r27 3bcb8: 51 e1 ldi r21, 0x11 ; 17 3bcba: 07 c0 rjmp .+14 ; 0x3bcca <__udivmodhi4_ep> 0003bcbc <__udivmodhi4_loop>: 3bcbc: aa 1f adc r26, r26 3bcbe: bb 1f adc r27, r27 3bcc0: a6 17 cp r26, r22 3bcc2: b7 07 cpc r27, r23 3bcc4: 10 f0 brcs .+4 ; 0x3bcca <__udivmodhi4_ep> 3bcc6: a6 1b sub r26, r22 3bcc8: b7 0b sbc r27, r23 0003bcca <__udivmodhi4_ep>: 3bcca: 88 1f adc r24, r24 3bccc: 99 1f adc r25, r25 3bcce: 5a 95 dec r21 3bcd0: a9 f7 brne .-22 ; 0x3bcbc <__udivmodhi4_loop> 3bcd2: 80 95 com r24 3bcd4: 90 95 com r25 3bcd6: bc 01 movw r22, r24 3bcd8: cd 01 movw r24, r26 3bcda: 08 95 ret 0003bcdc <__divmodhi4>: 3bcdc: 97 fb bst r25, 7 3bcde: 07 2e mov r0, r23 3bce0: 16 f4 brtc .+4 ; 0x3bce6 <__divmodhi4+0xa> 3bce2: 00 94 com r0 3bce4: 07 d0 rcall .+14 ; 0x3bcf4 <__divmodhi4_neg1> 3bce6: 77 fd sbrc r23, 7 3bce8: 09 d0 rcall .+18 ; 0x3bcfc <__divmodhi4_neg2> 3bcea: 0f 94 5a de call 0x3bcb4 ; 0x3bcb4 <__udivmodhi4> 3bcee: 07 fc sbrc r0, 7 3bcf0: 05 d0 rcall .+10 ; 0x3bcfc <__divmodhi4_neg2> 3bcf2: 3e f4 brtc .+14 ; 0x3bd02 <__divmodhi4_exit> 0003bcf4 <__divmodhi4_neg1>: 3bcf4: 90 95 com r25 3bcf6: 81 95 neg r24 3bcf8: 9f 4f sbci r25, 0xFF ; 255 3bcfa: 08 95 ret 0003bcfc <__divmodhi4_neg2>: 3bcfc: 70 95 com r23 3bcfe: 61 95 neg r22 3bd00: 7f 4f sbci r23, 0xFF ; 255 0003bd02 <__divmodhi4_exit>: 3bd02: 08 95 ret 0003bd04 <__divmodsi4>: 3bd04: 05 2e mov r0, r21 3bd06: 97 fb bst r25, 7 3bd08: 1e f4 brtc .+6 ; 0x3bd10 <__divmodsi4+0xc> 3bd0a: 00 94 com r0 3bd0c: 0f 94 99 de call 0x3bd32 ; 0x3bd32 <__negsi2> 3bd10: 57 fd sbrc r21, 7 3bd12: 07 d0 rcall .+14 ; 0x3bd22 <__divmodsi4_neg2> 3bd14: 0f 94 04 de call 0x3bc08 ; 0x3bc08 <__udivmodsi4> 3bd18: 07 fc sbrc r0, 7 3bd1a: 03 d0 rcall .+6 ; 0x3bd22 <__divmodsi4_neg2> 3bd1c: 4e f4 brtc .+18 ; 0x3bd30 <__divmodsi4_exit> 3bd1e: 0d 94 99 de jmp 0x3bd32 ; 0x3bd32 <__negsi2> 0003bd22 <__divmodsi4_neg2>: 3bd22: 50 95 com r21 3bd24: 40 95 com r20 3bd26: 30 95 com r19 3bd28: 21 95 neg r18 3bd2a: 3f 4f sbci r19, 0xFF ; 255 3bd2c: 4f 4f sbci r20, 0xFF ; 255 3bd2e: 5f 4f sbci r21, 0xFF ; 255 0003bd30 <__divmodsi4_exit>: 3bd30: 08 95 ret 0003bd32 <__negsi2>: 3bd32: 90 95 com r25 3bd34: 80 95 com r24 3bd36: 70 95 com r23 3bd38: 61 95 neg r22 3bd3a: 7f 4f sbci r23, 0xFF ; 255 3bd3c: 8f 4f sbci r24, 0xFF ; 255 3bd3e: 9f 4f sbci r25, 0xFF ; 255 3bd40: 08 95 ret 0003bd42 <__tablejump2__>: 3bd42: ee 0f add r30, r30 3bd44: ff 1f adc r31, r31 3bd46: 88 1f adc r24, r24 3bd48: 8b bf out 0x3b, r24 ; 59 3bd4a: 07 90 elpm r0, Z+ 3bd4c: f6 91 elpm r31, Z 3bd4e: e0 2d mov r30, r0 3bd50: 19 94 eijmp 0003bd52 <__mulhisi3>: 3bd52: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 3bd56: 33 23 and r19, r19 3bd58: 12 f4 brpl .+4 ; 0x3bd5e <__mulhisi3+0xc> 3bd5a: 8a 1b sub r24, r26 3bd5c: 9b 0b sbc r25, r27 3bd5e: 0d 94 b3 de jmp 0x3bd66 ; 0x3bd66 <__usmulhisi3_tail> 0003bd62 <__usmulhisi3>: 3bd62: 0f 94 31 de call 0x3bc62 ; 0x3bc62 <__umulhisi3> 0003bd66 <__usmulhisi3_tail>: 3bd66: b7 ff sbrs r27, 7 3bd68: 08 95 ret 3bd6a: 82 1b sub r24, r18 3bd6c: 93 0b sbc r25, r19 3bd6e: 08 95 ret 0003bd70 <__subsf3>: 3bd70: 50 58 subi r21, 0x80 ; 128 0003bd72 <__addsf3>: 3bd72: bb 27 eor r27, r27 3bd74: aa 27 eor r26, r26 3bd76: 0f 94 d0 de call 0x3bda0 ; 0x3bda0 <__addsf3x> 3bd7a: 0d 94 e2 d8 jmp 0x3b1c4 ; 0x3b1c4 <__fp_round> 3bd7e: 0f 94 d4 d8 call 0x3b1a8 ; 0x3b1a8 <__fp_pscA> 3bd82: 38 f0 brcs .+14 ; 0x3bd92 <__addsf3+0x20> 3bd84: 0f 94 db d8 call 0x3b1b6 ; 0x3b1b6 <__fp_pscB> 3bd88: 20 f0 brcs .+8 ; 0x3bd92 <__addsf3+0x20> 3bd8a: 39 f4 brne .+14 ; 0x3bd9a <__addsf3+0x28> 3bd8c: 9f 3f cpi r25, 0xFF ; 255 3bd8e: 19 f4 brne .+6 ; 0x3bd96 <__addsf3+0x24> 3bd90: 26 f4 brtc .+8 ; 0x3bd9a <__addsf3+0x28> 3bd92: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 3bd96: 0e f4 brtc .+2 ; 0x3bd9a <__addsf3+0x28> 3bd98: e0 95 com r30 3bd9a: e7 fb bst r30, 7 3bd9c: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 0003bda0 <__addsf3x>: 3bda0: e9 2f mov r30, r25 3bda2: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_split3> 3bda6: 58 f3 brcs .-42 ; 0x3bd7e <__addsf3+0xc> 3bda8: ba 17 cp r27, r26 3bdaa: 62 07 cpc r22, r18 3bdac: 73 07 cpc r23, r19 3bdae: 84 07 cpc r24, r20 3bdb0: 95 07 cpc r25, r21 3bdb2: 20 f0 brcs .+8 ; 0x3bdbc <__addsf3x+0x1c> 3bdb4: 79 f4 brne .+30 ; 0x3bdd4 <__addsf3x+0x34> 3bdb6: a6 f5 brtc .+104 ; 0x3be20 <__addsf3x+0x80> 3bdb8: 0d 94 15 d9 jmp 0x3b22a ; 0x3b22a <__fp_zero> 3bdbc: 0e f4 brtc .+2 ; 0x3bdc0 <__addsf3x+0x20> 3bdbe: e0 95 com r30 3bdc0: 0b 2e mov r0, r27 3bdc2: ba 2f mov r27, r26 3bdc4: a0 2d mov r26, r0 3bdc6: 0b 01 movw r0, r22 3bdc8: b9 01 movw r22, r18 3bdca: 90 01 movw r18, r0 3bdcc: 0c 01 movw r0, r24 3bdce: ca 01 movw r24, r20 3bdd0: a0 01 movw r20, r0 3bdd2: 11 24 eor r1, r1 3bdd4: ff 27 eor r31, r31 3bdd6: 59 1b sub r21, r25 3bdd8: 99 f0 breq .+38 ; 0x3be00 <__addsf3x+0x60> 3bdda: 59 3f cpi r21, 0xF9 ; 249 3bddc: 50 f4 brcc .+20 ; 0x3bdf2 <__addsf3x+0x52> 3bdde: 50 3e cpi r21, 0xE0 ; 224 3bde0: 68 f1 brcs .+90 ; 0x3be3c <__addsf3x+0x9c> 3bde2: 1a 16 cp r1, r26 3bde4: f0 40 sbci r31, 0x00 ; 0 3bde6: a2 2f mov r26, r18 3bde8: 23 2f mov r18, r19 3bdea: 34 2f mov r19, r20 3bdec: 44 27 eor r20, r20 3bdee: 58 5f subi r21, 0xF8 ; 248 3bdf0: f3 cf rjmp .-26 ; 0x3bdd8 <__addsf3x+0x38> 3bdf2: 46 95 lsr r20 3bdf4: 37 95 ror r19 3bdf6: 27 95 ror r18 3bdf8: a7 95 ror r26 3bdfa: f0 40 sbci r31, 0x00 ; 0 3bdfc: 53 95 inc r21 3bdfe: c9 f7 brne .-14 ; 0x3bdf2 <__addsf3x+0x52> 3be00: 7e f4 brtc .+30 ; 0x3be20 <__addsf3x+0x80> 3be02: 1f 16 cp r1, r31 3be04: ba 0b sbc r27, r26 3be06: 62 0b sbc r22, r18 3be08: 73 0b sbc r23, r19 3be0a: 84 0b sbc r24, r20 3be0c: ba f0 brmi .+46 ; 0x3be3c <__addsf3x+0x9c> 3be0e: 91 50 subi r25, 0x01 ; 1 3be10: a1 f0 breq .+40 ; 0x3be3a <__addsf3x+0x9a> 3be12: ff 0f add r31, r31 3be14: bb 1f adc r27, r27 3be16: 66 1f adc r22, r22 3be18: 77 1f adc r23, r23 3be1a: 88 1f adc r24, r24 3be1c: c2 f7 brpl .-16 ; 0x3be0e <__addsf3x+0x6e> 3be1e: 0e c0 rjmp .+28 ; 0x3be3c <__addsf3x+0x9c> 3be20: ba 0f add r27, r26 3be22: 62 1f adc r22, r18 3be24: 73 1f adc r23, r19 3be26: 84 1f adc r24, r20 3be28: 48 f4 brcc .+18 ; 0x3be3c <__addsf3x+0x9c> 3be2a: 87 95 ror r24 3be2c: 77 95 ror r23 3be2e: 67 95 ror r22 3be30: b7 95 ror r27 3be32: f7 95 ror r31 3be34: 9e 3f cpi r25, 0xFE ; 254 3be36: 08 f0 brcs .+2 ; 0x3be3a <__addsf3x+0x9a> 3be38: b0 cf rjmp .-160 ; 0x3bd9a <__addsf3+0x28> 3be3a: 93 95 inc r25 3be3c: 88 0f add r24, r24 3be3e: 08 f0 brcs .+2 ; 0x3be42 <__addsf3x+0xa2> 3be40: 99 27 eor r25, r25 3be42: ee 0f add r30, r30 3be44: 97 95 ror r25 3be46: 87 95 ror r24 3be48: 08 95 ret 3be4a: 0f 94 d4 d8 call 0x3b1a8 ; 0x3b1a8 <__fp_pscA> 3be4e: 60 f0 brcs .+24 ; 0x3be68 <__addsf3x+0xc8> 3be50: 80 e8 ldi r24, 0x80 ; 128 3be52: 91 e0 ldi r25, 0x01 ; 1 3be54: 09 f4 brne .+2 ; 0x3be58 <__addsf3x+0xb8> 3be56: 9e ef ldi r25, 0xFE ; 254 3be58: 0f 94 db d8 call 0x3b1b6 ; 0x3b1b6 <__fp_pscB> 3be5c: 28 f0 brcs .+10 ; 0x3be68 <__addsf3x+0xc8> 3be5e: 40 e8 ldi r20, 0x80 ; 128 3be60: 51 e0 ldi r21, 0x01 ; 1 3be62: 71 f4 brne .+28 ; 0x3be80 3be64: 5e ef ldi r21, 0xFE ; 254 3be66: 0c c0 rjmp .+24 ; 0x3be80 3be68: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 3be6c: 0d 94 15 d9 jmp 0x3b22a ; 0x3b22a <__fp_zero> 0003be70 : 3be70: e9 2f mov r30, r25 3be72: e0 78 andi r30, 0x80 ; 128 3be74: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_split3> 3be78: 40 f3 brcs .-48 ; 0x3be4a <__addsf3x+0xaa> 3be7a: 09 2e mov r0, r25 3be7c: 05 2a or r0, r21 3be7e: b1 f3 breq .-20 ; 0x3be6c <__addsf3x+0xcc> 3be80: 26 17 cp r18, r22 3be82: 37 07 cpc r19, r23 3be84: 48 07 cpc r20, r24 3be86: 59 07 cpc r21, r25 3be88: 38 f0 brcs .+14 ; 0x3be98 3be8a: 0e 2e mov r0, r30 3be8c: 07 f8 bld r0, 7 3be8e: e0 25 eor r30, r0 3be90: 69 f0 breq .+26 ; 0x3beac 3be92: e0 25 eor r30, r0 3be94: e0 64 ori r30, 0x40 ; 64 3be96: 0a c0 rjmp .+20 ; 0x3beac 3be98: ef 63 ori r30, 0x3F ; 63 3be9a: 07 f8 bld r0, 7 3be9c: 00 94 com r0 3be9e: 07 fa bst r0, 7 3bea0: db 01 movw r26, r22 3bea2: b9 01 movw r22, r18 3bea4: 9d 01 movw r18, r26 3bea6: dc 01 movw r26, r24 3bea8: ca 01 movw r24, r20 3beaa: ad 01 movw r20, r26 3beac: ef 93 push r30 3beae: 0f 94 cf df call 0x3bf9e ; 0x3bf9e <__divsf3_pse> 3beb2: 0f 94 e2 d8 call 0x3b1c4 ; 0x3b1c4 <__fp_round> 3beb6: 0f 94 68 df call 0x3bed0 ; 0x3bed0 3beba: 5f 91 pop r21 3bebc: 55 23 and r21, r21 3bebe: 39 f0 breq .+14 ; 0x3bece 3bec0: 2b ed ldi r18, 0xDB ; 219 3bec2: 3f e0 ldi r19, 0x0F ; 15 3bec4: 49 e4 ldi r20, 0x49 ; 73 3bec6: 50 fd sbrc r21, 0 3bec8: 49 ec ldi r20, 0xC9 ; 201 3beca: 0d 94 b9 de jmp 0x3bd72 ; 0x3bd72 <__addsf3> 3bece: 08 95 ret 0003bed0 : 3bed0: df 93 push r29 3bed2: dd 27 eor r29, r29 3bed4: b9 2f mov r27, r25 3bed6: bf 77 andi r27, 0x7F ; 127 3bed8: 40 e8 ldi r20, 0x80 ; 128 3beda: 5f e3 ldi r21, 0x3F ; 63 3bedc: 16 16 cp r1, r22 3bede: 17 06 cpc r1, r23 3bee0: 48 07 cpc r20, r24 3bee2: 5b 07 cpc r21, r27 3bee4: 18 f4 brcc .+6 ; 0x3beec 3bee6: d9 2f mov r29, r25 3bee8: 0f 94 b4 e1 call 0x3c368 ; 0x3c368 3beec: 9f 93 push r25 3beee: 8f 93 push r24 3bef0: 7f 93 push r23 3bef2: 6f 93 push r22 3bef4: 0f 94 5a d8 call 0x3b0b4 ; 0x3b0b4 3bef8: e2 ee ldi r30, 0xE2 ; 226 3befa: f1 e7 ldi r31, 0x71 ; 113 3befc: 0f 94 c4 e0 call 0x3c188 ; 0x3c188 <__fp_powser> 3bf00: 0f 94 e2 d8 call 0x3b1c4 ; 0x3b1c4 <__fp_round> 3bf04: 2f 91 pop r18 3bf06: 3f 91 pop r19 3bf08: 4f 91 pop r20 3bf0a: 5f 91 pop r21 3bf0c: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__mulsf3x> 3bf10: dd 23 and r29, r29 3bf12: 51 f0 breq .+20 ; 0x3bf28 3bf14: 90 58 subi r25, 0x80 ; 128 3bf16: a2 ea ldi r26, 0xA2 ; 162 3bf18: 2a ed ldi r18, 0xDA ; 218 3bf1a: 3f e0 ldi r19, 0x0F ; 15 3bf1c: 49 ec ldi r20, 0xC9 ; 201 3bf1e: 5f e3 ldi r21, 0x3F ; 63 3bf20: d0 78 andi r29, 0x80 ; 128 3bf22: 5d 27 eor r21, r29 3bf24: 0f 94 d0 de call 0x3bda0 ; 0x3bda0 <__addsf3x> 3bf28: df 91 pop r29 3bf2a: 0d 94 e2 d8 jmp 0x3b1c4 ; 0x3b1c4 <__fp_round> 0003bf2e : 3bf2e: 0f 94 2a e1 call 0x3c254 ; 0x3c254 <__fp_trunc> 3bf32: 90 f0 brcs .+36 ; 0x3bf58 3bf34: 9f 37 cpi r25, 0x7F ; 127 3bf36: 48 f4 brcc .+18 ; 0x3bf4a 3bf38: 91 11 cpse r25, r1 3bf3a: 16 f4 brtc .+4 ; 0x3bf40 3bf3c: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 3bf40: 60 e0 ldi r22, 0x00 ; 0 3bf42: 70 e0 ldi r23, 0x00 ; 0 3bf44: 80 e8 ldi r24, 0x80 ; 128 3bf46: 9f e3 ldi r25, 0x3F ; 63 3bf48: 08 95 ret 3bf4a: 26 f0 brts .+8 ; 0x3bf54 3bf4c: 1b 16 cp r1, r27 3bf4e: 61 1d adc r22, r1 3bf50: 71 1d adc r23, r1 3bf52: 81 1d adc r24, r1 3bf54: 0d 94 9b e0 jmp 0x3c136 ; 0x3c136 <__fp_mintl> 3bf58: 0d 94 b6 e0 jmp 0x3c16c ; 0x3c16c <__fp_mpack> 0003bf5c <__cmpsf2>: 3bf5c: 0f 94 77 e0 call 0x3c0ee ; 0x3c0ee <__fp_cmp> 3bf60: 08 f4 brcc .+2 ; 0x3bf64 <__cmpsf2+0x8> 3bf62: 81 e0 ldi r24, 0x01 ; 1 3bf64: 08 95 ret 0003bf66 : 3bf66: 0f 94 ed e0 call 0x3c1da ; 0x3c1da <__fp_rempio2> 3bf6a: e3 95 inc r30 3bf6c: 0d 94 16 e1 jmp 0x3c22c ; 0x3c22c <__fp_sinus> 0003bf70 <__divsf3>: 3bf70: 0f 94 cc df call 0x3bf98 ; 0x3bf98 <__divsf3x> 3bf74: 0d 94 e2 d8 jmp 0x3b1c4 ; 0x3b1c4 <__fp_round> 3bf78: 0f 94 db d8 call 0x3b1b6 ; 0x3b1b6 <__fp_pscB> 3bf7c: 58 f0 brcs .+22 ; 0x3bf94 <__divsf3+0x24> 3bf7e: 0f 94 d4 d8 call 0x3b1a8 ; 0x3b1a8 <__fp_pscA> 3bf82: 40 f0 brcs .+16 ; 0x3bf94 <__divsf3+0x24> 3bf84: 29 f4 brne .+10 ; 0x3bf90 <__divsf3+0x20> 3bf86: 5f 3f cpi r21, 0xFF ; 255 3bf88: 29 f0 breq .+10 ; 0x3bf94 <__divsf3+0x24> 3bf8a: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 3bf8e: 51 11 cpse r21, r1 3bf90: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 3bf94: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 0003bf98 <__divsf3x>: 3bf98: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_split3> 3bf9c: 68 f3 brcs .-38 ; 0x3bf78 <__divsf3+0x8> 0003bf9e <__divsf3_pse>: 3bf9e: 99 23 and r25, r25 3bfa0: b1 f3 breq .-20 ; 0x3bf8e <__divsf3+0x1e> 3bfa2: 55 23 and r21, r21 3bfa4: 91 f3 breq .-28 ; 0x3bf8a <__divsf3+0x1a> 3bfa6: 95 1b sub r25, r21 3bfa8: 55 0b sbc r21, r21 3bfaa: bb 27 eor r27, r27 3bfac: aa 27 eor r26, r26 3bfae: 62 17 cp r22, r18 3bfb0: 73 07 cpc r23, r19 3bfb2: 84 07 cpc r24, r20 3bfb4: 38 f0 brcs .+14 ; 0x3bfc4 <__divsf3_pse+0x26> 3bfb6: 9f 5f subi r25, 0xFF ; 255 3bfb8: 5f 4f sbci r21, 0xFF ; 255 3bfba: 22 0f add r18, r18 3bfbc: 33 1f adc r19, r19 3bfbe: 44 1f adc r20, r20 3bfc0: aa 1f adc r26, r26 3bfc2: a9 f3 breq .-22 ; 0x3bfae <__divsf3_pse+0x10> 3bfc4: 35 d0 rcall .+106 ; 0x3c030 <__divsf3_pse+0x92> 3bfc6: 0e 2e mov r0, r30 3bfc8: 3a f0 brmi .+14 ; 0x3bfd8 <__divsf3_pse+0x3a> 3bfca: e0 e8 ldi r30, 0x80 ; 128 3bfcc: 32 d0 rcall .+100 ; 0x3c032 <__divsf3_pse+0x94> 3bfce: 91 50 subi r25, 0x01 ; 1 3bfd0: 50 40 sbci r21, 0x00 ; 0 3bfd2: e6 95 lsr r30 3bfd4: 00 1c adc r0, r0 3bfd6: ca f7 brpl .-14 ; 0x3bfca <__divsf3_pse+0x2c> 3bfd8: 2b d0 rcall .+86 ; 0x3c030 <__divsf3_pse+0x92> 3bfda: fe 2f mov r31, r30 3bfdc: 29 d0 rcall .+82 ; 0x3c030 <__divsf3_pse+0x92> 3bfde: 66 0f add r22, r22 3bfe0: 77 1f adc r23, r23 3bfe2: 88 1f adc r24, r24 3bfe4: bb 1f adc r27, r27 3bfe6: 26 17 cp r18, r22 3bfe8: 37 07 cpc r19, r23 3bfea: 48 07 cpc r20, r24 3bfec: ab 07 cpc r26, r27 3bfee: b0 e8 ldi r27, 0x80 ; 128 3bff0: 09 f0 breq .+2 ; 0x3bff4 <__divsf3_pse+0x56> 3bff2: bb 0b sbc r27, r27 3bff4: 80 2d mov r24, r0 3bff6: bf 01 movw r22, r30 3bff8: ff 27 eor r31, r31 3bffa: 93 58 subi r25, 0x83 ; 131 3bffc: 5f 4f sbci r21, 0xFF ; 255 3bffe: 3a f0 brmi .+14 ; 0x3c00e <__divsf3_pse+0x70> 3c000: 9e 3f cpi r25, 0xFE ; 254 3c002: 51 05 cpc r21, r1 3c004: 78 f0 brcs .+30 ; 0x3c024 <__divsf3_pse+0x86> 3c006: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 3c00a: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 3c00e: 5f 3f cpi r21, 0xFF ; 255 3c010: e4 f3 brlt .-8 ; 0x3c00a <__divsf3_pse+0x6c> 3c012: 98 3e cpi r25, 0xE8 ; 232 3c014: d4 f3 brlt .-12 ; 0x3c00a <__divsf3_pse+0x6c> 3c016: 86 95 lsr r24 3c018: 77 95 ror r23 3c01a: 67 95 ror r22 3c01c: b7 95 ror r27 3c01e: f7 95 ror r31 3c020: 9f 5f subi r25, 0xFF ; 255 3c022: c9 f7 brne .-14 ; 0x3c016 <__divsf3_pse+0x78> 3c024: 88 0f add r24, r24 3c026: 91 1d adc r25, r1 3c028: 96 95 lsr r25 3c02a: 87 95 ror r24 3c02c: 97 f9 bld r25, 7 3c02e: 08 95 ret 3c030: e1 e0 ldi r30, 0x01 ; 1 3c032: 66 0f add r22, r22 3c034: 77 1f adc r23, r23 3c036: 88 1f adc r24, r24 3c038: bb 1f adc r27, r27 3c03a: 62 17 cp r22, r18 3c03c: 73 07 cpc r23, r19 3c03e: 84 07 cpc r24, r20 3c040: ba 07 cpc r27, r26 3c042: 20 f0 brcs .+8 ; 0x3c04c <__divsf3_pse+0xae> 3c044: 62 1b sub r22, r18 3c046: 73 0b sbc r23, r19 3c048: 84 0b sbc r24, r20 3c04a: ba 0b sbc r27, r26 3c04c: ee 1f adc r30, r30 3c04e: 88 f7 brcc .-30 ; 0x3c032 <__divsf3_pse+0x94> 3c050: e0 95 com r30 3c052: 08 95 ret 0003c054 <__fixsfsi>: 3c054: 0f 94 31 e0 call 0x3c062 ; 0x3c062 <__fixunssfsi> 3c058: 68 94 set 3c05a: b1 11 cpse r27, r1 3c05c: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 3c060: 08 95 ret 0003c062 <__fixunssfsi>: 3c062: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c066: 88 f0 brcs .+34 ; 0x3c08a <__fixunssfsi+0x28> 3c068: 9f 57 subi r25, 0x7F ; 127 3c06a: 98 f0 brcs .+38 ; 0x3c092 <__fixunssfsi+0x30> 3c06c: b9 2f mov r27, r25 3c06e: 99 27 eor r25, r25 3c070: b7 51 subi r27, 0x17 ; 23 3c072: b0 f0 brcs .+44 ; 0x3c0a0 <__fixunssfsi+0x3e> 3c074: e1 f0 breq .+56 ; 0x3c0ae <__fixunssfsi+0x4c> 3c076: 66 0f add r22, r22 3c078: 77 1f adc r23, r23 3c07a: 88 1f adc r24, r24 3c07c: 99 1f adc r25, r25 3c07e: 1a f0 brmi .+6 ; 0x3c086 <__fixunssfsi+0x24> 3c080: ba 95 dec r27 3c082: c9 f7 brne .-14 ; 0x3c076 <__fixunssfsi+0x14> 3c084: 14 c0 rjmp .+40 ; 0x3c0ae <__fixunssfsi+0x4c> 3c086: b1 30 cpi r27, 0x01 ; 1 3c088: 91 f0 breq .+36 ; 0x3c0ae <__fixunssfsi+0x4c> 3c08a: 0f 94 15 d9 call 0x3b22a ; 0x3b22a <__fp_zero> 3c08e: b1 e0 ldi r27, 0x01 ; 1 3c090: 08 95 ret 3c092: 0d 94 15 d9 jmp 0x3b22a ; 0x3b22a <__fp_zero> 3c096: 67 2f mov r22, r23 3c098: 78 2f mov r23, r24 3c09a: 88 27 eor r24, r24 3c09c: b8 5f subi r27, 0xF8 ; 248 3c09e: 39 f0 breq .+14 ; 0x3c0ae <__fixunssfsi+0x4c> 3c0a0: b9 3f cpi r27, 0xF9 ; 249 3c0a2: cc f3 brlt .-14 ; 0x3c096 <__fixunssfsi+0x34> 3c0a4: 86 95 lsr r24 3c0a6: 77 95 ror r23 3c0a8: 67 95 ror r22 3c0aa: b3 95 inc r27 3c0ac: d9 f7 brne .-10 ; 0x3c0a4 <__fixunssfsi+0x42> 3c0ae: 3e f4 brtc .+14 ; 0x3c0be <__fixunssfsi+0x5c> 3c0b0: 90 95 com r25 3c0b2: 80 95 com r24 3c0b4: 70 95 com r23 3c0b6: 61 95 neg r22 3c0b8: 7f 4f sbci r23, 0xFF ; 255 3c0ba: 8f 4f sbci r24, 0xFF ; 255 3c0bc: 9f 4f sbci r25, 0xFF ; 255 3c0be: 08 95 ret 0003c0c0 : 3c0c0: 0f 94 2a e1 call 0x3c254 ; 0x3c254 <__fp_trunc> 3c0c4: 90 f0 brcs .+36 ; 0x3c0ea 3c0c6: 9f 37 cpi r25, 0x7F ; 127 3c0c8: 48 f4 brcc .+18 ; 0x3c0dc 3c0ca: 91 11 cpse r25, r1 3c0cc: 16 f0 brts .+4 ; 0x3c0d2 3c0ce: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 3c0d2: 60 e0 ldi r22, 0x00 ; 0 3c0d4: 70 e0 ldi r23, 0x00 ; 0 3c0d6: 80 e8 ldi r24, 0x80 ; 128 3c0d8: 9f eb ldi r25, 0xBF ; 191 3c0da: 08 95 ret 3c0dc: 26 f4 brtc .+8 ; 0x3c0e6 3c0de: 1b 16 cp r1, r27 3c0e0: 61 1d adc r22, r1 3c0e2: 71 1d adc r23, r1 3c0e4: 81 1d adc r24, r1 3c0e6: 0d 94 9b e0 jmp 0x3c136 ; 0x3c136 <__fp_mintl> 3c0ea: 0d 94 b6 e0 jmp 0x3c16c ; 0x3c16c <__fp_mpack> 0003c0ee <__fp_cmp>: 3c0ee: 99 0f add r25, r25 3c0f0: 00 08 sbc r0, r0 3c0f2: 55 0f add r21, r21 3c0f4: aa 0b sbc r26, r26 3c0f6: e0 e8 ldi r30, 0x80 ; 128 3c0f8: fe ef ldi r31, 0xFE ; 254 3c0fa: 16 16 cp r1, r22 3c0fc: 17 06 cpc r1, r23 3c0fe: e8 07 cpc r30, r24 3c100: f9 07 cpc r31, r25 3c102: c0 f0 brcs .+48 ; 0x3c134 <__fp_cmp+0x46> 3c104: 12 16 cp r1, r18 3c106: 13 06 cpc r1, r19 3c108: e4 07 cpc r30, r20 3c10a: f5 07 cpc r31, r21 3c10c: 98 f0 brcs .+38 ; 0x3c134 <__fp_cmp+0x46> 3c10e: 62 1b sub r22, r18 3c110: 73 0b sbc r23, r19 3c112: 84 0b sbc r24, r20 3c114: 95 0b sbc r25, r21 3c116: 39 f4 brne .+14 ; 0x3c126 <__fp_cmp+0x38> 3c118: 0a 26 eor r0, r26 3c11a: 61 f0 breq .+24 ; 0x3c134 <__fp_cmp+0x46> 3c11c: 23 2b or r18, r19 3c11e: 24 2b or r18, r20 3c120: 25 2b or r18, r21 3c122: 21 f4 brne .+8 ; 0x3c12c <__fp_cmp+0x3e> 3c124: 08 95 ret 3c126: 0a 26 eor r0, r26 3c128: 09 f4 brne .+2 ; 0x3c12c <__fp_cmp+0x3e> 3c12a: a1 40 sbci r26, 0x01 ; 1 3c12c: a6 95 lsr r26 3c12e: 8f ef ldi r24, 0xFF ; 255 3c130: 81 1d adc r24, r1 3c132: 81 1d adc r24, r1 3c134: 08 95 ret 0003c136 <__fp_mintl>: 3c136: 88 23 and r24, r24 3c138: 71 f4 brne .+28 ; 0x3c156 <__fp_mintl+0x20> 3c13a: 77 23 and r23, r23 3c13c: 21 f0 breq .+8 ; 0x3c146 <__fp_mintl+0x10> 3c13e: 98 50 subi r25, 0x08 ; 8 3c140: 87 2b or r24, r23 3c142: 76 2f mov r23, r22 3c144: 07 c0 rjmp .+14 ; 0x3c154 <__fp_mintl+0x1e> 3c146: 66 23 and r22, r22 3c148: 11 f4 brne .+4 ; 0x3c14e <__fp_mintl+0x18> 3c14a: 99 27 eor r25, r25 3c14c: 0d c0 rjmp .+26 ; 0x3c168 <__fp_mintl+0x32> 3c14e: 90 51 subi r25, 0x10 ; 16 3c150: 86 2b or r24, r22 3c152: 70 e0 ldi r23, 0x00 ; 0 3c154: 60 e0 ldi r22, 0x00 ; 0 3c156: 2a f0 brmi .+10 ; 0x3c162 <__fp_mintl+0x2c> 3c158: 9a 95 dec r25 3c15a: 66 0f add r22, r22 3c15c: 77 1f adc r23, r23 3c15e: 88 1f adc r24, r24 3c160: da f7 brpl .-10 ; 0x3c158 <__fp_mintl+0x22> 3c162: 88 0f add r24, r24 3c164: 96 95 lsr r25 3c166: 87 95 ror r24 3c168: 97 f9 bld r25, 7 3c16a: 08 95 ret 0003c16c <__fp_mpack>: 3c16c: 9f 3f cpi r25, 0xFF ; 255 3c16e: 31 f0 breq .+12 ; 0x3c17c <__fp_mpack_finite+0xc> 0003c170 <__fp_mpack_finite>: 3c170: 91 50 subi r25, 0x01 ; 1 3c172: 20 f4 brcc .+8 ; 0x3c17c <__fp_mpack_finite+0xc> 3c174: 87 95 ror r24 3c176: 77 95 ror r23 3c178: 67 95 ror r22 3c17a: b7 95 ror r27 3c17c: 88 0f add r24, r24 3c17e: 91 1d adc r25, r1 3c180: 96 95 lsr r25 3c182: 87 95 ror r24 3c184: 97 f9 bld r25, 7 3c186: 08 95 ret 0003c188 <__fp_powser>: 3c188: df 93 push r29 3c18a: cf 93 push r28 3c18c: 1f 93 push r17 3c18e: 0f 93 push r16 3c190: ff 92 push r15 3c192: ef 92 push r14 3c194: df 92 push r13 3c196: 7b 01 movw r14, r22 3c198: 8c 01 movw r16, r24 3c19a: 68 94 set 3c19c: 06 c0 rjmp .+12 ; 0x3c1aa <__fp_powser+0x22> 3c19e: da 2e mov r13, r26 3c1a0: ef 01 movw r28, r30 3c1a2: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__mulsf3x> 3c1a6: fe 01 movw r30, r28 3c1a8: e8 94 clt 3c1aa: a5 91 lpm r26, Z+ 3c1ac: 25 91 lpm r18, Z+ 3c1ae: 35 91 lpm r19, Z+ 3c1b0: 45 91 lpm r20, Z+ 3c1b2: 55 91 lpm r21, Z+ 3c1b4: a6 f3 brts .-24 ; 0x3c19e <__fp_powser+0x16> 3c1b6: ef 01 movw r28, r30 3c1b8: 0f 94 d0 de call 0x3bda0 ; 0x3bda0 <__addsf3x> 3c1bc: fe 01 movw r30, r28 3c1be: 97 01 movw r18, r14 3c1c0: a8 01 movw r20, r16 3c1c2: da 94 dec r13 3c1c4: 69 f7 brne .-38 ; 0x3c1a0 <__fp_powser+0x18> 3c1c6: df 90 pop r13 3c1c8: ef 90 pop r14 3c1ca: ff 90 pop r15 3c1cc: 0f 91 pop r16 3c1ce: 1f 91 pop r17 3c1d0: cf 91 pop r28 3c1d2: df 91 pop r29 3c1d4: 08 95 ret 3c1d6: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 0003c1da <__fp_rempio2>: 3c1da: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c1de: d8 f3 brcs .-10 ; 0x3c1d6 <__fp_powser+0x4e> 3c1e0: e8 94 clt 3c1e2: e0 e0 ldi r30, 0x00 ; 0 3c1e4: bb 27 eor r27, r27 3c1e6: 9f 57 subi r25, 0x7F ; 127 3c1e8: f0 f0 brcs .+60 ; 0x3c226 <__fp_rempio2+0x4c> 3c1ea: 2a ed ldi r18, 0xDA ; 218 3c1ec: 3f e0 ldi r19, 0x0F ; 15 3c1ee: 49 ec ldi r20, 0xC9 ; 201 3c1f0: 06 c0 rjmp .+12 ; 0x3c1fe <__fp_rempio2+0x24> 3c1f2: ee 0f add r30, r30 3c1f4: bb 0f add r27, r27 3c1f6: 66 1f adc r22, r22 3c1f8: 77 1f adc r23, r23 3c1fa: 88 1f adc r24, r24 3c1fc: 28 f0 brcs .+10 ; 0x3c208 <__fp_rempio2+0x2e> 3c1fe: b2 3a cpi r27, 0xA2 ; 162 3c200: 62 07 cpc r22, r18 3c202: 73 07 cpc r23, r19 3c204: 84 07 cpc r24, r20 3c206: 28 f0 brcs .+10 ; 0x3c212 <__fp_rempio2+0x38> 3c208: b2 5a subi r27, 0xA2 ; 162 3c20a: 62 0b sbc r22, r18 3c20c: 73 0b sbc r23, r19 3c20e: 84 0b sbc r24, r20 3c210: e3 95 inc r30 3c212: 9a 95 dec r25 3c214: 72 f7 brpl .-36 ; 0x3c1f2 <__fp_rempio2+0x18> 3c216: 80 38 cpi r24, 0x80 ; 128 3c218: 30 f4 brcc .+12 ; 0x3c226 <__fp_rempio2+0x4c> 3c21a: 9a 95 dec r25 3c21c: bb 0f add r27, r27 3c21e: 66 1f adc r22, r22 3c220: 77 1f adc r23, r23 3c222: 88 1f adc r24, r24 3c224: d2 f7 brpl .-12 ; 0x3c21a <__fp_rempio2+0x40> 3c226: 90 48 sbci r25, 0x80 ; 128 3c228: 0d 94 b8 e0 jmp 0x3c170 ; 0x3c170 <__fp_mpack_finite> 0003c22c <__fp_sinus>: 3c22c: ef 93 push r30 3c22e: e0 ff sbrs r30, 0 3c230: 07 c0 rjmp .+14 ; 0x3c240 <__fp_sinus+0x14> 3c232: a2 ea ldi r26, 0xA2 ; 162 3c234: 2a ed ldi r18, 0xDA ; 218 3c236: 3f e0 ldi r19, 0x0F ; 15 3c238: 49 ec ldi r20, 0xC9 ; 201 3c23a: 5f eb ldi r21, 0xBF ; 191 3c23c: 0f 94 d0 de call 0x3bda0 ; 0x3bda0 <__addsf3x> 3c240: 0f 94 e2 d8 call 0x3b1c4 ; 0x3b1c4 <__fp_round> 3c244: 0f 90 pop r0 3c246: 03 94 inc r0 3c248: 01 fc sbrc r0, 1 3c24a: 90 58 subi r25, 0x80 ; 128 3c24c: ef e0 ldi r30, 0x0F ; 15 3c24e: f2 e7 ldi r31, 0x72 ; 114 3c250: 0d 94 0d e3 jmp 0x3c61a ; 0x3c61a <__fp_powsodd> 0003c254 <__fp_trunc>: 3c254: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c258: a0 f0 brcs .+40 ; 0x3c282 <__fp_trunc+0x2e> 3c25a: be e7 ldi r27, 0x7E ; 126 3c25c: b9 17 cp r27, r25 3c25e: 88 f4 brcc .+34 ; 0x3c282 <__fp_trunc+0x2e> 3c260: bb 27 eor r27, r27 3c262: 9f 38 cpi r25, 0x8F ; 143 3c264: 60 f4 brcc .+24 ; 0x3c27e <__fp_trunc+0x2a> 3c266: 16 16 cp r1, r22 3c268: b1 1d adc r27, r1 3c26a: 67 2f mov r22, r23 3c26c: 78 2f mov r23, r24 3c26e: 88 27 eor r24, r24 3c270: 98 5f subi r25, 0xF8 ; 248 3c272: f7 cf rjmp .-18 ; 0x3c262 <__fp_trunc+0xe> 3c274: 86 95 lsr r24 3c276: 77 95 ror r23 3c278: 67 95 ror r22 3c27a: b1 1d adc r27, r1 3c27c: 93 95 inc r25 3c27e: 96 39 cpi r25, 0x96 ; 150 3c280: c8 f3 brcs .-14 ; 0x3c274 <__fp_trunc+0x20> 3c282: 08 95 ret 0003c284 <__gesf2>: 3c284: 0f 94 77 e0 call 0x3c0ee ; 0x3c0ee <__fp_cmp> 3c288: 08 f4 brcc .+2 ; 0x3c28c <__gesf2+0x8> 3c28a: 8f ef ldi r24, 0xFF ; 255 3c28c: 08 95 ret 3c28e: 0f 94 d4 d8 call 0x3b1a8 ; 0x3b1a8 <__fp_pscA> 3c292: 29 f0 breq .+10 ; 0x3c29e <__gesf2+0x1a> 3c294: 0f 94 db d8 call 0x3b1b6 ; 0x3b1b6 <__fp_pscB> 3c298: 11 f0 breq .+4 ; 0x3c29e <__gesf2+0x1a> 3c29a: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 3c29e: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 3c2a2: b9 01 movw r22, r18 3c2a4: ca 01 movw r24, r20 3c2a6: 0d 94 b6 e0 jmp 0x3c16c ; 0x3c16c <__fp_mpack> 0003c2aa : 3c2aa: 9f 77 andi r25, 0x7F ; 127 3c2ac: 5f 77 andi r21, 0x7F ; 127 3c2ae: 0f 94 f3 d8 call 0x3b1e6 ; 0x3b1e6 <__fp_split3> 3c2b2: 68 f3 brcs .-38 ; 0x3c28e <__gesf2+0xa> 3c2b4: 99 23 and r25, r25 3c2b6: a9 f3 breq .-22 ; 0x3c2a2 <__gesf2+0x1e> 3c2b8: 55 23 and r21, r21 3c2ba: a9 f3 breq .-22 ; 0x3c2a6 <__gesf2+0x22> 3c2bc: ff 27 eor r31, r31 3c2be: 95 17 cp r25, r21 3c2c0: 58 f4 brcc .+22 ; 0x3c2d8 3c2c2: e5 2f mov r30, r21 3c2c4: e9 1b sub r30, r25 3c2c6: ed 30 cpi r30, 0x0D ; 13 3c2c8: 60 f7 brcc .-40 ; 0x3c2a2 <__gesf2+0x1e> 3c2ca: 5e 3b cpi r21, 0xBE ; 190 3c2cc: 10 f0 brcs .+4 ; 0x3c2d2 3c2ce: f1 e4 ldi r31, 0x41 ; 65 3c2d0: 1c c0 rjmp .+56 ; 0x3c30a 3c2d2: 90 34 cpi r25, 0x40 ; 64 3c2d4: e0 f4 brcc .+56 ; 0x3c30e 3c2d6: 0a c0 rjmp .+20 ; 0x3c2ec 3c2d8: e9 2f mov r30, r25 3c2da: e5 1b sub r30, r21 3c2dc: ed 30 cpi r30, 0x0D ; 13 3c2de: 18 f7 brcc .-58 ; 0x3c2a6 <__gesf2+0x22> 3c2e0: 9e 3b cpi r25, 0xBE ; 190 3c2e2: 10 f0 brcs .+4 ; 0x3c2e8 3c2e4: f1 e4 ldi r31, 0x41 ; 65 3c2e6: 11 c0 rjmp .+34 ; 0x3c30a 3c2e8: 50 34 cpi r21, 0x40 ; 64 3c2ea: 88 f4 brcc .+34 ; 0x3c30e 3c2ec: f9 ea ldi r31, 0xA9 ; 169 3c2ee: 88 23 and r24, r24 3c2f0: 2a f0 brmi .+10 ; 0x3c2fc 3c2f2: 9a 95 dec r25 3c2f4: 66 0f add r22, r22 3c2f6: 77 1f adc r23, r23 3c2f8: 88 1f adc r24, r24 3c2fa: da f7 brpl .-10 ; 0x3c2f2 3c2fc: 44 23 and r20, r20 3c2fe: 2a f0 brmi .+10 ; 0x3c30a 3c300: 5a 95 dec r21 3c302: 22 0f add r18, r18 3c304: 33 1f adc r19, r19 3c306: 44 1f adc r20, r20 3c308: da f7 brpl .-10 ; 0x3c300 3c30a: 9f 1b sub r25, r31 3c30c: 5f 1b sub r21, r31 3c30e: ff 93 push r31 3c310: 1f 93 push r17 3c312: 0f 93 push r16 3c314: ff 92 push r15 3c316: ef 92 push r14 3c318: 79 01 movw r14, r18 3c31a: 8a 01 movw r16, r20 3c31c: bb 27 eor r27, r27 3c31e: ab 2f mov r26, r27 3c320: 9b 01 movw r18, r22 3c322: ac 01 movw r20, r24 3c324: 0f 94 74 d8 call 0x3b0e8 ; 0x3b0e8 <__mulsf3_pse> 3c328: 97 01 movw r18, r14 3c32a: a8 01 movw r20, r16 3c32c: bf 93 push r27 3c32e: 7b 01 movw r14, r22 3c330: 8c 01 movw r16, r24 3c332: aa 27 eor r26, r26 3c334: ba 2f mov r27, r26 3c336: b9 01 movw r22, r18 3c338: ca 01 movw r24, r20 3c33a: 0f 94 74 d8 call 0x3b0e8 ; 0x3b0e8 <__mulsf3_pse> 3c33e: af 91 pop r26 3c340: 97 01 movw r18, r14 3c342: a8 01 movw r20, r16 3c344: ef 90 pop r14 3c346: ff 90 pop r15 3c348: 0f 91 pop r16 3c34a: 1f 91 pop r17 3c34c: 0f 94 d0 de call 0x3bda0 ; 0x3bda0 <__addsf3x> 3c350: 0f 94 e2 d8 call 0x3b1c4 ; 0x3b1c4 <__fp_round> 3c354: 0f 94 87 e2 call 0x3c50e ; 0x3c50e 3c358: 4f 91 pop r20 3c35a: 40 ff sbrs r20, 0 3c35c: 08 95 ret 3c35e: 55 27 eor r21, r21 3c360: 47 fd sbrc r20, 7 3c362: 50 95 com r21 3c364: 0d 94 c0 e1 jmp 0x3c380 ; 0x3c380 0003c368 : 3c368: 9b 01 movw r18, r22 3c36a: ac 01 movw r20, r24 3c36c: 60 e0 ldi r22, 0x00 ; 0 3c36e: 70 e0 ldi r23, 0x00 ; 0 3c370: 80 e8 ldi r24, 0x80 ; 128 3c372: 9f e3 ldi r25, 0x3F ; 63 3c374: 0d 94 b8 df jmp 0x3bf70 ; 0x3bf70 <__divsf3> 3c378: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 3c37c: 0d 94 b6 e0 jmp 0x3c16c ; 0x3c16c <__fp_mpack> 0003c380 : 3c380: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c384: d8 f3 brcs .-10 ; 0x3c37c 3c386: 99 23 and r25, r25 3c388: c9 f3 breq .-14 ; 0x3c37c 3c38a: 94 0f add r25, r20 3c38c: 51 1d adc r21, r1 3c38e: a3 f3 brvs .-24 ; 0x3c378 3c390: 91 50 subi r25, 0x01 ; 1 3c392: 50 40 sbci r21, 0x00 ; 0 3c394: 94 f0 brlt .+36 ; 0x3c3ba 3c396: 59 f0 breq .+22 ; 0x3c3ae 3c398: 88 23 and r24, r24 3c39a: 32 f0 brmi .+12 ; 0x3c3a8 3c39c: 66 0f add r22, r22 3c39e: 77 1f adc r23, r23 3c3a0: 88 1f adc r24, r24 3c3a2: 91 50 subi r25, 0x01 ; 1 3c3a4: 50 40 sbci r21, 0x00 ; 0 3c3a6: c1 f7 brne .-16 ; 0x3c398 3c3a8: 9e 3f cpi r25, 0xFE ; 254 3c3aa: 51 05 cpc r21, r1 3c3ac: 2c f7 brge .-54 ; 0x3c378 3c3ae: 88 0f add r24, r24 3c3b0: 91 1d adc r25, r1 3c3b2: 96 95 lsr r25 3c3b4: 87 95 ror r24 3c3b6: 97 f9 bld r25, 7 3c3b8: 08 95 ret 3c3ba: 5f 3f cpi r21, 0xFF ; 255 3c3bc: ac f0 brlt .+42 ; 0x3c3e8 3c3be: 98 3e cpi r25, 0xE8 ; 232 3c3c0: 9c f0 brlt .+38 ; 0x3c3e8 3c3c2: bb 27 eor r27, r27 3c3c4: 86 95 lsr r24 3c3c6: 77 95 ror r23 3c3c8: 67 95 ror r22 3c3ca: b7 95 ror r27 3c3cc: 08 f4 brcc .+2 ; 0x3c3d0 3c3ce: b1 60 ori r27, 0x01 ; 1 3c3d0: 93 95 inc r25 3c3d2: c1 f7 brne .-16 ; 0x3c3c4 3c3d4: bb 0f add r27, r27 3c3d6: 58 f7 brcc .-42 ; 0x3c3ae 3c3d8: 11 f4 brne .+4 ; 0x3c3de 3c3da: 60 ff sbrs r22, 0 3c3dc: e8 cf rjmp .-48 ; 0x3c3ae 3c3de: 6f 5f subi r22, 0xFF ; 255 3c3e0: 7f 4f sbci r23, 0xFF ; 255 3c3e2: 8f 4f sbci r24, 0xFF ; 255 3c3e4: 9f 4f sbci r25, 0xFF ; 255 3c3e6: e3 cf rjmp .-58 ; 0x3c3ae 3c3e8: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 0003c3ec : 3c3ec: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c3f0: 58 f1 brcs .+86 ; 0x3c448 3c3f2: 9e 57 subi r25, 0x7E ; 126 3c3f4: 60 f1 brcs .+88 ; 0x3c44e 3c3f6: 98 51 subi r25, 0x18 ; 24 3c3f8: a0 f0 brcs .+40 ; 0x3c422 3c3fa: e9 f0 breq .+58 ; 0x3c436 3c3fc: 98 30 cpi r25, 0x08 ; 8 3c3fe: 20 f5 brcc .+72 ; 0x3c448 3c400: 09 2e mov r0, r25 3c402: 99 27 eor r25, r25 3c404: 66 0f add r22, r22 3c406: 77 1f adc r23, r23 3c408: 88 1f adc r24, r24 3c40a: 99 1f adc r25, r25 3c40c: 0a 94 dec r0 3c40e: d1 f7 brne .-12 ; 0x3c404 3c410: 12 c0 rjmp .+36 ; 0x3c436 3c412: 06 2e mov r0, r22 3c414: 67 2f mov r22, r23 3c416: 78 2f mov r23, r24 3c418: 88 27 eor r24, r24 3c41a: 98 5f subi r25, 0xF8 ; 248 3c41c: 11 f4 brne .+4 ; 0x3c422 3c41e: 00 0c add r0, r0 3c420: 07 c0 rjmp .+14 ; 0x3c430 3c422: 99 3f cpi r25, 0xF9 ; 249 3c424: b4 f3 brlt .-20 ; 0x3c412 3c426: 86 95 lsr r24 3c428: 77 95 ror r23 3c42a: 67 95 ror r22 3c42c: 93 95 inc r25 3c42e: d9 f7 brne .-10 ; 0x3c426 3c430: 61 1d adc r22, r1 3c432: 71 1d adc r23, r1 3c434: 81 1d adc r24, r1 3c436: 3e f4 brtc .+14 ; 0x3c446 3c438: 90 95 com r25 3c43a: 80 95 com r24 3c43c: 70 95 com r23 3c43e: 61 95 neg r22 3c440: 7f 4f sbci r23, 0xFF ; 255 3c442: 8f 4f sbci r24, 0xFF ; 255 3c444: 9f 4f sbci r25, 0xFF ; 255 3c446: 08 95 ret 3c448: 68 94 set 3c44a: 0d 94 16 d9 jmp 0x3b22c ; 0x3b22c <__fp_szero> 3c44e: 0d 94 15 d9 jmp 0x3b22a ; 0x3b22a <__fp_zero> 0003c452 : 3c452: fa 01 movw r30, r20 3c454: ee 0f add r30, r30 3c456: ff 1f adc r31, r31 3c458: 30 96 adiw r30, 0x00 ; 0 3c45a: 21 05 cpc r18, r1 3c45c: 31 05 cpc r19, r1 3c45e: a1 f1 breq .+104 ; 0x3c4c8 3c460: 61 15 cp r22, r1 3c462: 71 05 cpc r23, r1 3c464: 61 f4 brne .+24 ; 0x3c47e 3c466: 80 38 cpi r24, 0x80 ; 128 3c468: bf e3 ldi r27, 0x3F ; 63 3c46a: 9b 07 cpc r25, r27 3c46c: 49 f1 breq .+82 ; 0x3c4c0 3c46e: 68 94 set 3c470: 90 38 cpi r25, 0x80 ; 128 3c472: 81 05 cpc r24, r1 3c474: 61 f0 breq .+24 ; 0x3c48e 3c476: 80 38 cpi r24, 0x80 ; 128 3c478: bf ef ldi r27, 0xFF ; 255 3c47a: 9b 07 cpc r25, r27 3c47c: 41 f0 breq .+16 ; 0x3c48e 3c47e: 99 23 and r25, r25 3c480: 4a f5 brpl .+82 ; 0x3c4d4 3c482: ff 3f cpi r31, 0xFF ; 255 3c484: e1 05 cpc r30, r1 3c486: 31 05 cpc r19, r1 3c488: 21 05 cpc r18, r1 3c48a: 19 f1 breq .+70 ; 0x3c4d2 3c48c: e8 94 clt 3c48e: 08 94 sec 3c490: e7 95 ror r30 3c492: d9 01 movw r26, r18 3c494: aa 23 and r26, r26 3c496: 29 f4 brne .+10 ; 0x3c4a2 3c498: ab 2f mov r26, r27 3c49a: be 2f mov r27, r30 3c49c: f8 5f subi r31, 0xF8 ; 248 3c49e: d0 f3 brcs .-12 ; 0x3c494 3c4a0: 10 c0 rjmp .+32 ; 0x3c4c2 3c4a2: ff 5f subi r31, 0xFF ; 255 3c4a4: 70 f4 brcc .+28 ; 0x3c4c2 3c4a6: a6 95 lsr r26 3c4a8: e0 f7 brcc .-8 ; 0x3c4a2 3c4aa: f7 39 cpi r31, 0x97 ; 151 3c4ac: 50 f0 brcs .+20 ; 0x3c4c2 3c4ae: 19 f0 breq .+6 ; 0x3c4b6 3c4b0: ff 3a cpi r31, 0xAF ; 175 3c4b2: 38 f4 brcc .+14 ; 0x3c4c2 3c4b4: 9f 77 andi r25, 0x7F ; 127 3c4b6: 9f 93 push r25 3c4b8: 0d d0 rcall .+26 ; 0x3c4d4 3c4ba: 0f 90 pop r0 3c4bc: 07 fc sbrc r0, 7 3c4be: 90 58 subi r25, 0x80 ; 128 3c4c0: 08 95 ret 3c4c2: 46 f0 brts .+16 ; 0x3c4d4 3c4c4: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 3c4c8: 60 e0 ldi r22, 0x00 ; 0 3c4ca: 70 e0 ldi r23, 0x00 ; 0 3c4cc: 80 e8 ldi r24, 0x80 ; 128 3c4ce: 9f e3 ldi r25, 0x3F ; 63 3c4d0: 08 95 ret 3c4d2: 4f e7 ldi r20, 0x7F ; 127 3c4d4: 9f 77 andi r25, 0x7F ; 127 3c4d6: 5f 93 push r21 3c4d8: 4f 93 push r20 3c4da: 3f 93 push r19 3c4dc: 2f 93 push r18 3c4de: 0f 94 29 e3 call 0x3c652 ; 0x3c652 3c4e2: 2f 91 pop r18 3c4e4: 3f 91 pop r19 3c4e6: 4f 91 pop r20 3c4e8: 5f 91 pop r21 3c4ea: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3c4ee: 0d 94 d4 e2 jmp 0x3c5a8 ; 0x3c5a8 0003c4f2 : 3c4f2: 9f 93 push r25 3c4f4: 0f 94 ed e0 call 0x3c1da ; 0x3c1da <__fp_rempio2> 3c4f8: 0f 90 pop r0 3c4fa: 07 fc sbrc r0, 7 3c4fc: ee 5f subi r30, 0xFE ; 254 3c4fe: 0d 94 16 e1 jmp 0x3c22c ; 0x3c22c <__fp_sinus> 3c502: 19 f4 brne .+6 ; 0x3c50a 3c504: 16 f4 brtc .+4 ; 0x3c50a 3c506: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 3c50a: 0d 94 b6 e0 jmp 0x3c16c ; 0x3c16c <__fp_mpack> 0003c50e : 3c50e: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c512: b8 f3 brcs .-18 ; 0x3c502 3c514: 99 23 and r25, r25 3c516: c9 f3 breq .-14 ; 0x3c50a 3c518: b6 f3 brts .-20 ; 0x3c506 3c51a: 9f 57 subi r25, 0x7F ; 127 3c51c: 55 0b sbc r21, r21 3c51e: 87 ff sbrs r24, 7 3c520: 0f 94 06 e3 call 0x3c60c ; 0x3c60c <__fp_norm2> 3c524: 00 24 eor r0, r0 3c526: a0 e6 ldi r26, 0x60 ; 96 3c528: 40 ea ldi r20, 0xA0 ; 160 3c52a: 90 01 movw r18, r0 3c52c: 80 58 subi r24, 0x80 ; 128 3c52e: 56 95 lsr r21 3c530: 97 95 ror r25 3c532: 28 f4 brcc .+10 ; 0x3c53e 3c534: 80 5c subi r24, 0xC0 ; 192 3c536: 66 0f add r22, r22 3c538: 77 1f adc r23, r23 3c53a: 88 1f adc r24, r24 3c53c: 20 f0 brcs .+8 ; 0x3c546 3c53e: 26 17 cp r18, r22 3c540: 37 07 cpc r19, r23 3c542: 48 07 cpc r20, r24 3c544: 30 f4 brcc .+12 ; 0x3c552 3c546: 62 1b sub r22, r18 3c548: 73 0b sbc r23, r19 3c54a: 84 0b sbc r24, r20 3c54c: 20 29 or r18, r0 3c54e: 31 29 or r19, r1 3c550: 4a 2b or r20, r26 3c552: a6 95 lsr r26 3c554: 17 94 ror r1 3c556: 07 94 ror r0 3c558: 20 25 eor r18, r0 3c55a: 31 25 eor r19, r1 3c55c: 4a 27 eor r20, r26 3c55e: 58 f7 brcc .-42 ; 0x3c536 3c560: 66 0f add r22, r22 3c562: 77 1f adc r23, r23 3c564: 88 1f adc r24, r24 3c566: 20 f0 brcs .+8 ; 0x3c570 3c568: 26 17 cp r18, r22 3c56a: 37 07 cpc r19, r23 3c56c: 48 07 cpc r20, r24 3c56e: 30 f4 brcc .+12 ; 0x3c57c 3c570: 62 0b sbc r22, r18 3c572: 73 0b sbc r23, r19 3c574: 84 0b sbc r24, r20 3c576: 20 0d add r18, r0 3c578: 31 1d adc r19, r1 3c57a: 41 1d adc r20, r1 3c57c: a0 95 com r26 3c57e: 81 f7 brne .-32 ; 0x3c560 3c580: b9 01 movw r22, r18 3c582: 84 2f mov r24, r20 3c584: 91 58 subi r25, 0x81 ; 129 3c586: 88 0f add r24, r24 3c588: 96 95 lsr r25 3c58a: 87 95 ror r24 3c58c: 08 95 ret 0003c58e <__unordsf2>: 3c58e: 0f 94 77 e0 call 0x3c0ee ; 0x3c0ee <__fp_cmp> 3c592: 88 0b sbc r24, r24 3c594: 99 0b sbc r25, r25 3c596: 08 95 ret 3c598: 29 f4 brne .+10 ; 0x3c5a4 <__unordsf2+0x16> 3c59a: 16 f0 brts .+4 ; 0x3c5a0 <__unordsf2+0x12> 3c59c: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 3c5a0: 0d 94 15 d9 jmp 0x3b22a ; 0x3b22a <__fp_zero> 3c5a4: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 0003c5a8 : 3c5a8: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c5ac: a8 f3 brcs .-22 ; 0x3c598 <__unordsf2+0xa> 3c5ae: 96 38 cpi r25, 0x86 ; 134 3c5b0: a0 f7 brcc .-24 ; 0x3c59a <__unordsf2+0xc> 3c5b2: 07 f8 bld r0, 7 3c5b4: 0f 92 push r0 3c5b6: e8 94 clt 3c5b8: 2b e3 ldi r18, 0x3B ; 59 3c5ba: 3a ea ldi r19, 0xAA ; 170 3c5bc: 48 eb ldi r20, 0xB8 ; 184 3c5be: 5f e7 ldi r21, 0x7F ; 127 3c5c0: 0f 94 74 d8 call 0x3b0e8 ; 0x3b0e8 <__mulsf3_pse> 3c5c4: 0f 92 push r0 3c5c6: 0f 92 push r0 3c5c8: 0f 92 push r0 3c5ca: 4d b7 in r20, 0x3d ; 61 3c5cc: 5e b7 in r21, 0x3e ; 62 3c5ce: 0f 92 push r0 3c5d0: 0f 94 71 e3 call 0x3c6e2 ; 0x3c6e2 3c5d4: ed e2 ldi r30, 0x2D ; 45 3c5d6: f2 e7 ldi r31, 0x72 ; 114 3c5d8: 0f 94 c4 e0 call 0x3c188 ; 0x3c188 <__fp_powser> 3c5dc: 4f 91 pop r20 3c5de: 5f 91 pop r21 3c5e0: ef 91 pop r30 3c5e2: ff 91 pop r31 3c5e4: e5 95 asr r30 3c5e6: ee 1f adc r30, r30 3c5e8: ff 1f adc r31, r31 3c5ea: 49 f0 breq .+18 ; 0x3c5fe 3c5ec: fe 57 subi r31, 0x7E ; 126 3c5ee: e0 68 ori r30, 0x80 ; 128 3c5f0: 44 27 eor r20, r20 3c5f2: ee 0f add r30, r30 3c5f4: 44 1f adc r20, r20 3c5f6: fa 95 dec r31 3c5f8: e1 f7 brne .-8 ; 0x3c5f2 3c5fa: 41 95 neg r20 3c5fc: 55 0b sbc r21, r21 3c5fe: 0f 94 c0 e1 call 0x3c380 ; 0x3c380 3c602: 0f 90 pop r0 3c604: 07 fe sbrs r0, 7 3c606: 0d 94 b4 e1 jmp 0x3c368 ; 0x3c368 3c60a: 08 95 ret 0003c60c <__fp_norm2>: 3c60c: 91 50 subi r25, 0x01 ; 1 3c60e: 50 40 sbci r21, 0x00 ; 0 3c610: 66 0f add r22, r22 3c612: 77 1f adc r23, r23 3c614: 88 1f adc r24, r24 3c616: d2 f7 brpl .-12 ; 0x3c60c <__fp_norm2> 3c618: 08 95 ret 0003c61a <__fp_powsodd>: 3c61a: 9f 93 push r25 3c61c: 8f 93 push r24 3c61e: 7f 93 push r23 3c620: 6f 93 push r22 3c622: ff 93 push r31 3c624: ef 93 push r30 3c626: 9b 01 movw r18, r22 3c628: ac 01 movw r20, r24 3c62a: 0f 94 5e d8 call 0x3b0bc ; 0x3b0bc <__mulsf3> 3c62e: ef 91 pop r30 3c630: ff 91 pop r31 3c632: 0f 94 c4 e0 call 0x3c188 ; 0x3c188 <__fp_powser> 3c636: 2f 91 pop r18 3c638: 3f 91 pop r19 3c63a: 4f 91 pop r20 3c63c: 5f 91 pop r21 3c63e: 0d 94 5e d8 jmp 0x3b0bc ; 0x3b0bc <__mulsf3> 3c642: 16 f0 brts .+4 ; 0x3c648 <__fp_powsodd+0x2e> 3c644: 0d 94 b6 e0 jmp 0x3c16c ; 0x3c16c <__fp_mpack> 3c648: 0d 94 d1 d8 jmp 0x3b1a2 ; 0x3b1a2 <__fp_nan> 3c64c: 68 94 set 3c64e: 0d 94 cb d8 jmp 0x3b196 ; 0x3b196 <__fp_inf> 0003c652 : 3c652: 0f 94 fb d8 call 0x3b1f6 ; 0x3b1f6 <__fp_splitA> 3c656: a8 f3 brcs .-22 ; 0x3c642 <__fp_powsodd+0x28> 3c658: 99 23 and r25, r25 3c65a: c1 f3 breq .-16 ; 0x3c64c <__fp_powsodd+0x32> 3c65c: ae f3 brts .-22 ; 0x3c648 <__fp_powsodd+0x2e> 3c65e: df 93 push r29 3c660: cf 93 push r28 3c662: 1f 93 push r17 3c664: 0f 93 push r16 3c666: ff 92 push r15 3c668: c9 2f mov r28, r25 3c66a: dd 27 eor r29, r29 3c66c: 88 23 and r24, r24 3c66e: 2a f0 brmi .+10 ; 0x3c67a 3c670: 21 97 sbiw r28, 0x01 ; 1 3c672: 66 0f add r22, r22 3c674: 77 1f adc r23, r23 3c676: 88 1f adc r24, r24 3c678: da f7 brpl .-10 ; 0x3c670 3c67a: 20 e0 ldi r18, 0x00 ; 0 3c67c: 30 e0 ldi r19, 0x00 ; 0 3c67e: 40 e8 ldi r20, 0x80 ; 128 3c680: 5f eb ldi r21, 0xBF ; 191 3c682: 9f e3 ldi r25, 0x3F ; 63 3c684: 88 39 cpi r24, 0x98 ; 152 3c686: 20 f0 brcs .+8 ; 0x3c690 3c688: 80 3e cpi r24, 0xE0 ; 224 3c68a: 38 f0 brcs .+14 ; 0x3c69a 3c68c: 21 96 adiw r28, 0x01 ; 1 3c68e: 8f 77 andi r24, 0x7F ; 127 3c690: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3c694: e5 e5 ldi r30, 0x55 ; 85 3c696: f2 e7 ldi r31, 0x72 ; 114 3c698: 04 c0 rjmp .+8 ; 0x3c6a2 3c69a: 0f 94 b9 de call 0x3bd72 ; 0x3bd72 <__addsf3> 3c69e: e2 e8 ldi r30, 0x82 ; 130 3c6a0: f2 e7 ldi r31, 0x72 ; 114 3c6a2: 0f 94 c4 e0 call 0x3c188 ; 0x3c188 <__fp_powser> 3c6a6: 8b 01 movw r16, r22 3c6a8: be 01 movw r22, r28 3c6aa: ec 01 movw r28, r24 3c6ac: fb 2e mov r15, r27 3c6ae: 6f 57 subi r22, 0x7F ; 127 3c6b0: 71 09 sbc r23, r1 3c6b2: 75 95 asr r23 3c6b4: 77 1f adc r23, r23 3c6b6: 88 0b sbc r24, r24 3c6b8: 99 0b sbc r25, r25 3c6ba: 0f 94 1f d8 call 0x3b03e ; 0x3b03e <__floatsisf> 3c6be: 28 e1 ldi r18, 0x18 ; 24 3c6c0: 32 e7 ldi r19, 0x72 ; 114 3c6c2: 41 e3 ldi r20, 0x31 ; 49 3c6c4: 5f e3 ldi r21, 0x3F ; 63 3c6c6: 0f 94 71 d8 call 0x3b0e2 ; 0x3b0e2 <__mulsf3x> 3c6ca: af 2d mov r26, r15 3c6cc: 98 01 movw r18, r16 3c6ce: ae 01 movw r20, r28 3c6d0: ff 90 pop r15 3c6d2: 0f 91 pop r16 3c6d4: 1f 91 pop r17 3c6d6: cf 91 pop r28 3c6d8: df 91 pop r29 3c6da: 0f 94 d0 de call 0x3bda0 ; 0x3bda0 <__addsf3x> 3c6de: 0d 94 e2 d8 jmp 0x3b1c4 ; 0x3b1c4 <__fp_round> 0003c6e2 : 3c6e2: fa 01 movw r30, r20 3c6e4: dc 01 movw r26, r24 3c6e6: aa 0f add r26, r26 3c6e8: bb 1f adc r27, r27 3c6ea: 9b 01 movw r18, r22 3c6ec: ac 01 movw r20, r24 3c6ee: bf 57 subi r27, 0x7F ; 127 3c6f0: 28 f4 brcc .+10 ; 0x3c6fc 3c6f2: 22 27 eor r18, r18 3c6f4: 33 27 eor r19, r19 3c6f6: 44 27 eor r20, r20 3c6f8: 50 78 andi r21, 0x80 ; 128 3c6fa: 20 c0 rjmp .+64 ; 0x3c73c 3c6fc: b7 51 subi r27, 0x17 ; 23 3c6fe: 90 f4 brcc .+36 ; 0x3c724 3c700: ab 2f mov r26, r27 3c702: 00 24 eor r0, r0 3c704: 46 95 lsr r20 3c706: 37 95 ror r19 3c708: 27 95 ror r18 3c70a: 01 1c adc r0, r1 3c70c: a3 95 inc r26 3c70e: d2 f3 brmi .-12 ; 0x3c704 3c710: 00 20 and r0, r0 3c712: 71 f0 breq .+28 ; 0x3c730 3c714: 22 0f add r18, r18 3c716: 33 1f adc r19, r19 3c718: 44 1f adc r20, r20 3c71a: b3 95 inc r27 3c71c: da f3 brmi .-10 ; 0x3c714 3c71e: 0e d0 rcall .+28 ; 0x3c73c 3c720: 0d 94 b8 de jmp 0x3bd70 ; 0x3bd70 <__subsf3> 3c724: 61 30 cpi r22, 0x01 ; 1 3c726: 71 05 cpc r23, r1 3c728: a0 e8 ldi r26, 0x80 ; 128 3c72a: 8a 07 cpc r24, r26 3c72c: b9 46 sbci r27, 0x69 ; 105 3c72e: 30 f4 brcc .+12 ; 0x3c73c 3c730: 9b 01 movw r18, r22 3c732: ac 01 movw r20, r24 3c734: 66 27 eor r22, r22 3c736: 77 27 eor r23, r23 3c738: 88 27 eor r24, r24 3c73a: 90 78 andi r25, 0x80 ; 128 3c73c: 30 96 adiw r30, 0x00 ; 0 3c73e: 21 f0 breq .+8 ; 0x3c748 3c740: 20 83 st Z, r18 3c742: 31 83 std Z+1, r19 ; 0x01 3c744: 42 83 std Z+2, r20 ; 0x02 3c746: 53 83 std Z+3, r21 ; 0x03 3c748: 08 95 ret 0003c74a : 3c74a: 91 11 cpse r25, r1 3c74c: 08 95 ret 3c74e: 81 54 subi r24, 0x41 ; 65 3c750: 8a 51 subi r24, 0x1A ; 26 3c752: 08 f4 brcc .+2 ; 0x3c756 3c754: 80 5e subi r24, 0xE0 ; 224 3c756: 85 5a subi r24, 0xA5 ; 165 3c758: 08 95 ret 0003c75a : 3c75a: fb 01 movw r30, r22 3c75c: dc 01 movw r26, r24 3c75e: 04 c0 rjmp .+8 ; 0x3c768 3c760: 8d 91 ld r24, X+ 3c762: 01 90 ld r0, Z+ 3c764: 80 19 sub r24, r0 3c766: 21 f4 brne .+8 ; 0x3c770 3c768: 41 50 subi r20, 0x01 ; 1 3c76a: 50 40 sbci r21, 0x00 ; 0 3c76c: c8 f7 brcc .-14 ; 0x3c760 3c76e: 88 1b sub r24, r24 3c770: 99 0b sbc r25, r25 3c772: 08 95 ret 0003c774 : 3c774: fb 01 movw r30, r22 3c776: dc 01 movw r26, r24 3c778: 02 c0 rjmp .+4 ; 0x3c77e 3c77a: 01 90 ld r0, Z+ 3c77c: 0d 92 st X+, r0 3c77e: 41 50 subi r20, 0x01 ; 1 3c780: 50 40 sbci r21, 0x00 ; 0 3c782: d8 f7 brcc .-10 ; 0x3c77a 3c784: 08 95 ret 0003c786 : 3c786: dc 01 movw r26, r24 3c788: 01 c0 rjmp .+2 ; 0x3c78c 3c78a: 6d 93 st X+, r22 3c78c: 41 50 subi r20, 0x01 ; 1 3c78e: 50 40 sbci r21, 0x00 ; 0 3c790: e0 f7 brcc .-8 ; 0x3c78a 3c792: 08 95 ret 0003c794 : 3c794: fb 01 movw r30, r22 3c796: dc 01 movw r26, r24 3c798: 8d 91 ld r24, X+ 3c79a: 81 34 cpi r24, 0x41 ; 65 3c79c: 1c f0 brlt .+6 ; 0x3c7a4 3c79e: 8b 35 cpi r24, 0x5B ; 91 3c7a0: 0c f4 brge .+2 ; 0x3c7a4 3c7a2: 80 5e subi r24, 0xE0 ; 224 3c7a4: 61 91 ld r22, Z+ 3c7a6: 61 34 cpi r22, 0x41 ; 65 3c7a8: 1c f0 brlt .+6 ; 0x3c7b0 3c7aa: 6b 35 cpi r22, 0x5B ; 91 3c7ac: 0c f4 brge .+2 ; 0x3c7b0 3c7ae: 60 5e subi r22, 0xE0 ; 224 3c7b0: 86 1b sub r24, r22 3c7b2: 61 11 cpse r22, r1 3c7b4: 89 f3 breq .-30 ; 0x3c798 3c7b6: 99 0b sbc r25, r25 3c7b8: 08 95 ret 0003c7ba : 3c7ba: fb 01 movw r30, r22 3c7bc: dc 01 movw r26, r24 3c7be: 0d 90 ld r0, X+ 3c7c0: 00 20 and r0, r0 3c7c2: e9 f7 brne .-6 ; 0x3c7be 3c7c4: 11 97 sbiw r26, 0x01 ; 1 3c7c6: 01 90 ld r0, Z+ 3c7c8: 0d 92 st X+, r0 3c7ca: 00 20 and r0, r0 3c7cc: e1 f7 brne .-8 ; 0x3c7c6 3c7ce: 08 95 ret 0003c7d0 : 3c7d0: fc 01 movw r30, r24 3c7d2: 81 91 ld r24, Z+ 3c7d4: 86 17 cp r24, r22 3c7d6: 21 f0 breq .+8 ; 0x3c7e0 3c7d8: 88 23 and r24, r24 3c7da: d9 f7 brne .-10 ; 0x3c7d2 3c7dc: 99 27 eor r25, r25 3c7de: 08 95 ret 3c7e0: 31 97 sbiw r30, 0x01 ; 1 3c7e2: cf 01 movw r24, r30 3c7e4: 08 95 ret 0003c7e6 : 3c7e6: fb 01 movw r30, r22 3c7e8: dc 01 movw r26, r24 3c7ea: 8d 91 ld r24, X+ 3c7ec: 01 90 ld r0, Z+ 3c7ee: 80 19 sub r24, r0 3c7f0: 01 10 cpse r0, r1 3c7f2: d9 f3 breq .-10 ; 0x3c7ea 3c7f4: 99 0b sbc r25, r25 3c7f6: 08 95 ret 0003c7f8 : 3c7f8: fb 01 movw r30, r22 3c7fa: dc 01 movw r26, r24 3c7fc: 01 90 ld r0, Z+ 3c7fe: 0d 92 st X+, r0 3c800: 00 20 and r0, r0 3c802: e1 f7 brne .-8 ; 0x3c7fc 3c804: 08 95 ret 0003c806 : 3c806: fb 01 movw r30, r22 3c808: dc 01 movw r26, r24 3c80a: 41 50 subi r20, 0x01 ; 1 3c80c: 50 40 sbci r21, 0x00 ; 0 3c80e: 30 f0 brcs .+12 ; 0x3c81c 3c810: 8d 91 ld r24, X+ 3c812: 01 90 ld r0, Z+ 3c814: 80 19 sub r24, r0 3c816: 19 f4 brne .+6 ; 0x3c81e 3c818: 00 20 and r0, r0 3c81a: b9 f7 brne .-18 ; 0x3c80a 3c81c: 88 1b sub r24, r24 3c81e: 99 0b sbc r25, r25 3c820: 08 95 ret 0003c822 : 3c822: fb 01 movw r30, r22 3c824: dc 01 movw r26, r24 3c826: 41 50 subi r20, 0x01 ; 1 3c828: 50 40 sbci r21, 0x00 ; 0 3c82a: 48 f0 brcs .+18 ; 0x3c83e 3c82c: 01 90 ld r0, Z+ 3c82e: 0d 92 st X+, r0 3c830: 00 20 and r0, r0 3c832: c9 f7 brne .-14 ; 0x3c826 3c834: 01 c0 rjmp .+2 ; 0x3c838 3c836: 1d 92 st X+, r1 3c838: 41 50 subi r20, 0x01 ; 1 3c83a: 50 40 sbci r21, 0x00 ; 0 3c83c: e0 f7 brcc .-8 ; 0x3c836 3c83e: 08 95 ret 0003c840 : 3c840: 0f 93 push r16 3c842: 1f 93 push r17 3c844: cf 93 push r28 3c846: df 93 push r29 3c848: e0 91 15 18 lds r30, 0x1815 ; 0x801815 <__iob+0x2> 3c84c: f0 91 16 18 lds r31, 0x1816 ; 0x801816 <__iob+0x3> 3c850: 23 81 ldd r18, Z+3 ; 0x03 3c852: ec 01 movw r28, r24 3c854: 10 e0 ldi r17, 0x00 ; 0 3c856: 00 e0 ldi r16, 0x00 ; 0 3c858: 21 fd sbrc r18, 1 3c85a: 08 c0 rjmp .+16 ; 0x3c86c 3c85c: 0f ef ldi r16, 0xFF ; 255 3c85e: 1f ef ldi r17, 0xFF ; 255 3c860: 14 c0 rjmp .+40 ; 0x3c88a 3c862: 19 95 eicall 3c864: 89 2b or r24, r25 3c866: 11 f0 breq .+4 ; 0x3c86c 3c868: 0f ef ldi r16, 0xFF ; 255 3c86a: 1f ef ldi r17, 0xFF ; 255 3c86c: 89 91 ld r24, Y+ 3c86e: 60 91 15 18 lds r22, 0x1815 ; 0x801815 <__iob+0x2> 3c872: 70 91 16 18 lds r23, 0x1816 ; 0x801816 <__iob+0x3> 3c876: db 01 movw r26, r22 3c878: 18 96 adiw r26, 0x08 ; 8 3c87a: ed 91 ld r30, X+ 3c87c: fc 91 ld r31, X 3c87e: 81 11 cpse r24, r1 3c880: f0 cf rjmp .-32 ; 0x3c862 3c882: 8a e0 ldi r24, 0x0A ; 10 3c884: 19 95 eicall 3c886: 89 2b or r24, r25 3c888: 49 f7 brne .-46 ; 0x3c85c 3c88a: c8 01 movw r24, r16 3c88c: df 91 pop r29 3c88e: cf 91 pop r28 3c890: 1f 91 pop r17 3c892: 0f 91 pop r16 3c894: 08 95 ret 0003c896 <__do_global_dtors>: 3c896: 17 e5 ldi r17, 0x57 ; 87 3c898: cb e5 ldi r28, 0x5B ; 91 3c89a: d7 e5 ldi r29, 0x57 ; 87 3c89c: 00 e0 ldi r16, 0x00 ; 0 3c89e: 06 c0 rjmp .+12 ; 0x3c8ac <__do_global_dtors+0x16> 3c8a0: 80 2f mov r24, r16 3c8a2: fe 01 movw r30, r28 3c8a4: 0f 94 a1 de call 0x3bd42 ; 0x3bd42 <__tablejump2__> 3c8a8: 21 96 adiw r28, 0x01 ; 1 3c8aa: 01 1d adc r16, r1 3c8ac: cc 35 cpi r28, 0x5C ; 92 3c8ae: d1 07 cpc r29, r17 3c8b0: 80 e0 ldi r24, 0x00 ; 0 3c8b2: 08 07 cpc r16, r24 3c8b4: a9 f7 brne .-22 ; 0x3c8a0 <__do_global_dtors+0xa> 3c8b6: f8 94 cli 0003c8b8 <__stop_program>: 3c8b8: ff cf rjmp .-2 ; 0x3c8b8 <__stop_program>